linux/drivers/gpu/drm/bridge/sii9234.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2017 Samsung Electronics
 *
 * Authors:
 *    Tomasz Stanislawski <[email protected]>
 *    Maciej Purski <[email protected]>
 *
 * Based on sii9234 driver created by:
 *    Adam Hampson <[email protected]>
 *    Erik Gilling <[email protected]>
 *    Shankar Bandal <[email protected]>
 *    Dharam Kumar <[email protected]>
 */
#include <drm/bridge/mhl.h>
#include <drm/drm_bridge.h>
#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>

#define CBUS_DEVCAP_OFFSET

#define SII9234_MHL_VERSION
#define SII9234_SCRATCHPAD_SIZE
#define SII9234_INT_STAT_SIZE

#define BIT_TMDS_CCTRL_TMDS_OE
#define MHL_HPD_OUT_OVR_EN
#define MHL_HPD_OUT_OVR_VAL
#define MHL_INIT_TIMEOUT

/* MHL Tx registers and bits */
#define MHL_TX_SRST
#define MHL_TX_SYSSTAT_REG
#define MHL_TX_INTR1_REG
#define MHL_TX_INTR4_REG
#define MHL_TX_INTR1_ENABLE_REG
#define MHL_TX_INTR4_ENABLE_REG
#define MHL_TX_INT_CTRL_REG
#define MHL_TX_TMDS_CCTRL
#define MHL_TX_DISC_CTRL1_REG
#define MHL_TX_DISC_CTRL2_REG
#define MHL_TX_DISC_CTRL3_REG
#define MHL_TX_DISC_CTRL4_REG
#define MHL_TX_DISC_CTRL5_REG
#define MHL_TX_DISC_CTRL6_REG
#define MHL_TX_DISC_CTRL7_REG
#define MHL_TX_DISC_CTRL8_REG
#define MHL_TX_STAT2_REG
#define MHL_TX_MHLTX_CTL1_REG
#define MHL_TX_MHLTX_CTL2_REG
#define MHL_TX_MHLTX_CTL4_REG
#define MHL_TX_MHLTX_CTL6_REG
#define MHL_TX_MHLTX_CTL7_REG

#define RSEN_STATUS
#define HPD_CHANGE_INT
#define RSEN_CHANGE_INT
#define RGND_READY_INT
#define VBUS_LOW_INT
#define CBUS_LKOUT_INT
#define MHL_DISC_FAIL_INT
#define MHL_EST_INT
#define HPD_CHANGE_INT_MASK
#define RSEN_CHANGE_INT_MASK

#define RGND_READY_MASK
#define CBUS_LKOUT_MASK
#define MHL_DISC_FAIL_MASK
#define MHL_EST_MASK

#define SKIP_GND

#define ATT_THRESH_SHIFT
#define ATT_THRESH_MASK
#define USB_D_OEN
#define DEGLITCH_TIME_MASK
#define DEGLITCH_TIME_2MS
#define DEGLITCH_TIME_4MS
#define DEGLITCH_TIME_8MS
#define DEGLITCH_TIME_16MS
#define DEGLITCH_TIME_40MS
#define DEGLITCH_TIME_50MS
#define DEGLITCH_TIME_60MS
#define DEGLITCH_TIME_128MS

#define USB_D_OVR
#define USB_ID_OVR
#define DVRFLT_SEL
#define BLOCK_RGND_INT
#define SKIP_DEG
#define CI2CA_POL
#define CI2CA_WKUP
#define SINGLE_ATT

#define USB_D_ODN
#define VBUS_CHECK
#define RGND_INTP_MASK
#define RGND_INTP_OPEN
#define RGND_INTP_2K
#define RGND_INTP_1K
#define RGND_INTP_SHORT

/* HDMI registers */
#define HDMI_RX_TMDS0_CCTRL1_REG
#define HDMI_RX_TMDS_CLK_EN_REG
#define HDMI_RX_TMDS_CH_EN_REG
#define HDMI_RX_PLL_CALREFSEL_REG
#define HDMI_RX_PLL_VCOCAL_REG
#define HDMI_RX_EQ_DATA0_REG
#define HDMI_RX_EQ_DATA1_REG
#define HDMI_RX_EQ_DATA2_REG
#define HDMI_RX_EQ_DATA3_REG
#define HDMI_RX_EQ_DATA4_REG
#define HDMI_RX_TMDS_ZONE_CTRL_REG
#define HDMI_RX_TMDS_MODE_CTRL_REG

