linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: jacopo mondi <jacopo@jmondi.org>
Cc: Chris Brandt <Chris.Brandt@renesas.com>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	"magnus.damm@gmail.com" <magnus.damm@gmail.com>,
	"geert+renesas@glider.be" <geert+renesas@glider.be>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 0/3] Renesas RZ PFC and GPIO driver
Date: Wed, 11 Jan 2017 13:22:26 +0200	[thread overview]
Message-ID: <7332833.bE664ByKOm@avalon> (raw)
In-Reply-To: <06e9c953-df81-08f1-a817-730301778e06@jmondi.org>

Hi Jacopo,

On Tuesday 10 Jan 2017 23:32:27 jacopo mondi wrote:
> On 10/01/2017 02:28, Laurent Pinchart wrote:
> > On Monday 09 Jan 2017 23:53:39 Chris Brandt wrote:
> >> On Monday, January 09, 2017, Laurent Pinchart wrote:
> >>> Both the existing RZ/A model and the pinctrl model are in my opinion
> >>> improvements over the RZ/G and R-Car models. I don't care much about
> >>> whether pinctrl-single can be used, but we really need hardware
> >>> architectures that don't require those huge data tables.
> >> 
> >> I can definitely agree to that.
> >> 
> >>> It's more complex than that. Both the pin-based and group-based models
> >>> have their pros and cons, and the pinctrl API is some kind of mix that
> >>> allows both options.
> >> 
> >> Here is my general question: Which of these 2 approaches are better?
> >> 
> >> A) In the DT, the user ask "enable Ethernet please" and magic happens in
> >>    the pfc driver.
> >> 
> >> B) In the DT, the user looks up the correct pin/function assignments in
> >>    the SoC Hardware Manual and manually spells out what they need.
> >> 
> >> R-Car looks more like A. I've been using a driver that looks more like B.
> >> 
> >> For most drivers (USB, MMC, SDHI, etc..,), I'm happy when 'magic happens'
> >> and I don't really have to open a HW manual at all.
> >> But, for something like setting up the PFC when someone gets a shiny new
> >> board, making people actually open a HW manual seems acceptable to me.
> > 
> > From a user point of view, option A looks better to me. However, it has
> > two drawbacks:
> > 
> > - Through deciding what pin groups we make available we create a DT ABI
> > that will make it difficult to fix mistakes in case the groups are not
> > fine-grained enough.
> > 
> > - The data tables in C code are large, and we end up compiling many of
> > them in multi-platform kernel, significantly increasing the kernel size.
> > 
> > I would thus favour option B.
> 
> That would be saner, I agree.
> 
> And a much saner way of doing this would be, in my understanding, not
> using the group-based sh-pfc drivers used for R-Car and back it up with
> a pin-based equivalent, where to hook drivers for each specific hardware.

We can't really do that for the existing SoCs as the concept of groups is 
present in the hardware. Not only do we need to select per-pin functions, but 
there are also register bits that perform pin muxing for whole groups. If this 
changes in future generations of the SoCs we then could do away with the data 
tables, but for now we're stuck with them.

> Looks like pinmux-single, yes, but that driver bets on the ability to
> set pin functions and configurations with a write to a single register
> while, at least for RZ/A, the same is scattered among several registers
> (I may be wrong on the single register requirement for pinctrl-single
> though)
> 
> So, I guess what direction to take depends on whether or not we're going
> to see more hardware with a per-pin configuration that would benefit
> from this new rz-pfc driver (it seems so) and if this justify splitting
> sh-pfc in two, a group-based one for R-Car devices (and all devices
> there already) and a new pin-based one.
> 
> Or maybe we can tie pin-based configuration in sh-pfc and it's me not
> seeing how to do that.

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2017-01-11 11:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 19:31 [PATCH 0/3] Renesas RZ PFC and GPIO driver Jacopo Mondi
2017-01-09 19:31 ` [PATCH 1/3] pinctrl: sh-pfc: Add r7s72100 PFC driver Jacopo Mondi
2017-01-10 14:59   ` Geert Uytterhoeven
2017-01-09 19:31 ` [PATCH 2/3] gpio: gpio-rz: GPIO driver for Renesas RZ series Jacopo Mondi
2017-01-11 14:55   ` Linus Walleij
2017-01-12 10:50     ` jacopo mondi
2017-01-12 14:39       ` Chris Brandt
2017-01-12 19:13         ` jacopo mondi
2017-01-12 19:45           ` Chris Brandt
2017-01-09 19:31 ` [PATCH 3/3] arm: dts: r7s72100: Add peripherals nodes Jacopo Mondi
2017-01-10 15:07   ` Geert Uytterhoeven
2017-01-10 19:58     ` Laurent Pinchart
2017-01-10 21:13       ` Geert Uytterhoeven
2017-01-11 10:33       ` Simon Horman
2017-01-11 10:55         ` Laurent Pinchart
2017-01-11 10:59           ` Simon Horman
2017-01-11  9:17     ` jacopo mondi
2017-01-11 10:56   ` Laurent Pinchart
2017-01-09 19:51 ` [PATCH 0/3] Renesas RZ PFC and GPIO driver Laurent Pinchart
2017-01-09 21:08   ` Chris Brandt
2017-01-09 22:49     ` Laurent Pinchart
2017-01-09 23:53       ` Chris Brandt
2017-01-10  1:28         ` Laurent Pinchart
2017-01-10  3:12           ` Chris Brandt
2017-01-10 22:32           ` jacopo mondi
2017-01-11  0:46             ` Chris Brandt
2017-01-11 10:35               ` Simon Horman
2017-01-11 11:22             ` Laurent Pinchart [this message]
2017-01-11 15:15               ` jacopo mondi
2017-01-11 16:31                 ` Laurent Pinchart
2017-01-11 17:51                   ` jacopo mondi
2017-01-11 20:17                     ` Chris Brandt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7332833.bE664ByKOm@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Chris.Brandt@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jacopo@jmondi.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).