diff options
Diffstat (limited to 'drivers/video/backlight/tosa_lcd.c')
-rw-r--r-- | drivers/video/backlight/tosa_lcd.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 86fff88c2e4a..96bae941585a 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c | |||
@@ -63,7 +63,7 @@ static int tosa_tg_send(struct spi_device *spi, int adrs, uint8_t data) | |||
63 | int tosa_bl_enable(struct spi_device *spi, int enable) | 63 | int tosa_bl_enable(struct spi_device *spi, int enable) |
64 | { | 64 | { |
65 | /* bl_enable GP04=1 otherwise GP04=0*/ | 65 | /* bl_enable GP04=1 otherwise GP04=0*/ |
66 | return tosa_tg_send(spi, TG_GPODR2, enable? 0x01 : 0x00); | 66 | return tosa_tg_send(spi, TG_GPODR2, enable ? 0x01 : 0x00); |
67 | } | 67 | } |
68 | EXPORT_SYMBOL(tosa_bl_enable); | 68 | EXPORT_SYMBOL(tosa_bl_enable); |
69 | 69 | ||
@@ -91,15 +91,17 @@ static void tosa_lcd_tg_on(struct tosa_lcd_data *data) | |||
91 | tosa_tg_send(spi, TG_PNLCTL, value); | 91 | tosa_tg_send(spi, TG_PNLCTL, value); |
92 | 92 | ||
93 | /* TG LCD pannel power up */ | 93 | /* TG LCD pannel power up */ |
94 | tosa_tg_send(spi, TG_PINICTL,0x4); | 94 | tosa_tg_send(spi, TG_PINICTL, 0x4); |
95 | mdelay(50); | 95 | mdelay(50); |
96 | 96 | ||
97 | /* TG LCD GVSS */ | 97 | /* TG LCD GVSS */ |
98 | tosa_tg_send(spi, TG_PINICTL,0x0); | 98 | tosa_tg_send(spi, TG_PINICTL, 0x0); |
99 | 99 | ||
100 | if (!data->i2c) { | 100 | if (!data->i2c) { |
101 | /* after the pannel is powered up the first time, we can access the i2c bus */ | 101 | /* |
102 | /* so probe for the DAC */ | 102 | * after the pannel is powered up the first time, |
103 | * we can access the i2c bus so probe for the DAC | ||
104 | */ | ||
103 | struct i2c_adapter *adap = i2c_get_adapter(0); | 105 | struct i2c_adapter *adap = i2c_get_adapter(0); |
104 | struct i2c_board_info info = { | 106 | struct i2c_board_info info = { |
105 | .type = "tosa-bl", | 107 | .type = "tosa-bl", |
@@ -115,11 +117,11 @@ static void tosa_lcd_tg_off(struct tosa_lcd_data *data) | |||
115 | struct spi_device *spi = data->spi; | 117 | struct spi_device *spi = data->spi; |
116 | 118 | ||
117 | /* TG LCD VHSA off */ | 119 | /* TG LCD VHSA off */ |
118 | tosa_tg_send(spi, TG_PINICTL,0x4); | 120 | tosa_tg_send(spi, TG_PINICTL, 0x4); |
119 | mdelay(50); | 121 | mdelay(50); |
120 | 122 | ||
121 | /* TG LCD signal off */ | 123 | /* TG LCD signal off */ |
122 | tosa_tg_send(spi, TG_PINICTL,0x6); | 124 | tosa_tg_send(spi, TG_PINICTL, 0x6); |
123 | mdelay(50); | 125 | mdelay(50); |
124 | 126 | ||
125 | /* TG Off */ | 127 | /* TG Off */ |
@@ -193,17 +195,13 @@ static int tosa_lcd_probe(struct spi_device *spi) | |||
193 | data->spi = spi; | 195 | data->spi = spi; |
194 | dev_set_drvdata(&spi->dev, data); | 196 | dev_set_drvdata(&spi->dev, data); |
195 | 197 | ||
196 | ret = devm_gpio_request(&spi->dev, TOSA_GPIO_TG_ON, "tg #pwr"); | 198 | ret = devm_gpio_request_one(&spi->dev, TOSA_GPIO_TG_ON, |
199 | GPIOF_OUT_INIT_LOW, "tg #pwr"); | ||
197 | if (ret < 0) | 200 | if (ret < 0) |
198 | goto err_gpio_tg; | 201 | goto err_gpio_tg; |
199 | 202 | ||
200 | mdelay(60); | 203 | mdelay(60); |
201 | 204 | ||
202 | ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); | ||
203 | if (ret < 0) | ||
204 | goto err_gpio_tg; | ||
205 | |||
206 | mdelay(60); | ||
207 | tosa_lcd_tg_init(data); | 205 | tosa_lcd_tg_init(data); |
208 | 206 | ||
209 | tosa_lcd_tg_on(data); | 207 | tosa_lcd_tg_on(data); |