Lines Matching refs:ddata

153 	struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);  in tpo_td043_set_hmirror()  local
155 ddata->hmirror = enable; in tpo_td043_set_hmirror()
156 return tpo_td043_write_mirror(ddata->spi, ddata->hmirror, in tpo_td043_set_hmirror()
157 ddata->vmirror); in tpo_td043_set_hmirror()
162 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev); in tpo_td043_get_hmirror() local
164 return ddata->hmirror; in tpo_td043_get_hmirror()
170 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_vmirror_show() local
172 return sysfs_emit(buf, "%d\n", ddata->vmirror); in tpo_td043_vmirror_show()
178 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_vmirror_store() local
188 ret = tpo_td043_write_mirror(ddata->spi, ddata->hmirror, val); in tpo_td043_vmirror_store()
192 ddata->vmirror = val; in tpo_td043_vmirror_store()
200 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_mode_show() local
202 return sysfs_emit(buf, "%d\n", ddata->mode); in tpo_td043_mode_show()
208 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_mode_store() local
216 ddata->mode = val; in tpo_td043_mode_store()
219 tpo_td043_write(ddata->spi, 2, val); in tpo_td043_mode_store()
227 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_gamma_show() local
232 for (i = 0; i < ARRAY_SIZE(ddata->gamma); i++) { in tpo_td043_gamma_show()
234 ddata->gamma[i]); in tpo_td043_gamma_show()
247 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_gamma_store() local
260 ddata->gamma[i] = g[i]; in tpo_td043_gamma_store()
262 tpo_td043_write_gamma(ddata->spi, ddata->gamma); in tpo_td043_gamma_store()
285 static int tpo_td043_power_on(struct panel_drv_data *ddata) in tpo_td043_power_on() argument
289 if (ddata->powered_on) in tpo_td043_power_on()
292 r = regulator_enable(ddata->vcc_reg); in tpo_td043_power_on()
299 if (gpio_is_valid(ddata->nreset_gpio)) in tpo_td043_power_on()
300 gpio_set_value(ddata->nreset_gpio, 1); in tpo_td043_power_on()
302 tpo_td043_write(ddata->spi, 2, in tpo_td043_power_on()
303 TPO_R02_MODE(ddata->mode) | TPO_R02_NCLK_RISING); in tpo_td043_power_on()
304 tpo_td043_write(ddata->spi, 3, TPO_R03_VAL_NORMAL); in tpo_td043_power_on()
305 tpo_td043_write(ddata->spi, 0x20, 0xf0); in tpo_td043_power_on()
306 tpo_td043_write(ddata->spi, 0x21, 0xf0); in tpo_td043_power_on()
307 tpo_td043_write_mirror(ddata->spi, ddata->hmirror, in tpo_td043_power_on()
308 ddata->vmirror); in tpo_td043_power_on()
309 tpo_td043_write_gamma(ddata->spi, ddata->gamma); in tpo_td043_power_on()
311 ddata->powered_on = 1; in tpo_td043_power_on()
315 static void tpo_td043_power_off(struct panel_drv_data *ddata) in tpo_td043_power_off() argument
317 if (!ddata->powered_on) in tpo_td043_power_off()
320 tpo_td043_write(ddata->spi, 3, in tpo_td043_power_off()
323 if (gpio_is_valid(ddata->nreset_gpio)) in tpo_td043_power_off()
324 gpio_set_value(ddata->nreset_gpio, 0); in tpo_td043_power_off()
329 tpo_td043_write(ddata->spi, 3, TPO_R03_VAL_STANDBY); in tpo_td043_power_off()
331 regulator_disable(ddata->vcc_reg); in tpo_td043_power_off()
333 ddata->powered_on = 0; in tpo_td043_power_off()
338 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_connect() local
339 struct omap_dss_device *in = ddata->in; in tpo_td043_connect()
349 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_disconnect() local
350 struct omap_dss_device *in = ddata->in; in tpo_td043_disconnect()
360 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_enable() local
361 struct omap_dss_device *in = ddata->in; in tpo_td043_enable()
370 if (ddata->data_lines) in tpo_td043_enable()
371 in->ops.dpi->set_data_lines(in, ddata->data_lines); in tpo_td043_enable()
372 in->ops.dpi->set_timings(in, &ddata->videomode); in tpo_td043_enable()
382 if (!ddata->spi_suspended) { in tpo_td043_enable()
383 r = tpo_td043_power_on(ddata); in tpo_td043_enable()
397 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_disable() local
398 struct omap_dss_device *in = ddata->in; in tpo_td043_disable()
405 if (!ddata->spi_suspended) in tpo_td043_disable()
406 tpo_td043_power_off(ddata); in tpo_td043_disable()
414 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_set_timings() local
415 struct omap_dss_device *in = ddata->in; in tpo_td043_set_timings()
417 ddata->videomode = *timings; in tpo_td043_set_timings()
426 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_get_timings() local
428 *timings = ddata->videomode; in tpo_td043_get_timings()
434 struct panel_drv_data *ddata = to_panel_data(dssdev); in tpo_td043_check_timings() local
435 struct omap_dss_device *in = ddata->in; in tpo_td043_check_timings()
461 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); in tpo_td043_probe_of() local
470 ddata->nreset_gpio = gpio; in tpo_td043_probe_of()
478 ddata->in = in; in tpo_td043_probe_of()
485 struct panel_drv_data *ddata; in tpo_td043_probe() local
503 ddata = devm_kzalloc(&spi->dev, sizeof(*ddata), GFP_KERNEL); in tpo_td043_probe()
504 if (ddata == NULL) in tpo_td043_probe()
507 dev_set_drvdata(&spi->dev, ddata); in tpo_td043_probe()
509 ddata->spi = spi; in tpo_td043_probe()
515 ddata->mode = TPO_R02_MODE_800x480; in tpo_td043_probe()
516 memcpy(ddata->gamma, tpo_td043_def_gamma, sizeof(ddata->gamma)); in tpo_td043_probe()
518 ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc"); in tpo_td043_probe()
519 if (IS_ERR(ddata->vcc_reg)) { in tpo_td043_probe()
524 if (gpio_is_valid(ddata->nreset_gpio)) { in tpo_td043_probe()
526 ddata->nreset_gpio, GPIOF_OUT_INIT_LOW, in tpo_td043_probe()
540 ddata->videomode = tpo_td043_timings; in tpo_td043_probe()
542 dssdev = &ddata->dssdev; in tpo_td043_probe()
547 dssdev->panel.timings = ddata->videomode; in tpo_td043_probe()
562 omap_dss_put_device(ddata->in); in tpo_td043_probe()
568 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); in tpo_td043_remove() local
569 struct omap_dss_device *dssdev = &ddata->dssdev; in tpo_td043_remove()
570 struct omap_dss_device *in = ddata->in; in tpo_td043_remove()
572 dev_dbg(&ddata->spi->dev, "%s\n", __func__); in tpo_td043_remove()
587 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_spi_suspend() local
589 dev_dbg(dev, "tpo_td043_spi_suspend, tpo %p\n", ddata); in tpo_td043_spi_suspend()
591 ddata->power_on_resume = ddata->powered_on; in tpo_td043_spi_suspend()
592 tpo_td043_power_off(ddata); in tpo_td043_spi_suspend()
593 ddata->spi_suspended = 1; in tpo_td043_spi_suspend()
600 struct panel_drv_data *ddata = dev_get_drvdata(dev); in tpo_td043_spi_resume() local
605 if (ddata->power_on_resume) { in tpo_td043_spi_resume()
606 ret = tpo_td043_power_on(ddata); in tpo_td043_spi_resume()
610 ddata->spi_suspended = 0; in tpo_td043_spi_resume()