Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: Rename last mux driver to standard pattern

Update the MAINTAINERS entry and all other references accordingly.

Based on an original patch by Wolfram Sang.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>

[wsa: fixed merge conflict due to rework in i2c_add_mux_adapter()]

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

authored by

Jean Delvare and committed by
Wolfram Sang
e7065e20 353f56b5

+39 -40
+6 -6
Documentation/i2c/muxes/gpio-i2cmux Documentation/i2c/muxes/i2c-mux-gpio
··· 1 - Kernel driver gpio-i2cmux 1 + Kernel driver i2c-gpio-mux 2 2 3 3 Author: Peter Korsgaard <peter.korsgaard@barco.com> 4 4 5 5 Description 6 6 ----------- 7 7 8 - gpio-i2cmux is an i2c mux driver providing access to I2C bus segments 8 + i2c-gpio-mux is an i2c mux driver providing access to I2C bus segments 9 9 from a master I2C bus and a hardware MUX controlled through GPIO pins. 10 10 11 11 E.G.: ··· 26 26 Usage 27 27 ----- 28 28 29 - gpio-i2cmux uses the platform bus, so you need to provide a struct 29 + i2c-gpio-mux uses the platform bus, so you need to provide a struct 30 30 platform_device with the platform_data pointing to a struct 31 31 gpio_i2cmux_platform_data with the I2C adapter number of the master 32 32 bus, the number of bus segments to create and the GPIO pins used 33 - to control it. See include/linux/gpio-i2cmux.h for details. 33 + to control it. See include/linux/i2c-gpio-mux.h for details. 34 34 35 35 E.G. something like this for a MUX providing 4 bus segments 36 36 controlled through 3 GPIO pins: 37 37 38 - #include <linux/gpio-i2cmux.h> 38 + #include <linux/i2c-gpio-mux.h> 39 39 #include <linux/platform_device.h> 40 40 41 41 static const unsigned myboard_gpiomux_gpios[] = { ··· 57 57 }; 58 58 59 59 static struct platform_device myboard_i2cmux = { 60 - .name = "gpio-i2cmux", 60 + .name = "i2c-gpio-mux", 61 61 .id = 0, 62 62 .dev = { 63 63 .platform_data = &myboard_i2cmux_data,
+3 -3
MAINTAINERS
··· 2937 2937 M: Peter Korsgaard <peter.korsgaard@barco.com> 2938 2938 L: linux-i2c@vger.kernel.org 2939 2939 S: Supported 2940 - F: drivers/i2c/muxes/gpio-i2cmux.c 2941 - F: include/linux/gpio-i2cmux.h 2942 - F: Documentation/i2c/muxes/gpio-i2cmux 2940 + F: drivers/i2c/muxes/i2c-mux-gpio.c 2941 + F: include/linux/i2c-mux-gpio.h 2942 + F: Documentation/i2c/muxes/i2c-mux-gpio 2943 2943 2944 2944 GENERIC HDLC (WAN) DRIVERS 2945 2945 M: Krzysztof Halasa <khc@pm.waw.pl>
+1 -1
drivers/i2c/muxes/Kconfig
··· 15 15 through GPIO pins. 16 16 17 17 This driver can also be built as a module. If so, the module 18 - will be called gpio-i2cmux. 18 + will be called i2c-mux-gpio. 19 19 20 20 config I2C_MUX_PCA9541 21 21 tristate "NXP PCA9541 I2C Master Selector"
+1 -1
drivers/i2c/muxes/Makefile
··· 1 1 # 2 2 # Makefile for multiplexer I2C chip drivers. 3 3 4 - obj-$(CONFIG_I2C_MUX_GPIO) += gpio-i2cmux.o 4 + obj-$(CONFIG_I2C_MUX_GPIO) += i2c-mux-gpio.o 5 5 obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux-pca9541.o 6 6 obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o 7 7
+21 -22
drivers/i2c/muxes/gpio-i2cmux.c drivers/i2c/muxes/i2c-mux-gpio.c
··· 10 10 11 11 #include <linux/i2c.h> 12 12 #include <linux/i2c-mux.h> 13 - #include <linux/gpio-i2cmux.h> 13 + #include <linux/i2c-mux-gpio.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/init.h> 16 16 #include <linux/module.h> ··· 20 20 struct gpiomux { 21 21 struct i2c_adapter *parent; 22 22 struct i2c_adapter **adap; /* child busses */ 23 - struct gpio_i2cmux_platform_data data; 23 + struct i2c_mux_gpio_platform_data data; 24 24 }; 25 25 26 - static void gpiomux_set(const struct gpiomux *mux, unsigned val) 26 + static void i2c_mux_gpio_set(const struct gpiomux *mux, unsigned val) 27 27 { 28 28 int i; 29 29 ··· 31 31 gpio_set_value(mux->data.gpios[i], val & (1 << i)); 32 32 } 33 33 34 - static int gpiomux_select(struct i2c_adapter *adap, void *data, u32 chan) 34 + static int i2c_mux_gpio_select(struct i2c_adapter *adap, void *data, u32 chan) 35 35 { 36 36 struct gpiomux *mux = data; 37 37 38 - gpiomux_set(mux, mux->data.values[chan]); 38 + i2c_mux_gpio_set(mux, mux->data.values[chan]); 39 39 40 40 return 0; 41 41 } 42 42 43 - static int gpiomux_deselect(struct i2c_adapter *adap, void *data, u32 chan) 43 + static int i2c_mux_gpio_deselect(struct i2c_adapter *adap, void *data, u32 chan) 44 44 { 45 45 struct gpiomux *mux = data; 46 46 47 - gpiomux_set(mux, mux->data.idle); 47 + i2c_mux_gpio_set(mux, mux->data.idle); 48 48 49 49 return 0; 50 50 } 51 51 52 - static int __devinit gpiomux_probe(struct platform_device *pdev) 52 + static int __devinit i2c_mux_gpio_probe(struct platform_device *pdev) 53 53 { 54 54 struct gpiomux *mux; 55 - struct gpio_i2cmux_platform_data *pdata; 55 + struct i2c_mux_gpio_platform_data *pdata; 56 56 struct i2c_adapter *parent; 57 57 int (*deselect) (struct i2c_adapter *, void *, u32); 58 58 unsigned initial_state; ··· 86 86 goto alloc_failed2; 87 87 } 88 88 89 - if (pdata->idle != GPIO_I2CMUX_NO_IDLE) { 89 + if (pdata->idle != I2C_MUX_GPIO_NO_IDLE) { 90 90 initial_state = pdata->idle; 91 - deselect = gpiomux_deselect; 91 + deselect = i2c_mux_gpio_deselect; 92 92 } else { 93 93 initial_state = pdata->values[0]; 94 94 deselect = NULL; 95 95 } 96 96 97 97 for (i = 0; i < pdata->n_gpios; i++) { 98 - ret = gpio_request(pdata->gpios[i], "gpio-i2cmux"); 98 + ret = gpio_request(pdata->gpios[i], "i2c-mux-gpio"); 99 99 if (ret) 100 100 goto err_request_gpio; 101 101 gpio_direction_output(pdata->gpios[i], ··· 105 105 for (i = 0; i < pdata->n_values; i++) { 106 106 u32 nr = pdata->base_nr ? (pdata->base_nr + i) : 0; 107 107 108 - mux->adap[i] = i2c_add_mux_adapter(parent, &pdev->dev, mux, 109 - nr, i, 110 - gpiomux_select, deselect); 108 + mux->adap[i] = i2c_add_mux_adapter(parent, &pdev->dev, mux, nr, i, 109 + i2c_mux_gpio_select, deselect); 111 110 if (!mux->adap[i]) { 112 111 ret = -ENODEV; 113 112 dev_err(&pdev->dev, "Failed to add adapter %d\n", i); ··· 137 138 return ret; 138 139 } 139 140 140 - static int __devexit gpiomux_remove(struct platform_device *pdev) 141 + static int __devexit i2c_mux_gpio_remove(struct platform_device *pdev) 141 142 { 142 143 struct gpiomux *mux = platform_get_drvdata(pdev); 143 144 int i; ··· 156 157 return 0; 157 158 } 158 159 159 - static struct platform_driver gpiomux_driver = { 160 - .probe = gpiomux_probe, 161 - .remove = __devexit_p(gpiomux_remove), 160 + static struct platform_driver i2c_mux_gpio_driver = { 161 + .probe = i2c_mux_gpio_probe, 162 + .remove = __devexit_p(i2c_mux_gpio_remove), 162 163 .driver = { 163 164 .owner = THIS_MODULE, 164 - .name = "gpio-i2cmux", 165 + .name = "i2c-mux-gpio", 165 166 }, 166 167 }; 167 168 168 - module_platform_driver(gpiomux_driver); 169 + module_platform_driver(i2c_mux_gpio_driver); 169 170 170 171 MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver"); 171 172 MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>"); 172 173 MODULE_LICENSE("GPL"); 173 - MODULE_ALIAS("platform:gpio-i2cmux"); 174 + MODULE_ALIAS("platform:i2c-mux-gpio");
+7 -7
include/linux/gpio-i2cmux.h include/linux/i2c-mux-gpio.h
··· 1 1 /* 2 - * gpio-i2cmux interface to platform code 2 + * i2c-mux-gpio interface to platform code 3 3 * 4 4 * Peter Korsgaard <peter.korsgaard@barco.com> 5 5 * ··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - #ifndef _LINUX_GPIO_I2CMUX_H 12 - #define _LINUX_GPIO_I2CMUX_H 11 + #ifndef _LINUX_I2C_MUX_GPIO_H 12 + #define _LINUX_I2C_MUX_GPIO_H 13 13 14 14 /* MUX has no specific idle mode */ 15 - #define GPIO_I2CMUX_NO_IDLE ((unsigned)-1) 15 + #define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1) 16 16 17 17 /** 18 - * struct gpio_i2cmux_platform_data - Platform-dependent data for gpio-i2cmux 18 + * struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio 19 19 * @parent: Parent I2C bus adapter number 20 20 * @base_nr: Base I2C bus number to number adapters from or zero for dynamic 21 21 * @values: Array of bitmasks of GPIO settings (low/high) for each ··· 25 25 * @n_gpios: Number of GPIOs used to control MUX 26 26 * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used 27 27 */ 28 - struct gpio_i2cmux_platform_data { 28 + struct i2c_mux_gpio_platform_data { 29 29 int parent; 30 30 int base_nr; 31 31 const unsigned *values; ··· 35 35 unsigned idle; 36 36 }; 37 37 38 - #endif /* _LINUX_GPIO_I2CMUX_H */ 38 + #endif /* _LINUX_I2C_MUX_GPIO_H */