aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-08-27 05:49:50 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-14 04:18:50 -0400
commitef7315084ede82ea55f251003a6f0088d95d9fa6 (patch)
tree449a6d74cc7feb564350f7970bb9a662ec3dfce7
parentbfa88ea7ee9e6b4fd673e45a8cc0a8e0b7ef4761 (diff)
ARM: mach-shmobile: ap4evb: modify tsc2007 platform settings
This patch modify x_plate_ohms to correct value for tsc2007, and removed un-necessary ts_get_pendown_state(). gpio_pull_up() was removed also. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c51
1 files changed, 3 insertions, 48 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 95935c83c306..0cb9e7cf1ddc 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -756,7 +756,6 @@ device_initcall(hdmi_init_pm_clock);
756 * FIXME !! 756 * FIXME !!
757 * 757 *
758 * gpio_no_direction 758 * gpio_no_direction
759 * gpio_pull_up
760 * are quick_hack. 759 * are quick_hack.
761 * 760 *
762 * current gpio frame work doesn't have 761 * current gpio frame work doesn't have
@@ -768,58 +767,12 @@ static void __init gpio_no_direction(u32 addr)
768 __raw_writeb(0x00, addr); 767 __raw_writeb(0x00, addr);
769} 768}
770 769
771static void __init gpio_pull_up(u32 addr)
772{
773 u8 data = __raw_readb(addr);
774
775 data &= 0x0F;
776 data |= 0xC0;
777 __raw_writeb(data, addr);
778}
779
780/* TouchScreen */ 770/* TouchScreen */
781#define IRQ28 evt2irq(0x3380) /* IRQ28A */ 771#define IRQ28 evt2irq(0x3380) /* IRQ28A */
782#define IRQ7 evt2irq(0x02e0) /* IRQ7A */ 772#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
783static int ts_get_pendown_state(void)
784{
785 int val1, val2;
786
787 gpio_free(GPIO_FN_IRQ28_123);
788 gpio_free(GPIO_FN_IRQ7_40);
789
790 gpio_request(GPIO_PORT123, NULL);
791 gpio_request(GPIO_PORT40, NULL);
792
793 gpio_direction_input(GPIO_PORT123);
794 gpio_direction_input(GPIO_PORT40);
795
796 val1 = gpio_get_value(GPIO_PORT123);
797 val2 = gpio_get_value(GPIO_PORT40);
798
799 gpio_request(GPIO_FN_IRQ28_123, NULL); /* for QHD */
800 gpio_request(GPIO_FN_IRQ7_40, NULL); /* for WVGA */
801
802 return val1 ^ val2;
803}
804
805#define PORT40CR 0xE6051028
806#define PORT123CR 0xE605007B
807static int ts_init(void)
808{
809 gpio_request(GPIO_FN_IRQ28_123, NULL); /* for QHD */
810 gpio_request(GPIO_FN_IRQ7_40, NULL); /* for WVGA */
811
812 gpio_pull_up(PORT40CR);
813 gpio_pull_up(PORT123CR);
814
815 return 0;
816}
817
818static struct tsc2007_platform_data tsc2007_info = { 773static struct tsc2007_platform_data tsc2007_info = {
819 .model = 2007, 774 .model = 2007,
820 .x_plate_ohms = 180, 775 .x_plate_ohms = 1000,
821 .get_pendown_state = ts_get_pendown_state,
822 .init_platform_hw = ts_init,
823}; 776};
824 777
825static struct i2c_board_info tsc_device = { 778static struct i2c_board_info tsc_device = {
@@ -994,6 +947,7 @@ static void __init ap4evb_init(void)
994 gpio_request(GPIO_FN_KEYIN4, NULL); 947 gpio_request(GPIO_FN_KEYIN4, NULL);
995 948
996 /* enable TouchScreen */ 949 /* enable TouchScreen */
950 gpio_request(GPIO_FN_IRQ28_123, NULL);
997 set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); 951 set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW);
998 952
999 tsc_device.irq = IRQ28; 953 tsc_device.irq = IRQ28;
@@ -1069,6 +1023,7 @@ static void __init ap4evb_init(void)
1069 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1023 lcdc_info.ch[0].lcd_size_cfg.height = 91;
1070 1024
1071 /* enable TouchScreen */ 1025 /* enable TouchScreen */
1026 gpio_request(GPIO_FN_IRQ7_40, NULL);
1072 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); 1027 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
1073 1028
1074 tsc_device.irq = IRQ7; 1029 tsc_device.irq = IRQ7;