From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vinod.koul@intel.com>,
liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org,
patches.audio@intel.com
Subject: Re: [PATCH 3/3] ALSA: hda: register selectively for SPT-LP
Date: Thu, 30 Apr 2015 22:59:22 +0200 [thread overview]
Message-ID: <s5hk2wtjpsl.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150430203355.GP22845@sirena.org.uk>
At Thu, 30 Apr 2015 21:33:55 +0100,
Mark Brown wrote:
>
> On Thu, Apr 30, 2015 at 08:22:36PM +0530, Vinod Koul wrote:
>
> > - /* Sunrise Point-LP */
> > - { PCI_DEVICE(0x8086, 0x9d70),
> > - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
>
> > +static const struct pci_device_id azx_intel_adsp_ids[] = {
> > + /* Sunrise Point-LP */
> > + { PCI_DEVICE(0x8086, 0x9d70),
> > + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
> > + { 0, }
> > +};
> > +MODULE_DEVICE_TABLE(pci, azx_intel_adsp_ids);
> > +
>
> > static int __init azx_module_init(void)
> > {
> > int ret;
> >
> > ret = pci_register_driver(&azx_driver);
> >
> > + if (!hdac_adsp_enable)
> > + ret = pci_register_driver(&azx_intel_adsp_driver);
>
> This feels like the wrong idiom here. I'd expect us to do this by
> binding to the device but ignoring the DSP functionality, or if the
> device has only DSP functionality (it's not clear with the context I
> have but I think that's the case) just printing a message and not
> telling the sound core about it. Having the driver just fail to load
> seems like it might be a bit obscure.
>
> Though to be honest if it *is* going to register as a separate HDA
> device then it seems like userspace quirking for this is just as viable.
Ideally, it'd be best if the system can do everything automatically,
e.g. loads the DSP driver at first, then falls back to the legacy
driver if no DSP is found. But there seems no clean way to do this,
so far. Thus the flag was introduced.
BTW, the patch won't work as expected. The device list is created at
the module build time (modpost), thus it must expose all devices,
including SKL. The patch essentially excludes SKL PCI ID from the
list.
Another way to skip the unwanted driver is just to return -ENODEV from
its probe callback when the given PCI is SKL and the flag is set.
Then the driver core ignores this and continues to the next possible
driver (i.e. the dsp one). The same should be applied to hda-soc-skl
driver in vice versa.
Takashi
next prev parent reply other threads:[~2015-04-30 20:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 14:52 [PATCH 1/3] ALSA: hda: add hdac_adsp_enable module flag Vinod Koul
2015-04-30 14:52 ` [PATCH 2/3] ALSA: hda: remove module_pci_driver Vinod Koul
2015-04-30 14:52 ` [PATCH 3/3] ALSA: hda: register selectively for SPT-LP Vinod Koul
2015-04-30 20:33 ` Mark Brown
2015-04-30 20:59 ` Takashi Iwai [this message]
2015-04-30 21:23 ` Mark Brown
2015-05-01 4:31 ` Vinod Koul
2015-04-30 16:02 ` [PATCH 1/3] ALSA: hda: add hdac_adsp_enable module flag Pierre-Louis Bossart
2015-04-30 19:27 ` Mark Brown
2015-04-30 20:44 ` Takashi Iwai
2015-05-01 4:39 ` Vinod Koul
2015-05-01 14:15 ` Pierre-Louis Bossart
2015-05-01 14:41 ` Mark Brown
2015-05-01 11:13 ` Mark Brown
2015-04-30 20:47 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hk2wtjpsl.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox