All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
@ 2014-02-15  9:17 Takashi Iwai
  2014-02-15  9:17 ` [PATCH 2/3] ALSA: hda/realtek - Allow NULL bus->pci Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Takashi Iwai @ 2014-02-15  9:17 UTC (permalink / raw)
  To: alsa-devel

The default parent device can be obtained directly via card object, so
we don't need to rely on pci->dev.parent.  Since there is no access to
pci_dev, we can reduce the inclusion of linux/pci.h, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/hda_beep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 0589b39cda6e..d8c437a94559 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -20,7 +20,6 @@
  */
 
 #include <linux/input.h>
-#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/export.h>
@@ -167,7 +166,7 @@ static int snd_hda_do_attach(struct hda_beep *beep)
 	input_dev->evbit[0] = BIT_MASK(EV_SND);
 	input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
 	input_dev->event = snd_hda_beep_event;
-	input_dev->dev.parent = &codec->bus->pci->dev;
+	input_dev->dev.parent = codec->bus->card->dev;
 	input_set_drvdata(input_dev, beep);
 
 	err = input_register_device(input_dev);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] ALSA: hda/realtek - Allow NULL bus->pci
  2014-02-15  9:17 [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
@ 2014-02-15  9:17 ` Takashi Iwai
  2014-02-15  9:17 ` [PATCH 3/3] ALSA: hda - Remove superfluous inclusion of linux/pci.h Takashi Iwai
  2014-02-15  9:22 ` [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
  2 siblings, 0 replies; 14+ messages in thread
From: Takashi Iwai @ 2014-02-15  9:17 UTC (permalink / raw)
  To: alsa-devel

Realtek codec driver contains some codes referring to the PCI
subdevice IDs, but most of them are optional, typically for checking
the codec name variants.  Add NULL checks appropriately so that it can
work without PCI assignment.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_realtek.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 86857b674302..c5405f319cfe 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -395,6 +395,8 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
 		goto do_sku;
 	}
 
+	if (!codec->bus->pci)
+		return -1;
 	ass = codec->subsystem_id & 0xffff;
 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
 		goto do_sku;
@@ -483,7 +485,8 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
 	}
 
 	ass = codec->subsystem_id & 0xffff;
-	if ((ass != codec->bus->pci->subsystem_device) && (ass & 1))
+	if (codec->bus->pci &&
+	    ass != codec->bus->pci->subsystem_device && (ass & 1))
 		goto do_sku;
 
 	/* invalid SSID, check the special NID pin defcfg instead */
@@ -966,6 +969,8 @@ static int alc_codec_rename_from_preset(struct hda_codec *codec)
 			return alc_codec_rename(codec, p->name);
 	}
 
+	if (!codec->bus->pci)
+		return 0;
 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
 		if (q->codec_vendor_id != codec->vendor_id)
 			continue;
