diff mbox

[v2,5/6] ALSA: hda - allow codecs to access the i915 pin/ELD callback

Message ID 20150908145835.GC2415@ares
State New
Headers show

Commit Message

Luis Henriques Sept. 8, 2015, 2:58 p.m. UTC
On Thu, Sep 03, 2015 at 01:55:05PM +0200, David Henningsson wrote:
...
> diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h
> index 51cd664..51b940c 100644
> --- a/sound/pci/hda/hda_intel.h
> +++ b/sound/pci/hda/hda_intel.h
> @@ -54,6 +54,7 @@ void haswell_set_bclk(struct hda_intel *hda);
>  int hda_i915_init(struct hda_intel *hda);
>  int hda_i915_init_bpo(struct hda_intel *hda);
>  int hda_i915_exit(struct hda_intel *hda);
> +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
>  #else
>  static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable)
>  {
> @@ -80,6 +81,10 @@ static inline int hda_i915_exit_bpo(void)
>  {
>         return 0;
>  }
> +static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *)

The above like fails to build in architectures that don't define
CONFIG_SND_HDA_I915 (for example ppc64el):

/tmp/kernel-henrix-wHmaOcAl/build/sound/pci/hda/hda_intel.h:84:64: error: parameter name omitted

Would it be OK for you if I slightly modify your patch to add the
parameter name?  (Full patch below).

Cheers,
--
Luís

From 36a85cb7921ede2ff65e25824a899b6ad0ce3638 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Thu, 3 Sep 2015 13:55:05 +0200
Subject: [PATCH] UBUNTU: SAUCE: ALSA: hda - allow codecs to access the i915
 pin/ELD callback

BugLink: http://bugs.launchpad.net/bugs/1490895

This lets the interested codec be notified when an i915 pin/ELD
event happens.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Brad Figg <brad.figg@canonical.com>
[ luis: fix build failure due to parameter name omission in function ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_i915.c  | 10 ++++++++++
 sound/pci/hda/hda_intel.h |  5 +++++
 2 files changed, 15 insertions(+)

Comments

David Henningsson Sept. 8, 2015, 4:21 p.m. UTC | #1
On 2015-09-08 16:58, Luis Henriques wrote:
> On Thu, Sep 03, 2015 at 01:55:05PM +0200, David Henningsson wrote:
> ...
>> diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h
>> index 51cd664..51b940c 100644
>> --- a/sound/pci/hda/hda_intel.h
>> +++ b/sound/pci/hda/hda_intel.h
>> @@ -54,6 +54,7 @@ void haswell_set_bclk(struct hda_intel *hda);
>>   int hda_i915_init(struct hda_intel *hda);
>>   int hda_i915_init_bpo(struct hda_intel *hda);
>>   int hda_i915_exit(struct hda_intel *hda);
>> +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
>>   #else
>>   static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable)
>>   {
>> @@ -80,6 +81,10 @@ static inline int hda_i915_exit_bpo(void)
>>   {
>>          return 0;
>>   }
>> +static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *)
>
> The above like fails to build in architectures that don't define
> CONFIG_SND_HDA_I915 (for example ppc64el):
>
> /tmp/kernel-henrix-wHmaOcAl/build/sound/pci/hda/hda_intel.h:84:64: error: parameter name omitted
>
> Would it be OK for you if I slightly modify your patch to add the
> parameter name?  (Full patch below).

Sure, please go ahead and change things so that the build succeeds, 
sorry for messing up.

Upstream has apparently done the same [1].

>
> Cheers,
> --
> Luís
>
>  From 36a85cb7921ede2ff65e25824a899b6ad0ce3638 Mon Sep 17 00:00:00 2001
> From: David Henningsson <david.henningsson@canonical.com>
> Date: Thu, 3 Sep 2015 13:55:05 +0200
> Subject: [PATCH] UBUNTU: SAUCE: ALSA: hda - allow codecs to access the i915
>   pin/ELD callback
>
> BugLink: http://bugs.launchpad.net/bugs/1490895
>
> This lets the interested codec be notified when an i915 pin/ELD
> event happens.
>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> Signed-off-by: Brad Figg <brad.figg@canonical.com>
> [ luis: fix build failure due to parameter name omission in function ]
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>   sound/pci/hda/hda_i915.c  | 10 ++++++++++
>   sound/pci/hda/hda_intel.h |  5 +++++
>   2 files changed, 15 insertions(+)
>
> diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
> index 27a21b2f013b..e999279e6007 100644
> --- a/sound/pci/hda/hda_i915.c
> +++ b/sound/pci/hda/hda_i915.c
> @@ -110,6 +110,16 @@ void haswell_set_bclk(struct hda_intel *hda)
>   	azx_writew(&hda->chip, EM5, bclk_n);
>   }
>
> +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *aops)
> +{
> +	if (WARN_ON(!hdac_acomp))
> +		return -ENODEV;
> +
> +	hdac_acomp->audio_ops = aops;
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier);
> +
>   static int hda_component_master_bind(struct device *dev)
>   {
>   	struct snd_card *card = dev_get_drvdata(dev);
> diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h
> index 51cd6647bf33..98a5c6c5b883 100644
> --- a/sound/pci/hda/hda_intel.h
> +++ b/sound/pci/hda/hda_intel.h
> @@ -54,6 +54,7 @@ void haswell_set_bclk(struct hda_intel *hda);
>   int hda_i915_init(struct hda_intel *hda);
>   int hda_i915_init_bpo(struct hda_intel *hda);
>   int hda_i915_exit(struct hda_intel *hda);
> +int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
>   #else
>   static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable)
>   {
> @@ -80,6 +81,10 @@ static inline int hda_i915_exit_bpo(void)
>   {
>          return 0;
>   }
> +static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *aops)
> +{
> +	return -ENODEV;
> +}
>   #endif
>
>   #endif
>
diff mbox

Patch

diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 27a21b2f013b..e999279e6007 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -110,6 +110,16 @@  void haswell_set_bclk(struct hda_intel *hda)
 	azx_writew(&hda->chip, EM5, bclk_n);
 }
 
+int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *aops)
+{
+	if (WARN_ON(!hdac_acomp))
+		return -ENODEV;
+
+	hdac_acomp->audio_ops = aops;
+	return 0;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier);
+
 static int hda_component_master_bind(struct device *dev)
 {
 	struct snd_card *card = dev_get_drvdata(dev);
diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h
index 51cd6647bf33..98a5c6c5b883 100644
--- a/sound/pci/hda/hda_intel.h
+++ b/sound/pci/hda/hda_intel.h
@@ -54,6 +54,7 @@  void haswell_set_bclk(struct hda_intel *hda);
 int hda_i915_init(struct hda_intel *hda);
 int hda_i915_init_bpo(struct hda_intel *hda);
 int hda_i915_exit(struct hda_intel *hda);
+int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
 #else
 static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable)
 {
@@ -80,6 +81,10 @@  static inline int hda_i915_exit_bpo(void)
 {
        return 0;
 }
+static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *aops)
+{
+	return -ENODEV;
+}
 #endif
 
 #endif