/* Set the polarity of the CC line, which is the active CC line used for power delivery.  */
static int ucpd_cc_set_polarity(const struct device *dev, enum tc_cc_polarity polarity)
/* Set the polarity of the CC line, which is the active CC line used for power delivery.  */
static int ucpd_cc_set_polarity(const struct device *dev, enum tc_cc_polarity polarity)
{
	const struct tcpc_config *const config = dev->config;
	uint32_t cr;
	cr = LL_UCPD_ReadReg(config->ucpd_port, CR);
	if (polarity == TC_POLARITY_CC1) {
		cr &= ~UCPD_CR_PHYCCSEL;
	} else if (polarity == TC_POLARITY_CC2) {
		cr |= UCPD_CR_PHYCCSEL;
	} else {
		return -ENOTSUP;
	}
	LL_UCPD_WriteReg(config->ucpd_port, CR, cr);
	return 0;
}