Lines Matching +full:2 +full:x32 +full:- +full:bit

1 // SPDX-License-Identifier: GPL-2.0+
32 #define ILI9486_MADCTL_BGR BIT(3)
33 #define ILI9486_MADCTL_MV BIT(5)
34 #define ILI9486_MADCTL_MX BIT(6)
35 #define ILI9486_MADCTL_MY BIT(7)
38 * The PiScreen/waveshare rpi-lcd-35 has a SPI to 16-bit parallel bus converter
39 * in front of the display controller. This means that 8-bit values have to be
40 * transferred as 16-bit.
45 struct spi_device *spi = mipi->spi; in waveshare_command()
54 return -ENOMEM; in waveshare_command()
57 * The displays are Raspberry Pi HATs and connected to the 8-bit only in waveshare_command()
58 * SPI controller, so 16-bit command and parameters need byte swapping in waveshare_command()
59 * before being transferred as 8-bit on the big endian SPI bus. in waveshare_command()
62 spi_bus_lock(spi->controller); in waveshare_command()
63 gpiod_set_value_cansleep(mipi->dc, 0); in waveshare_command()
64 speed_hz = mipi_dbi_spi_cmd_max_speed(spi, 2); in waveshare_command()
65 ret = mipi_dbi_spi_transfer(spi, speed_hz, 8, buf, 2); in waveshare_command()
66 spi_bus_unlock(spi->controller); in waveshare_command()
70 /* 8-bit configuration data, not 16-bit pixel data */ in waveshare_command()
74 num *= 2; in waveshare_command()
81 if (*cmd == MIPI_DCS_WRITE_MEMORY_START && !mipi->swap_bytes) in waveshare_command()
84 spi_bus_lock(spi->controller); in waveshare_command()
85 gpiod_set_value_cansleep(mipi->dc, 1); in waveshare_command()
88 spi_bus_unlock(spi->controller); in waveshare_command()
99 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); in waveshare_enable()
100 struct mipi_dbi *dbi = &dbidev->dbi; in waveshare_enable()
104 if (!drm_dev_enter(pipe->crtc.dev, &idx)) in waveshare_enable()
129 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, in waveshare_enable()
132 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, in waveshare_enable()
139 switch (dbidev->rotation) { in waveshare_enable()
184 { .compatible = "waveshare,rpi-lcd-35" },
192 { "rpi-lcd-35", 0 },
200 struct device *dev = &spi->dev; in ili9486_probe()
213 dbi = &dbidev->dbi; in ili9486_probe()
214 drm = &dbidev->drm; in ili9486_probe()
216 dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in ili9486_probe()
217 if (IS_ERR(dbi->reset)) in ili9486_probe()
218 return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n"); in ili9486_probe()
224 dbidev->backlight = devm_of_find_backlight(dev); in ili9486_probe()
225 if (IS_ERR(dbidev->backlight)) in ili9486_probe()
226 return PTR_ERR(dbidev->backlight); in ili9486_probe()
234 dbi->command = waveshare_command; in ili9486_probe()
235 dbi->read_commands = NULL; in ili9486_probe()