linux/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for MegaChips STDP4028 with GE B850v3 firmware (LVDS-DP)
 * Driver for MegaChips STDP2690 with GE B850v3 firmware (DP-DP++)

 * Copyright (c) 2017, Collabora Ltd.
 * Copyright (c) 2017, General Electric Company


 * This driver creates a drm_bridge and a drm_connector for the LVDS to DP++
 * display bridge of the GE B850v3. There are two physical bridges on the video
 * signal pipeline: a STDP4028(LVDS to DP) and a STDP2690(DP to DP++). The
 * physical bridges are automatically configured by the input video signal, and
 * the driver has no access to the video processing pipeline. The driver is
 * only needed to read EDID from the STDP2690 and to handle HPD events from the
 * STDP4028. The driver communicates with both bridges over i2c. The video
 * signal pipeline is as follows:
 *
 *   Host -> LVDS|--(STDP4028)--|DP -> DP|--(STDP2690)--|DP++ -> Video output
 */

#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_edid.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>

#define EDID_EXT_BLOCK_CNT

#define STDP4028_IRQ_OUT_CONF_REG
#define STDP4028_DPTX_IRQ_EN_REG
#define STDP4028_DPTX_IRQ_STS_REG
#define STDP4028_DPTX_STS_REG

#define STDP4028_DPTX_DP_IRQ_EN

#define STDP4028_DPTX_HOTPLUG_IRQ_EN
#define STDP4028_DPTX_LINK_CH_IRQ_EN
#define STDP4028_DPTX_IRQ_CONFIG

#define STDP4028_DPTX_HOTPLUG_STS
#define STDP4028_DPTX_LINK_STS
#define STDP4028_CON_STATE_CONNECTED

#define STDP4028_DPTX_HOTPLUG_CH_STS
#define STDP4028_DPTX_LINK_CH_STS
#define STDP4028_DPTX_IRQ_CLEAR

static DEFINE_MUTEX(ge_b850v3_lvds_dev_mutex);

struct ge_b850v3_lvds {};

static struct ge_b850v3_lvds *ge_b850v3_lvds_ptr;

static int stdp2690_read_block(void *context, u8 *buf, unsigned int block, size_t len)
{}

static const struct drm_edid *ge_b850v3_lvds_edid_read(struct drm_bridge *bridge,
						       struct drm_connector *connector)
{}

static int ge_b850v3_lvds_get_modes(struct drm_connector *connector)
{}

static enum drm_mode_status ge_b850v3_lvds_mode_valid(
		struct drm_connector *connector, struct drm_display_mode *mode)
{}

static const struct
drm_connector_helper_funcs ge_b850v3_lvds_connector_helper_funcs =;

static enum drm_connector_status ge_b850v3_lvds_bridge_detect(struct drm_bridge *bridge)
{}

static enum drm_connector_status ge_b850v3_lvds_detect(struct drm_connector *connector,
						       bool force)
{}

static const struct drm_connector_funcs ge_b850v3_lvds_connector_funcs =;

static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge)
{}

static irqreturn_t ge_b850v3_lvds_irq_handler(int irq, void *dev_id)
{}

static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
				 enum drm_bridge_attach_flags flags)
{}

static const struct drm_bridge_funcs ge_b850v3_lvds_funcs =;

static int ge_b850v3_lvds_init(struct device *dev)
{}

static void ge_b850v3_lvds_remove(void)
{}

static int ge_b850v3_register(void)
{}

static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c)
{}

static void stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
{}

static const struct i2c_device_id stdp4028_ge_b850v3_fw_i2c_table[] =;
MODULE_DEVICE_TABLE(i2c, stdp4028_ge_b850v3_fw_i2c_table);

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

static struct i2c_driver stdp4028_ge_b850v3_fw_driver =;

static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c)
{}

static void stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
{}

static const struct i2c_device_id stdp2690_ge_b850v3_fw_i2c_table[] =;
MODULE_DEVICE_TABLE(i2c, stdp2690_ge_b850v3_fw_i2c_table);

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

static struct i2c_driver stdp2690_ge_b850v3_fw_driver =;

static int __init stdpxxxx_ge_b850v3_init(void)
{}
module_init();

static void __exit stdpxxxx_ge_b850v3_exit(void)
{}
module_exit(stdpxxxx_ge_b850v3_exit);

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