[alsa-devel] Different reg_default for rt5650 codec

Bard Liao bardliao at realtek.com
Fri Oct 30 04:40:40 CET 2015


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Friday, October 30, 2015 9:20 AM
> To: Bard Liao
> Cc: John Lin; Oder Chiou; alsa-devel at alsa-project.org; Flove; Jack Yu
> Subject: Re: Different reg_default for rt5650 codec
> 
> On Thu, Oct 29, 2015 at 11:17:26AM +0000, Bard Liao wrote:
> 
> > Something like
> > 	case RT5650_DEVICE_ID:
> > +		rt5645->regmap-> reg_defaults = rt5650_reg;
> > +		rt5645->regmap-> num_reg_defaults = ARRAY_SIZE(rt5650_reg)
> > 		rt5645->codec_type = CODEC_TYPE_RT5650;
> > 		break;
> >
> > Is that ok?
> 
> No, that's not OK - the config needs to be constant and...
> 
> > Or should I use different regmap_config? There is one question if I use
> > different regmap_config. We will know which codec it is by
> regmap_read.
> > So, regmap is init before we know which codec it is. Assume
> rt5645_regmap
> > is used and what should I do once rt5650 is detected?
> 
> ...you definitely can't change it after you registered the CODEC, regmap
> will ignore that.  What should be happening here is that the devices
> should be being registered using different identifiers so that before we
> try to create the regmap we know what device is being used.
> 
> If there are buggy BIOSs out there that don't do that what I'd recommend
> doing is creating a temporary regmap with no defaults or anything, just
> the basic I/O.  Use that to read the identification registers from the
> device and then create a second regmap with the actual configuration for
> the device.

Thanks Mark. I will follow your suggestion to create a temporary regmap
to get the codec ID.

> 
> ------Please consider the environment before printing this e-mail.


More information about the Alsa-devel mailing list