Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ab02c34 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa
Browse files

drivers: soc: qcom: terminate SBU lines when unused



Terminate SBU lines with high impedance when they are unused,
specifically at boot time and for non-DP use-cases. This is
required so that USB compliance test cases can be passed.

Change-Id: I42c6fedb784d0c2e113c5f4c69ac7ff100fc24e2
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 886a5c0c
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ static const struct fsa4480_reg_val fsa_reg_i2c_defaults[] = {
	{FSA4480_DELAY_L_MIC, 0x00},
	{FSA4480_DELAY_L_SENSE, 0x00},
	{FSA4480_DELAY_L_AGND, 0x09},
	{FSA4480_SWITCH_SETTINGS, 0x98},
};

static void fsa4480_usbc_update_settings(struct fsa4480_priv *fsa_priv,
@@ -193,7 +194,7 @@ int fsa4480_unreg_notifier(struct notifier_block *nb,
	if (!fsa_priv)
		return -EINVAL;

	fsa4480_usbc_update_settings(fsa_priv, 0x18, 0xF8);
	fsa4480_usbc_update_settings(fsa_priv, 0x18, 0x98);
	return blocking_notifier_chain_unregister
					(&fsa_priv->fsa4480_notifier, nb);
}
@@ -253,6 +254,9 @@ int fsa4480_switch_event(struct device_node *node,
	case FSA_USBC_ORIENTATION_CC2:
		fsa4480_usbc_update_settings(fsa_priv, 0x60, 0xE0);
		return fsa4480_validate_display_port_settings(fsa_priv);
	case FSA_USBC_DISPLAYPORT_DISCONNECTED:
		fsa4480_usbc_update_settings(fsa_priv, 0x18, 0x98);
		break;
	default:
		break;
	}
@@ -294,7 +298,7 @@ static int fsa4480_usbc_analog_setup_switches
				POWER_SUPPLY_TYPEC_NONE, NULL);

		/* deactivate switches */
		fsa4480_usbc_update_settings(fsa_priv, 0x18, 0xF8);
		fsa4480_usbc_update_settings(fsa_priv, 0x18, 0x98);

		if (fsa_priv->usbc_force_pr_mode) {
			pval.intval = POWER_SUPPLY_TYPEC_PR_DUAL;
@@ -405,7 +409,7 @@ static int fsa4480_remove(struct i2c_client *i2c)
	if (!fsa_priv)
		return -EINVAL;

	fsa4480_usbc_update_settings(fsa_priv, 0x18, 0xF8);
	fsa4480_usbc_update_settings(fsa_priv, 0x18, 0x98);

	/* deregister from PMI */
	power_supply_unreg_notifier(&fsa_priv->psy_nb);
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ enum fsa_function {
	FSA_MIC_GND_SWAP,
	FSA_USBC_ORIENTATION_CC1,
	FSA_USBC_ORIENTATION_CC2,
	FSA_USBC_DISPLAYPORT_DISCONNECTED,
	FSA_EVENT_MAX,
};