linux/drivers/gpu/drm/vc4/vc4_dpi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2016 Broadcom Limited
 */

/**
 * DOC: VC4 DPI module
 *
 * The VC4 DPI hardware supports MIPI DPI type 4 and Nokia ViSSI
 * signals.  On BCM2835, these can be routed out to GPIO0-27 with the
 * ALT2 function.
 */

#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/media-bus-format.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include "vc4_drv.h"
#include "vc4_regs.h"

#define DPI_C
#define DPI_OUTPUT_ENABLE_MODE

/* The order field takes the incoming 24 bit RGB from the pixel valve
 * and shuffles the 3 channels.
 */
#define DPI_ORDER_MASK
#define DPI_ORDER_SHIFT
#define DPI_ORDER_RGB
#define DPI_ORDER_BGR
#define DPI_ORDER_GRB
#define DPI_ORDER_BRG

/* The format field takes the ORDER-shuffled pixel valve data and
 * formats it onto the output lines.
 */
#define DPI_FORMAT_MASK
#define DPI_FORMAT_SHIFT
/* This define is named in the hardware, but actually just outputs 0. */
#define DPI_FORMAT_9BIT_666_RGB
/* Outputs 00000000rrrrrggggggbbbbb */
#define DPI_FORMAT_16BIT_565_RGB_1
/* Outputs 000rrrrr00gggggg000bbbbb */
#define DPI_FORMAT_16BIT_565_RGB_2
/* Outputs 00rrrrr000gggggg00bbbbb0 */
#define DPI_FORMAT_16BIT_565_RGB_3
/* Outputs 000000rrrrrrggggggbbbbbb */
#define DPI_FORMAT_18BIT_666_RGB_1
/* Outputs 00rrrrrr00gggggg00bbbbbb */
#define DPI_FORMAT_18BIT_666_RGB_2
/* Outputs rrrrrrrrggggggggbbbbbbbb */
#define DPI_FORMAT_24BIT_888_RGB

/* Reverses the polarity of the corresponding signal */
#define DPI_PIXEL_CLK_INVERT
#define DPI_HSYNC_INVERT
#define DPI_VSYNC_INVERT
#define DPI_OUTPUT_ENABLE_INVERT

/* Outputs the signal the falling clock edge instead of rising. */
#define DPI_HSYNC_NEGATE
#define DPI_VSYNC_NEGATE
#define DPI_OUTPUT_ENABLE_NEGATE

/* Disables the signal */
#define DPI_HSYNC_DISABLE
#define DPI_VSYNC_DISABLE
#define DPI_OUTPUT_ENABLE_DISABLE

/* Power gate to the device, full reset at 0 -> 1 transition */
#define DPI_ENABLE

/* All other registers besides DPI_C return the ID */
#define DPI_ID
#define DPI_ID_VALUE

/* General DPI hardware state. */
struct vc4_dpi {};

#define to_vc4_dpi(_encoder)

#define DPI_READ(offset)

#define DPI_WRITE(offset, val)

static const struct debugfs_reg32 dpi_regs[] =;

static void vc4_dpi_encoder_disable(struct drm_encoder *encoder)
{}

static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
{}

static enum drm_mode_status vc4_dpi_encoder_mode_valid(struct drm_encoder *encoder,
						       const struct drm_display_mode *mode)
{}

static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs =;

static int vc4_dpi_late_register(struct drm_encoder *encoder)
{}

static const struct drm_encoder_funcs vc4_dpi_encoder_funcs =;

static const struct of_device_id vc4_dpi_dt_match[] =;

/* Sets up the next link in the display chain, whether it's a panel or
 * a bridge.
 */
static int vc4_dpi_init_bridge(struct vc4_dpi *dpi)
{}

static void vc4_dpi_disable_clock(void *ptr)
{}

static int vc4_dpi_bind(struct device *dev, struct device *master, void *data)
{}

static const struct component_ops vc4_dpi_ops =;

static int vc4_dpi_dev_probe(struct platform_device *pdev)
{}

static void vc4_dpi_dev_remove(struct platform_device *pdev)
{}

struct platform_driver vc4_dpi_driver =;