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

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2022 Google, Inc
 *
 * USB-C module to reduce wakeups due to contaminants.
 */

#include <linux/device.h>
#include <linux/irqreturn.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/usb/tcpci.h>
#include <linux/usb/tcpm.h>
#include <linux/usb/typec.h>

#include "tcpci_maxim.h"

enum fladc_select {};

#define FLADC_1uA_LSB_MV
/* High range CC */
#define FLADC_CC_HIGH_RANGE_LSB_MV
/* Low range CC */
#define FLADC_CC_LOW_RANGE_LSB_MV

/* 1uA current source */
#define FLADC_CC_SCALE1
/* 5 uA current source */
#define FLADC_CC_SCALE2

#define FLADC_1uA_CC_OFFSET_MV
#define FLADC_CC_HIGH_RANGE_OFFSET_MV
#define FLADC_CC_LOW_RANGE_OFFSET_MV

#define CONTAMINANT_THRESHOLD_SBU_K
#define CONTAMINANT_THRESHOLD_CC_K

#define READ1_SLEEP_MS
#define READ2_SLEEP_MS

#define STATUS_CHECK(reg, mask, val)

#define IS_CC_OPEN(cc_status)

static int max_contaminant_adc_to_mv(struct max_tcpci_chip *chip, enum fladc_select channel,
				     bool ua_src, u8 fladc)
{}

static int max_contaminant_read_adc_mv(struct max_tcpci_chip *chip, enum fladc_select channel,
				       int sleep_msec, bool raw, bool ua_src)
{}

static int max_contaminant_read_resistance_kohm(struct max_tcpci_chip *chip,
						enum fladc_select channel, int sleep_msec, bool raw)
{}

static int max_contaminant_read_comparators(struct max_tcpci_chip *chip, u8 *vendor_cc_status2_cc1,
					    u8 *vendor_cc_status2_cc2)
{}

static int max_contaminant_detect_contaminant(struct max_tcpci_chip *chip)
{}

static int max_contaminant_enable_dry_detection(struct max_tcpci_chip *chip)
{}

bool max_contaminant_is_contaminant(struct max_tcpci_chip *chip, bool disconnect_while_debounce)
{}

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