Lines Matching full:ts

58 #define RPI_DSI_DRIVER_NAME "rpi-ts-dsi"
219 static int rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg) in rpi_touchscreen_i2c_read() argument
221 return i2c_smbus_read_byte_data(ts->i2c, reg); in rpi_touchscreen_i2c_read()
224 static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts, in rpi_touchscreen_i2c_write() argument
229 ret = i2c_smbus_write_byte_data(ts->i2c, reg, val); in rpi_touchscreen_i2c_write()
231 dev_err(&ts->i2c->dev, "I2C write failed: %d\n", ret); in rpi_touchscreen_i2c_write()
234 static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) in rpi_touchscreen_write() argument
245 mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); in rpi_touchscreen_write()
252 struct rpi_touchscreen *ts = panel_to_ts(panel); in rpi_touchscreen_disable() local
254 rpi_touchscreen_i2c_write(ts, REG_PWM, 0); in rpi_touchscreen_disable()
256 rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); in rpi_touchscreen_disable()
269 struct rpi_touchscreen *ts = panel_to_ts(panel); in rpi_touchscreen_prepare() local
272 rpi_touchscreen_i2c_write(ts, REG_POWERON, 1); in rpi_touchscreen_prepare()
275 if (rpi_touchscreen_i2c_read(ts, REG_PORTB) & 1) in rpi_touchscreen_prepare()
279 rpi_touchscreen_write(ts, DSI_LANEENABLE, in rpi_touchscreen_prepare()
282 rpi_touchscreen_write(ts, PPI_D0S_CLRSIPOCOUNT, 0x05); in rpi_touchscreen_prepare()
283 rpi_touchscreen_write(ts, PPI_D1S_CLRSIPOCOUNT, 0x05); in rpi_touchscreen_prepare()
284 rpi_touchscreen_write(ts, PPI_D0S_ATMR, 0x00); in rpi_touchscreen_prepare()
285 rpi_touchscreen_write(ts, PPI_D1S_ATMR, 0x00); in rpi_touchscreen_prepare()
286 rpi_touchscreen_write(ts, PPI_LPTXTIMECNT, 0x03); in rpi_touchscreen_prepare()
288 rpi_touchscreen_write(ts, SPICMR, 0x00); in rpi_touchscreen_prepare()
289 rpi_touchscreen_write(ts, LCDCTRL, 0x00100150); in rpi_touchscreen_prepare()
290 rpi_touchscreen_write(ts, SYSCTRL, 0x040f); in rpi_touchscreen_prepare()
293 rpi_touchscreen_write(ts, PPI_STARTPPI, 0x01); in rpi_touchscreen_prepare()
294 rpi_touchscreen_write(ts, DSI_STARTDSI, 0x01); in rpi_touchscreen_prepare()
302 struct rpi_touchscreen *ts = panel_to_ts(panel); in rpi_touchscreen_enable() local
305 rpi_touchscreen_i2c_write(ts, REG_PWM, 255); in rpi_touchscreen_enable()
312 rpi_touchscreen_i2c_write(ts, REG_PORTA, BIT(2)); in rpi_touchscreen_enable()
366 struct rpi_touchscreen *ts; in rpi_touchscreen_probe() local
376 ts = devm_drm_panel_alloc(dev, __typeof(*ts), base, in rpi_touchscreen_probe()
380 if (IS_ERR(ts)) in rpi_touchscreen_probe()
381 return PTR_ERR(ts); in rpi_touchscreen_probe()
383 i2c_set_clientdata(i2c, ts); in rpi_touchscreen_probe()
385 ts->i2c = i2c; in rpi_touchscreen_probe()
387 ver = rpi_touchscreen_i2c_read(ts, REG_ID); in rpi_touchscreen_probe()
403 rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); in rpi_touchscreen_probe()
427 ts->dsi = mipi_dsi_device_register_full(host, &info); in rpi_touchscreen_probe()
428 if (IS_ERR(ts->dsi)) { in rpi_touchscreen_probe()
430 PTR_ERR(ts->dsi)); in rpi_touchscreen_probe()
431 return PTR_ERR(ts->dsi); in rpi_touchscreen_probe()
437 drm_panel_add(&ts->base); in rpi_touchscreen_probe()
448 struct rpi_touchscreen *ts = i2c_get_clientdata(i2c); in rpi_touchscreen_remove() local
450 mipi_dsi_detach(ts->dsi); in rpi_touchscreen_remove()
452 drm_panel_remove(&ts->base); in rpi_touchscreen_remove()
454 mipi_dsi_device_unregister(ts->dsi); in rpi_touchscreen_remove()