All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Timur Tabi <timur@freescale.com>
Cc: vbarinov <vbarinov@embeddedalley.com>,
	alsa-devel <alsa-devel@alsa-project.org>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	mano@roarinelk.homelinux.net,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Cliff Cai <cliff.cai@analog.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	dg@emlix.com, Grant Likely <grant.likely@secretlab.ca>,
	Sedji Gaouaou <sedji.gaouaou@atmel.com>,
	"kyungmin.park" <kyungmin.park@samsung.com>,
	"Candelaria Villareal, Jorge" <jorge.candelaria@ti.com>,
	ben-linux <ben-linux@fluff.org>,
	Kuninori Morimoto <morimoto.kuninori@renesas.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	anemo@mba.ocn.ne.jp
Subject: Re: ASoC - Support for multiple components
Date: Thu, 22 Apr 2010 12:27:53 +0100	[thread overview]
Message-ID: <1271935673.3228.335.camel@odin> (raw)
In-Reply-To: <p2ned82fe3e1004211513zffc1ae64k7e12daf4a3cac648@mail.gmail.com>

On Wed, 2010-04-21 at 17:13 -0500, Timur Tabi wrote:
> On Wed, Apr 21, 2010 at 4:07 PM, Timur Tabi <timur@freescale.com> wrote:
> 
> > Cirrus Logic CS4270 ALSA SoC Codec Driver
> > cs4270 0-004f: found device at i2c address 4F
> > cs4270 0-004f: hardware revision 3
> > cs4270 0-004f: codec register CS4270 79
> > cs4270 0-004f: dai register cs4270 0
> > Registered DAI 'cs4270.0'
> > Registered codec 'CS4270.79'
> > ...
> >
> > soc-audio soc-audio: CODEC CS4270 not registered
> >
> > Does this mean that my fabric driver should be looking for "CS4270.79"
> > instead of just "CS4270"?
> 

I've appended a component ID to each instantiated ASoC component to
distinguish similar/same component types from each other. e.g. consider
a board with two CS4270 codecs.  The component ID used here is unique to
the device and is either the platform_device ID, I2C address or SPI chip
select. Although, it doesn't really matter what the ID source is as long
as it's unique to that device.

> Ok, I figured out the solution.  I need to add this to mpc8610_hpcd_probe():
> 
> +       iprop = of_get_property(codec_np, "reg", NULL);
> +       if (!iprop) {
> +               dev_err(&ofdev->dev, "codec node is missing 'reg' property\n");
> +               goto error;
> +       }
> +       machine_data->dai.codec_id = *iprop;
> 

Applied.

> So I have another question.  Currently, I need to do this:
> 
> 	machine_data->dai.codec_dai_drv = &cs4270_dai; /* The codec_dai we want */
> 
> In other words, I still need to have a global variable in my codec
> driver called "cs4270_dai" that the fabric driver has to access.  This
> is a real problem because it means that my fabric driver has to be
> hard-coded with the information on the codec that's attached to the
> SSI.  However, I already have that information in the device tree, I
> can extract all the information I need from the device tree.  If I can
> get rid of the assignment of "cs4270_dai", I can make my machine
> driver completely codec-independent.

The use of ID here is to deprecate the passing in of the 'driver' struct
so it can be removed in a subsequent patch. I'm trying to make the
changes as small as possible here, but let me see how much difference
changing this now will make to the current patch size. 

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

  reply	other threads:[~2010-04-22 11:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 14:09 ASoC - Support for multiple components Liam Girdwood
2010-04-19 14:14 ` Timur Tabi
2010-04-19 15:15 ` Grant Likely
2010-04-19 16:25   ` Liam Girdwood
2010-04-19 17:14     ` Mark Brown
2010-04-19 17:23       ` Liam Girdwood
2010-04-19 17:03   ` Mark Brown
2010-04-20  7:17 ` Peter Ujfalusi
2010-04-20 10:46   ` Liam Girdwood
2010-04-21  5:53     ` Peter Ujfalusi
2010-04-21  7:18       ` Liam Girdwood
2010-04-21 17:41         ` Mark Brown
2010-04-26 10:49     ` Mark Brown
2010-04-26 11:17       ` Liam Girdwood
2010-04-26 14:24         ` Mark Brown
2010-04-26 12:05       ` Timur Tabi
2010-04-26 13:13         ` Mark Brown
2010-04-21 21:07 ` Timur Tabi
2010-04-21 22:13   ` Timur Tabi
2010-04-22 11:27     ` Liam Girdwood [this message]
2010-04-22 14:52       ` Timur Tabi
2010-04-22 11:03   ` Liam Girdwood

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=1271935673.3228.335.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=cliff.cai@analog.com \
    --cc=dg@emlix.com \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@gmail.com \
    --cc=jorge.candelaria@ti.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=mano@roarinelk.homelinux.net \
    --cc=morimoto.kuninori@renesas.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sedji.gaouaou@atmel.com \
    --cc=timur@freescale.com \
    --cc=vbarinov@embeddedalley.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 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.