Lines Matching +full:2 +full:x32 +full:- +full:bit
1 // SPDX-License-Identifier: GPL-2.0+
33 #define ILI9486_MADCTL_BGR BIT(3)
34 #define ILI9486_MADCTL_MV BIT(5)
35 #define ILI9486_MADCTL_MX BIT(6)
36 #define ILI9486_MADCTL_MY BIT(7)
39 * The PiScreen/waveshare rpi-lcd-35 has a SPI to 16-bit parallel bus converter
40 * in front of the display controller. This means that 8-bit values have to be
41 * transferred as 16-bit.
46 struct spi_device *spi = mipi->spi; in waveshare_command()
55 return -ENOMEM; in waveshare_command()
58 * The displays are Raspberry Pi HATs and connected to the 8-bit only in waveshare_command()
59 * SPI controller, so 16-bit command and parameters need byte swapping in waveshare_command()
60 * before being transferred as 8-bit on the big endian SPI bus. in waveshare_command()
63 spi_bus_lock(spi->controller); in waveshare_command()
64 gpiod_set_value_cansleep(mipi->dc, 0); in waveshare_command()
65 speed_hz = mipi_dbi_spi_cmd_max_speed(spi, 2); in waveshare_command()
66 ret = mipi_dbi_spi_transfer(spi, speed_hz, 8, buf, 2); in waveshare_command()
67 spi_bus_unlock(spi->controller); in waveshare_command()
71 /* 8-bit configuration data, not 16-bit pixel data */ in waveshare_command()
75 num *= 2; in waveshare_command()
82 if (*cmd == MIPI_DCS_WRITE_MEMORY_START && !mipi->swap_bytes) in waveshare_command()
85 spi_bus_lock(spi->controller); in waveshare_command()
86 gpiod_set_value_cansleep(mipi->dc, 1); in waveshare_command()
89 spi_bus_unlock(spi->controller); in waveshare_command()
100 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); in waveshare_enable()
101 struct mipi_dbi *dbi = &dbidev->dbi; in waveshare_enable()
105 if (!drm_dev_enter(pipe->crtc.dev, &idx)) in waveshare_enable()
130 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, in waveshare_enable()
133 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, in waveshare_enable()
140 switch (dbidev->rotation) { in waveshare_enable()
185 { .compatible = "waveshare,rpi-lcd-35" },
193 { "rpi-lcd-35", 0 },
201 struct device *dev = &spi->dev; in ili9486_probe()
214 dbi = &dbidev->dbi; in ili9486_probe()
215 drm = &dbidev->drm; in ili9486_probe()
217 dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in ili9486_probe()
218 if (IS_ERR(dbi->reset)) in ili9486_probe()
219 return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n"); in ili9486_probe()
225 dbidev->backlight = devm_of_find_backlight(dev); in ili9486_probe()
226 if (IS_ERR(dbidev->backlight)) in ili9486_probe()
227 return PTR_ERR(dbidev->backlight); in ili9486_probe()
235 dbi->command = waveshare_command; in ili9486_probe()
236 dbi->read_commands = NULL; in ili9486_probe()