drivers/usb/typec/tcpm/tcpci_maxim.h

Source file repositories/reference/linux-study-clean/drivers/usb/typec/tcpm/tcpci_maxim.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/typec/tcpm/tcpci_maxim.h
Extension
.h
Size
3507 bytes
Lines
103
Domain
Driver Families
Bucket
drivers/usb
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct max_tcpci_chip {
	struct tcpci_data data;
	struct tcpci *tcpci;
	struct device *dev;
	struct i2c_client *client;
	struct tcpm_port *port;
	enum contamiant_state contaminant_state;
	bool veto_vconn_swap;
	struct regulator *vbus_reg;
};

static inline int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val)
{
	return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u16));
}

static inline int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val)
{
	return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u16));
}

static inline int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val)
{
	return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u8));
}

static inline int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val)
{
	return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u8));
}

/**
 * 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_

Annotation

Implementation Notes