Lines Matching +full:break +full:- +full:control

1 // SPDX-License-Identifier: GPL-2.0-only
3 * tdo24m - SPI-based drivers for Toppoly TDO24M series LCD panels
45 #define CMD_NULL (-1)
57 CMD2(0xB8, 0xFF, 0xF9), /* Output Control */
65 CMD2(0xB8, 0x80, 0x02), /* Output Control */
90 CMD1(0xcf, 0x02), /* Blanking period control (1) */
91 CMD2(0xd0, 0x08, 0x04), /* Blanking period control (2) */
92 CMD1(0xd1, 0x01), /* CKV timing control on/off */
93 CMD2(0xd2, 0x14, 0x00), /* CKV 1,2 timing control */
94 CMD2(0xd3, 0x1a, 0x0f), /* OEV timing control */
95 CMD2(0xd4, 0x1f, 0xaf), /* ASW timing control (1) */
96 CMD1(0xd5, 0x14), /* ASW timing control (2) */
103 CMD1(0xd6, 0x02), /* Blanking period control (1) */
104 CMD2(0xd7, 0x08, 0x04), /* Blanking period control (2) */
105 CMD1(0xd8, 0x01), /* CKV timing control on/off */
106 CMD2(0xd9, 0x00, 0x08), /* CKV 1,2 timing control */
107 CMD2(0xde, 0x05, 0x0a), /* OEV timing control */
108 CMD2(0xdf, 0x0a, 0x19), /* ASW timing control (1) */
109 CMD1(0xe0, 0x0a), /* ASW timing control (2) */
132 CMD1(0xcf, 0x02), /* Blanking period control (1) */
133 CMD2(0xd0, 0x08, 0x04), /* Blanking period control (2) */
134 CMD1(0xd1, 0x01), /* CKV timing control on/off */
135 CMD2(0xd2, 0x00, 0x1e), /* CKV 1,2 timing control */
136 CMD2(0xd3, 0x14, 0x28), /* OEV timing control */
137 CMD2(0xd4, 0x28, 0x64), /* ASW timing control (1) */
138 CMD1(0xd5, 0x28), /* ASW timing control (2) */
145 CMD2(0xb8, 0xff, 0xf9), /* Output control */
149 CMD1(0x3a, 0x60), /* Display mode 18-bit RGB */
150 CMD1(0xbf, 0x10), /* Drive system change control */
177 struct spi_transfer *x = &lcd->xfer; in tdo24m_writes()
183 if (!lcd->color_invert && *p == CMD0(0x21)) in tdo24m_writes()
188 data = *p << (7 - nparams); in tdo24m_writes()
191 lcd->buf[0] = (data >> 8) & 0xff; in tdo24m_writes()
192 lcd->buf[1] = data & 0xff; in tdo24m_writes()
193 break; in tdo24m_writes()
195 lcd->buf[0] = (data >> 16) & 0xff; in tdo24m_writes()
196 lcd->buf[1] = (data >> 8) & 0xff; in tdo24m_writes()
197 lcd->buf[2] = data & 0xff; in tdo24m_writes()
198 break; in tdo24m_writes()
200 lcd->buf[0] = (data >> 24) & 0xff; in tdo24m_writes()
201 lcd->buf[1] = (data >> 16) & 0xff; in tdo24m_writes()
202 lcd->buf[2] = (data >> 8) & 0xff; in tdo24m_writes()
203 lcd->buf[3] = data & 0xff; in tdo24m_writes()
204 break; in tdo24m_writes()
208 x->len = nparams + 2; in tdo24m_writes()
209 err = spi_sync(lcd->spi_dev, &lcd->msg); in tdo24m_writes()
211 break; in tdo24m_writes()
224 break; in tdo24m_adj_mode()
229 break; in tdo24m_adj_mode()
231 return -EINVAL; in tdo24m_adj_mode()
234 lcd->mode = mode; in tdo24m_adj_mode()
245 break; in tdo35s_adj_mode()
250 break; in tdo35s_adj_mode()
252 return -EINVAL; in tdo35s_adj_mode()
255 lcd->mode = mode; in tdo35s_adj_mode()
271 err = lcd->adj_mode(lcd, lcd->mode); in tdo24m_power_on()
285 if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->power)) in tdo24m_power()
287 else if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->power)) in tdo24m_power()
291 lcd->power = power; in tdo24m_power()
308 return lcd->power; in tdo24m_get_power()
316 if (m->xres == 640 || m->xres == 480) in tdo24m_set_mode()
319 if (lcd->mode == mode) in tdo24m_set_mode()
322 return lcd->adj_mode(lcd, mode); in tdo24m_set_mode()
340 pdata = dev_get_platdata(&spi->dev); in tdo24m_probe()
342 model = pdata->model; in tdo24m_probe()
346 spi->bits_per_word = 8; in tdo24m_probe()
347 spi->mode = SPI_MODE_3; in tdo24m_probe()
352 lcd = devm_kzalloc(&spi->dev, sizeof(struct tdo24m), GFP_KERNEL); in tdo24m_probe()
354 return -ENOMEM; in tdo24m_probe()
356 lcd->spi_dev = spi; in tdo24m_probe()
357 lcd->power = FB_BLANK_POWERDOWN; in tdo24m_probe()
358 lcd->mode = MODE_VGA; /* default to VGA */ in tdo24m_probe()
360 lcd->buf = devm_kzalloc(&spi->dev, TDO24M_SPI_BUFF_SIZE, GFP_KERNEL); in tdo24m_probe()
361 if (lcd->buf == NULL) in tdo24m_probe()
362 return -ENOMEM; in tdo24m_probe()
364 m = &lcd->msg; in tdo24m_probe()
365 x = &lcd->xfer; in tdo24m_probe()
369 x->cs_change = 0; in tdo24m_probe()
370 x->tx_buf = &lcd->buf[0]; in tdo24m_probe()
375 lcd->color_invert = 1; in tdo24m_probe()
376 lcd->adj_mode = tdo24m_adj_mode; in tdo24m_probe()
377 break; in tdo24m_probe()
379 lcd->adj_mode = tdo35s_adj_mode; in tdo24m_probe()
380 lcd->color_invert = 0; in tdo24m_probe()
381 break; in tdo24m_probe()
383 dev_err(&spi->dev, "Unsupported model"); in tdo24m_probe()
384 return -EINVAL; in tdo24m_probe()
387 lcd->lcd_dev = devm_lcd_device_register(&spi->dev, "tdo24m", &spi->dev, in tdo24m_probe()
389 if (IS_ERR(lcd->lcd_dev)) in tdo24m_probe()
390 return PTR_ERR(lcd->lcd_dev); in tdo24m_probe()