aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3evm.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2011-04-24 18:09:05 -0400
committerTony Lindgren <tony@atomide.com>2011-05-03 05:38:09 -0400
commit96974a249b0cf3537f49115a59be67e2c54f315c (patch)
tree4415a81a5ad4a91313bacf6b534b77f5556858a9 /arch/arm/mach-omap2/board-omap3evm.c
parentd14f81741f4ca5c96f52eff0210c8da0b0997d6f (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-omap3evm.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3fc85c6fc55..376ea87dce6 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -50,6 +50,7 @@
50#include "mux.h" 50#include "mux.h"
51#include "sdram-micron-mt46h32m32lf-6.h" 51#include "sdram-micron-mt46h32m32lf-6.h"
52#include "hsmmc.h" 52#include "hsmmc.h"
53#include "common-board-devices.h"
53 54
54#define OMAP3_EVM_TS_GPIO 175 55#define OMAP3_EVM_TS_GPIO 175
55#define OMAP3_EVM_EHCI_VBUS 22 56#define OMAP3_EVM_EHCI_VBUS 22
@@ -630,51 +631,6 @@ static int __init omap3_evm_i2c_init(void)
630 return 0; 631 return 0;
631} 632}
632 633
633static void ads7846_dev_init(void)
634{
635 if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
636 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
637
638 gpio_direction_input(OMAP3_EVM_TS_GPIO);
639 gpio_set_debounce(OMAP3_EVM_TS_GPIO, 310);
640}
641
642static int ads7846_get_pendown_state(void)
643{
644 return !gpio_get_value(OMAP3_EVM_TS_GPIO);
645}
646
647static struct ads7846_platform_data ads7846_config = {
648 .x_max = 0x0fff,
649 .y_max = 0x0fff,
650 .x_plate_ohms = 180,
651 .pressure_max = 255,
652 .debounce_max = 10,
653 .debounce_tol = 3,
654 .debounce_rep = 1,
655 .get_pendown_state = ads7846_get_pendown_state,
656 .keep_vref_on = 1,
657 .settle_delay_usecs = 150,
658 .wakeup = true,
659};
660
661static struct omap2_mcspi_device_config ads7846_mcspi_config = {
662 .turbo_mode = 0,
663 .single_channel = 1, /* 0: slave, 1: master */
664};
665
666static struct spi_board_info omap3evm_spi_board_info[] = {
667 [0] = {
668 .modalias = "ads7846",
669 .bus_num = 1,
670 .chip_select = 0,
671 .max_speed_hz = 1500000,
672 .controller_data = &ads7846_mcspi_config,
673 .irq = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
674 .platform_data = &ads7846_config,
675 },
676};
677
678static struct omap_board_config_kernel omap3_evm_config[] __initdata = { 634static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
679}; 635};
680 636
@@ -792,9 +748,6 @@ static void __init omap3_evm_init(void)
792 748
793 omap_display_init(&omap3_evm_dss_data); 749 omap_display_init(&omap3_evm_dss_data);
794 750
795 spi_register_board_info(omap3evm_spi_board_info,
796 ARRAY_SIZE(omap3evm_spi_board_info));
797
798 omap_serial_init(); 751 omap_serial_init();
799 752
800 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ 753 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
@@ -827,7 +780,7 @@ static void __init omap3_evm_init(void)
827 } 780 }
828 usb_musb_init(&musb_board_data); 781 usb_musb_init(&musb_board_data);
829 usbhs_init(&usbhs_bdata); 782 usbhs_init(&usbhs_bdata);
830 ads7846_dev_init(); 783 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
831 omap3evm_init_smsc911x(); 784 omap3evm_init_smsc911x();
832 omap3_evm_display_init(); 785 omap3_evm_display_init();
833 786