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

OMAPDSS: picodlp panel: handle gpio data in panel driver

The picodlp panel driver leaves gpio requests to the platform's board file.
These should happen in the panel driver itself.

A platform data struct called picodlp_panel_data already exists to hold gpio
numbers and other platform data. 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
d52e2e75 3552fb78

+20 -1
+20 -1
drivers/video/omap2/displays/panel-picodlp.c
··· 423 423 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev); 424 424 struct i2c_adapter *adapter; 425 425 struct i2c_client *picodlp_i2c_client; 426 - int picodlp_adapter_id; 426 + int r, picodlp_adapter_id; 427 427 428 428 dssdev->panel.timings = pico_ls_timings; 429 + 430 + if (!picodlp_pdata) 431 + return -EINVAL; 429 432 430 433 picod = devm_kzalloc(&dssdev->dev, sizeof(*picod), GFP_KERNEL); 431 434 if (!picod) ··· 454 451 picod->picodlp_i2c_client = picodlp_i2c_client; 455 452 456 453 dev_set_drvdata(&dssdev->dev, picod); 454 + 455 + if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) { 456 + r = devm_gpio_request_one(&dssdev->dev, 457 + picodlp_pdata->emu_done_gpio, 458 + GPIOF_IN, "DLP EMU DONE"); 459 + if (r) 460 + return r; 461 + } 462 + 463 + if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) { 464 + r = devm_gpio_request_one(&dssdev->dev, 465 + picodlp_pdata->pwrgood_gpio, 466 + GPIOF_OUT_INIT_LOW, "DLP PWRGOOD"); 467 + if (r) 468 + return r; 469 + } 457 470 458 471 return 0; 459 472 }