From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: [PATCH 02/10] ALSA: hda - Bind codecs via standard bus Date: Sat, 28 Feb 2015 10:55:32 +0100 Message-ID: <54F19094.6000003@metafoo.de> References: <1424970025-8082-1-git-send-email-tiwai@suse.de> <1424970025-8082-3-git-send-email-tiwai@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-out-061.synserver.de (smtp-out-061.synserver.de [212.40.185.61]) by alsa0.perex.cz (Postfix) with ESMTP id 5A5E92602AD for ; Sat, 28 Feb 2015 10:55:32 +0100 (CET) In-Reply-To: <1424970025-8082-3-git-send-email-tiwai@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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? ;) [...] > + 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. > + /* TODO: PM and others */