From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RFC] add bus driver model support for ad hoc AC97 drivers Date: Thu, 27 Jan 2005 12:13:51 +0100 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Nicolas Pitre Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 26 Jan 2005 11:26:06 -0500 (EST), Nicolas Pitre wrote: > > > I would like to know what people think of the following patch. It > allows for a codec on an AC97 bus to be shared with other drivers which > are completely unrelated to audio. It registers a new bus type, and > whenever a codec instance is created then a device for it is also > registered with the driver model using that bus type. This allows, for > example, to use the extra features of the UCB1400 like the touchscreen > interface and the additional GPIOs and ADCs available on that chip for > battery monitoring. I have a working UCB1400 touchscreen driver here > that simply registers with the driver model happily working alongside > with audio features using this. Looks fine to me. > Index: linux-2.6/sound/pci/ac97/ac97_codec.c > =================================================================== > --- linux-2.6.orig/sound/pci/ac97/ac97_codec.c > +++ linux-2.6/sound/pci/ac97/ac97_codec.c (snip) > @@ -2110,6 +2112,12 @@ > snd_ac97_free(ac97); > return err; > } > + ac97->dev.bus = &ac97_bus_type; > + ac97->dev.parent = ac97->bus->card->dev; > + ac97->dev.platform_data = ac97; > + strncpy(ac97->dev.bus_id, snd_ac97_get_short_name(ac97), BUS_ID_SIZE); This may be problematic with names with '/' letters. Either the name entry or snd_ac97_get_short_name() needs a fix. Takashi ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl