linux/drivers/usb/typec/tcpm/tcpci_rt1711h.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2018, Richtek Technology Corporation
 *
 * Richtek RT1711H Type-C Chip Driver
 */

#include <linux/bits.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/gpio/consumer.h>
#include <linux/usb/tcpci.h>
#include <linux/usb/tcpm.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>

#define RT1711H_VID
#define RT1711H_PID
#define RT1711H_DID
#define RT1715_DID

#define RT1711H_PHYCTRL1
#define RT1711H_PHYCTRL2

#define RT1711H_RTCTRL4
/* rx threshold of rd/rp: 1b0 for level 0.4V/0.7V, 1b1 for 0.35V/0.75V */
#define RT1711H_BMCIO_RXDZSEL

#define RT1711H_RTCTRL8
/* Autoidle timeout = (tout * 2 + 1) * 6.4ms */
#define RT1711H_RTCTRL8_SET(ck300, ship_off, auto_idle, tout)
#define RT1711H_AUTOIDLEEN
#define RT1711H_ENEXTMSG

#define RT1711H_RTCTRL11

/* I2C timeout = (tout + 1) * 12.5ms */
#define RT1711H_RTCTRL11_SET(en, tout)

#define RT1711H_RTCTRL13
#define RT1711H_RTCTRL14
#define RT1711H_RTCTRL15
#define RT1711H_RTCTRL16

#define RT1711H_RTCTRL18
/* 1b0 as fixed rx threshold of rd/rp 0.55V, 1b1 depends on RTCRTL4[0] */
#define BMCIO_RXDZEN

struct rt1711h_chip_info {};

struct rt1711h_chip {};

static int rt1711h_read16(struct rt1711h_chip *chip, unsigned int reg, u16 *val)
{}

static int rt1711h_write16(struct rt1711h_chip *chip, unsigned int reg, u16 val)
{}

static int rt1711h_read8(struct rt1711h_chip *chip, unsigned int reg, u8 *val)
{}

static int rt1711h_write8(struct rt1711h_chip *chip, unsigned int reg, u8 val)
{}

static const struct regmap_config rt1711h_regmap_config =;

static struct rt1711h_chip *tdata_to_rt1711h(struct tcpci_data *tdata)
{}

static int rt1711h_init(struct tcpci *tcpci, struct tcpci_data *tdata)
{}

static int rt1711h_set_vbus(struct tcpci *tcpci, struct tcpci_data *tdata,
			    bool src, bool snk)
{}

static int rt1711h_set_vconn(struct tcpci *tcpci, struct tcpci_data *tdata,
			     bool enable)
{}

/*
 * Selects the CC PHY noise filter voltage level according to the remote current
 * CC voltage level.
 *
 * @status: The port's current cc status read from IC
 * Return 0 if writes succeed; failure code otherwise
 */
static inline int rt1711h_init_cc_params(struct rt1711h_chip *chip, u8 status)
{}

static int rt1711h_start_drp_toggling(struct tcpci *tcpci,
				      struct tcpci_data *tdata,
				      enum typec_cc_status cc)
{}

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

static int rt1711h_sw_reset(struct rt1711h_chip *chip)
{}

static int rt1711h_check_revision(struct i2c_client *i2c, struct rt1711h_chip *chip)
{}

static int rt1711h_probe(struct i2c_client *client)
{}

static void rt1711h_remove(struct i2c_client *client)
{}

static const struct rt1711h_chip_info rt1711h =;

static const struct rt1711h_chip_info rt1715 =;

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

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

static struct i2c_driver rt1711h_i2c_driver =;
module_i2c_driver();

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