of/gpio: add default of_xlate function if device has a node pointer
Implement generic OF gpio hooks and thus make device-enabled GPIO chips (i.e. the ones that have gpio_chip->dev specified) automatically attach to the OpenFirmware subsystem. Which means that now we can handle I2C and SPI GPIO chips almost* transparently. * "Almost" because some chips still require platform data, and for these chips OF-glue is still needed, though with this change the glue will be much smaller. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Bill Gatliff <bgat@billgatliff.com> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Andrew Morton <akpm@linux-foundation.org> CC: linux-kernel@vger.kernel.org CC: devicetree-discuss@lists.ozlabs.org
This commit is contained in:
committed by
Grant Likely
parent
594fa265e0
commit
391c970c0d
@@ -633,7 +633,6 @@ int cpm1_gpiochip_add16(struct device_node *np)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = cpm1_gpio16_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = 16;
|
||||
gc->direction_input = cpm1_gpio16_dir_in;
|
||||
gc->direction_output = cpm1_gpio16_dir_out;
|
||||
@@ -755,7 +754,6 @@ int cpm1_gpiochip_add32(struct device_node *np)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = cpm1_gpio32_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = 32;
|
||||
gc->direction_input = cpm1_gpio32_dir_in;
|
||||
gc->direction_output = cpm1_gpio32_dir_out;
|
||||
|
@@ -337,7 +337,6 @@ int cpm2_gpiochip_add32(struct device_node *np)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = cpm2_gpio32_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = 32;
|
||||
gc->direction_input = cpm2_gpio32_dir_in;
|
||||
gc->direction_output = cpm2_gpio32_dir_out;
|
||||
|
@@ -273,7 +273,6 @@ static void __init mpc8xxx_add_controller(struct device_node *np)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = mpc8xxx_gpio_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = MPC8XXX_GPIO_PINS;
|
||||
gc->direction_input = mpc8xxx_gpio_dir_in;
|
||||
gc->direction_output = mpc8xxx_gpio_dir_out;
|
||||
|
@@ -194,7 +194,6 @@ static int __init ppc4xx_add_gpiochips(void)
|
||||
mm_gc = &ppc4xx_gc->mm_gc;
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = 32;
|
||||
gc->direction_input = ppc4xx_gpio_dir_in;
|
||||
gc->direction_output = ppc4xx_gpio_dir_out;
|
||||
|
@@ -321,7 +321,6 @@ static int __init qe_add_gpiochips(void)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = qe_gpio_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = QE_PIO_PINS;
|
||||
gc->direction_input = qe_gpio_dir_in;
|
||||
gc->direction_output = qe_gpio_dir_out;
|
||||
|
@@ -103,7 +103,6 @@ static int __init u8_simple_gpiochip_add(struct device_node *np)
|
||||
gc = &mm_gc->gc;
|
||||
|
||||
mm_gc->save_regs = u8_gpio_save_regs;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->ngpio = 8;
|
||||
gc->direction_input = u8_gpio_dir_in;
|
||||
gc->direction_output = u8_gpio_dir_out;
|
||||
|
Reference in New Issue
Block a user