Skip to contentSkip to conversation

ASoC: hdmi: add device PM dependency

PATCH Superseded [email protected] 2 participants 3 messages Mar 29, 2019 – Mar 30, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: hdmi: add device PM dependency

From: Libin Yang <[email protected]>

HDMI audio codec register operation depends on the display audio power domain. The hdmi audio codec dapm event callback must be called after display audio power is turned on.

Add hdac_hdmi_device_link_add() in HDMI audio codec driver. The customer audio driver can call the function to set the audio power dependency.

---
 sound/soc/codecs/hdac_hdmi.c | 12 ++++++++++++
 sound/soc/codecs/hdac_hdmi.h |  6 ++++++
 2 files changed, 18 insertions(+)
sound/soc/codecs/hdac_hdmi.c +12 -0
index 5eeb0fe..c991407 100644
@@ -1792,6 +1792,18 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,
 }
 EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
 
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags)
+{
+	struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component);
+	struct hdac_device *hdev = hdmi->hdev;
+
+	return device_link_add(consumer, &hdev->dev, flags);
+}
+EXPORT_SYMBOL_GPL(hdac_hdmi_device_link_add);
+
 static void hdac_hdmi_present_sense_all_pins(struct hdac_device *hdev,
 			struct hdac_hdmi_priv *hdmi, bool detect_pin_caps)
 {
sound/soc/codecs/hdac_hdmi.h +6 -0
index 4fa2fc9..9239c6b 100644
@@ -7,4 +7,10 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm,
 
 int hdac_hdmi_jack_port_init(struct snd_soc_component *component,
 			struct snd_soc_dapm_context *dapm);
+
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags);
+
 #endif /* __HDAC_HDMI_H__ */
Signature · 1 line
2.7.4
#1 lore raw
Quoted 8 lines · On 3/29/19 1:23 AM, [email protected] wrote:

From: Libin Yang <[email protected]>

HDMI audio codec register operation depends on the display audio power domain. The hdmi audio codec dapm event callback must be called after display audio power is turned on.

Add hdac_hdmi_device_link_add() in HDMI audio codec driver. The customer audio driver can call the function to set the audio power dependency.

Can you clarify what the 'customer audio driver(s)' are, and in the case where you meant the cAVS/SST driver all a patch that makes use of this new routine?

Also the patch subject should be ASoC: hdac_hdmi: ...

Quoted 46 lines
---
  sound/soc/codecs/hdac_hdmi.c | 12 ++++++++++++
  sound/soc/codecs/hdac_hdmi.h |  6 ++++++
  2 files changed, 18 insertions(+)
sound/soc/codecs/hdac_hdmi.c +12 -0
index 5eeb0fe..c991407 100644
@@ -1792,6 +1792,18 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,
  }
  EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
 
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags)
+{
+	struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component);
+	struct hdac_device *hdev = hdmi->hdev;
+
+	return device_link_add(consumer, &hdev->dev, flags);
+}
+EXPORT_SYMBOL_GPL(hdac_hdmi_device_link_add);
+
  static void hdac_hdmi_present_sense_all_pins(struct hdac_device *hdev,
  			struct hdac_hdmi_priv *hdmi, bool detect_pin_caps)
  {
sound/soc/codecs/hdac_hdmi.h +6 -0
index 4fa2fc9..9239c6b 100644
@@ -7,4 +7,10 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm,
 
  int hdac_hdmi_jack_port_init(struct snd_soc_component *component,
  			struct snd_soc_dapm_context *dapm);
+
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags);
+
  #endif /* __HDAC_HDMI_H__ */
#2 lore raw

Hi Pierre,

Quoted 7 lines · On 3/29/19 1:23 AM, [email protected] wrote:
Quoted 6 lines

From: Libin Yang <[email protected]>

HDMI audio codec register operation depends on the display audio power domain. The hdmi audio codec dapm event callback must be called after display audio power is turned on.

Quoted 6 lines
Quoted 2 lines

Add hdac_hdmi_device_link_add() in HDMI audio codec driver. The customer audio driver can call the function to set the audio power

dependency.

Can you clarify what the 'customer audio driver(s)' are, and in the case where you meant the cAVS/SST driver all a patch that makes use of this new routine?

Sure, I will do it. I haven't made the patches for cAVS/SST driver. I tested it on SOF driver. It works.

Quoted 2 lines

Also the patch subject should be ASoC: hdac_hdmi: ...

Thanks for point it out. I will change the subject.

Regards,
Libin

Quoted 51 lines

sound/soc/codecs/hdac_hdmi.c int hdac_hdmi_jack_init(struct snd_soc_dai *dai,

Quoted 15 lines
---
  sound/soc/codecs/hdac_hdmi.c | 12 ++++++++++++
  sound/soc/codecs/hdac_hdmi.h |  6 ++++++
  2 files changed, 18 insertions(+)
(quoted diff) +0 -0

b/sound/soc/codecs/hdac_hdmi.c index 5eeb0fe..c991407 100644

sound/soc/codecs/hdac_hdmi.c +0 -0
@@ -1792,6 +1792,18 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai,

int device,

sound/soc/codecs/hdac_hdmi.c int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,

Quoted 9 lines
sound/soc/codecs/hdac_hdmi.c +6 -0
  }
  EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
 
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags)
+{
+	struct hdac_hdmi_priv *hdmi =

snd_soc_component_get_drvdata(component);

Quoted 25 lines
sound/soc/codecs/hdac_hdmi.c +5 -0
+	struct hdac_device *hdev = hdmi->hdev;
+
+	return device_link_add(consumer, &hdev->dev, flags); }
+EXPORT_SYMBOL_GPL(hdac_hdmi_device_link_add);
+
  static void hdac_hdmi_present_sense_all_pins(struct hdac_device *hdev,
  			struct hdac_hdmi_priv *hdmi, bool detect_pin_caps)
  {
(quoted diff) +0 -0

b/sound/soc/codecs/hdac_hdmi.h index 4fa2fc9..9239c6b 100644

sound/soc/codecs/hdac_hdmi.h +6 -0
@@ -7,4 +7,10 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int
 pcm,
 
  int hdac_hdmi_jack_port_init(struct snd_soc_component *component,
  			struct snd_soc_dapm_context *dapm);
+
+struct device_link *
+hdac_hdmi_device_link_add(struct device *consumer,
+			  struct snd_soc_component *component,
+			  u32 flags);
+
  #endif /* __HDAC_HDMI_H__ */