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

Commit 089ebed2 authored by smanag's avatar smanag Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm8x16-wcd: Read subsystem name from dtsi



msm8x16-wcd codec registers callback with adsp
subsystem to receive subsystem restart notifications.
This will not work for msm8909 and msm8916 targets
where audio dsp firmware is run on modem dsp.

Read subsystem name from codec node of dtsi and
register callback with the respective subsystem.
msm8916, msm8909 are expected to have this subsys-name
property defined in the codec node.

CRs-Fixed: 2127307
Change-Id: I7a2d98513b9a32ed9f0af895820113d627e65813
Signed-off-by: default avatarSoumya Managoli <smanag@codeaurora.org>
parent 803a9a91
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -756,7 +756,12 @@ normally open.

Optional Properties:
- qcom,us-euro-gpios : GPIO on which gnd/mic swap signal is coming.

- qcom,subsys-name: This value provides the subsystem name where codec
		is present. This property enables the codec driver to
		register and receive subsytem restart notification from subsystem
		and follow appropriate steps to ensure codec is in proper state
		after subsytem restart. By default codec driver register
		with ADSP subsystem.
Example:

	sound {
@@ -1649,6 +1654,12 @@ capacitor mode.
- qcom,msm-micbias2-ext-cap : Boolean. Enable micbias2 external
capacitor mode.
- qcom,msm-spk-ext-pa : GPIO which enables external speaker pa.
- qcom,subsys-name: This value provides the subsystem name where codec
		is present. This property enables the codec driver to
		register and receive subsytem restart notification from subsystem
		and follow appropriate steps to ensure codec is in proper state
		after subsytem restart. By default codec driver register
		with ADSP subsystem.

To Configure External Audio Switch
- qcom,msm-ext-audio-switch : GPIO which controls external switch that switches
+14 −3
Original line number Diff line number Diff line
@@ -5759,6 +5759,7 @@ static int msm8x16_wcd_codec_probe(struct snd_soc_codec *codec)
	struct msm8x16_wcd *msm8x16_wcd;
	struct msm8x16_wcd_pdata *pdata;
	int i, ret;
	const char *subsys_name = NULL;

	dev_dbg(codec->dev, "%s()\n", __func__);

@@ -5888,9 +5889,19 @@ static int msm8x16_wcd_codec_probe(struct snd_soc_codec *codec)
	/* Set initial cap mode */
	msm8x16_wcd_configure_cap(codec, false, false);
	registered_codec = codec;
	ret = of_property_read_string(codec->dev->of_node,
				"qcom,subsys-name",
				&subsys_name);
	if (ret) {
		dev_dbg(codec->dev, "missing subsys-name entry in dt node\n");
		adsp_state_notifier =
			subsys_notif_register_notifier("adsp",
			&adsp_state_notifier_block);
	} else {
		adsp_state_notifier =
			subsys_notif_register_notifier(subsys_name,
			&adsp_state_notifier_block);
	}
	if (!adsp_state_notifier) {
		dev_err(codec->dev, "Failed to register adsp state notifier\n");
		iounmap(msm8x16_wcd->dig_base);