Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272200
b: refs/heads/master
c: 0556dc3
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Linus Torvalds committed Nov 1, 2011
1 parent 1511395 commit fc2429a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2967b0ad3302d8627c0d99bfed4b8f167e21fdee
refs/heads/master: 0556dc340e5159cdff925a5ab7f3a72f49745661
6 changes: 2 additions & 4 deletions trunk/arch/arm/mach-imx/mach-mx27_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static struct regulator_init_data gpo_init = {
};

static struct regulator_consumer_supply vmmc1_consumers[] = {
REGULATOR_SUPPLY("lcd_2v8", NULL),
REGULATOR_SUPPLY("vcore", "spi0.0"),
};

static struct regulator_init_data vmmc1_init = {
Expand All @@ -257,7 +257,7 @@ static struct regulator_init_data vmmc1_init = {
};

static struct regulator_consumer_supply vgen_consumers[] = {
REGULATOR_SUPPLY("vdd_lcdio", NULL),
REGULATOR_SUPPLY("vdd", "spi0.0"),
};

static struct regulator_init_data vgen_init = {
Expand Down Expand Up @@ -348,8 +348,6 @@ static const struct imx_fb_platform_data mx27_3ds_fb_data __initconst = {
static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = {
.reset_gpio = LCD_RESET,
.data_enable_gpio = LCD_ENABLE,
.core_supply = "lcd_2v8",
.io_supply = "vdd_lcdio",
};

static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/arm/mach-imx/mach-mx31_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ static struct mx3fb_platform_data mx3fb_pdata __initdata = {
static struct l4f00242t03_pdata mx31_3ds_l4f00242t03_pdata = {
.reset_gpio = IOMUX_TO_GPIO(MX31_PIN_LCS1),
.data_enable_gpio = IOMUX_TO_GPIO(MX31_PIN_SER_RS),
.core_supply = "lcd_2v8",
.io_supply = "vdd_lcdio",
};

/*
Expand Down Expand Up @@ -411,7 +409,7 @@ static struct regulator_init_data vmmc2_init = {
};

static struct regulator_consumer_supply vmmc1_consumers[] = {
REGULATOR_SUPPLY("lcd_2v8", NULL),
REGULATOR_SUPPLY("vcore", "spi0.0"),
REGULATOR_SUPPLY("cmos_2v8", "soc-camera-pdrv.0"),
};

Expand All @@ -428,7 +426,7 @@ static struct regulator_init_data vmmc1_init = {
};

static struct regulator_consumer_supply vgen_consumers[] = {
REGULATOR_SUPPLY("vdd_lcdio", NULL),
REGULATOR_SUPPLY("vdd", "spi0.0"),
};

static struct regulator_init_data vgen_init = {
Expand Down
57 changes: 20 additions & 37 deletions trunk/drivers/video/backlight/l4f00242t03.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,11 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)

dev_dbg(&spi->dev, "initializing LCD\n");

if (priv->io_reg) {
regulator_set_voltage(priv->io_reg, 1800000, 1800000);
regulator_enable(priv->io_reg);
}
regulator_set_voltage(priv->io_reg, 1800000, 1800000);
regulator_enable(priv->io_reg);

if (priv->core_reg) {
regulator_set_voltage(priv->core_reg, 2800000, 2800000);
regulator_enable(priv->core_reg);
}
regulator_set_voltage(priv->core_reg, 2800000, 2800000);
regulator_enable(priv->core_reg);

l4f00242t03_reset(pdata->reset_gpio);

Expand All @@ -78,11 +74,8 @@ static void l4f00242t03_lcd_powerdown(struct spi_device *spi)

gpio_set_value(pdata->data_enable_gpio, 0);

if (priv->io_reg)
regulator_disable(priv->io_reg);

if (priv->core_reg)
regulator_disable(priv->core_reg);
regulator_disable(priv->io_reg);
regulator_disable(priv->core_reg);
}

static int l4f00242t03_lcd_power_get(struct lcd_device *ld)
Expand Down Expand Up @@ -201,24 +194,18 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
if (ret)
goto err3;

if (pdata->io_supply) {
priv->io_reg = regulator_get(NULL, pdata->io_supply);

if (IS_ERR(priv->io_reg)) {
pr_err("%s: Unable to get the IO regulator\n",
__func__);
goto err3;
}
priv->io_reg = regulator_get(&spi->dev, "vdd");
if (IS_ERR(priv->io_reg)) {
dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",
__func__);
goto err3;
}

if (pdata->core_supply) {
priv->core_reg = regulator_get(NULL, pdata->core_supply);

if (IS_ERR(priv->core_reg)) {
pr_err("%s: Unable to get the core regulator\n",
__func__);
goto err4;
}
priv->core_reg = regulator_get(&spi->dev, "vcore");
if (IS_ERR(priv->core_reg)) {
dev_err(&spi->dev, "%s: Unable to get the core regulator\n",
__func__);
goto err4;
}

priv->ld = lcd_device_register("l4f00242t03",
Expand All @@ -238,11 +225,9 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
return 0;

err5:
if (priv->core_reg)
regulator_put(priv->core_reg);
regulator_put(priv->core_reg);
err4:
if (priv->io_reg)
regulator_put(priv->io_reg);
regulator_put(priv->io_reg);
err3:
gpio_free(pdata->data_enable_gpio);
err2:
Expand All @@ -266,10 +251,8 @@ static int __devexit l4f00242t03_remove(struct spi_device *spi)
gpio_free(pdata->data_enable_gpio);
gpio_free(pdata->reset_gpio);

if (priv->io_reg)
regulator_put(priv->io_reg);
if (priv->core_reg)
regulator_put(priv->core_reg);
regulator_put(priv->io_reg);
regulator_put(priv->core_reg);

kfree(priv);

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/spi/l4f00242t03.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
struct l4f00242t03_pdata {
unsigned int reset_gpio;
unsigned int data_enable_gpio;
const char *io_supply; /* will be set to 1.8 V */
const char *core_supply; /* will be set to 2.8 V */
};

#endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */

0 comments on commit fc2429a

Please sign in to comment.