ARM: OMAP2+: Add chip_select to ads7846 init
Subsystems (3)
This patch adds the chip_select as parameter to omap_ads7846_init.
All existing omap2-boards use chip select 0 on different spi busses. I work on bringing a board mainline where the ads7846 is connected to
chip select 1. This patch prepares the omap_ads7846_init function for this board.
Signed-off-by Thomas Weber <[email protected]>
--- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/common-board-devices.c | 13 ++++++++----- arch/arm/mach-omap2/common-board-devices.h | 3 ++- 11 files changed, 19 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +1 -1
@@ -710,7 +710,7 @@ static void __init omap_3430sdp_init(void) gpio_pendown =SDP3430_TS_GPIO_IRQ_SDPV2 ; else gpio_pendown =SDP3430_TS_GPIO_IRQ_SDPV1 ; -omap_ads7846_init (1 , gpio_pendown,310 ,NULL ); +omap_ads7846_init (1 ,0 , gpio_pendown,310 ,NULL );board_serial_init ();omap_sdrc_init (hyb18m512160af6_sdrc_params,NULL );usb_musb_init (NULL );
arch/arm/mach-omap2/board-cm-t35.c +1 -1
@@ -606,7 +606,7 @@ static void __init cm_t3x_common_init(void)omap_sdrc_init (mt46h32m32lf6_sdrc_params, mt46h32m32lf6_sdrc_params);cm_t35_init_i2c (); -omap_ads7846_init (1 ,CM_T35_GPIO_PENDOWN ,0 ,NULL ); +omap_ads7846_init (1 ,0 ,CM_T35_GPIO_PENDOWN ,0 ,NULL );cm_t35_init_ethernet ();cm_t35_init_led ();cm_t35_init_display ();
arch/arm/mach-omap2/board-devkit8000.c +1 -1
@@ -642,7 +642,7 @@ static void __init devkit8000_init(void)omap_display_init (&devkit8000_dss_data); -omap_ads7846_init (2 ,OMAP3_DEVKIT_TS_GPIO ,0 ,NULL ); +omap_ads7846_init (2 ,0 ,OMAP3_DEVKIT_TS_GPIO ,0 ,NULL );usb_musb_init (NULL );usbhs_init (&usbhs_bdata);
arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -417,7 +417,7 @@ static void __init omap_ldp_init(void)ldp_init_smsc911x ();omap_i2c_init ();platform_add_devices (ldp_devices,ARRAY_SIZE (ldp_devices)); -omap_ads7846_init (1 ,54 ,310 ,NULL ); +omap_ads7846_init (1 ,0 ,54 ,310 ,NULL );omap_serial_init ();omap_sdrc_init (NULL ,NULL );usb_musb_init (NULL );
arch/arm/mach-omap2/board-omap3evm.c +1 -1
@@ -661,7 +661,7 @@ static void __init omap3_evm_init(void) }usb_musb_init (&musb_board_data);usbhs_init (&usbhs_bdata); -omap_ads7846_init (1 ,OMAP3_EVM_TS_GPIO ,310 ,NULL ); +omap_ads7846_init (1 ,0 ,OMAP3_EVM_TS_GPIO ,310 ,NULL );omap3evm_init_smsc911x ();omap3_evm_display_init ();
arch/arm/mach-omap2/board-omap3pandora.c +1 -1
@@ -590,7 +590,7 @@ static void __init omap3pandora_init(void) mt46h32m32lf6_sdrc_params);spi_register_board_info (omap3pandora_spi_board_info,ARRAY_SIZE (omap3pandora_spi_board_info)); -omap_ads7846_init (1 ,OMAP3_PANDORA_TS_GPIO ,0 ,NULL ); +omap_ads7846_init (1 ,0 ,OMAP3_PANDORA_TS_GPIO ,0 ,NULL );usbhs_init (&usbhs_bdata);usb_musb_init (NULL );gpmc_nand_init (&pandora_nand_data);
arch/arm/mach-omap2/board-omap3stalker.c +1 -1
@@ -436,7 +436,7 @@ static void __init omap3_stalker_init(void)omap_sdrc_init (mt46h32m32lf6_sdrc_params,NULL );usb_musb_init (NULL );usbhs_init (&usbhs_bdata); -omap_ads7846_init (1 ,OMAP3_STALKER_TS_GPIO ,310 ,NULL ); +omap_ads7846_init (1 ,0 ,OMAP3_STALKER_TS_GPIO ,310 ,NULL );omap_mux_init_gpio (21 ,OMAP_PIN_OUTPUT );omap_mux_init_gpio (18 ,OMAP_PIN_INPUT_PULLUP );
arch/arm/mach-omap2/board-omap3touchbook.c +1 -1
@@ -363,7 +363,7 @@ static void __init omap3_touchbook_init(void)gpio_request_one (176 ,GPIOF_OUT_INIT_HIGH ,"DVI_nPD" );/* Touchscreen and accelerometer */ -omap_ads7846_init (4 ,OMAP3_TS_GPIO ,310 , &ads7846_pdata); +omap_ads7846_init (4 ,0 ,OMAP3_TS_GPIO ,310 , &ads7846_pdata);usb_musb_init (NULL );usbhs_init (&usbhs_bdata); omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
arch/arm/mach-omap2/board-overo.c +1 -1
@@ -105,7 +105,7 @@ static struct platform_device vads7846_device = {static void __init overo_ads7846_init (void ) { -omap_ads7846_init (1 ,OVERO_GPIO_PENDOWN ,0 ,NULL ); +omap_ads7846_init (1 ,0 ,OVERO_GPIO_PENDOWN ,0 ,NULL );platform_device_register (&vads7846_device); }
arch/arm/mach-omap2/common-board-devices.c +8 -5
@@ -51,14 +51,15 @@ static struct ads7846_platform_data ads7846_config = {static struct spi_board_info ads7846_spi_board_info__initdata = { .modalias ="ads7846" , .bus_num = -EINVAL , - .chip_select =0 , + .chip_select = -EINVAL , .max_speed_hz =1500000 , .controller_data = &ads7846_mcspi_config, .irq = -EINVAL , .platform_data = &ads7846_config, }; -void __init omap_ads7846_init (int bus_num,int gpio_pendown,int gpio_debounce, +void __init omap_ads7846_init (int bus_num,int chip_select, +int gpio_pendown,int gpio_debounce,struct ads7846_platform_data *board_pdata) {struct spi_board_info *spi_bi = &ads7846_spi_board_info;
@@ -78,8 +79,9 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, ads7846_config.gpio_pendown = gpio_pendown; - spi_bi->bus_num = bus_num; - spi_bi->irq =OMAP_GPIO_IRQ (gpio_pendown); + spi_bi->bus_num = bus_num; + spi_bi->chip_select = chip_select; + spi_bi->irq =OMAP_GPIO_IRQ (gpio_pendown);if (board_pdata) spi_bi->platform_data = board_pdata;
@@ -87,7 +89,8 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, spi_register_board_info(&ads7846_spi_board_info, 1); }#else -void __init omap_ads7846_init (int bus_num,int gpio_pendown,int gpio_debounce, +void __init omap_ads7846_init (int bus_num,int chip_select, +int gpio_pendown,int gpio_debounce,struct ads7846_platform_data *board_pdata) { }
arch/arm/mach-omap2/common-board-devices.h +2 -1
@@ -8,7 +8,8 @@struct mtd_partition ;struct ads7846_platform_data ; -void omap_ads7846_init (int bus_num,int gpio_pendown,int gpio_debounce, +void omap_ads7846_init (int bus_num,int chip_select, +int gpio_pendown,int gpio_debounce,struct ads7846_platform_data *board_pdata);void omap_nand_flash_init (int opts,struct mtd_partition *parts,int n_parts);
Signature · 1 line
1.7.7.1
Tony Lindgren
maintainerQuoted 28 lines · Thomas Weber
This patch adds the
chip_selectas parameter toomap_ads7846_init.
All existing omap2-boards use chip select 0 on different spi busses. I work on bringing a board mainline where the ads7846 is connected to
chip select 1. This patch prepares theomap_ads7846_initfunction for this board.Signed-off-by Thomas Weber <[email protected]>--- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/common-board-devices.c | 13 ++++++++----- arch/arm/mach-omap2/common-board-devices.h | 3 ++- 11 files changed, 19 insertions(+), 15 deletions(-)arch/arm/mach-omap2/board-3430sdp.c +0
-0
arch/arm/mach-omap2/board-3430sdp.c static void __init omap_3430sdp_init(void) · line 716
Quoted 8 lines
arch/arm/mach-omap2/board-3430sdp.c +1
-1@@ -710,7 +710,7 @@ static void __init omap_3430sdp_init(void) gpio_pendown =SDP3430_TS_GPIO_IRQ_SDPV2 ; else gpio_pendown =SDP3430_TS_GPIO_IRQ_SDPV1 ; -omap_ads7846_init (1 , gpio_pendown,310 ,NULL ); +omap_ads7846_init (1 ,0 , gpio_pendown,310 ,NULL );board_serial_init ();omap_sdrc_init (hyb18m512160af6_sdrc_params,NULL );usb_musb_init (NULL );
This seems OK to me until we have device tree bindings for this.
Regards,
Tony