@@ -4502,13 +4507,15 @@ static int patch_alc269(struct hda_codec *codec)
 		spec->codec_variant = ALC269_TYPE_ALC269VA;
 		switch (alc_get_coef0(codec) & 0x00f0) {
 		case 0x0010:
-			if (codec->bus->pci->subsystem_vendor == 0x1025 &&
+			if (codec->bus->pci &&
+			    codec->bus->pci->subsystem_vendor == 0x1025 &&
 			    spec->cdefine.platform_type == 1)
 				err = alc_codec_rename(codec, "ALC271X");
 			spec->codec_variant = ALC269_TYPE_ALC269VB;
 			break;
 		case 0x0020:
-			if (codec->bus->pci->subsystem_vendor == 0x17aa &&
+			if (codec->bus->pci &&
+			    codec->bus->pci->subsystem_vendor == 0x17aa &&
 			    codec->bus->pci->subsystem_device == 0x21f3)
 				err = alc_codec_rename(codec, "ALC3202");
 			spec->codec_variant = ALC269_TYPE_ALC269VC;
@@ -5309,7 +5316,7 @@ static int patch_alc662(struct hda_codec *codec)
 		spec->gen.beep_nid = 0x01;
 
 	if ((alc_get_coef0(codec) & (1 << 14)) &&
-	    codec->bus->pci->subsystem_vendor == 0x1025 &&
+	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
 	    spec->cdefine.platform_type == 1) {
 		err = alc_codec_rename(codec, "ALC272X");
 		if (err < 0)
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] ALSA: hda - Remove superfluous inclusion of linux/pci.h
  2014-02-15  9:17 [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
  2014-02-15  9:17 ` [PATCH 2/3] ALSA: hda/realtek - Allow NULL bus->pci Takashi Iwai
@ 2014-02-15  9:17 ` Takashi Iwai
  2014-02-15  9:22 ` [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
  2 siblings, 0 replies; 14+ messages in thread
From: Takashi Iwai @ 2014-02-15  9:17 UTC (permalink / raw)
  To: alsa-devel

Some codec drivers still have it since using PCI_VENDOR_ID_*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/hda_codec.c      | 1 -
 sound/pci/hda/hda_hwdep.c      | 1 -
 sound/pci/hda/patch_analog.c   | 1 -
 sound/pci/hda/patch_ca0110.c   | 1 -
 sound/pci/hda/patch_ca0132.c   | 1 -
 sound/pci/hda/patch_cirrus.c   | 1 -
 sound/pci/hda/patch_cmedia.c   | 1 -
 sound/pci/hda/patch_conexant.c | 1 -
 8 files changed, 8 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index dafcf82139e2..4be322b0d745 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/async.h>
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 72d8389fb399..53c961992d0c 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -20,7 +20,6 @@
 
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/compat.h>
 #include <linux/mutex.h>
 #include <linux/ctype.h>
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index df3652ad15ef..1eb00a6d3ef5 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -21,7 +21,6 @@
 
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/module.h>
 
 #include <sound/core.h>
diff --git a/sound/pci/hda/patch_ca0110.c b/sound/pci/hda/patch_ca0110.c
index 30b3a4bc06ee..5e65999e0d8e 100644
--- a/sound/pci/hda/patch_ca0110.c
+++ b/sound/pci/hda/patch_ca0110.c
@@ -20,7 +20,6 @@
 
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include "hda_codec.h"
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 54d14793725a..4c5132cdb0cf 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -24,7 +24,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/firmware.h>
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index fc492ac24caa..387f0b551889 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -20,7 +20,6 @@
 
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include <sound/tlv.h>
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index 139ef301c914..d782292b1ba9 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -23,7 +23,6 @@
 
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include "hda_codec.h"
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 59e3aeac2233..13a416060eb8 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include <sound/jack.h>
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-15  9:17 [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
  2014-02-15  9:17 ` [PATCH 2/3] ALSA: hda/realtek - Allow NULL bus->pci Takashi Iwai
  2014-02-15  9:17 ` [PATCH 3/3] ALSA: hda - Remove superfluous inclusion of linux/pci.h Takashi Iwai
@ 2014-02-15  9:22 ` Takashi Iwai
  2014-02-18 18:04   ` Stephen Warren
  2 siblings, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2014-02-15  9:22 UTC (permalink / raw)
  To: alsa-devel; +Cc: Dylan Reid, Stephen Warren

At Sat, 15 Feb 2014 10:17:33 +0100,
Takashi Iwai wrote:
> 
> The default parent device can be obtained directly via card object, so
> we don't need to rely on pci->dev.parent.  Since there is no access to
> pci_dev, we can reduce the inclusion of linux/pci.h, too.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

I forgot the cover page: these tree patches are trivial cleanups of
hda-codec drivers (not the controller) to work without PCI device
assignment. The idea was triggered by Dylan's question.


Takashi

> ---
>  sound/pci/hda/hda_beep.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
> index 0589b39cda6e..d8c437a94559 100644
> --- a/sound/pci/hda/hda_beep.c
> +++ b/sound/pci/hda/hda_beep.c
> @@ -20,7 +20,6 @@
>   */
>  
>  #include <linux/input.h>
> -#include <linux/pci.h>
>  #include <linux/slab.h>
>  #include <linux/workqueue.h>
>  #include <linux/export.h>
> @@ -167,7 +166,7 @@ static int snd_hda_do_attach(struct hda_beep *beep)
>  	input_dev->evbit[0] = BIT_MASK(EV_SND);
>  	input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
>  	input_dev->event = snd_hda_beep_event;
> -	input_dev->dev.parent = &codec->bus->pci->dev;
> +	input_dev->dev.parent = codec->bus->card->dev;
>  	input_set_drvdata(input_dev, beep);
>  
>  	err = input_register_device(input_dev);
> -- 
> 1.8.5.2
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-15  9:22 ` [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
@ 2014-02-18 18:04   ` Stephen Warren
  2014-02-18 18:20     ` Dylan Reid
  2014-02-19  8:33     ` Takashi Iwai
  0 siblings, 2 replies; 14+ messages in thread
From: Stephen Warren @ 2014-02-18 18:04 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel; +Cc: Dylan Reid

On 02/15/2014 02:22 AM, Takashi Iwai wrote:
> At Sat, 15 Feb 2014 10:17:33 +0100,
> Takashi Iwai wrote:
>>
>> The default parent device can be obtained directly via card object, so
>> we don't need to rely on pci->dev.parent.  Since there is no access to
>> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>>
>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> 
> I forgot the cover page: these tree patches are trivial cleanups of
> hda-codec drivers (not the controller) to work without PCI device
> assignment. The idea was triggered by Dylan's question.

The series seems fine to me, so briefly,
Reviewed-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-18 18:04   ` Stephen Warren
@ 2014-02-18 18:20     ` Dylan Reid
  2014-02-19  8:33     ` Takashi Iwai
  1 sibling, 0 replies; 14+ messages in thread
From: Dylan Reid @ 2014-02-18 18:20 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Takashi Iwai, alsa-devel

On Tue, Feb 18, 2014 at 10:04 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
>> At Sat, 15 Feb 2014 10:17:33 +0100,
>> Takashi Iwai wrote:
>>>
>>> The default parent device can be obtained directly via card object, so
>>> we don't need to rely on pci->dev.parent.  Since there is no access to
>>> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>>>
>>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>>
>> I forgot the cover page: these tree patches are trivial cleanups of
>> hda-codec drivers (not the controller) to work without PCI device
>> assignment. The idea was triggered by Dylan's question.
>
> The series seems fine to me, so briefly,
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>

Thanks Takashi,

I tested this series on a Haswell and IvyBridge system. Looks good to
me as well.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-18 18:04   ` Stephen Warren
  2014-02-18 18:20     ` Dylan Reid
@ 2014-02-19  8:33     ` Takashi Iwai
  2014-02-19 15:16       ` Dylan Reid
  1 sibling, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2014-02-19  8:33 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, Dylan Reid

At Tue, 18 Feb 2014 11:04:19 -0700,
Stephen Warren wrote:
> 
> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
> > At Sat, 15 Feb 2014 10:17:33 +0100,
> > Takashi Iwai wrote:
> >>
> >> The default parent device can be obtained directly via card object, so
> >> we don't need to rely on pci->dev.parent.  Since there is no access to
> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
> >>
> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > 
> > I forgot the cover page: these tree patches are trivial cleanups of
> > hda-codec drivers (not the controller) to work without PCI device
> > assignment. The idea was triggered by Dylan's question.
> 
> The series seems fine to me, so briefly,
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Thanks.  Any chance to work on / submit other changes for Tegra
HD-audio support?

As already mentioned, I think a cleaner way would be to write
hda_platform.c instead of hacking hda_intel.c with ifdefs.
Some code in hda_intel.c (e.g. bus ops and PCM callbacks) can be moved
out, either as a new helper module or just merging into snd-hda-codec
helper module, so that they can be used by both hda_intel.c and
hda_platform.c.

Ideally, we may rename hda_intel.c with hda_pci.c, but I'm afraid this
would bring too many regressions for module options.


Takashi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-19  8:33     ` Takashi Iwai
@ 2014-02-19 15:16       ` Dylan Reid
  2014-02-27 12:03         ` Takashi Iwai
  0 siblings, 1 reply; 14+ messages in thread
From: Dylan Reid @ 2014-02-19 15:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Stephen Warren

On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Tue, 18 Feb 2014 11:04:19 -0700,
> Stephen Warren wrote:
>>
>> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
>> > At Sat, 15 Feb 2014 10:17:33 +0100,
>> > Takashi Iwai wrote:
>> >>
>> >> The default parent device can be obtained directly via card object, so
>> >> we don't need to rely on pci->dev.parent.  Since there is no access to
>> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>> >>
>> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> >
>> > I forgot the cover page: these tree patches are trivial cleanups of
>> > hda-codec drivers (not the controller) to work without PCI device
>> > assignment. The idea was triggered by Dylan's question.
>>
>> The series seems fine to me, so briefly,
>> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>
> Thanks.  Any chance to work on / submit other changes for Tegra
> HD-audio support?

That's the plan, hopefully I'll be able to find time to throw together
an RFC by the end of the week.

>
> As already mentioned, I think a cleaner way would be to write
> hda_platform.c instead of hacking hda_intel.c with ifdefs.
> Some code in hda_intel.c (e.g. bus ops and PCM callbacks) can be moved
> out, either as a new helper module or just merging into snd-hda-codec
> helper module, so that they can be used by both hda_intel.c and
> hda_platform.c.

That sounds like a good idea.  There aren't a lot of differences,
mostly isolated to init and suspend/resume.  That should be easy to
put in hda_platform.

Thanks,

Dylan

>
> Ideally, we may rename hda_intel.c with hda_pci.c, but I'm afraid this
> would bring too many regressions for module options.
>
>
> Takashi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-19 15:16       ` Dylan Reid
@ 2014-02-27 12:03         ` Takashi Iwai
  2014-02-27 16:44           ` Dylan Reid
  0 siblings, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2014-02-27 12:03 UTC (permalink / raw)
  To: Dylan Reid; +Cc: alsa-devel, Stephen Warren

At Wed, 19 Feb 2014 07:16:38 -0800,
Dylan Reid wrote:
> 
> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Tue, 18 Feb 2014 11:04:19 -0700,
> > Stephen Warren wrote:
> >>
> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
> >> > Takashi Iwai wrote:
> >> >>
> >> >> The default parent device can be obtained directly via card object, so
> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
> >> >>
> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >> >
> >> > I forgot the cover page: these tree patches are trivial cleanups of
> >> > hda-codec drivers (not the controller) to work without PCI device
> >> > assignment. The idea was triggered by Dylan's question.
> >>
> >> The series seems fine to me, so briefly,
> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> >
> > Thanks.  Any chance to work on / submit other changes for Tegra
> > HD-audio support?
> 
> That's the plan, hopefully I'll be able to find time to throw together
> an RFC by the end of the week.

Since there was no patch appearing yet, I merged my latest development
branch to for-next branch, which includes lots of changes in
hda_intel.c and hda_codec.c.  If any, please rebase your patches to
it.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-27 12:03         ` Takashi Iwai
@ 2014-02-27 16:44           ` Dylan Reid
  2014-02-27 16:57             ` Takashi Iwai
  0 siblings, 1 reply; 14+ messages in thread
From: Dylan Reid @ 2014-02-27 16:44 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Stephen Warren

On Thu, Feb 27, 2014 at 4:03 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Wed, 19 Feb 2014 07:16:38 -0800,
> Dylan Reid wrote:
>>
>> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> > At Tue, 18 Feb 2014 11:04:19 -0700,
>> > Stephen Warren wrote:
>> >>
>> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
>> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
>> >> > Takashi Iwai wrote:
>> >> >>
>> >> >> The default parent device can be obtained directly via card object, so
>> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
>> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>> >> >>
>> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> >> >
>> >> > I forgot the cover page: these tree patches are trivial cleanups of
>> >> > hda-codec drivers (not the controller) to work without PCI device
>> >> > assignment. The idea was triggered by Dylan's question.
>> >>
>> >> The series seems fine to me, so briefly,
>> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> >
>> > Thanks.  Any chance to work on / submit other changes for Tegra
>> > HD-audio support?
>>
>> That's the plan, hopefully I'll be able to find time to throw together
>> an RFC by the end of the week.
>
> Since there was no patch appearing yet, I merged my latest development
> branch to for-next branch, which includes lots of changes in
> hda_intel.c and hda_codec.c.  If any, please rebase your patches to
> it.

Thanks for the heads up.  I've got a series that is almost ready, I'm
still trying to tease part of the build out from under CONFIG_PCI in
the hda makefile.  I'll try to button that up and get a the whole lot
rebased on top of the for-next branch.

Dylan

>
>
> thanks,
>
> Takashi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-27 16:44           ` Dylan Reid
@ 2014-02-27 16:57             ` Takashi Iwai
  2014-02-27 17:32               ` Dylan Reid
  0 siblings, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2014-02-27 16:57 UTC (permalink / raw)
  To: Dylan Reid; +Cc: alsa-devel, Stephen Warren

At Thu, 27 Feb 2014 08:44:48 -0800,
Dylan Reid wrote:
> 
> On Thu, Feb 27, 2014 at 4:03 AM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Wed, 19 Feb 2014 07:16:38 -0800,
> > Dylan Reid wrote:
> >>
> >> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >> > At Tue, 18 Feb 2014 11:04:19 -0700,
> >> > Stephen Warren wrote:
> >> >>
> >> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
> >> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
> >> >> > Takashi Iwai wrote:
> >> >> >>
> >> >> >> The default parent device can be obtained directly via card object, so
> >> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
> >> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
> >> >> >>
> >> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >> >> >
> >> >> > I forgot the cover page: these tree patches are trivial cleanups of
> >> >> > hda-codec drivers (not the controller) to work without PCI device
> >> >> > assignment. The idea was triggered by Dylan's question.
> >> >>
> >> >> The series seems fine to me, so briefly,
> >> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> >> >
> >> > Thanks.  Any chance to work on / submit other changes for Tegra
> >> > HD-audio support?
> >>
> >> That's the plan, hopefully I'll be able to find time to throw together
> >> an RFC by the end of the week.
> >
> > Since there was no patch appearing yet, I merged my latest development
> > branch to for-next branch, which includes lots of changes in
> > hda_intel.c and hda_codec.c.  If any, please rebase your patches to
> > it.
> 
> Thanks for the heads up.  I've got a series that is almost ready, I'm
> still trying to tease part of the build out from under CONFIG_PCI in
> the hda makefile.

I don't think we have a dependency on CONFIG_PCI in Makefile.  Kconfig
has a dependency, but it can be easily reduced by a patch like below.

Of course, it'd be better to move the whole hda directory out of pci,
but we can do it later at any time once via git.

>  I'll try to button that up and get a the whole lot
> rebased on top of the for-next branch.

Thanks!


Takashi

---
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 8756c8e32922..56d93bf45025 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -578,8 +578,6 @@ config SND_FM801_TEA575X_BOOL
 	  FM801 chip with a TEA5757 tuner (MediaForte SF256-PCS, SF256-PCP and
 	  SF64-PCR) into the snd-fm801 driver.
 
-source "sound/pci/hda/Kconfig"
-
 config SND_HDSP
 	tristate "RME Hammerfall DSP Audio"
 	select FW_LOADER
@@ -889,3 +887,5 @@ config SND_YMFPCI
 	  will be called snd-ymfpci.
 
 endif	# SND_PCI
+
+source "sound/pci/hda/Kconfig"
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index f2032dd7e35e..6fc769da6949 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -1,5 +1,6 @@
 menuconfig SND_HDA_INTEL
 	tristate "Intel HD Audio"
+	depends on (PCI || SOMETHING_YOU_WANT)
 	select SND_PCM
 	select SND_VMASTER
 	select SND_KCTL_JACK

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-27 16:57             ` Takashi Iwai
@ 2014-02-27 17:32               ` Dylan Reid
  2014-02-27 20:10                 ` Takashi Iwai
  0 siblings, 1 reply; 14+ messages in thread
From: Dylan Reid @ 2014-02-27 17:32 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Stephen Warren

On Thu, Feb 27, 2014 at 8:57 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Thu, 27 Feb 2014 08:44:48 -0800,
> Dylan Reid wrote:
>>
>> On Thu, Feb 27, 2014 at 4:03 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> > At Wed, 19 Feb 2014 07:16:38 -0800,
>> > Dylan Reid wrote:
>> >>
>> >> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> >> > At Tue, 18 Feb 2014 11:04:19 -0700,
>> >> > Stephen Warren wrote:
>> >> >>
>> >> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
>> >> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
>> >> >> > Takashi Iwai wrote:
>> >> >> >>
>> >> >> >> The default parent device can be obtained directly via card object, so
>> >> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
>> >> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>> >> >> >>
>> >> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> >> >> >
>> >> >> > I forgot the cover page: these tree patches are trivial cleanups of
>> >> >> > hda-codec drivers (not the controller) to work without PCI device
>> >> >> > assignment. The idea was triggered by Dylan's question.
>> >> >>
>> >> >> The series seems fine to me, so briefly,
>> >> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> >> >
>> >> > Thanks.  Any chance to work on / submit other changes for Tegra
>> >> > HD-audio support?
>> >>
>> >> That's the plan, hopefully I'll be able to find time to throw together
>> >> an RFC by the end of the week.
>> >
>> > Since there was no patch appearing yet, I merged my latest development
>> > branch to for-next branch, which includes lots of changes in
>> > hda_intel.c and hda_codec.c.  If any, please rebase your patches to
>> > it.
>>
>> Thanks for the heads up.  I've got a series that is almost ready, I'm
>> still trying to tease part of the build out from under CONFIG_PCI in
>> the hda makefile.
>
> I don't think we have a dependency on CONFIG_PCI in Makefile.  Kconfig
> has a dependency, but it can be easily reduced by a patch like below.

Sounds good.  I was looking at re-using some of the config options
(HDMI codec and power save) for the platform driver as well.  Maybe
something like the following.  SND_HDA would build the helper module
and hda-codec that are used by both hda_intel and a platform driver.

>
> Of course, it'd be better to move the whole hda directory out of pci,
> but we can do it later at any time once via git.

I can add that to the end of the series or it can move it whenever is
convenient, not sure how many pending patch sets it would disrupt.

Thanks!

Dylan

>
>>  I'll try to button that up and get a the whole lot
>> rebased on top of the for-next branch.
>
> Thanks!
>
>
> Takashi
>
> ---
> diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
> index 8756c8e32922..56d93bf45025 100644
> --- a/sound/pci/Kconfig
> +++ b/sound/pci/Kconfig
> @@ -578,8 +578,6 @@ config SND_FM801_TEA575X_BOOL
>           FM801 chip with a TEA5757 tuner (MediaForte SF256-PCS, SF256-PCP and
>           SF64-PCR) into the snd-fm801 driver.
>
> -source "sound/pci/hda/Kconfig"
> -
>  config SND_HDSP
>         tristate "RME Hammerfall DSP Audio"
>         select FW_LOADER
> @@ -889,3 +887,5 @@ config SND_YMFPCI
>           will be called snd-ymfpci.
>
>  endif  # SND_PCI
> +
> +source "sound/pci/hda/Kconfig"
> diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
> index f2032dd7e35e..6fc769da6949 100644
> --- a/sound/pci/hda/Kconfig
> +++ b/sound/pci/hda/Kconfig
> @@ -1,5 +1,6 @@
>  menuconfig SND_HDA_INTEL
>         tristate "Intel HD Audio"
> +       depends on (PCI || SOMETHING_YOU_WANT)
>         select SND_PCM
>         select SND_VMASTER
>         select SND_KCTL_JACK

---
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 8756c8e..56d93bf 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -578,8 +578,6 @@ config SND_FM801_TEA575X_BOOL
          FM801 chip with a TEA5757 tuner (MediaForte SF256-PCS, SF256-PCP and
          SF64-PCR) into the snd-fm801 driver.

-source "sound/pci/hda/Kconfig"
-
 config SND_HDSP
        tristate "RME Hammerfall DSP Audio"
        select FW_LOADER
@@ -889,3 +887,5 @@ config SND_YMFPCI
          will be called snd-ymfpci.

 endif  # SND_PCI
+
+source "sound/pci/hda/Kconfig"
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index 0e53634..d983d24 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -1,5 +1,5 @@
-menuconfig SND_HDA_INTEL
-       tristate "Intel HD Audio"
+menuconfig SND_HDA
+       tristate "HD Audio"
        select SND_PCM
        select SND_VMASTER
        select SND_KCTL_JACK
@@ -10,9 +10,55 @@ menuconfig SND_HDA_INTEL
          This option enables the HD-audio controller.  Don't forget
          to choose the appropriate codec options below.

+config SND_HDA_INTEL
+       tristate "Intel HD Audio"
+       depends on SND_PCI
+       select SND_HDA
+       help
+         Say Y here to support standard PC HDA over PCI
+
+         This options enables support for HD Audio via PCI present on
+         most PCs.
+
          To compile this driver as a module, choose M here: the module
          will be called snd-hda-intel.

+config SND_HDA_TEGRA
+       tristate "Tegra HD Audio"
+       select SND_HDA
+       help
+         Say Y here to support the HDA controller present in Nvidia
+         Tegra SoCs
+
+         This options enables support for the HD Audio controller
+         present in some Nvidia Tegra SoCs, used to communicate audio
+         to the HDMI output.
+
+         To compile this driver as a module, choose M here: the module
+         will be called snd-hda-tegra.
+
+if SND_HDA_INTEL || SND_HDA_TEGRA
+
+config SND_HDA_CODEC_HDMI
+       tristate "Build HDMI/DisplayPort HD-audio codec support"
+       help
+         Say Y or M here to include HDMI and DisplayPort HD-audio codec
+         support in snd-hda-intel or tegra driver.  This includes all
+         AMD/ATI, Intel and Nvidia HDMI/DisplayPort codecs.
+
+comment "Set to Y if you want auto-loading the codec driver"
+       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_HDMI=m
+
+config SND_HDA_POWER_SAVE_DEFAULT
+       int "Default time-out for HD-audio power-save mode"
+       depends on PM
+       default 0
+       help
+         The default time-out value in seconds for HD-audio automatic
+         power-save mode.  0 means to disable the power-save mode.
+
+endif
+
 if SND_HDA_INTEL

 config SND_HDA_DSP_LOADER
@@ -126,16 +172,6 @@ config SND_HDA_CODEC_VIA
 comment "Set to Y if you want auto-loading the codec driver"
        depends on SND_HDA_INTEL=y && SND_HDA_CODEC_VIA=m

-config SND_HDA_CODEC_HDMI
-       tristate "Build HDMI/DisplayPort HD-audio codec support"
-       help
-         Say Y or M here to include HDMI and DisplayPort HD-audio codec
-         support in snd-hda-intel driver.  This includes all AMD/ATI,
-         Intel and Nvidia HDMI/DisplayPort codecs.
-
-comment "Set to Y if you want auto-loading the codec driver"
-       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_HDMI=m
-
 config SND_HDA_I915
        bool
        default y
@@ -220,12 +256,4 @@ config SND_HDA_GENERIC
 comment "Set to Y if you want auto-loading the codec driver"
        depends on SND_HDA_INTEL=y && SND_HDA_GENERIC=m

-config SND_HDA_POWER_SAVE_DEFAULT
-       int "Default time-out for HD-audio power-save mode"
-       depends on PM
-       default 0
-       help
-         The default time-out value in seconds for HD-audio automatic
-         power-save mode.  0 means to disable the power-save mode.
-
 endif
diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile
index c5fa8e7..a964b6e 100644
--- a/sound/pci/hda/Makefile
+++ b/sound/pci/hda/Makefile
@@ -1,4 +1,6 @@
-snd-hda-intel-objs := hda_shared.o hda_intel.o
+snd-hda-intel-objs := hda_intel.o
+snd-hda-shared-objs := hda_shared.o
+snd-hda-tegra-objs := hda_tegra.o
 # for haswell power well
 snd-hda-intel-$(CONFIG_SND_HDA_I915) +=        hda_i915.o

@@ -25,7 +27,8 @@ snd-hda-codec-via-objs :=     patch_via.o
 snd-hda-codec-hdmi-objs :=     patch_hdmi.o hda_eld.o

 # common driver
-obj-$(CONFIG_SND_HDA_INTEL) := snd-hda-codec.o
+obj-$(CONFIG_SND_HDA) := snd-hda-codec.o
+obj-$(CONFIG_SND_HDA) += snd-hda-shared.o

 # codec drivers
 obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o
@@ -45,3 +48,4 @@ obj-$(CONFIG_SND_HDA_CODEC_HDMI) += snd-hda-codec-hdmi.o
 # otherwise the codec patches won't be hooked before the PCI probe
 # when built in kernel
 obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
+obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-27 17:32               ` Dylan Reid
@ 2014-02-27 20:10                 ` Takashi Iwai
  2014-02-27 20:41                   ` Dylan Reid
  0 siblings, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2014-02-27 20:10 UTC (permalink / raw)
  To: Dylan Reid; +Cc: alsa-devel, Stephen Warren

At Thu, 27 Feb 2014 09:32:21 -0800,
Dylan Reid wrote:
> 
> On Thu, Feb 27, 2014 at 8:57 AM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Thu, 27 Feb 2014 08:44:48 -0800,
> > Dylan Reid wrote:
> >>
> >> On Thu, Feb 27, 2014 at 4:03 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >> > At Wed, 19 Feb 2014 07:16:38 -0800,
> >> > Dylan Reid wrote:
> >> >>
> >> >> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >> >> > At Tue, 18 Feb 2014 11:04:19 -0700,
> >> >> > Stephen Warren wrote:
> >> >> >>
> >> >> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
> >> >> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
> >> >> >> > Takashi Iwai wrote:
> >> >> >> >>
> >> >> >> >> The default parent device can be obtained directly via card object, so
> >> >> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
> >> >> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
> >> >> >> >>
> >> >> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >> >> >> >
> >> >> >> > I forgot the cover page: these tree patches are trivial cleanups of
> >> >> >> > hda-codec drivers (not the controller) to work without PCI device
> >> >> >> > assignment. The idea was triggered by Dylan's question.
> >> >> >>
> >> >> >> The series seems fine to me, so briefly,
> >> >> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> >> >> >
> >> >> > Thanks.  Any chance to work on / submit other changes for Tegra
> >> >> > HD-audio support?
> >> >>
> >> >> That's the plan, hopefully I'll be able to find time to throw together
> >> >> an RFC by the end of the week.
> >> >
> >> > Since there was no patch appearing yet, I merged my latest development
> >> > branch to for-next branch, which includes lots of changes in
> >> > hda_intel.c and hda_codec.c.  If any, please rebase your patches to
> >> > it.
> >>
> >> Thanks for the heads up.  I've got a series that is almost ready, I'm
> >> still trying to tease part of the build out from under CONFIG_PCI in
> >> the hda makefile.
> >
> > I don't think we have a dependency on CONFIG_PCI in Makefile.  Kconfig
> > has a dependency, but it can be easily reduced by a patch like below.
> 
> Sounds good.  I was looking at re-using some of the config options
> (HDMI codec and power save) for the platform driver as well.  Maybe
> something like the following.  SND_HDA would build the helper module
> and hda-codec that are used by both hda_intel and a platform driver.

I think we can simply allow building all HD-audio codec drivers when
CONFIG_SND_HDA is set.  They are basically independent from the
controller type.  There are also other selectable items like hwdep
support.  The diff in sound/pci/hda would be like below.


Takashi

--
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index f2032dd7e35e..4cbf46e59d1c 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -1,8 +1,15 @@
-menuconfig SND_HDA_INTEL
-	tristate "Intel HD Audio"
+menu "HD-Audio"
+
+config SND_HDA
+	tristate
 	select SND_PCM
 	select SND_VMASTER
 	select SND_KCTL_JACK
+
+config SND_HDA_INTEL
+	tristate "HD Audio PCI"
+	depends on SND_PCI
+	select SND_HDA
 	help
 	  Say Y here to include support for Intel "High Definition
 	  Audio" (Azalia) and its compatible devices.
@@ -13,7 +20,21 @@ menuconfig SND_HDA_INTEL
 	  To compile this driver as a module, choose M here: the module
 	  will be called snd-hda-intel.
 
-if SND_HDA_INTEL
+config SND_HDA_TEGRA
+       tristate "Tegra HD Audio"
+       select SND_HDA
+       help
+         Say Y here to support the HDA controller present in Nvidia
+         Tegra SoCs
+
+         This options enables support for the HD Audio controller
+         present in some Nvidia Tegra SoCs, used to communicate audio
+         to the HDMI output.
+
+         To compile this driver as a module, choose M here: the module
+         will be called snd-hda-tegra.
+
+if SND_HDA
 
 config SND_HDA_DSP_LOADER
 	bool
@@ -49,7 +70,7 @@ config SND_HDA_RECONFIG
 
 config SND_HDA_INPUT_BEEP
 	bool "Support digital beep via input layer"
-	depends on INPUT=y || INPUT=SND_HDA_INTEL
+	depends on INPUT=y || INPUT=SND_HDA
 	help
 	  Say Y here to build a digital beep interface for HD-audio
 	  driver. This interface is used to generate digital beeps.
@@ -90,7 +111,7 @@ config SND_HDA_CODEC_REALTEK
 	  snd-hda-intel driver, such as ALC880.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_REALTEK=m
+	depends on SND_HDA=y && SND_HDA_CODEC_REALTEK=m
 
 config SND_HDA_CODEC_ANALOG
 	tristate "Build Analog Device HD-audio codec support"
@@ -100,7 +121,7 @@ config SND_HDA_CODEC_ANALOG
 	  snd-hda-intel driver, such as AD1986A.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_ANALOG=m
+	depends on SND_HDA=y && SND_HDA_CODEC_ANALOG=m
 
 config SND_HDA_CODEC_SIGMATEL
 	tristate "Build IDT/Sigmatel HD-audio codec support"
@@ -110,7 +131,7 @@ config SND_HDA_CODEC_SIGMATEL
 	  snd-hda-intel driver, such as STAC9200.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_SIGMATEL=m
+	depends on SND_HDA=y && SND_HDA_CODEC_SIGMATEL=m
 
 config SND_HDA_CODEC_VIA
 	tristate "Build VIA HD-audio codec support"
@@ -120,7 +141,7 @@ config SND_HDA_CODEC_VIA
 	  snd-hda-intel driver, such as VT1708.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_VIA=m
+	depends on SND_HDA=y && SND_HDA_CODEC_VIA=m
 
 config SND_HDA_CODEC_HDMI
 	tristate "Build HDMI/DisplayPort HD-audio codec support"
@@ -130,7 +151,7 @@ config SND_HDA_CODEC_HDMI
 	  Intel and Nvidia HDMI/DisplayPort codecs.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_HDMI=m
+	depends on SND_HDA=y && SND_HDA_CODEC_HDMI=m
 
 config SND_HDA_I915
 	bool
@@ -145,7 +166,7 @@ config SND_HDA_CODEC_CIRRUS
 	  snd-hda-intel driver, such as CS4206.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CIRRUS=m
+	depends on SND_HDA=y && SND_HDA_CODEC_CIRRUS=m
 
 config SND_HDA_CODEC_CONEXANT
 	tristate "Build Conexant HD-audio codec support"
@@ -155,7 +176,7 @@ config SND_HDA_CODEC_CONEXANT
 	  snd-hda-intel driver, such as CX20549.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CONEXANT=m
+	depends on SND_HDA=y && SND_HDA_CODEC_CONEXANT=m
 
 config SND_HDA_CODEC_CA0110
 	tristate "Build Creative CA0110-IBG codec support"
@@ -165,7 +186,7 @@ config SND_HDA_CODEC_CA0110
 	  snd-hda-intel driver, found on some Creative X-Fi cards.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CA0110=m
+	depends on SND_HDA=y && SND_HDA_CODEC_CA0110=m
 
 config SND_HDA_CODEC_CA0132
 	tristate "Build Creative CA0132 codec support"
@@ -174,7 +195,7 @@ config SND_HDA_CODEC_CA0132
 	  snd-hda-intel driver.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CA0132=m
+	depends on SND_HDA=y && SND_HDA_CODEC_CA0132=m
 
 config SND_HDA_CODEC_CA0132_DSP
 	bool "Support new DSP code for CA0132 codec"
@@ -196,7 +217,7 @@ config SND_HDA_CODEC_CMEDIA
 	  snd-hda-intel driver, such as CMI9880.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CMEDIA=m
+	depends on SND_HDA=y && SND_HDA_CODEC_CMEDIA=m
 
 config SND_HDA_CODEC_SI3054
 	tristate "Build Silicon Labs 3054 HD-modem codec support"
@@ -205,7 +226,7 @@ config SND_HDA_CODEC_SI3054
 	  (and compatibles) support in snd-hda-intel driver.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_CODEC_SI3054=m
+	depends on SND_HDA=y && SND_HDA_CODEC_SI3054=m
 
 config SND_HDA_GENERIC
 	tristate "Enable generic HD-audio codec parser"
@@ -214,7 +235,7 @@ config SND_HDA_GENERIC
 	  in snd-hda-intel driver.
 
 comment "Set to Y if you want auto-loading the codec driver"
-	depends on SND_HDA_INTEL=y && SND_HDA_GENERIC=m
+	depends on SND_HDA=y && SND_HDA_GENERIC=m
 
 config SND_HDA_POWER_SAVE_DEFAULT
 	int "Default time-out for HD-audio power-save mode"
@@ -225,3 +246,5 @@ config SND_HDA_POWER_SAVE_DEFAULT
 	  power-save mode.  0 means to disable the power-save mode.
 
 endif
+
+endmenu

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c
  2014-02-27 20:10                 ` Takashi Iwai
@ 2014-02-27 20:41                   ` Dylan Reid
  0 siblings, 0 replies; 14+ messages in thread
From: Dylan Reid @ 2014-02-27 20:41 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Stephen Warren

On Thu, Feb 27, 2014 at 12:10 PM, Takashi Iwai <tiwai@suse.de> wrote:
> At Thu, 27 Feb 2014 09:32:21 -0800,
> Dylan Reid wrote:
>>
>> On Thu, Feb 27, 2014 at 8:57 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> > At Thu, 27 Feb 2014 08:44:48 -0800,
>> > Dylan Reid wrote:
>> >>
>> >> On Thu, Feb 27, 2014 at 4:03 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> >> > At Wed, 19 Feb 2014 07:16:38 -0800,
>> >> > Dylan Reid wrote:
>> >> >>
>> >> >> On Wed, Feb 19, 2014 at 12:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
>> >> >> > At Tue, 18 Feb 2014 11:04:19 -0700,
>> >> >> > Stephen Warren wrote:
>> >> >> >>
>> >> >> >> On 02/15/2014 02:22 AM, Takashi Iwai wrote:
>> >> >> >> > At Sat, 15 Feb 2014 10:17:33 +0100,
>> >> >> >> > Takashi Iwai wrote:
>> >> >> >> >>
>> >> >> >> >> The default parent device can be obtained directly via card object, so
>> >> >> >> >> we don't need to rely on pci->dev.parent.  Since there is no access to
>> >> >> >> >> pci_dev, we can reduce the inclusion of linux/pci.h, too.
>> >> >> >> >>
>> >> >> >> >> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> >> >> >> >
>> >> >> >> > I forgot the cover page: these tree patches are trivial cleanups of
>> >> >> >> > hda-codec drivers (not the controller) to work without PCI device
>> >> >> >> > assignment. The idea was triggered by Dylan's question.
>> >> >> >>
>> >> >> >> The series seems fine to me, so briefly,
>> >> >> >> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> >> >> >
>> >> >> > Thanks.  Any chance to work on / submit other changes for Tegra
>> >> >> > HD-audio support?
>> >> >>
>> >> >> That's the plan, hopefully I'll be able to find time to throw together
>> >> >> an RFC by the end of the week.
>> >> >
>> >> > Since there was no patch appearing yet, I merged my latest development
>> >> > branch to for-next branch, which includes lots of changes in
>> >> > hda_intel.c and hda_codec.c.  If any, please rebase your patches to
>> >> > it.
>> >>
>> >> Thanks for the heads up.  I've got a series that is almost ready, I'm
>> >> still trying to tease part of the build out from under CONFIG_PCI in
>> >> the hda makefile.
>> >
>> > I don't think we have a dependency on CONFIG_PCI in Makefile.  Kconfig
>> > has a dependency, but it can be easily reduced by a patch like below.
>>
>> Sounds good.  I was looking at re-using some of the config options
>> (HDMI codec and power save) for the platform driver as well.  Maybe
>> something like the following.  SND_HDA would build the helper module
>> and hda-codec that are used by both hda_intel and a platform driver.
>
> I think we can simply allow building all HD-audio codec drivers when
> CONFIG_SND_HDA is set.  They are basically independent from the
> controller type.  There are also other selectable items like hwdep
> support.  The diff in sound/pci/hda would be like below.

Thanks I'll work off of that.  It will need a change
include/sound/core.h to define snd_pci_quirk without CONFIG_PCI since
the codecs use that, and maybe stub out a couple of the pci specific
functions.  That seems reasonable to me.

Dylan

>
>
> Takashi
>
> --
> diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
> index f2032dd7e35e..4cbf46e59d1c 100644
> --- a/sound/pci/hda/Kconfig
> +++ b/sound/pci/hda/Kconfig
> @@ -1,8 +1,15 @@
> -menuconfig SND_HDA_INTEL
> -       tristate "Intel HD Audio"
> +menu "HD-Audio"
> +
> +config SND_HDA
> +       tristate
>         select SND_PCM
>         select SND_VMASTER
>         select SND_KCTL_JACK
> +
> +config SND_HDA_INTEL
> +       tristate "HD Audio PCI"
> +       depends on SND_PCI
> +       select SND_HDA
>         help
>           Say Y here to include support for Intel "High Definition
>           Audio" (Azalia) and its compatible devices.
> @@ -13,7 +20,21 @@ menuconfig SND_HDA_INTEL
>           To compile this driver as a module, choose M here: the module
>           will be called snd-hda-intel.
>
> -if SND_HDA_INTEL
> +config SND_HDA_TEGRA
> +       tristate "Tegra HD Audio"
> +       select SND_HDA
> +       help
> +         Say Y here to support the HDA controller present in Nvidia
> +         Tegra SoCs
> +
> +         This options enables support for the HD Audio controller
> +         present in some Nvidia Tegra SoCs, used to communicate audio
> +         to the HDMI output.
> +
> +         To compile this driver as a module, choose M here: the module
> +         will be called snd-hda-tegra.
> +
> +if SND_HDA
>
>  config SND_HDA_DSP_LOADER
>         bool
> @@ -49,7 +70,7 @@ config SND_HDA_RECONFIG
>
>  config SND_HDA_INPUT_BEEP
>         bool "Support digital beep via input layer"
> -       depends on INPUT=y || INPUT=SND_HDA_INTEL
> +       depends on INPUT=y || INPUT=SND_HDA
>         help
>           Say Y here to build a digital beep interface for HD-audio
>           driver. This interface is used to generate digital beeps.
> @@ -90,7 +111,7 @@ config SND_HDA_CODEC_REALTEK
>           snd-hda-intel driver, such as ALC880.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_REALTEK=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_REALTEK=m
>
>  config SND_HDA_CODEC_ANALOG
>         tristate "Build Analog Device HD-audio codec support"
> @@ -100,7 +121,7 @@ config SND_HDA_CODEC_ANALOG
>           snd-hda-intel driver, such as AD1986A.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_ANALOG=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_ANALOG=m
>
>  config SND_HDA_CODEC_SIGMATEL
>         tristate "Build IDT/Sigmatel HD-audio codec support"
> @@ -110,7 +131,7 @@ config SND_HDA_CODEC_SIGMATEL
>           snd-hda-intel driver, such as STAC9200.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_SIGMATEL=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_SIGMATEL=m
>
>  config SND_HDA_CODEC_VIA
>         tristate "Build VIA HD-audio codec support"
> @@ -120,7 +141,7 @@ config SND_HDA_CODEC_VIA
>           snd-hda-intel driver, such as VT1708.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_VIA=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_VIA=m
>
>  config SND_HDA_CODEC_HDMI
>         tristate "Build HDMI/DisplayPort HD-audio codec support"
> @@ -130,7 +151,7 @@ config SND_HDA_CODEC_HDMI
>           Intel and Nvidia HDMI/DisplayPort codecs.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_HDMI=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_HDMI=m
>
>  config SND_HDA_I915
>         bool
> @@ -145,7 +166,7 @@ config SND_HDA_CODEC_CIRRUS
>           snd-hda-intel driver, such as CS4206.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CIRRUS=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_CIRRUS=m
>
>  config SND_HDA_CODEC_CONEXANT
>         tristate "Build Conexant HD-audio codec support"
> @@ -155,7 +176,7 @@ config SND_HDA_CODEC_CONEXANT
>           snd-hda-intel driver, such as CX20549.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CONEXANT=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_CONEXANT=m
>
>  config SND_HDA_CODEC_CA0110
>         tristate "Build Creative CA0110-IBG codec support"
> @@ -165,7 +186,7 @@ config SND_HDA_CODEC_CA0110
>           snd-hda-intel driver, found on some Creative X-Fi cards.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CA0110=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_CA0110=m
>
>  config SND_HDA_CODEC_CA0132
>         tristate "Build Creative CA0132 codec support"
> @@ -174,7 +195,7 @@ config SND_HDA_CODEC_CA0132
>           snd-hda-intel driver.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CA0132=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_CA0132=m
>
>  config SND_HDA_CODEC_CA0132_DSP
>         bool "Support new DSP code for CA0132 codec"
> @@ -196,7 +217,7 @@ config SND_HDA_CODEC_CMEDIA
>           snd-hda-intel driver, such as CMI9880.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_CMEDIA=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_CMEDIA=m
>
>  config SND_HDA_CODEC_SI3054
>         tristate "Build Silicon Labs 3054 HD-modem codec support"
> @@ -205,7 +226,7 @@ config SND_HDA_CODEC_SI3054
>           (and compatibles) support in snd-hda-intel driver.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_CODEC_SI3054=m
> +       depends on SND_HDA=y && SND_HDA_CODEC_SI3054=m
>
>  config SND_HDA_GENERIC
>         tristate "Enable generic HD-audio codec parser"
> @@ -214,7 +235,7 @@ config SND_HDA_GENERIC
>           in snd-hda-intel driver.
>
>  comment "Set to Y if you want auto-loading the codec driver"
> -       depends on SND_HDA_INTEL=y && SND_HDA_GENERIC=m
> +       depends on SND_HDA=y && SND_HDA_GENERIC=m
>
>  config SND_HDA_POWER_SAVE_DEFAULT
>         int "Default time-out for HD-audio power-save mode"
> @@ -225,3 +246,5 @@ config SND_HDA_POWER_SAVE_DEFAULT
>           power-save mode.  0 means to disable the power-save mode.
>
>  endif
> +
> +endmenu

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-02-27 20:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15  9:17 [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
2014-02-15  9:17 ` [PATCH 2/3] ALSA: hda/realtek - Allow NULL bus->pci Takashi Iwai
2014-02-15  9:17 ` [PATCH 3/3] ALSA: hda - Remove superfluous inclusion of linux/pci.h Takashi Iwai
2014-02-15  9:22 ` [PATCH 1/3] ALSA: hda - Remove dependency on bus->pci in hda_beep.c Takashi Iwai
2014-02-18 18:04   ` Stephen Warren
2014-02-18 18:20     ` Dylan Reid
2014-02-19  8:33     ` Takashi Iwai
2014-02-19 15:16       ` Dylan Reid
2014-02-27 12:03         ` Takashi Iwai
2014-02-27 16:44           ` Dylan Reid
2014-02-27 16:57             ` Takashi Iwai
2014-02-27 17:32               ` Dylan Reid
2014-02-27 20:10                 ` Takashi Iwai
2014-02-27 20:41                   ` Dylan Reid

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.