From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934930AbcIRU1w (ORCPT ); Sun, 18 Sep 2016 16:27:52 -0400 Received: from down.free-electrons.com ([37.187.137.238]:43528 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756647AbcIRU1n (ORCPT ); Sun, 18 Sep 2016 16:27:43 -0400 Date: Sun, 18 Sep 2016 22:27:41 +0200 From: Maxime Ripard To: Danny Milosavljevic Cc: Mark Brown , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Liam Girdwood , linux-sunxi@googlegroups.com Subject: Re: [PATCH v4 3/3] ASoC: sun4i-codec: Add custom regmap configs Message-ID: <20160918202741.GM17518@lukather> References: <20160915163630.18026-1-dannym@scratchpost.org> <20160915163630.18026-4-dannym@scratchpost.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UUMz/kfoogzZ9WLZ" Content-Disposition: inline In-Reply-To: <20160915163630.18026-4-dannym@scratchpost.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UUMz/kfoogzZ9WLZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2016 at 06:36:30PM +0200, Danny Milosavljevic wrote: > ASoC: sun4i-codec: The A20 has a few extra registers that the A10 > doesn't have. > Therefore, use different regmaps for A10 as compared to A20. Same comment with the commit log. >=20 > Signed-off-by: Danny Milosavljevic > --- > sound/soc/sunxi/sun4i-codec.c | 33 ++++++++++++++++++++++++++++++--- > 1 file changed, 30 insertions(+), 3 deletions(-) >=20 > diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c > index 3b53b78..c5d6d84c 100644 > --- a/sound/soc/sunxi/sun4i-codec.c > +++ b/sound/soc/sunxi/sun4i-codec.c > @@ -682,12 +682,37 @@ static const struct regmap_config sun4i_codec_regma= p_config =3D { > .reg_bits =3D 32, > .reg_stride =3D 4, > .val_bits =3D 32, > + .max_register =3D SUN4I_CODEC_ADC_RXCNT, > +}; > + > +static const struct regmap_config sun7i_codec_regmap_config =3D { > + .reg_bits =3D 32, > + .reg_stride =3D 4, > + .val_bits =3D 32, > .max_register =3D SUN7I_CODEC_AC_MIC_PHONE_CAL, > }; > =20 > +struct sun4i_codec_quirks { > + const struct regmap_config *regmap_config; > +}; > + > +static const struct sun4i_codec_quirks sun4i_codec_quirks =3D { > + .regmap_config =3D &sun4i_codec_regmap_config, > +}; > + > +static const struct sun4i_codec_quirks sun7i_codec_quirks =3D { > + .regmap_config =3D &sun7i_codec_regmap_config, > +}; > + > static const struct of_device_id sun4i_codec_of_match[] =3D { > - { .compatible =3D "allwinner,sun4i-a10-codec" }, > - { .compatible =3D "allwinner,sun7i-a20-codec" }, > + { > + .compatible =3D "allwinner,sun4i-a10-codec", > + .data =3D &sun4i_codec_quirks, > + }, > + { > + .compatible =3D "allwinner,sun7i-a20-codec", > + .data =3D &sun7i_codec_quirks, > + }, > {} > }; > MODULE_DEVICE_TABLE(of, sun4i_codec_of_match); > @@ -760,6 +785,7 @@ static int sun4i_codec_probe(struct platform_device *= pdev) > { > struct snd_soc_card *card; > struct sun4i_codec *scodec; > + const struct sun4i_codec_quirks *quirks; > struct resource *res; > void __iomem *base; > int ret; > @@ -777,8 +803,9 @@ static int sun4i_codec_probe(struct platform_device *= pdev) > return PTR_ERR(base); > } > =20 > + quirks =3D of_device_get_match_data(&pdev->dev); And you probably want to check that quirks isn't null there. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --UUMz/kfoogzZ9WLZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJX3vi9AAoJEBx+YmzsjxAgJWoP/j4fwrmMeuBrzCK5L67ASGsK IM3EDYW8QRDlJDy3wI9oFS6LTP+jW2Ut0mQFY4CA713qASB3juMvxORLzbwKhT95 aYOuKzn6m7AKRcPslBxm7vNyGIK2LR5IVX98r5okxVUXWoFxUPzY/dCF0XdUShwT HbKvpullv4aC1yOKTbz8AZ4BwqXY6eoiMMs1oBAXPn5d3FL2zyx5GOtmKvr5HaKC qFN0f8p9mr2+0zhddEey3cfA/3bFYDkenJx6PON1lvlWG5HSBIBFC511Tc+LVpRL C31qPbdMQkgkDcjMM0/SoC2n+mHBizRoJICRWb0vN7b2dytUiVyNTX7ZE/Q+/2Xg 9FNgYazEZReAsXY4TWk2Ze2dCq+rr3vJOXfToqkHM0LhgeglQ6csyM3vZpyWSEZs O9fIO+L2m/mA3E7FZIh8ORl8M0yl5BNmb6XU7IxYDBJBnJTEe54DexVTlBEbeXHH 5FU+2YvQGPByyFgsq46ZwJmxAZGIBAeJ3/7/MiXEtcDCdnWaGV5/kMbpTJq/ZOO+ onBq2fu40CQcc8PRGbezugtekOLV0yucQVN+TpDWd23R/rUWM/swItr/rBKNEpQa KuWDUDdSGEoLKFBfkedxIGj8jcM/UEgHbBMbcYlA5Jkr1VuRUVmJVLd5ULrBkl6V TTgwSC+h8AwB5xRAAES8 =0rxS -----END PGP SIGNATURE----- --UUMz/kfoogzZ9WLZ--