linux/drivers/usb/typec/tcpm/tcpci_maxim.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright 2022 Google, Inc
 *
 * MAXIM TCPC header file.
 */
#ifndef TCPCI_MAXIM_H_
#define TCPCI_MAXIM_H_

#define VENDOR_CC_STATUS2
#define CC1_VUFP_RD0P5
#define CC2_VUFP_RD0P5
#define TCPC_VENDOR_FLADC_STATUS

#define TCPC_VENDOR_CC_CTRL1
#define CCCONNDRY
#define CCCOMPEN

#define TCPC_VENDOR_CC_CTRL2
#define SBUOVPDIS
#define CCOVPDIS
#define SBURPCTRL
#define CCLPMODESEL
#define ULTRA_LOW_POWER_MODE
#define CCRPCTRL
#define UA_1_SRC
#define UA_80_SRC

#define TCPC_VENDOR_CC_CTRL3
#define CCWTRDEB
#define CCWTRDEB_1MS
#define CCWTRSEL
#define CCWTRSEL_1V
#define CCLADDERDIS
#define WTRCYCLE
#define WTRCYCLE_2_4_S
#define WTRCYCLE_4_8_S

#define TCPC_VENDOR_ADC_CTRL1
#define ADCINSEL
#define ADCEN

enum contamiant_state {};

/*
 * @potential_contaminant:
 *		Last returned result to tcpm indicating whether the TCPM port
 *		has potential contaminant.
 */
struct max_tcpci_chip {};

static inline int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val)
{}

static inline int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val)
{}

static inline int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val)
{}

static inline int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val)
{}

/**
 * max_contaminant_is_contaminant - Test if CC was toggled due to contaminant
 *
 * @chip: Handle to a struct max_tcpci_chip
 * @disconnect_while_debounce: Whether the disconnect was detected when CC
 *      		       pins were debouncing
 * @cc_handled: Returns whether or not update to CC status was handled here
 *
 * Determine if a contaminant was detected.
 *
 * Returns: true if a contaminant was detected, false otherwise. cc_handled
 * is updated to reflect whether or not further CC handling is required.
 */
bool max_contaminant_is_contaminant(struct max_tcpci_chip *chip, bool disconnect_while_debounce,
				    bool *cc_handled);

#endif  // TCPCI_MAXIM_H_