/* Checks if VBUS is at a particular level.  */
static bool adc_vbus_check_level(const struct device *dev, enum tc_vbus_level level)
/* Checks if VBUS is at a particular level.  */
static bool adc_vbus_check_level(const struct device *dev, enum tc_vbus_level level)
{
	int meas;
	int ret;
	ret = adc_vbus_measure(dev, &meas);
	if (ret) {
		return false;
	}
	switch (level) {
	case TC_VBUS_SAFE0V:
		return (meas < PD_V_SAFE_0V_MAX_MV);
	case TC_VBUS_PRESENT:
		return (meas >= PD_V_SAFE_5V_MIN_MV);
	case TC_VBUS_REMOVED:
		return (meas < TC_V_SINK_DISCONNECT_MAX_MV);
	}
	return false;
}