__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * MIPI Display Bus Interface (DBI) LCD controller support
 *
 * Copyright 2016 Noralf Trønnes
 */

#ifndef __LINUX_MIPI_DBI_H
#define __LINUX_MIPI_DBI_H

#include <linux/mutex.h>
#include <drm/drm_device.h>
#include <drm/drm_simple_kms_helper.h>

struct drm_format_conv_state;
struct drm_rect;
struct gpio_desc;
struct iosys_map;
struct regulator;
struct spi_device;

/**
 * struct mipi_dbi - MIPI DBI interface
 */
struct mipi_dbi {
	/**
	 * @cmdlock: Command lock
	 */
	struct mutex cmdlock;

	/**
	 * @command: Bus specific callback executing commands.
	 */
	int (*command)(struct mipi_dbi *dbi, u8 *cmd, u8 *param, size_t num);

	/**
	 * @read_commands: Array of read commands terminated by a zero entry.
	 *                 Reading is disabled if this is NULL.
	 */
	const u8 *read_commands;

	/**
	 * @swap_bytes: Swap bytes in buffer before transfer
	 */
	bool swap_bytes;

	/**
	 * @reset: Optional reset gpio
	 */
	struct gpio_desc *reset;

	/* Type C specific */

	/**
	 * @spi: SPI device
	 */
	struct spi_device *spi;

	/**
	 * @write_memory_bpw: Bits per word used on a MIPI_DCS_WRITE_MEMORY_START transfer
	 */
	unsigned int write_memory_bpw;

	/**
	 * @dc: Optional D/C gpio.
	 */
	struct gpio_desc *dc;

	/**
	 * @tx_buf9: Buffer used for Option 1 9-bit conversion
	 */
	void *tx_buf9;

	/**
	 * @tx_buf9_len: Size of tx_buf9.
	 */
	size_t tx_buf9_len;
};

/**
 * struct mipi_dbi_dev - MIPI DBI device
 */
struct mipi_dbi_dev {
	/**
	 * @drm: DRM device
	 */
	struct drm_device drm;

	/**
	 * @pipe: Display pipe structure
	 */
	struct drm_simple_display_pipe pipe;

	/**
	 * @connector: Connector
	 */
	struct drm_connector connector;

	/**
	 * @mode: Fixed display mode
	 */
	struct drm_display_mode mode;

	/**
	 * @pixel_format: Native pixel format (DRM_FORMAT\_\*)
	 */
	u32 pixel_format;

	/**
	 * @tx_buf: Buffer used for transfer (copy clip rect area)
	 */
	u16 *tx_buf;

	/**
	 * @rotation: initial rotation in degrees Counter Clock Wise
	 */
	unsigned int rotation;

	/**
	 * @left_offset: Horizontal offset of the display relative to the
	 *               controller's driver array
	 */
	unsigned int left_offset;

	/**
	 * @top_offset: Vertical offset of the display relative to the
	 *              controller's driver array
	 */
	unsigned int top_offset;

	/**
	 * @backlight: backlight device (optional)
	 */
	struct backlight_device *backlight;

	/**
	 * @regulator: power regulator (Vdd) (optional)
	 */
	struct regulator *regulator;

	/**
	 * @io_regulator: I/O power regulator (Vddi) (optional)
	 */
	struct regulator *io_regulator;

	/**
	 * @dbi: MIPI DBI interface
	 */
	struct mipi_dbi dbi;

	/**
	 * @driver_private: Driver private data.
	 *                  Necessary for drivers with private data since devm_drm_dev_alloc()
	 *                  can't allocate structures that embed a structure which then again
	 *                  embeds drm_device.
	 */
	void *driver_private;
};

static inline struct mipi_dbi_dev *drm_to_mipi_dbi_dev(struct drm_device *drm)
{
	return container_of(drm, struct mipi_dbi_dev, drm);
}

int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi,
		      struct gpio_desc *dc);
int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev,
				   const struct drm_simple_display_pipe_funcs *funcs,
				   const uint32_t *formats, unsigned int format_count,
				   const struct drm_display_mode *mode,
				   unsigned int rotation, size_t tx_buf_size);
int mipi_dbi_dev_init(struct mipi_dbi_dev *dbidev,
		      const struct drm_simple_display_pipe_funcs *funcs,
		      const struct drm_display_mode *mode, unsigned int rotation);
enum drm_mode_status mipi_dbi_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
					      const struct drm_display_mode *mode);
