From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbcJJKE7 (ORCPT ); Mon, 10 Oct 2016 06:04:59 -0400 Received: from down.free-electrons.com ([37.187.137.238]:39760 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751764AbcJJKE5 (ORCPT ); Mon, 10 Oct 2016 06:04:57 -0400 Date: Mon, 10 Oct 2016 12:04:44 +0200 From: Maxime Ripard To: Chen-Yu Tsai Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Mark Rutland , Russell King , Linux-ALSA , linux-arm-kernel , linux-kernel , devicetree , linux-sunxi Subject: Re: [PATCH 05/12] ASoC: sun4i-codec: Add support for A31 playback through headphone output Message-ID: <20161010100444.GD3462@lukather> References: <20161003110804.28235-1-wens@csie.org> <20161003110804.28235-6-wens@csie.org> <20161003114709.GC5228@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q9KOos5vDmpwPx9o" Content-Disposition: inline In-Reply-To: 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 --q9KOos5vDmpwPx9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 04, 2016 at 12:26:08PM +0800, Chen-Yu Tsai wrote: > >> +struct sun4i_codec_regs { > >> + u32 adc_fifoc; > >> + u32 adc_fifos; > >> + u32 adc_rxdata; > >> +}; > >> + > >> struct sun4i_codec { > >> struct device *dev; > >> struct regmap *regmap; > >> struct clk *clk_apb; > >> struct clk *clk_module; > >> struct gpio_desc *gpio_pa; > >> + const struct sun4i_codec_regs *regs; > > > > You're reimplementing reg_field here. >=20 > Are you suggesting we do reg_fields for each register? > Or all the bit fields separately. The latter would add > quite a few pointers. only the one that change, so judging from your structure, only the ADC fifo control, status and data registers. > >> +static const struct of_device_id sun4i_codec_of_match[] =3D { > >> + { > >> + .compatible =3D "allwinner,sun4i-a10-codec", > >> + .data =3D &sun4i_codec_quirks, > >> + }, > >> + { > >> + .compatible =3D "allwinner,sun6i-a31-codec", > >> + .data =3D &sun6i_a31_codec_quirks, > >> + }, > >> + { > >> + .compatible =3D "allwinner,sun7i-a20-codec", > >> + .data =3D &sun7i_codec_quirks, > >> + }, > >> + {} > >> +}; > >> +MODULE_DEVICE_TABLE(of, sun4i_codec_of_match); > >> + > > > > I don't really like moving blocks of code over and over again, > > especially in the middle of an unrelated patch. >=20 > It's not completely unrelated. I want different create_card > functions for the different SoCs, and that has to be part of the > quirks, so the quirks and the of_match list have to be moved > below them. I suppose I could leave the regmap parts in place, > but keeping them together is nicer. >=20 > If I split out the addition of the .create_card field and > code movement into a separate patch, would that be OK? Yep, that would work. Thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --q9KOos5vDmpwPx9o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJX+2e8AAoJEBx+YmzsjxAgrn8P/3ypUQoQjS4iE+2EfH0rSKvv xtBKK+PifvffmOEqTF7cnAh8usYRXD5wl87hlMdtAhgMRJoxHf1yULU9f7/Ipqac grfKe5e/MtpYHJ0rKPk7Z/G0+ZhW7eCttjKT37zRriE1GXGIq954piA5eNNsatNB v8E/xvZvsfanhFyFqBODQSnYzw+ZfOFIk6oKFDPvmZBLypA4C7MVX2Ej9h/fcb3S iFqG1QzY1QEXpmz/UB32Huqix9mZxBcXbfr4i9H0UX348UjFwyEnlJ214w3/h6us 5K0cq/GMpRmxHnwY+zr7NZBdj/lj5o1MyW4NokMMVV4czfcbeTPy6ngmfQUXkYUA cWrbdApLwjUDl8UJlpKcfcN/Xa/0oXE/MddTmEE9j69ti16/yQM6WXlT+0ri5tK1 83MSrda1dLY/HDdCYSmWB9Ju7/E0wdybGr0SGPooJeRKpm3FUxy4HaVFVPVjhhsY Ahws7uQnIbHwKhXGZ5d0J3OuQda/OLjBm5aZtoQmhkSU0MULsrjQz2/ndVStgDbf i/m6fOv+V0Qx5J2Od3/2yXS5tgGmQI5vjRjN2kbhpSPlDOG90moBCGIJqLeklIyJ 5dUhpGdyyJfR17qKWgeVFRPTxClajP80BCgzQdiNTXELrjmdzGv7Ll4hu0FFIgDl rqxQbxEj/5NqmYf5NI2F =iuq3 -----END PGP SIGNATURE----- --q9KOos5vDmpwPx9o--