From: Lars-Peter Clausen <lars@metafoo.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 02/10] ALSA: hda - Bind codecs via standard bus
Date: Sat, 28 Feb 2015 11:24:55 +0100 [thread overview]
Message-ID: <54F19777.4050305@metafoo.de> (raw)
In-Reply-To: <s5hvbimgxja.wl-tiwai@suse.de>
On 02/28/2015 11:06 AM, Takashi Iwai wrote:
> At Sat, 28 Feb 2015 10:55:32 +0100,
> Lars-Peter Clausen wrote:
>>
>> On 02/26/2015 06:00 PM, Takashi Iwai wrote:
>>> Now we create the standard HD-audio bus (/sys/bus/hdaudio), and bind
>>> the codec driver with the codec device over there. This is the first
>>> step of the whole transition so that the changes to each codec driver
>>> are kept as minimal as possible.
>>>
>>> Each codec driver needs to register hda_codec_driver struct containing
>>> the currently existing preset via the new helper macro
>>> module_hda_codec_driver(). The old hda_codec_preset_list is replaced
>>> with this infrastructure. The generic parsers (for HDMI and other)
>>> are also included in the preset with the special IDs to bind
>>> uniquely.
>>>
>>> In HD-audio core side, the device binding code is split to
>>> hda_bind.c. It provides the snd_hda_bus_type implementation to match
>>> the codec driver with the given codec vendor ID. It also manages the
>>> module auto-loading by itself like before: when the matching isn't
>>> found, it tries to probe the corresponding codec modules, and finally
>>> falls back to the generic drivers. (The special ID mentioned above is
>>> set at this stage.)
>>>
>>> The only visible change to outside is that the hdaudio sysfs entry now
>>> appears in /sys/bus/devices, not as a sound class device.
>>>
>>> More works to move the suspend/resume and remove ops will be
>>> (hopefully) done in later patches.
>>
>> Great stuff. AC'97 is next? ;)
>
> Feel free to join to the club 97! :)
>
>> [...]
>>> + drv->driver.probe = hda_codec_driver_probe;
>>> + drv->driver.remove = hda_codec_driver_remove;
>>
>> Small nitpick, in my opinion it would be cleaner to use the snd_hda_bus_type
>> probe/remove callbacks for this.
>
> Correct. However, this would need more changes. In this series, I'm
> trying a gradual transition without a big surprise. The merit of this
> patch is that you need minimum changes in the codec driver side.
What I meant was instead of dynamically assigning the probe/remove callbacks
of each driver struct, just statistically setup the probe/remove callbacks
for the bus_type with the same callbacks. From a functional point of view
there should not be any difference.
- Lars
next prev parent reply other threads:[~2015-02-28 10:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 17:00 [PATCH 00/10] Modernization of HD-audio bus and PM stuff Takashi Iwai
2015-02-26 17:00 ` [PATCH 01/10] ALSA: hda - Decouple PCM and hwdep devices from codec object Takashi Iwai
2015-02-26 17:00 ` [PATCH 02/10] ALSA: hda - Bind codecs via standard bus Takashi Iwai
2015-02-28 9:55 ` Lars-Peter Clausen
2015-02-28 10:06 ` Takashi Iwai
2015-02-28 10:24 ` Lars-Peter Clausen [this message]
2015-02-28 15:04 ` Takashi Iwai
2015-02-26 17:00 ` [PATCH 03/10] ALSA: hda - Move codec suspend/resume to codec driver Takashi Iwai
2015-02-26 17:00 ` [PATCH 04/10] ALSA: hda - Use standard runtime PM for codec power-save control Takashi Iwai
2015-02-26 17:00 ` [PATCH 05/10] ALSA: hda - Drop power_save value indirection in hda_bus Takashi Iwai
2015-02-26 17:00 ` [PATCH 06/10] ALSA: hda - Replace bus pm_notify with the standard runtime PM framework Takashi Iwai
2015-02-26 17:00 ` [PATCH 07/10] ALSA: hda - Power down codec automatically at registration Takashi Iwai
2015-02-26 17:00 ` [PATCH 08/10] ALSA: hda - Set parent of input beep devices Takashi Iwai
2015-02-26 17:00 ` [PATCH 09/10] ALSA: hda - Remove channel mode helper functions Takashi Iwai
2015-02-26 17:00 ` [PATCH 10/10] ALSA: hda - Clear pcm pointer assigned to hda_pcm at device removal 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=54F19777.4050305@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/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 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.