void mipi_dbi_pipe_update(struct drm_simple_display_pipe *pipe,
			  struct drm_plane_state *old_state);
void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev,
			   struct drm_crtc_state *crtc_state,
			   struct drm_plane_state *plan_state);
void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe);
int mipi_dbi_pipe_begin_fb_access(struct drm_simple_display_pipe *pipe,
				  struct drm_plane_state *plane_state);
void mipi_dbi_pipe_end_fb_access(struct drm_simple_display_pipe *pipe,
				 struct drm_plane_state *plane_state);
void mipi_dbi_pipe_reset_plane(struct drm_simple_display_pipe *pipe);
struct drm_plane_state *mipi_dbi_pipe_duplicate_plane_state(struct drm_simple_display_pipe *pipe);
void mipi_dbi_pipe_destroy_plane_state(struct drm_simple_display_pipe *pipe,
				       struct drm_plane_state *plane_state);

void mipi_dbi_hw_reset(struct mipi_dbi *dbi);
bool mipi_dbi_display_is_on(struct mipi_dbi *dbi);
int mipi_dbi_poweron_reset(struct mipi_dbi_dev *dbidev);
int mipi_dbi_poweron_conditional_reset(struct mipi_dbi_dev *dbidev);

u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len);
int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
			  u8 bpw, const void *buf, size_t len);

int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val);
int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
			      size_t len);
int mipi_dbi_buf_copy(void *dst, struct iosys_map *src, struct drm_framebuffer *fb,
		      struct drm_rect *clip, bool swap,
		      struct drm_format_conv_state *fmtcnv_state);

/**
 * mipi_dbi_command - MIPI DCS command with optional parameter(s)
 * @dbi: MIPI DBI structure
 * @cmd: Command
 * @seq: Optional parameter(s)
 *
 * Send MIPI DCS command to the controller. Use mipi_dbi_command_read() for
 * get/read.
 *
 * Returns:
 * Zero on success, negative error code on failure.
 */
#define mipi_dbi_command(dbi, cmd, seq...) \
({ \
	const u8 d[] = { seq }; \
	struct device *dev = &(dbi)->spi->dev;	\
	int ret; \
	ret = mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
	if (ret) \
		dev_err_ratelimited(dev, "error %d when sending command %#02x\n", ret, cmd); \
	ret; \
})

#ifdef CONFIG_DEBUG_FS
void mipi_dbi_debugfs_init(struct drm_minor *minor);
#else
static inline void mipi_dbi_debugfs_init(struct drm_minor *minor) {}
#endif

/**
 * DRM_MIPI_DBI_SIMPLE_DISPLAY_PIPE_FUNCS - Initializes struct drm_simple_display_pipe_funcs
 *                                          for MIPI-DBI devices
 * @enable_: Enable-callback implementation
 *
 * This macro initializes struct drm_simple_display_pipe_funcs with default
 * values for MIPI-DBI-based devices. The only callback that depends on the
 * hardware is @enable, for which the driver has to provide an implementation.
 * MIPI-based drivers are encouraged to use this macro for initialization.
 */
#define DRM_MIPI_DBI_SIMPLE_DISPLAY_PIPE_FUNCS(enable_) \
	.mode_valid = mipi_dbi_pipe_mode_valid, \
	.enable = (enable_), \
	.disable = mipi_dbi_pipe_disable, \
	.update = mipi_dbi_pipe_update, \
	.begin_fb_access = mipi_dbi_pipe_begin_fb_access, \
	.end_fb_access = mipi_dbi_pipe_end_fb_access, \
	.reset_plane = mipi_dbi_pipe_reset_plane, \
	.duplicate_plane_state = mipi_dbi_pipe_duplicate_plane_state, \
	.destroy_plane_state = mipi_dbi_pipe_destroy_plane_state

#endif /* __LINUX_MIPI_DBI_H */

Filemanager

