diff options
Diffstat (limited to 'drivers/video/backlight/tosa_lcd.c')
| -rw-r--r-- | drivers/video/backlight/tosa_lcd.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 33047a66cc24..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 */ |
| @@ -169,7 +171,7 @@ static struct lcd_ops tosa_lcd_ops = { | |||
| 169 | .set_mode = tosa_lcd_set_mode, | 171 | .set_mode = tosa_lcd_set_mode, |
| 170 | }; | 172 | }; |
| 171 | 173 | ||
| 172 | static int __devinit tosa_lcd_probe(struct spi_device *spi) | 174 | static int tosa_lcd_probe(struct spi_device *spi) |
| 173 | { | 175 | { |
| 174 | int ret; | 176 | int ret; |
| 175 | struct tosa_lcd_data *data; | 177 | struct tosa_lcd_data *data; |
| @@ -193,17 +195,13 @@ static int __devinit 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); |
| @@ -226,7 +224,7 @@ err_gpio_tg: | |||
| 226 | return ret; | 224 | return ret; |
| 227 | } | 225 | } |
| 228 | 226 | ||
| 229 | static int __devexit tosa_lcd_remove(struct spi_device *spi) | 227 | static int tosa_lcd_remove(struct spi_device *spi) |
| 230 | { | 228 | { |
| 231 | struct tosa_lcd_data *data = dev_get_drvdata(&spi->dev); | 229 | struct tosa_lcd_data *data = dev_get_drvdata(&spi->dev); |
| 232 | 230 | ||
| @@ -275,7 +273,7 @@ static struct spi_driver tosa_lcd_driver = { | |||
| 275 | .owner = THIS_MODULE, | 273 | .owner = THIS_MODULE, |
| 276 | }, | 274 | }, |
| 277 | .probe = tosa_lcd_probe, | 275 | .probe = tosa_lcd_probe, |
| 278 | .remove = __devexit_p(tosa_lcd_remove), | 276 | .remove = tosa_lcd_remove, |
| 279 | .suspend = tosa_lcd_suspend, | 277 | .suspend = tosa_lcd_suspend, |
| 280 | .resume = tosa_lcd_resume, | 278 | .resume = tosa_lcd_resume, |
| 281 | }; | 279 | }; |
