aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonghwa Lee <dh09.lee@samsung.com>2011-03-07 17:17:09 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-03-07 17:17:09 -0500
commitcc7df8727de87b1552278f153eaa1d244bcb7555 (patch)
tree0ce0c801b92d8d81af053c5b8c2688d7f3e19bd6
parentf5fb4a205cbfff4acd2f567bb8f7a38892ad0dc6 (diff)
ARM: EXYNOS4: enabled lcd and backlight in NURI board
This patch enables lcd and backlight drivers in NURI board. Signed-off-by: Donghwa Lee <dh09.lee@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-exynos4/Kconfig1
-rw-r--r--arch/arm/mach-exynos4/mach-nuri.c74
2 files changed, 75 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index d3893f6fdc4..ad55ce78b37 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -150,6 +150,7 @@ config MACH_NURI
150 select EXYNOS4_SETUP_I2C1 150 select EXYNOS4_SETUP_I2C1
151 select EXYNOS4_SETUP_I2C5 151 select EXYNOS4_SETUP_I2C5
152 select EXYNOS4_SETUP_SDHCI 152 select EXYNOS4_SETUP_SDHCI
153 select SAMSUNG_DEV_PWM
153 help 154 help
154 Machine support for Samsung Mobile NURI Board. 155 Machine support for Samsung Mobile NURI Board.
155 156
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
index 4767ed1e39f..b79ad010d19 100644
--- a/arch/arm/mach-exynos4/mach-nuri.c
+++ b/arch/arm/mach-exynos4/mach-nuri.c
@@ -17,6 +17,10 @@
17#include <linux/regulator/machine.h> 17#include <linux/regulator/machine.h>
18#include <linux/regulator/fixed.h> 18#include <linux/regulator/fixed.h>
19#include <linux/mmc/host.h> 19#include <linux/mmc/host.h>
20#include <linux/fb.h>
21#include <linux/pwm_backlight.h>
22
23#include <video/platform_lcd.h>
20 24
21#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
22#include <asm/mach-types.h> 26#include <asm/mach-types.h>
@@ -181,6 +185,73 @@ static struct platform_device nuri_gpio_keys = {
181 }, 185 },
182}; 186};
183 187
188static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power)
189{
190 int gpio = EXYNOS4_GPE1(5);
191
192 gpio_request(gpio, "LVDS_nSHDN");
193 gpio_direction_output(gpio, power);
194 gpio_free(gpio);
195}
196
197static int nuri_bl_init(struct device *dev)
198{
199 int ret, gpio = EXYNOS4_GPE2(3);
200
201 ret = gpio_request(gpio, "LCD_LDO_EN");
202 if (!ret)
203 gpio_direction_output(gpio, 0);
204
205 return ret;
206}
207
208static int nuri_bl_notify(struct device *dev, int brightness)
209{
210 if (brightness < 1)
211 brightness = 0;
212
213 gpio_set_value(EXYNOS4_GPE2(3), 1);
214
215 return brightness;
216}
217
218static void nuri_bl_exit(struct device *dev)
219{
220 gpio_free(EXYNOS4_GPE2(3));
221}
222
223/* nuri pwm backlight */
224static struct platform_pwm_backlight_data nuri_backlight_data = {
225 .pwm_id = 0,
226 .pwm_period_ns = 30000,
227 .max_brightness = 100,
228 .dft_brightness = 50,
229 .init = nuri_bl_init,
230 .notify = nuri_bl_notify,
231 .exit = nuri_bl_exit,
232};
233
234static struct platform_device nuri_backlight_device = {
235 .name = "pwm-backlight",
236 .id = -1,
237 .dev = {
238 .parent = &s3c_device_timer[0].dev,
239 .platform_data = &nuri_backlight_data,
240 },
241};
242
243static struct plat_lcd_data nuri_lcd_platform_data = {
244 .set_power = nuri_lcd_power_on,
245};
246
247static struct platform_device nuri_lcd_device = {
248 .name = "platform-lcd",
249 .id = -1,
250 .dev = {
251 .platform_data = &nuri_lcd_platform_data,
252 },
253};
254
184/* I2C1 */ 255/* I2C1 */
185static struct i2c_board_info i2c1_devs[] __initdata = { 256static struct i2c_board_info i2c1_devs[] __initdata = {
186 /* Gyro, To be updated */ 257 /* Gyro, To be updated */
@@ -198,9 +269,12 @@ static struct platform_device *nuri_devices[] __initdata = {
198 &s3c_device_hsmmc2, 269 &s3c_device_hsmmc2,
199 &s3c_device_hsmmc3, 270 &s3c_device_hsmmc3,
200 &s3c_device_wdt, 271 &s3c_device_wdt,
272 &s3c_device_timer[0],
201 273
202 /* NURI Devices */ 274 /* NURI Devices */
203 &nuri_gpio_keys, 275 &nuri_gpio_keys,
276 &nuri_lcd_device,
277 &nuri_backlight_device,
204}; 278};
205 279
206static void __init nuri_map_io(void) 280static void __init nuri_map_io(void)