diff options
author | Archit Taneja <archit@ti.com> | 2013-02-12 04:37:32 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-04 04:50:48 -0400 |
commit | fde382541d55000ffc39587d5bff4f71fde8db07 (patch) | |
tree | 870fff68767f067b5542d49d4f38a0c32faee01b | |
parent | 5c4e599510cd519cfb0e172cc5ff139677d9f909 (diff) |
arm: omap: board-omap3evm: use sharp panel's gpio handling
The omap3evm board file currently requests gpios required by the sharp_ls dpi
panel, and provides platform_enable/disable callbacks to configure them.
These tasks have been moved to the sharp_ls panel driver itself and shouldn't
be done in the board files.
Remove the gpio requests and the platform callbacks from the board file.
Add the gpio information to panel_sharp_ls037v7dw01_data so that it's passed
to the panel driver.
Note: The GPIOs OMAP3EVM_LCD_PANEL_ENVDD and OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO
aren't directly connected to the sharp panel, hence they aren't passed to the
panel driver as platform data. These are set to a default value such that LCD
is enabled and backlight is on. These used to previously toggle through the
platform_enable/disable callbacks, but now these are always on. This needs to
be revisited.
Signed-off-by: Archit Taneja <archit@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 233a0d528fcf..80ed967cc056 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -155,61 +155,43 @@ static inline void __init omap3evm_init_smsc911x(void) { return; } | |||
155 | #define OMAP3EVM_LCD_PANEL_LR 2 | 155 | #define OMAP3EVM_LCD_PANEL_LR 2 |
156 | #define OMAP3EVM_LCD_PANEL_UD 3 | 156 | #define OMAP3EVM_LCD_PANEL_UD 3 |
157 | #define OMAP3EVM_LCD_PANEL_INI 152 | 157 | #define OMAP3EVM_LCD_PANEL_INI 152 |
158 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
159 | #define OMAP3EVM_LCD_PANEL_QVGA 154 | 158 | #define OMAP3EVM_LCD_PANEL_QVGA 154 |
160 | #define OMAP3EVM_LCD_PANEL_RESB 155 | 159 | #define OMAP3EVM_LCD_PANEL_RESB 155 |
160 | |||
161 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
161 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 | 162 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 |
163 | |||
164 | /* | ||
165 | * OMAP3EVM DVI control signals | ||
166 | */ | ||
162 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 | 167 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 |
163 | 168 | ||
164 | static struct gpio omap3_evm_dss_gpios[] __initdata = { | 169 | static struct panel_sharp_ls037v7dw01_data omap3_evm_lcd_data = { |
165 | { OMAP3EVM_LCD_PANEL_RESB, GPIOF_OUT_INIT_HIGH, "lcd_panel_resb" }, | 170 | .resb_gpio = OMAP3EVM_LCD_PANEL_RESB, |
166 | { OMAP3EVM_LCD_PANEL_INI, GPIOF_OUT_INIT_HIGH, "lcd_panel_ini" }, | 171 | .ini_gpio = OMAP3EVM_LCD_PANEL_INI, |
167 | { OMAP3EVM_LCD_PANEL_QVGA, GPIOF_OUT_INIT_LOW, "lcd_panel_qvga" }, | 172 | .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA, |
168 | { OMAP3EVM_LCD_PANEL_LR, GPIOF_OUT_INIT_HIGH, "lcd_panel_lr" }, | 173 | .lr_gpio = OMAP3EVM_LCD_PANEL_LR, |
169 | { OMAP3EVM_LCD_PANEL_UD, GPIOF_OUT_INIT_HIGH, "lcd_panel_ud" }, | 174 | .ud_gpio = OMAP3EVM_LCD_PANEL_UD, |
170 | { OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, "lcd_panel_envdd" }, | ||
171 | }; | 175 | }; |
172 | 176 | ||
173 | static int lcd_enabled; | ||
174 | static int dvi_enabled; | ||
175 | |||
176 | static void __init omap3_evm_display_init(void) | 177 | static void __init omap3_evm_display_init(void) |
177 | { | 178 | { |
178 | int r; | 179 | int r; |
179 | 180 | ||
180 | r = gpio_request_array(omap3_evm_dss_gpios, | 181 | r = gpio_request_one(OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, |
181 | ARRAY_SIZE(omap3_evm_dss_gpios)); | 182 | "lcd_panel_envdd"); |
182 | if (r) | 183 | if (r) |
183 | printk(KERN_ERR "failed to get lcd_panel_* gpios\n"); | 184 | pr_err("failed to get lcd_panel_envdd GPIO\n"); |
184 | } | ||
185 | 185 | ||
186 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | 186 | r = gpio_request_one(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, |
187 | { | 187 | GPIOF_OUT_INIT_LOW, "lcd_panel_bklight"); |
188 | if (dvi_enabled) { | 188 | if (r) |
189 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | 189 | pr_err("failed to get lcd_panel_bklight GPIO\n"); |
190 | return -EINVAL; | ||
191 | } | ||
192 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
193 | 190 | ||
194 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 191 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
195 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 192 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
196 | else | 193 | else |
197 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 194 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
198 | |||
199 | lcd_enabled = 1; | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | ||
204 | { | ||
205 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | ||
206 | |||
207 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
208 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
209 | else | ||
210 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
211 | |||
212 | lcd_enabled = 0; | ||
213 | } | 195 | } |
214 | 196 | ||
215 | static struct omap_dss_device omap3_evm_lcd_device = { | 197 | static struct omap_dss_device omap3_evm_lcd_device = { |
@@ -217,8 +199,7 @@ static struct omap_dss_device omap3_evm_lcd_device = { | |||
217 | .driver_name = "sharp_ls_panel", | 199 | .driver_name = "sharp_ls_panel", |
218 | .type = OMAP_DISPLAY_TYPE_DPI, | 200 | .type = OMAP_DISPLAY_TYPE_DPI, |
219 | .phy.dpi.data_lines = 18, | 201 | .phy.dpi.data_lines = 18, |
220 | .platform_enable = omap3_evm_enable_lcd, | 202 | .data = &omap3_evm_lcd_data, |
221 | .platform_disable = omap3_evm_disable_lcd, | ||
222 | }; | 203 | }; |
223 | 204 | ||
224 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) | 205 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) |