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

Commit c3df2e27 authored by Karthikeyan Mani's avatar Karthikeyan Mani Committed by Gerrit - the friendly Code Review server
Browse files

drivers: soc: qcom: notify of only usb audio plugs



Notify to FSA driver clients only if it is a audio
accessory plug. Add other type of accessory plug that
FSA driver should notify of if any in the switch condition.

Change-Id: I094835f5bfb950c60c89163443a25849dd0b5b52
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent f5f31790
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -150,20 +150,27 @@ static int fsa4480_usbc_analog_setup_switches(struct fsa4480_priv *fsa_priv)
	dev_dbg(dev, "%s: setting GPIOs active = %d\n",
		__func__, mode.intval != POWER_SUPPLY_TYPEC_NONE);

	if (mode.intval != POWER_SUPPLY_TYPEC_NONE) {
	switch (mode.intval) {
	/* add all modes FSA should notify for in here */
	case POWER_SUPPLY_TYPEC_SINK_AUDIO_ADAPTER:
		/* activate switches */
		fsa4480_usbc_update_settings(fsa_priv, 0x00, 0x9F);

		/* notify call chain on event */
		blocking_notifier_call_chain(&fsa_priv->fsa4480_notifier,
		POWER_SUPPLY_TYPEC_SINK_AUDIO_ADAPTER, NULL);
	} else {
		mode.intval, NULL);
		break;
	case POWER_SUPPLY_TYPEC_NONE:
		/* notify call chain on event */
		blocking_notifier_call_chain(&fsa_priv->fsa4480_notifier,
				POWER_SUPPLY_TYPEC_NONE, NULL);

		/* deactivate switches */
		fsa4480_usbc_update_settings(fsa_priv, 0x18, 0x98);
		break;
	default:
		/* ignore other usb connection modes */
		break;
	}

done: