diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-01-26 05:32:34 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-01-28 15:50:11 -0500 |
commit | f8bd493456c3da372ae81ed8f6b903f6207b9d98 (patch) | |
tree | 2f81cc7fa93df9025eb281ee9c2843d09b5201e6 /drivers/video/omap2/displays | |
parent | 1c16697bf9d5b206cb0d2b905a54de5e077296be (diff) |
video: use gpio_request_one
Using gpio_request_one can make the code simpler because it can
set the direction and initial value in one shot.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/omap2/displays')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/displays/panel-tpo-td043mtea1.c | 11 |
2 files changed, 3 insertions, 12 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 00c5c615585f..0f21fa5a16ae 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -1019,14 +1019,12 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
1019 | if (panel_data->use_ext_te) { | 1019 | if (panel_data->use_ext_te) { |
1020 | int gpio = panel_data->ext_te_gpio; | 1020 | int gpio = panel_data->ext_te_gpio; |
1021 | 1021 | ||
1022 | r = gpio_request(gpio, "taal irq"); | 1022 | r = gpio_request_one(gpio, GPIOF_IN, "taal irq"); |
1023 | if (r) { | 1023 | if (r) { |
1024 | dev_err(&dssdev->dev, "GPIO request failed\n"); | 1024 | dev_err(&dssdev->dev, "GPIO request failed\n"); |
1025 | goto err_gpio; | 1025 | goto err_gpio; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | gpio_direction_input(gpio); | ||
1029 | |||
1030 | r = request_irq(gpio_to_irq(gpio), taal_te_isr, | 1028 | r = request_irq(gpio_to_irq(gpio), taal_te_isr, |
1031 | IRQF_TRIGGER_RISING, | 1029 | IRQF_TRIGGER_RISING, |
1032 | "taal vsync", dssdev); | 1030 | "taal vsync", dssdev); |
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index e6649aa89591..880c313d6bcc 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c | |||
@@ -408,17 +408,12 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) | |||
408 | } | 408 | } |
409 | 409 | ||
410 | if (gpio_is_valid(nreset_gpio)) { | 410 | if (gpio_is_valid(nreset_gpio)) { |
411 | ret = gpio_request(nreset_gpio, "lcd reset"); | 411 | ret = gpio_request_one(nreset_gpio, GPIOF_OUT_INIT_LOW, |
412 | "lcd reset"); | ||
412 | if (ret < 0) { | 413 | if (ret < 0) { |
413 | dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); | 414 | dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); |
414 | goto fail_gpio_req; | 415 | goto fail_gpio_req; |
415 | } | 416 | } |
416 | |||
417 | ret = gpio_direction_output(nreset_gpio, 0); | ||
418 | if (ret < 0) { | ||
419 | dev_err(&dssdev->dev, "couldn't set GPIO direction\n"); | ||
420 | goto fail_gpio_direction; | ||
421 | } | ||
422 | } | 417 | } |
423 | 418 | ||
424 | ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); | 419 | ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); |
@@ -427,8 +422,6 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) | |||
427 | 422 | ||
428 | return 0; | 423 | return 0; |
429 | 424 | ||
430 | fail_gpio_direction: | ||
431 | gpio_free(nreset_gpio); | ||
432 | fail_gpio_req: | 425 | fail_gpio_req: |
433 | regulator_put(tpo_td043->vcc_reg); | 426 | regulator_put(tpo_td043->vcc_reg); |
434 | fail_regulator: | 427 | fail_regulator: |