aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-11-17 08:57:20 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 12:57:45 -0500
commit94760bf2523b4b5d3938e85ea0964ca7cd59a42b (patch)
tree93643ae945d3a3fc6e37325f268cda2fe3e7ddc4 /arch/arm/mach-clps711x
parente377ca1e32f66378cc6d0562851bfc51126865ea (diff)
ARM: clps711x: Moving backlight controls of framebuffer driver to the board
This patch moves the backlight controls for clps711x-framebuffer driver to the board code. To control we use "generic-bl" driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> [olof: fixed space/tab whitespace in drivers/video/clps711xfb.c] Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r--arch/arm/mach-clps711x/edb7211.c18
-rw-r--r--arch/arm/mach-clps711x/include/mach/hardware.h6
-rw-r--r--arch/arm/mach-clps711x/p720t.c21
3 files changed, 38 insertions, 7 deletions
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c
index 81cc6835d7a5..d5832b3557a1 100644
--- a/arch/arm/mach-clps711x/edb7211.c
+++ b/arch/arm/mach-clps711x/edb7211.c
@@ -13,6 +13,7 @@
13#include <linux/memblock.h> 13#include <linux/memblock.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/backlight.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17 18
18#include <asm/setup.h> 19#include <asm/setup.h>
@@ -30,6 +31,7 @@
30 31
31#define EDB7211_LCD_DC_DC_EN CLPS711X_GPIO(3, 1) 32#define EDB7211_LCD_DC_DC_EN CLPS711X_GPIO(3, 1)
32#define EDB7211_LCDEN CLPS711X_GPIO(3, 2) 33#define EDB7211_LCDEN CLPS711X_GPIO(3, 2)
34#define EDB7211_LCDBL CLPS711X_GPIO(3, 3)
33 35
34#define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) 36#define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300)
35#define EDB7211_CS8900_IRQ (IRQ_EINT3) 37#define EDB7211_CS8900_IRQ (IRQ_EINT3)
@@ -56,9 +58,22 @@ static struct plat_lcd_data edb7211_lcd_power_pdata = {
56 .set_power = edb7211_lcd_power_set, 58 .set_power = edb7211_lcd_power_set,
57}; 59};
58 60
61static void edb7211_lcd_backlight_set_intensity(int intensity)
62{
63 gpio_set_value(EDB7211_LCDBL, intensity);
64}
65
66static struct generic_bl_info edb7211_lcd_backlight_pdata = {
67 .name = "lcd-backlight.0",
68 .default_intensity = 0x01,
69 .max_intensity = 0x01,
70 .set_bl_intensity = edb7211_lcd_backlight_set_intensity,
71};
72
59static struct gpio edb7211_gpios[] __initconst = { 73static struct gpio edb7211_gpios[] __initconst = {
60 { EDB7211_LCD_DC_DC_EN, GPIOF_OUT_INIT_LOW, "LCD DC-DC" }, 74 { EDB7211_LCD_DC_DC_EN, GPIOF_OUT_INIT_LOW, "LCD DC-DC" },
61 { EDB7211_LCDEN, GPIOF_OUT_INIT_LOW, "LCD POWER" }, 75 { EDB7211_LCDEN, GPIOF_OUT_INIT_LOW, "LCD POWER" },
76 { EDB7211_LCDBL, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT" },
62}; 77};
63 78
64static struct map_desc edb7211_io_desc[] __initdata = { 79static struct map_desc edb7211_io_desc[] __initdata = {
@@ -117,6 +132,9 @@ static void __init edb7211_init(void)
117 platform_device_register_data(&platform_bus, "platform-lcd", 0, 132 platform_device_register_data(&platform_bus, "platform-lcd", 0,
118 &edb7211_lcd_power_pdata, 133 &edb7211_lcd_power_pdata,
119 sizeof(edb7211_lcd_power_pdata)); 134 sizeof(edb7211_lcd_power_pdata));
135 platform_device_register_data(&platform_bus, "generic-bl", 0,
136 &edb7211_lcd_backlight_pdata,
137 sizeof(edb7211_lcd_backlight_pdata));
120 platform_device_register_simple("video-clps711x", 0, NULL, 0); 138 platform_device_register_simple("video-clps711x", 0, NULL, 0);
121 platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, 139 platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
122 ARRAY_SIZE(edb7211_cs8900_resource)); 140 ARRAY_SIZE(edb7211_cs8900_resource));
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index 6acf714031e2..1ebf7b9e69fc 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -81,10 +81,4 @@
81 81
82#endif /* CONFIG_ARCH_EDB7211 */ 82#endif /* CONFIG_ARCH_EDB7211 */
83 83
84/*
85 * Relevant bits in port D, which controls power to the various parts of
86 * the LCD on the EDB7211.
87 */
88#define EDB_PD3_LCDBL (1<<3)
89
90#endif 84#endif
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index e25f10ed5606..1518fc83babd 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -25,6 +25,8 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/leds.h> 27#include <linux/leds.h>
28#include <linux/sizes.h>
29#include <linux/backlight.h>
28#include <linux/platform_device.h> 30#include <linux/platform_device.h>
29#include <linux/mtd/partitions.h> 31#include <linux/mtd/partitions.h>
30#include <linux/mtd/nand-gpio.h> 32#include <linux/mtd/nand-gpio.h>
@@ -33,7 +35,6 @@
33#include <asm/pgtable.h> 35#include <asm/pgtable.h>
34#include <asm/page.h> 36#include <asm/page.h>
35#include <asm/setup.h> 37#include <asm/setup.h>
36#include <asm/sizes.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 40#include <asm/mach/map.h>
@@ -103,6 +104,21 @@ static struct plat_lcd_data p720t_lcd_power_pdata = {
103 .set_power = p720t_lcd_power_set, 104 .set_power = p720t_lcd_power_set,
104}; 105};
105 106
107static void p720t_lcd_backlight_set_intensity(int intensity)
108{
109 if (intensity)
110 PLD_PWR |= PLD_S3_ON;
111 else
112 PLD_PWR = 0;
113}
114
115static struct generic_bl_info p720t_lcd_backlight_pdata = {
116 .name = "lcd-backlight.0",
117 .default_intensity = 0x01,
118 .max_intensity = 0x01,
119 .set_bl_intensity = p720t_lcd_backlight_set_intensity,
120};
121
106/* 122/*
107 * Map the P720T system PLD. It occupies two address spaces: 123 * Map the P720T system PLD. It occupies two address spaces:
108 * 0x10000000 and 0x10400000. We map both regions as one. 124 * 0x10000000 and 0x10400000. We map both regions as one.
@@ -187,6 +203,9 @@ static void __init p720t_init(void)
187 platform_device_register_data(&platform_bus, "platform-lcd", 0, 203 platform_device_register_data(&platform_bus, "platform-lcd", 0,
188 &p720t_lcd_power_pdata, 204 &p720t_lcd_power_pdata,
189 sizeof(p720t_lcd_power_pdata)); 205 sizeof(p720t_lcd_power_pdata));
206 platform_device_register_data(&platform_bus, "generic-bl", 0,
207 &p720t_lcd_backlight_pdata,
208 sizeof(p720t_lcd_backlight_pdata));
190 platform_device_register_simple("video-clps711x", 0, NULL, 0); 209 platform_device_register_simple("video-clps711x", 0, NULL, 0);
191} 210}
192 211