linux/drivers/gpu/drm/tiny/repaper.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * DRM driver for Pervasive Displays RePaper branded e-ink panels
 *
 * Copyright 2013-2017 Pervasive Displays, Inc.
 * Copyright 2017 Noralf Trønnes
 *
 * The driver supports:
 * Material Film: Aurora Mb (V231)
 * Driver IC: G2 (eTC)
 *
 * The controller code was taken from the userspace driver:
 * https://github.com/repaper/gratis
 */

#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/sched/clock.h>
#include <linux/spi/spi.h>
#include <linux/thermal.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_connector.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_dma_helper.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_format_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_modes.h>
#include <drm/drm_rect.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>

#define REPAPER_RID_G2_COG_ID

enum repaper_model {};

enum repaper_stage {};

enum repaper_epd_border_byte {};

struct repaper_epd {};

static inline struct repaper_epd *drm_to_epd(struct drm_device *drm)
{}

static int repaper_spi_transfer(struct spi_device *spi, u8 header,
				const void *tx, void *rx, size_t len)
{}

static int repaper_write_buf(struct spi_device *spi, u8 reg,
			     const u8 *buf, size_t len)
{}

static int repaper_write_val(struct spi_device *spi, u8 reg, u8 val)
{}

static int repaper_read_val(struct spi_device *spi, u8 reg)
{}

static int repaper_read_id(struct spi_device *spi)
{}

static void repaper_spi_mosi_low(struct spi_device *spi)
{}

/* pixels on display are numbered from 1 so even is actually bits 1,3,5,... */
static void repaper_even_pixels(struct repaper_epd *epd, u8 **pp,
				const u8 *data, u8 fixed_value, const u8 *mask,
				enum repaper_stage stage)
{}

/* pixels on display are numbered from 1 so odd is actually bits 0,2,4,... */
static void repaper_odd_pixels(struct repaper_epd *epd, u8 **pp,
			       const u8 *data, u8 fixed_value, const u8 *mask,
			       enum repaper_stage stage)
{}

/* interleave bits: (byte)76543210 -> (16 bit).7.6.5.4.3.2.1 */
static inline u16 repaper_interleave_bits(u16 value)
{}

/* pixels on display are numbered from 1 */
static void repaper_all_pixels(struct repaper_epd *epd, u8 **pp,
			       const u8 *data, u8 fixed_value, const u8 *mask,
			       enum repaper_stage stage)
{}

/* output one line of scan and data bytes to the display */
static void repaper_one_line(struct repaper_epd *epd, unsigned int line,
			     const u8 *data, u8 fixed_value, const u8 *mask,
			     enum repaper_stage stage)
{}

static void repaper_frame_fixed(struct repaper_epd *epd, u8 fixed_value,
				enum repaper_stage stage)
{}

static void repaper_frame_data(struct repaper_epd *epd, const u8 *image,
			       const u8 *mask, enum repaper_stage stage)
{}

static void repaper_frame_fixed_repeat(struct repaper_epd *epd, u8 fixed_value,
				       enum repaper_stage stage)
{}

static void repaper_frame_data_repeat(struct repaper_epd *epd, const u8 *image,
				      const u8 *mask, enum repaper_stage stage)
{}

static void repaper_get_temperature(struct repaper_epd *epd)
{}

static int repaper_fb_dirty(struct drm_framebuffer *fb,
			    struct drm_format_conv_state *fmtcnv_state)
{}

static void power_off(struct repaper_epd *epd)
{}

static enum drm_mode_status repaper_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
						    const struct drm_display_mode *mode)
{}

static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
				struct drm_crtc_state *crtc_state,
				struct drm_plane_state *plane_state)
{}

static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
{}

static void repaper_pipe_update(struct drm_simple_display_pipe *pipe,
				struct drm_plane_state *old_state)
{}

static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs =;

static int repaper_connector_get_modes(struct drm_connector *connector)
{}

static const struct drm_connector_helper_funcs repaper_connector_hfuncs =;

static const struct drm_connector_funcs repaper_connector_funcs =;

static const struct drm_mode_config_funcs repaper_mode_config_funcs =;

static const uint32_t repaper_formats[] =;

static const struct drm_display_mode repaper_e1144cs021_mode =;

static const u8 repaper_e1144cs021_cs[] =;

static const struct drm_display_mode repaper_e1190cs021_mode =;

static const u8 repaper_e1190cs021_cs[] =;

static const struct drm_display_mode repaper_e2200cs021_mode =;

static const u8 repaper_e2200cs021_cs[] =;

static const struct drm_display_mode repaper_e2271cs021_mode =;

static const u8 repaper_e2271cs021_cs[] =;

DEFINE_DRM_GEM_DMA_FOPS(repaper_fops);

static const struct drm_driver repaper_driver =;

static const struct of_device_id repaper_of_match[] =;
MODULE_DEVICE_TABLE(of, repaper_of_match);

static const struct spi_device_id repaper_id[] =;
MODULE_DEVICE_TABLE(spi, repaper_id);

static int repaper_probe(struct spi_device *spi)
{}

static void repaper_remove(struct spi_device *spi)
{}

static void repaper_shutdown(struct spi_device *spi)
{}

static struct spi_driver repaper_spi_driver =;
module_spi_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();