From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbbHTRC7 (ORCPT ); Thu, 20 Aug 2015 13:02:59 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:53897 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbbHTRC5 (ORCPT ); Thu, 20 Aug 2015 13:02:57 -0400 Date: Thu, 20 Aug 2015 10:02:11 -0700 From: Mark Brown To: Chen-Yu Tsai Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Maxime Ripard , Greg Kroah-Hartman , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi , Hans de Goede , Shuge , Meng Zhang Message-ID: <20150820170211.GB12027@sirena.org.uk> References: <1439958009-14056-1-git-send-email-wens@csie.org> <20150819163232.GS10748@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="R3G7APHDIzY6R/pk" Content-Disposition: inline In-Reply-To: X-Cookie: You are fairminded, just and loving. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 69.84.245.29 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v3 0/8] ARM: sunxi: Add Reduced Serial Bus support X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --R3G7APHDIzY6R/pk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 20, 2015 at 09:59:27AM +0800, Chen-Yu Tsai wrote: > On Thu, Aug 20, 2015 at 12:32 AM, Mark Brown wrote: > > This is flagged as something that is specific to the Allwinner SoCs. > > Why add generic regmap support rather than just implement the regmap > > reg_read() and reg_write() in a regmap in the controller driver? Are > > there expected to be other controller drivers from other vendors? > I don't expect there to be any other controller drivers. And it seems > at least some of the devices are dual interface (I2C/RSB). Though I > don't see how its connected to the generic regmap support. Regmap > is for device drivers connected to the RSB bus, not the bus controller > itself. The point here is that you can use regmap for a custom controller without having to implement a bus, to repeat what I said: | > Why add generic regmap support rather than just implement the regmap | > reg_read() and reg_write() in a regmap in the controller driver? Are > I could throw all the RSB-related stuff together, presumably under > drivers/soc/sunxi/rsb, though that doesn't help the fact that common > regmap code would be better than scattering regmap_* in various mfd > drivers. If there is only one controller driver you just have a single call into that driver in the client device which gives you the same level of shared code, having a wrapper layer in regmap that puts regmap_ functions around the equivalent controller specific functions isn't really adding a huge amount. It's a similar thing to the way we just reuse the platform bus for basic buses rather than copying it to make new bus types, we don't need to create lots of new boilerplate regmap types that are just really basic wrappers. There are a lot of these custom buses that people have. --R3G7APHDIzY6R/pk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV1ggOAAoJECTWi3JdVIfQEBkH/3bDWS+D9+6H9h3o3bvarSQR 5R9SKdus5+bxYwIZHUXj+OiLcW7p4gqwG8QYpyVm0YwSOAtPqA1a+rOrmnGYCQrl XYbTC42UnzTQyfm9dUCjCRiPsozOHEgkhQgcaNwUWFHhiRK0s2SdOXAQ5j2olZ7P /NfQExnazW9XqjMZPTINp4INaAZ0XV4kJdfsDHgfTq6KCY7mH+PYoWHHwMJmKw12 h0JoCuy+MDHH544voYdelFREE3i5H6jXJKBvLcZPNiYUCcDShNd74bBeujUuuobV HUIPhvV0tqQYYmiBn8KwRLW/ZqAKeogYSCewfdEOEMp2SM9Jx5z6xD9m6sx6r6A= =A6rf -----END PGP SIGNATURE----- --R3G7APHDIzY6R/pk--