diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-24 18:09:05 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-05-03 05:38:09 -0400 |
commit | 96974a249b0cf3537f49115a59be67e2c54f315c (patch) | |
tree | 4415a81a5ad4a91313bacf6b534b77f5556858a9 /arch/arm/mach-omap2/board-omap3pandora.c | |
parent | d14f81741f4ca5c96f52eff0210c8da0b0997d6f (diff) |
omap: consolidate touch screen initialization among different boards
Add common-board-devices.c that will contain the code for peripheral
devices initializatoin shared between multiple boards.
Start small with touchscreen initialization.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3pandora.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 07dba888f450..517701aae3ca 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | 23 | ||
24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
25 | #include <linux/spi/ads7846.h> | ||
26 | #include <linux/regulator/machine.h> | 25 | #include <linux/regulator/machine.h> |
27 | #include <linux/i2c/twl.h> | 26 | #include <linux/i2c/twl.h> |
28 | #include <linux/wl12xx.h> | 27 | #include <linux/wl12xx.h> |
@@ -52,6 +51,7 @@ | |||
52 | #include "mux.h" | 51 | #include "mux.h" |
53 | #include "sdram-micron-mt46h32m32lf-6.h" | 52 | #include "sdram-micron-mt46h32m32lf-6.h" |
54 | #include "hsmmc.h" | 53 | #include "hsmmc.h" |
54 | #include "common-board-devices.h" | ||
55 | 55 | ||
56 | #define PANDORA_WIFI_IRQ_GPIO 21 | 56 | #define PANDORA_WIFI_IRQ_GPIO 21 |
57 | #define PANDORA_WIFI_NRESET_GPIO 23 | 57 | #define PANDORA_WIFI_NRESET_GPIO 23 |
@@ -570,53 +570,8 @@ static int __init omap3pandora_i2c_init(void) | |||
570 | return 0; | 570 | return 0; |
571 | } | 571 | } |
572 | 572 | ||
573 | static void __init omap3pandora_ads7846_init(void) | ||
574 | { | ||
575 | int gpio = OMAP3_PANDORA_TS_GPIO; | ||
576 | int ret; | ||
577 | |||
578 | ret = gpio_request(gpio, "ads7846_pen_down"); | ||
579 | if (ret < 0) { | ||
580 | printk(KERN_ERR "Failed to request GPIO %d for " | ||
581 | "ads7846 pen down IRQ\n", gpio); | ||
582 | return; | ||
583 | } | ||
584 | |||
585 | gpio_direction_input(gpio); | ||
586 | } | ||
587 | |||
588 | static int ads7846_get_pendown_state(void) | ||
589 | { | ||
590 | return !gpio_get_value(OMAP3_PANDORA_TS_GPIO); | ||
591 | } | ||
592 | |||
593 | static struct ads7846_platform_data ads7846_config = { | ||
594 | .x_max = 0x0fff, | ||
595 | .y_max = 0x0fff, | ||
596 | .x_plate_ohms = 180, | ||
597 | .pressure_max = 255, | ||
598 | .debounce_max = 10, | ||
599 | .debounce_tol = 3, | ||
600 | .debounce_rep = 1, | ||
601 | .get_pendown_state = ads7846_get_pendown_state, | ||
602 | .keep_vref_on = 1, | ||
603 | }; | ||
604 | |||
605 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { | ||
606 | .turbo_mode = 0, | ||
607 | .single_channel = 1, /* 0: slave, 1: master */ | ||
608 | }; | ||
609 | |||
610 | static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { | 573 | static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { |
611 | { | 574 | { |
612 | .modalias = "ads7846", | ||
613 | .bus_num = 1, | ||
614 | .chip_select = 0, | ||
615 | .max_speed_hz = 1500000, | ||
616 | .controller_data = &ads7846_mcspi_config, | ||
617 | .irq = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO), | ||
618 | .platform_data = &ads7846_config, | ||
619 | }, { | ||
620 | .modalias = "tpo_td043mtea1_panel_spi", | 575 | .modalias = "tpo_td043mtea1_panel_spi", |
621 | .bus_num = 1, | 576 | .bus_num = 1, |
622 | .chip_select = 1, | 577 | .chip_select = 1, |
@@ -705,7 +660,7 @@ static void __init omap3pandora_init(void) | |||
705 | omap_serial_init(); | 660 | omap_serial_init(); |
706 | spi_register_board_info(omap3pandora_spi_board_info, | 661 | spi_register_board_info(omap3pandora_spi_board_info, |
707 | ARRAY_SIZE(omap3pandora_spi_board_info)); | 662 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
708 | omap3pandora_ads7846_init(); | 663 | omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); |
709 | usbhs_init(&usbhs_bdata); | 664 | usbhs_init(&usbhs_bdata); |
710 | usb_musb_init(&musb_board_data); | 665 | usb_musb_init(&musb_board_data); |
711 | gpmc_nand_init(&pandora_nand_data); | 666 | gpmc_nand_init(&pandora_nand_data); |