mipi_dbi_spi_init(9)
π mipi_dbi_spi_init(9) β like, the MIPI DBI SPI interface init era
okay bestie, welcome to the Kernel API Manual β¨ this one's mipi_dbi_spi_init(9) and it's genuinely the setup baddie that gets your MIPI DBI SPI interface living. no cap.
πΈ SYNOPSIS πΈ
int mipi_dbi_spi_init (struct spi_device *spi , struct mipi_dbi *dbi ,
struct gpio_desc *dc );
π ARGUMENTS π
spiβ the SPI device, the whole reason we're here fr fr π¦dbiβ the MIPI DBI structure you're about to initialize, she's getting a glow-updcβ the D/C gpio, and it's optional bestie, no pressure π
β¨ DESCRIPTION β¨
so this function sets mipi_dbi->command, and it enables mipi_dbi->read_commands for all the usual read commands. iconic behaviour honestly. π«Ά
after you call this, you gotta follow up with a call to mipi_dbi_dev_init or a driver-specific init. don't just leave her hanging π
if dc is set, we assume a Type C Option 3 interface. if it's not set, we assume Type C Option 1. that's the vibe check right there β
now, the endianness part β and yes this matters, listen up π’
if the command is MIPI_DCS_WRITE_MEMORY_START and the pixel format is RGB565, endianness has to be taken into account. the MIPI DBI serial interface is big endian, and framebuffers are assumed stored in memory as little endian (DRM_FORMAT_BIG_ENDIAN is not supported, sorry babe π).
here's literally how endianness is handled:
- Option 1 (D/C as a bit) β the buffer is sent on the wire byte by byte, so the 16-bit buffer is byteswapped before transfer π₯
- Option 3 (D/C as a gpio) β if the SPI controller supports 16 bits per word, the buffer can be sent as-is. if it doesn't, then the caller is responsible for swapping the bytes before calling
mipi_dbi_command_buf, and the buffer is sent 8 bpw. yes, that's on you bestie π
this handling is optimised for DRM_FORMAT_RGB565 framebuffers, and honestly? she ate. π
one more thing π β if the interface is Option 1 and the SPI controller doesn't support 9 bits per word, the buffer is sent as 9x 8-bit words, padded with MIPI DCS no-op commands if necessary. little padded queen π
π RETURN π
Zero on success, negative error code on failure. simple as that, periodt. β¨
π¦ SEE ALSO π¦
- Kernel file
./drivers/gpu/drm/drm_mipi_dbi.coverview(9) mipi_dbi_command_read(9)mipi_dbi_command_buf(9)mipi_dbi_buf_copy(9)drm_mipi_dbi_crtc_helper_mode_valid(9)drm_mipi_dbi_plane_helper_atomic_check(9)drm_mipi_dbi_plane_helper_atomic_update(9)drm_mipi_dbi_crtc_helper_atomic_check(9)drm_mipi_dbi_crtc_helper_atomic_disable(9)drm_mipi_dbi_connector_helper_get_modes(9)drm_mipi_dbi_dev_init(9)mipi_dbi_hw_reset(9)mipi_dbi_display_is_on(9)mipi_dbi_poweron_reset(9)mipi_dbi_poweron_conditional_reset(9)mipi_dbi_spi_cmd_max_speed(9)mipi_dbi_spi_transfer(9)mipi_dbi_debugfs_init(9)
okay that's the whole page, go forth and initialize πΈ this came to you from ./drivers/gpu/drm, dated October 2026, and stamped mipi_dbi_spi_init(9) β mwah, love u, bye ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms