summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2008-01-25 21:09:05 -0600
committerDaniel Schaeffer <daniel.schaeffer@timesys.com>2008-08-25 15:20:38 -0400
commita997dcc576fd45bebc1bbbcbac27d79a28387fef (patch)
tree4f88a74a303aa4ad137ef3f0d41ef1e3f9c572f2 /drivers
parent6f898ec5fa85a3de0721c3c68b292ebeb2398111 (diff)
ENGR00066550 Modify Epson VGA panel to use regulator api
This patch modifies the 3-stack Epson VGA panel driver to use the regulator API. Signed-off-by: Rob Herring <r.herring@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxc/mxcfb_epson_vga.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/video/mxc/mxcfb_epson_vga.c b/drivers/video/mxc/mxcfb_epson_vga.c
index 276e861d984a..b2338eecb2d8 100644
--- a/drivers/video/mxc/mxcfb_epson_vga.c
+++ b/drivers/video/mxc/mxcfb_epson_vga.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2007-2008 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -33,9 +33,9 @@
#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/init.h>
+#include <linux/regulator/regulator.h>
#include <linux/spi/spi.h>
#include <asm/arch/mxcfb.h>
-#include <asm/arch/pmic_power.h>
static struct spi_device *lcd_spi;
@@ -44,6 +44,8 @@ static void lcd_poweron(void);
static void lcd_poweroff(void);
static void (*lcd_reset) (void);
+static struct regulator *io_reg;
+static struct regulator *core_reg;
static struct fb_videomode video_modes[] = {
{
@@ -114,26 +116,21 @@ static struct notifier_block nb = {
static int __devinit lcd_spi_probe(struct spi_device *spi)
{
int i;
- t_regulator_voltage voltage;
- t_regulator_lp_mode lpmode = LOW_POWER_CTRL_BY_PIN;
+ struct mxc_lcd_platform_data *plat = spi->dev.platform_data;
lcd_spi = spi;
- /* open the VGEN of pmic to supply VDDI */
- voltage.vgen = VGEN_1_8V;
- pmic_power_regulator_set_voltage(REGU_VGEN, voltage);
- pmic_power_regulator_set_lp_mode(REGU_VGEN, lpmode);
- pmic_power_regulator_on(REGU_VGEN);
-
- /* open the VMMC1 of pmic to supply VDDI */
- voltage.vmmc1 = VMMC_2_8V;
- pmic_power_regulator_set_voltage(REGU_VMMC1, voltage);
- pmic_power_regulator_set_lp_mode(REGU_VMMC1, lpmode);
- pmic_power_regulator_on(REGU_VMMC1);
-
- if (spi->dev.platform_data) {
- lcd_reset = (void (*)(void))spi->dev.platform_data;
- lcd_reset();
+ if (plat) {
+ lcd_reset = plat->reset;
+ if (lcd_reset)
+ lcd_reset();
+
+ io_reg = regulator_get(&spi->dev, plat->io_reg);
+ regulator_set_voltage(io_reg, 1800000);
+ regulator_enable(io_reg);
+ core_reg = regulator_get(&spi->dev, plat->core_reg);
+ regulator_set_voltage(core_reg, 2800000);
+ regulator_enable(core_reg);
}
spi->bits_per_word = 9;
@@ -158,6 +155,9 @@ static int __devexit lcd_spi_remove(struct spi_device *spi)
{
fb_unregister_client(&nb);
lcd_poweroff();
+ regulator_put(io_reg, &spi->dev);
+ regulator_put(core_reg, &spi->dev);
+
return 0;
}