On Thu, Apr 16, 2015 at 02:57:49PM +0200, Lars-Peter Clausen wrote: > On 04/15/2015 11:42 PM, Kevin Cernekee wrote:
> >+ case TAS571X_ID_5711: > >+ priv->codec_driver.controls = tas5711_controls; > >+ priv->codec_driver.num_controls = ARRAY_SIZE(tas5711_controls); > >+ break; > >+ case TAS571X_ID_5717: > >+ case TAS571X_ID_5719: > >+ priv->codec_driver.controls = tas5717_controls; > >+ priv->codec_driver.num_controls = ARRAY_SIZE(tas5717_controls); > Typically when a driver supports multiple chips with different control sets > the snd_soc_codec_driver implements a probe callback in which the correct > controls are registered. I'm fine with doing it with tables (though just having two static CODEC driver structures would be a bit cleaner). The pattern with probe() is usually that there's some base set of controls all the devices have which then gets device specific controls/routes/whatever added to it so you get benefits fromm sharing the table but in this case the table is so tiny anyway that I'm not sure it's worth caring.
signature.asc
Description: Digital signature