aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-stuib.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-stuib.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c71
1 files changed, 1 insertions, 70 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 564f57d5d8a7..7e1f294f0434 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -77,9 +77,6 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
77 * BU21013 ROHM touchscreen interface on the STUIBs 77 * BU21013 ROHM touchscreen interface on the STUIBs
78 */ 78 */
79 79
80/* tracks number of bu21013 devices being enabled */
81static int bu21013_devices;
82
83#define TOUCH_GPIO_PIN 84 80#define TOUCH_GPIO_PIN 84
84 81
85#define TOUCH_XMAX 384 82#define TOUCH_XMAX 384
@@ -88,73 +85,8 @@ static int bu21013_devices;
88#define PRCMU_CLOCK_OCR 0x1CC 85#define PRCMU_CLOCK_OCR 0x1CC
89#define TSC_EXT_CLOCK_9_6MHZ 0x840000 86#define TSC_EXT_CLOCK_9_6MHZ 0x840000
90 87
91/**
92 * bu21013_gpio_board_init : configures the touch panel.
93 * @reset_pin: reset pin number
94 * This function can be used to configures
95 * the voltage and reset the touch panel controller.
96 */
97static int bu21013_gpio_board_init(int reset_pin)
98{
99 int retval = 0;
100
101 bu21013_devices++;
102 if (bu21013_devices == 1) {
103 retval = gpio_request(reset_pin, "touchp_reset");
104 if (retval) {
105 printk(KERN_ERR "Unable to request gpio reset_pin");
106 return retval;
107 }
108 retval = gpio_direction_output(reset_pin, 1);
109 if (retval < 0) {
110 printk(KERN_ERR "%s: gpio direction failed\n",
111 __func__);
112 return retval;
113 }
114 }
115
116 return retval;
117}
118
119/**
120 * bu21013_gpio_board_exit : deconfigures the touch panel controller
121 * @reset_pin: reset pin number
122 * This function can be used to deconfigures the chip selection
123 * for touch panel controller.
124 */
125static int bu21013_gpio_board_exit(int reset_pin)
126{
127 int retval = 0;
128
129 if (bu21013_devices == 1) {
130 retval = gpio_direction_output(reset_pin, 0);
131 if (retval < 0) {
132 printk(KERN_ERR "%s: gpio direction failed\n",
133 __func__);
134 return retval;
135 }
136 gpio_set_value(reset_pin, 0);
137 }
138 bu21013_devices--;
139
140 return retval;
141}
142
143/**
144 * bu21013_read_pin_val : get the interrupt pin value
145 * This function can be used to get the interrupt pin value for touch panel
146 * controller.
147 */
148static int bu21013_read_pin_val(void)
149{
150 return gpio_get_value(TOUCH_GPIO_PIN);
151}
152
153static struct bu21013_platform_device tsc_plat_device = { 88static struct bu21013_platform_device tsc_plat_device = {
154 .cs_en = bu21013_gpio_board_init, 89 .touch_pin = TOUCH_GPIO_PIN,
155 .cs_dis = bu21013_gpio_board_exit,
156 .irq_read_val = bu21013_read_pin_val,
157 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
158 .touch_x_max = TOUCH_XMAX, 90 .touch_x_max = TOUCH_XMAX,
159 .touch_y_max = TOUCH_YMAX, 91 .touch_y_max = TOUCH_YMAX,
160 .ext_clk = false, 92 .ext_clk = false,
@@ -171,7 +103,6 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
171 I2C_BOARD_INFO("bu21013_tp", 0x5D), 103 I2C_BOARD_INFO("bu21013_tp", 0x5D),
172 .platform_data = &tsc_plat_device, 104 .platform_data = &tsc_plat_device,
173 }, 105 },
174
175}; 106};
176 107
177void __init mop500_stuib_init(void) 108void __init mop500_stuib_init(void)