2 * Copyright (C) 2016 Noralf Trønnes
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
10 #ifndef __LINUX_TINYDRM_HELPERS_H
11 #define __LINUX_TINYDRM_HELPERS_H
13 struct backlight_device;
15 struct drm_display_mode;
16 struct drm_framebuffer;
18 struct drm_simple_display_pipe;
19 struct drm_simple_display_pipe_funcs;
26 * tinydrm_machine_little_endian - Machine is little endian
29 * true if *defined(__LITTLE_ENDIAN)*, false otherwise
31 static inline bool tinydrm_machine_little_endian(void)
33 #if defined(__LITTLE_ENDIAN)
40 int tinydrm_display_pipe_init(struct drm_device *drm,
41 struct drm_simple_display_pipe *pipe,
42 const struct drm_simple_display_pipe_funcs *funcs,
44 const uint32_t *formats,
45 unsigned int format_count,
46 const struct drm_display_mode *mode,
47 unsigned int rotation);
49 size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len);
50 bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw);
51 int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz,
52 struct spi_transfer *header, u8 bpw, const void *buf,
54 void _tinydrm_dbg_spi_message(struct spi_device *spi, struct spi_message *m);
58 * tinydrm_dbg_spi_message - Dump SPI message
62 * Dumps info about the transfers in a SPI message including buffer content.
63 * DEBUG has to be defined for this function to be enabled alongside setting
64 * the DRM_UT_DRIVER bit of &drm_debug.
66 static inline void tinydrm_dbg_spi_message(struct spi_device *spi,
67 struct spi_message *m)
69 if (drm_debug & DRM_UT_DRIVER)
70 _tinydrm_dbg_spi_message(spi, m);
73 static inline void tinydrm_dbg_spi_message(struct spi_device *spi,
74 struct spi_message *m)
79 #endif /* __LINUX_TINYDRM_HELPERS_H */