aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-11-19 06:27:43 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 04:50:40 -0400
commitfa2a02f26e76a01351b6a51e9152ae2efd088f48 (patch)
tree12b9301e50b7bb31d903f7c28032c092fb73f9a2 /arch/arm/mach-omap2
parent130cbe57f8f8c2fdf68eeb085f55b88a067404e8 (diff)
arm: omap: board-ldp: use generic dpi panel's gpio handling
The ldp board file currently requests gpios required to configure the NEC DPI panel, and provides platform_enable/disable callbacks to configure them. These tasks have been moved to the generic dpi panel driver itself and shouldn't be done in the board files. Remove the gpio requests and the platform callbacks from the board file. Configure the gpio information in generic dpi panel's platform data so that it's passed to the panel driver. Signed-off-by: Archit Taneja <archit@ti.com> Cc: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-ldp.c61
1 files changed, 9 insertions, 52 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 8a8e505a0e90..d0d17bc58d9b 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -181,34 +181,13 @@ static inline void __init ldp_init_smsc911x(void)
181 181
182/* LCD */ 182/* LCD */
183 183
184static int ldp_backlight_gpio;
185static int ldp_lcd_enable_gpio;
186
187#define LCD_PANEL_RESET_GPIO 55 184#define LCD_PANEL_RESET_GPIO 55
188#define LCD_PANEL_QVGA_GPIO 56 185#define LCD_PANEL_QVGA_GPIO 56
189 186
190static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
191{
192 if (gpio_is_valid(ldp_lcd_enable_gpio))
193 gpio_direction_output(ldp_lcd_enable_gpio, 1);
194 if (gpio_is_valid(ldp_backlight_gpio))
195 gpio_direction_output(ldp_backlight_gpio, 1);
196
197 return 0;
198}
199
200static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
201{
202 if (gpio_is_valid(ldp_lcd_enable_gpio))
203 gpio_direction_output(ldp_lcd_enable_gpio, 0);
204 if (gpio_is_valid(ldp_backlight_gpio))
205 gpio_direction_output(ldp_backlight_gpio, 0);
206}
207
208static struct panel_generic_dpi_data ldp_panel_data = { 187static struct panel_generic_dpi_data ldp_panel_data = {
209 .name = "nec_nl2432dr22-11b", 188 .name = "nec_nl2432dr22-11b",
210 .platform_enable = ldp_panel_enable_lcd, 189 .num_gpios = 4,
211 .platform_disable = ldp_panel_disable_lcd, 190 /* gpios filled in code */
212}; 191};
213 192
214static struct omap_dss_device ldp_lcd_device = { 193static struct omap_dss_device ldp_lcd_device = {
@@ -231,41 +210,19 @@ static struct omap_dss_board_info ldp_dss_data = {
231 210
232static void __init ldp_display_init(void) 211static void __init ldp_display_init(void)
233{ 212{
234 int r; 213 ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO;
235 214 ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO;
236 static struct gpio gpios[] __initdata = {
237 {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
238 {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
239 };
240
241 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
242 if (r) {
243 pr_err("Cannot request LCD GPIOs, error %d\n", r);
244 return;
245 }
246 215
247 omap_display_init(&ldp_dss_data); 216 omap_display_init(&ldp_dss_data);
248} 217}
249 218
250static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) 219static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
251{ 220{
252 int r; 221 ldp_panel_data.gpios[0] = gpio + 7;
253 222 ldp_panel_data.gpio_invert[0] = true;
254 struct gpio gpios[] = { 223
255 {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, 224 ldp_panel_data.gpios[1] = gpio + 15;
256 {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, 225 ldp_panel_data.gpio_invert[1] = true;
257 };
258
259 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
260 if (r) {
261 pr_err("Cannot request LCD GPIOs, error %d\n", r);
262 ldp_backlight_gpio = -EINVAL;
263 ldp_lcd_enable_gpio = -EINVAL;
264 return r;
265 }
266
267 ldp_backlight_gpio = gpio + 15;
268 ldp_lcd_enable_gpio = gpio + 7;
269 226
270 return 0; 227 return 0;
271} 228}