/* CBUS registers */
#define CBUS_INT_STATUS_1_REG
#define CBUS_INTR1_ENABLE_REG
#define CBUS_MSC_REQ_ABORT_REASON_REG
#define CBUS_INT_STATUS_2_REG
#define CBUS_INTR2_ENABLE_REG
#define CBUS_LINK_CONTROL_2_REG
#define CBUS_MHL_STATUS_REG_0
#define CBUS_MHL_STATUS_REG_1

#define BIT_CBUS_RESET
#define SET_HPD_DOWNSTREAM

/* TPI registers */
#define TPI_DPD_REG

/* Timeouts in msec */
#define T_SRC_VBUS_CBUS_TO_STABLE
#define T_SRC_CBUS_FLOAT
#define T_SRC_CBUS_DEGLITCH
#define T_SRC_RXSENSE_DEGLITCH

#define MHL1_MAX_CLK

#define I2C_TPI_ADDR
#define I2C_HDMI_ADDR
#define I2C_CBUS_ADDR

enum sii9234_state {};

struct sii9234 {};

enum sii9234_client_id {};

static const char * const sii9234_client_name[] =;

static int sii9234_writeb(struct sii9234 *ctx, int id, int offset,
			  int value)
{}

static int sii9234_writebm(struct sii9234 *ctx, int id, int offset,
			   int value, int mask)
{}

static int sii9234_readb(struct sii9234 *ctx, int id, int offset)
{}

static int sii9234_clear_error(struct sii9234 *ctx)
{}

#define mhl_tx_writeb(sii9234, offset, value)
#define mhl_tx_writebm(sii9234, offset, value, mask)
#define mhl_tx_readb(sii9234, offset)
#define cbus_writeb(sii9234, offset, value)
#define cbus_writebm(sii9234, offset, value, mask)
#define cbus_readb(sii9234, offset)
#define hdmi_writeb(sii9234, offset, value)
#define hdmi_writebm(sii9234, offset, value, mask)
#define hdmi_readb(sii9234, offset)
#define tpi_writeb(sii9234, offset, value)
#define tpi_writebm(sii9234, offset, value, mask)
#define tpi_readb(sii9234, offset)

static u8 sii9234_tmds_control(struct sii9234 *ctx, bool enable)
{}

static int sii9234_cbus_reset(struct sii9234 *ctx)
{}

/* Require to chek mhl imformation of samsung in cbus_init_register */
static int sii9234_cbus_init(struct sii9234 *ctx)
{}

static void force_usb_id_switch_open(struct sii9234 *ctx)
{}

static void release_usb_id_switch_open(struct sii9234 *ctx)
{}

static int sii9234_power_init(struct sii9234 *ctx)
{}

static int sii9234_hdmi_init(struct sii9234 *ctx)
{}

static int sii9234_mhl_tx_ctl_int(struct sii9234 *ctx)
{}

static int sii9234_reset(struct sii9234 *ctx)
{}

static int sii9234_goto_d3(struct sii9234 *ctx)
{}

static int sii9234_hw_on(struct sii9234 *ctx)
{}

static void sii9234_hw_off(struct sii9234 *ctx)
{}

static void sii9234_hw_reset(struct sii9234 *ctx)
{}

static void sii9234_cable_in(struct sii9234 *ctx)
{}

static void sii9234_cable_out(struct sii9234 *ctx)
{}

static enum sii9234_state sii9234_rgnd_ready_irq(struct sii9234 *ctx)
{}

static enum sii9234_state sii9234_mhl_established(struct sii9234 *ctx)
{}

static enum sii9234_state sii9234_hpd_change(struct sii9234 *ctx)
{}

static enum sii9234_state sii9234_rsen_change(struct sii9234 *ctx)
{}

static irqreturn_t sii9234_irq_thread(int irq, void *data)
{}

static int sii9234_init_resources(struct sii9234 *ctx,
				  struct i2c_client *client)
{}

static enum drm_mode_status sii9234_mode_valid(struct drm_bridge *bridge,
					 const struct drm_display_info *info,
					 const struct drm_display_mode *mode)
{}

static const struct drm_bridge_funcs sii9234_bridge_funcs =;

static int sii9234_probe(struct i2c_client *client)
{}

static void sii9234_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver sii9234_driver =;

module_i2c_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();