linux/drivers/usb/typec/mux/it5205.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ITE IT5205 Type-C USB alternate mode passive mux
 *
 * Copyright (c) 2020 MediaTek Inc.
 * Copyright (c) 2024 Collabora Ltd.
 *                    AngeloGioacchino Del Regno <[email protected]>
 *
 */

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/tcpm.h>
#include <linux/usb/typec.h>
#include <linux/usb/typec_dp.h>
#include <linux/usb/typec_mux.h>

#define IT5205_REG_CHIP_ID(x)
#define IT5205FN_CHIP_ID

/* MUX power down register */
#define IT5205_REG_MUXPDR
#define IT5205_MUX_POWER_DOWN

/* MUX control register */
#define IT5205_REG_MUXCR
#define IT5205_POLARITY_INVERTED
#define IT5205_DP_USB_CTRL_MASK
#define IT5205_DP
#define IT5205_DP_USB
#define IT5205_USB

/* Vref Select Register */
#define IT5205_REG_VSR
#define IT5205_VREF_SELECT_MASK
#define IT5205_VREF_SELECT_3_3V
#define IT5205_VREF_SELECT_OFF

/* CSBU Over Voltage Protection Register */
#define IT5205_REG_CSBUOVPSR
#define IT5205_OVP_SELECT_MASK
#define IT5205_OVP_3_90V
#define IT5205_OVP_3_68V
#define IT5205_OVP_3_62V
#define IT5205_OVP_3_57V

/* CSBU Switch Register */
#define IT5205_REG_CSBUSR
#define IT5205_CSBUSR_SWITCH

/* Interrupt Switch Register */
#define IT5205_REG_ISR
#define IT5205_ISR_CSBU_MASK
#define IT5205_ISR_CSBU_OVP

struct it5205 {};

static int it5205_switch_set(struct typec_switch_dev *sw, enum typec_orientation orientation)
{}

static int it5205_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state)
{}

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

static void it5205_enable_ovp(struct it5205 *it)
{}

static const struct regmap_config it5205_regmap =;

static int it5205_probe(struct i2c_client *client)
{}

static void it5205_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver it5205_driver =;
module_i2c_driver();

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