aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-01-26 05:32:34 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-01-28 15:50:11 -0500
commitf8bd493456c3da372ae81ed8f6b903f6207b9d98 (patch)
tree2f81cc7fa93df9025eb281ee9c2843d09b5201e6 /drivers/video/omap
parent1c16697bf9d5b206cb0d2b905a54de5e077296be (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/omap')
-rw-r--r--drivers/video/omap/lcd_inn1610.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
index 7e8bd8e08a98..e3d3d135aa48 100644
--- a/drivers/video/omap/lcd_inn1610.c
+++ b/drivers/video/omap/lcd_inn1610.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <asm/gpio.h> 25#include <linux/gpio.h>
26#include "omapfb.h" 26#include "omapfb.h"
27 27
28#define MODULE_NAME "omapfb-lcd_h3" 28#define MODULE_NAME "omapfb-lcd_h3"
@@ -32,20 +32,18 @@ static int innovator1610_panel_init(struct lcd_panel *panel,
32{ 32{
33 int r = 0; 33 int r = 0;
34 34
35 if (gpio_request(14, "lcd_en0")) { 35 /* configure GPIO(14, 15) as outputs */
36 if (gpio_request_one(14, GPIOF_OUT_INIT_LOW, "lcd_en0")) {
36 pr_err(MODULE_NAME ": can't request GPIO 14\n"); 37 pr_err(MODULE_NAME ": can't request GPIO 14\n");
37 r = -1; 38 r = -1;
38 goto exit; 39 goto exit;
39 } 40 }
40 if (gpio_request(15, "lcd_en1")) { 41 if (gpio_request_one(15, GPIOF_OUT_INIT_LOW, "lcd_en1")) {
41 pr_err(MODULE_NAME ": can't request GPIO 15\n"); 42 pr_err(MODULE_NAME ": can't request GPIO 15\n");
42 gpio_free(14); 43 gpio_free(14);
43 r = -1; 44 r = -1;
44 goto exit; 45 goto exit;
45 } 46 }
46 /* configure GPIO(14, 15) as outputs */
47 gpio_direction_output(14, 0);
48 gpio_direction_output(15, 0);
49exit: 47exit:
50 return r; 48 return r;
51} 49}