Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

OMAPDSS: n8x0 panel: handle gpio data in panel driver

The n8x0 panel driver leaves gpio configurations to the platform_enable and
disable calls in the platform's board file. These should happen in the panel
driver itself.

A platform data struct called panel_n8x0_data already exists to hold gpio
numbers and other platform data. However, the gpio requests are expected to be
done in the board file and not the panel driver.

Request all the gpios in the panel driver so that the board files which use
the the panel don't need to do it. This will help in removing the need for the
panel drivers to have platform related callbacks.

Signed-off-by: Archit Taneja <archit@ti.com>

authored by

Archit Taneja and committed by
Tomi Valkeinen
64f93897 b3fb8b98

+15
+15
drivers/video/omap2/displays/panel-n8x0.c
··· 426 426 { 427 427 struct panel_n8x0_data *bdata = get_board_data(dssdev); 428 428 struct panel_drv_data *ddata; 429 + int r; 429 430 430 431 dev_dbg(&dssdev->dev, "probe\n"); 431 432 ··· 444 443 dssdev->ctrl.pixel_size = 16; 445 444 dssdev->ctrl.rfbi_timings = n8x0_panel_timings; 446 445 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; 446 + 447 + if (gpio_is_valid(bdata->panel_reset)) { 448 + r = devm_gpio_request_one(&dssdev->dev, bdata->panel_reset, 449 + GPIOF_OUT_INIT_LOW, "PANEL RESET"); 450 + if (r) 451 + return r; 452 + } 453 + 454 + if (gpio_is_valid(bdata->ctrl_pwrdown)) { 455 + r = devm_gpio_request_one(&dssdev->dev, bdata->ctrl_pwrdown, 456 + GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN"); 457 + if (r) 458 + return r; 459 + } 447 460 448 461 return 0; 449 462 }