aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c55
-rw-r--r--arch/arm/mach-omap2/display.c2
2 files changed, 51 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 9821b824dcaf..a7a4a9c67615 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -21,6 +21,10 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24
25#include <linux/regulator/fixed.h>
26#include <linux/regulator/machine.h>
27
24#include <asm/mach-types.h> 28#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
26#include <asm/mach/time.h> 30#include <asm/mach/time.h>
@@ -195,14 +199,58 @@ static const struct imxi2c_platform_data mx27ads_i2c1_data __initconst = {
195static struct i2c_board_info mx27ads_i2c_devices[] = { 199static struct i2c_board_info mx27ads_i2c_devices[] = {
196}; 200};
197 201
198void lcd_power(int on) 202static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value)
199{ 203{
200 if (on) 204 if (value)
201 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG); 205 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
202 else 206 else
203 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); 207 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
204} 208}
205 209
210static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value)
211{
212 return 0;
213}
214
215#define MX27ADS_LCD_GPIO (6 * 32)
216
217static struct regulator_consumer_supply mx27ads_lcd_regulator_consumer =
218 REGULATOR_SUPPLY("lcd", "imx-fb.0");
219
220static struct regulator_init_data mx27ads_lcd_regulator_init_data = {
221 .constraints = {
222 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
223},
224 .consumer_supplies = &mx27ads_lcd_regulator_consumer,
225 .num_consumer_supplies = 1,
226};
227
228static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
229 .supply_name = "LCD",
230 .microvolts = 3300000,
231 .gpio = MX27ADS_LCD_GPIO,
232 .init_data = &mx27ads_lcd_regulator_init_data,
233};
234
235static void __init mx27ads_regulator_init(void)
236{
237 struct gpio_chip *vchip;
238
239 vchip = kzalloc(sizeof(*vchip), GFP_KERNEL);
240 vchip->owner = THIS_MODULE;
241 vchip->label = "LCD";
242 vchip->base = MX27ADS_LCD_GPIO;
243 vchip->ngpio = 1;
244 vchip->direction_output = vgpio_dir_out;
245 vchip->set = vgpio_set;
246 gpiochip_add(vchip);
247
248 platform_device_register_data(&platform_bus, "reg-fixed-voltage",
249 PLATFORM_DEVID_AUTO,
250 &mx27ads_lcd_regulator_pdata,
251 sizeof(mx27ads_lcd_regulator_pdata));
252}
253
206static struct imx_fb_videomode mx27ads_modes[] = { 254static struct imx_fb_videomode mx27ads_modes[] = {
207 { 255 {
208 .mode = { 256 .mode = {
@@ -239,8 +287,6 @@ static const struct imx_fb_platform_data mx27ads_fb_data __initconst = {
239 .pwmr = 0x00A903FF, 287 .pwmr = 0x00A903FF,
240 .lscr1 = 0x00120300, 288 .lscr1 = 0x00120300,
241 .dmacr = 0x00020010, 289 .dmacr = 0x00020010,
242
243 .lcd_power = lcd_power,
244}; 290};
245 291
246static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, 292static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
@@ -304,6 +350,7 @@ static void __init mx27ads_board_init(void)
304 i2c_register_board_info(1, mx27ads_i2c_devices, 350 i2c_register_board_info(1, mx27ads_i2c_devices,
305 ARRAY_SIZE(mx27ads_i2c_devices)); 351 ARRAY_SIZE(mx27ads_i2c_devices));
306 imx27_add_imx_i2c(1, &mx27ads_i2c1_data); 352 imx27_add_imx_i2c(1, &mx27ads_i2c1_data);
353 mx27ads_regulator_init();
307 imx27_add_imx_fb(&mx27ads_fb_data); 354 imx27_add_imx_fb(&mx27ads_fb_data);
308 imx27_add_mxc_mmc(0, &sdhc1_pdata); 355 imx27_add_mxc_mmc(0, &sdhc1_pdata);
309 imx27_add_mxc_mmc(1, &sdhc2_pdata); 356 imx27_add_mxc_mmc(1, &sdhc2_pdata);
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index cf0cb35fa972..16d33d831287 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -304,7 +304,6 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
304 board_data->version = ver; 304 board_data->version = ver;
305 board_data->dsi_enable_pads = omap_dsi_enable_pads; 305 board_data->dsi_enable_pads = omap_dsi_enable_pads;
306 board_data->dsi_disable_pads = omap_dsi_disable_pads; 306 board_data->dsi_disable_pads = omap_dsi_disable_pads;
307 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
308 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; 307 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;
309 308
310 omap_display_device.dev.platform_data = board_data; 309 omap_display_device.dev.platform_data = board_data;
@@ -646,7 +645,6 @@ int __init omapdss_init_of(void)
646 static struct omap_dss_board_info board_data = { 645 static struct omap_dss_board_info board_data = {
647 .dsi_enable_pads = omap_dsi_enable_pads, 646 .dsi_enable_pads = omap_dsi_enable_pads,
648 .dsi_disable_pads = omap_dsi_disable_pads, 647 .dsi_disable_pads = omap_dsi_disable_pads,
649 .get_context_loss_count = omap_pm_get_dev_context_loss_count,
650 .set_min_bus_tput = omap_dss_set_min_bus_tput, 648 .set_min_bus_tput = omap_dss_set_min_bus_tput,
651 }; 649 };
652 650