Name Type Size Permission Actions
bridge Folder 0755
clients Folder 0755
display Folder 0755
i2c Folder 0755
intel Folder 0755
ttm Folder 0755
amd_asic_type.h File 2.35 KB 0644
drm_accel.h File 2.29 KB 0644
drm_atomic.h File 43.1 KB 0644
drm_atomic_helper.h File 10.78 KB 0644
drm_atomic_state_helper.h File 4.42 KB 0644
drm_atomic_uapi.h File 2.06 KB 0644
drm_audio_component.h File 3.84 KB 0644
drm_auth.h File 4.18 KB 0644
drm_blend.h File 2.35 KB 0644
drm_bridge.h File 38.15 KB 0644
drm_bridge_connector.h File 405 B 0644
drm_buddy.h File 4.57 KB 0644
drm_cache.h File 3.3 KB 0644
drm_client.h File 6.3 KB 0644
drm_client_event.h File 897 B 0644
drm_color_mgmt.h File 3.91 KB 0644
drm_connector.h File 74.11 KB 0644
drm_crtc.h File 44.52 KB 0644
drm_crtc_helper.h File 2.51 KB 0644
drm_damage_helper.h File 3.33 KB 0644
drm_debugfs.h File 5.68 KB 0644
drm_debugfs_crc.h File 2.76 KB 0644
drm_device.h File 7.64 KB 0644
drm_drv.h File 17.32 KB 0644
drm_edid.h File 15.5 KB 0644
drm_eld.h File 4.76 KB 0644
drm_encoder.h File 11.07 KB 0644
drm_encoder_slave.h File 7.39 KB 0644
drm_exec.h File 4.3 KB 0644
drm_fb_dma_helper.h File 718 B 0644
drm_fb_helper.h File 11.68 KB 0644
drm_fbdev_dma.h File 461 B 0644
drm_fbdev_shmem.h File 475 B 0644
drm_fbdev_ttm.h File 488 B 0644
drm_file.h File 14.65 KB 0644
drm_fixed.h File 5.26 KB 0644
drm_flip_work.h File 2.63 KB 0644
drm_format_helper.h File 5.34 KB 0644
drm_fourcc.h File 9.99 KB 0644
drm_framebuffer.h File 10.04 KB 0644
drm_gem.h File 18.97 KB 0644
drm_gem_atomic_helper.h File 5.52 KB 0644
drm_gem_dma_helper.h File 9.29 KB 0644
drm_gem_framebuffer_helper.h File 1.93 KB 0644
drm_gem_shmem_helper.h File 8.21 KB 0644
drm_gem_ttm_helper.h File 822 B 0644
drm_gem_vram_helper.h File 5.73 KB 0644
drm_gpuvm.h File 33.53 KB 0644
drm_ioctl.h File 5.82 KB 0644
drm_kunit_helpers.h File 4.21 KB 0644
drm_lease.h File 1.01 KB 0644
drm_managed.h File 3.99 KB 0644
drm_mipi_dbi.h File 7.08 KB 0644
drm_mipi_dsi.h File 17.52 KB 0644
drm_mm.h File 17.46 KB 0644
drm_mode_config.h File 32.7 KB 0644
drm_mode_object.h File 5.46 KB 0644
drm_modes.h File 19.99 KB 0644
drm_modeset_helper.h File 1.77 KB 0644
drm_modeset_helper_vtables.h File 61.02 KB 0644
drm_modeset_lock.h File 7.07 KB 0644
drm_module.h File 3.72 KB 0644
drm_of.h File 5.5 KB 0644
drm_panel.h File 8.89 KB 0644
drm_panic.h File 5.33 KB 0644
drm_pciids.h File 61.04 KB 0644
drm_plane.h File 31.3 KB 0644
drm_plane_helper.h File 2.22 KB 0644
drm_prime.h File 4.21 KB 0644
drm_print.h File 22.7 KB 0644
drm_privacy_screen_consumer.h File 1.94 KB 0644
drm_privacy_screen_driver.h File 2.99 KB 0644
drm_privacy_screen_machine.h File 1.25 KB 0644
drm_probe_helper.h File 1.68 KB 0644
drm_property.h File 11.99 KB 0644
drm_rect.h File 7.52 KB 0644
drm_self_refresh_helper.h File 594 B 0644
drm_simple_kms_helper.h File 9.52 KB 0644
drm_suballoc.h File 2.74 KB 0644
drm_syncobj.h File 3.95 KB 0644
drm_sysfs.h File 512 B 0644
drm_util.h File 2.58 KB 0644
drm_utils.h File 592 B 0644
drm_vblank.h File 10.18 KB 0644
drm_vblank_work.h File 1.99 KB 0644
drm_vma_manager.h File 8.23 KB 0644
drm_writeback.h File 4.45 KB 0644
gpu_scheduler.h File 21.21 KB 0644
gud.h File 11.65 KB 0644
spsc_queue.h File 3.08 KB 0644
task_barrier.h File 2.95 KB 0644
Filemanager