[alsa-devel] [PATCH 2/3] ASoC: tas571x: New driver for TI TAS571x power amplifiers

Mark Brown broonie at kernel.org
Sat Apr 18 13:39:57 CEST 2015


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150418/ac5da02d/attachment-0001.sig>


More information about the Alsa-devel mailing list