1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2016 Noralf Trønnes
6 #ifndef __LINUX_TINYDRM_HELPERS_H
7 #define __LINUX_TINYDRM_HELPERS_H
9 struct backlight_device;
11 struct drm_display_mode;
12 struct drm_framebuffer;
14 struct drm_simple_display_pipe;
15 struct drm_simple_display_pipe_funcs;
22 * tinydrm_machine_little_endian - Machine is little endian
25 * true if *defined(__LITTLE_ENDIAN)*, false otherwise
27 static inline bool tinydrm_machine_little_endian(void)
29 #if defined(__LITTLE_ENDIAN)
36 int tinydrm_display_pipe_init(struct drm_device *drm,
37 struct drm_simple_display_pipe *pipe,
38 const struct drm_simple_display_pipe_funcs *funcs,
40 const uint32_t *formats,
41 unsigned int format_count,
42 const struct drm_display_mode *mode,
43 unsigned int rotation);
45 size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len);
46 int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz,
47 struct spi_transfer *header, u8 bpw, const void *buf,
49 void _tinydrm_dbg_spi_message(struct spi_device *spi, struct spi_message *m);
53 * tinydrm_dbg_spi_message - Dump SPI message
57 * Dumps info about the transfers in a SPI message including buffer content.
58 * DEBUG has to be defined for this function to be enabled alongside setting
59 * the DRM_UT_DRIVER bit of &drm_debug.
61 static inline void tinydrm_dbg_spi_message(struct spi_device *spi,
62 struct spi_message *m)
64 if (drm_debug & DRM_UT_DRIVER)
65 _tinydrm_dbg_spi_message(spi, m);
68 static inline void tinydrm_dbg_spi_message(struct spi_device *spi,
69 struct spi_message *m)
74 #endif /* __LINUX_TINYDRM_HELPERS_H */