devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Christian Lamparter <chunkeey@googlemail.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Alexander Shiyan" <shc_work@mail.ru>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Alexandre Courbot" <gnurou@gmail.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v8 2/3] gpio: mmio: add DT support for memory-mapped GPIOs
Date: Wed, 11 May 2016 13:05:49 +0200	[thread overview]
Message-ID: <e8213986-22b9-465f-9a4a-44d6d45e38b4@Spark> (raw)
In-Reply-To: <3359834.V76Y1cJiRU@debian64>

[-- Attachment #1: Type: text/plain, Size: 3974 bytes --]

Hello everyone,

First of all thanks Christian for persisting in adding generic device tree support for memory-mapped gpios.

For the brcm63xx case we could probably do something like this:
https://gist.github.com/Noltari/fd34aedafd427d25467697ec6799d15a
Notice that I'm doing something similar to what's already done for non device tree with basic-mmio-gpio vs basic-mmio-gpio-be:
https://github.com/torvalds/linux/blob/master/drivers/gpio/gpio-generic.c#L634

P.S: excuse me for not using an interleaved reply, but I'm sending this from my phone :)

Regards,
Álvaro.


El 10 may 2016 21:55 +0200, Christian Lamparter<chunkeey@googlemail.com>, escribió:
> On Tuesday, May 10, 2016 02:08:45 PM Linus Walleij wrote:
> > On Sun, May 8, 2016 at 3:08 PM, Christian Lamparter
> > <chunkeey@googlemail.com>wrote:
> >  
> > > From: Álvaro Fernández Rojas<noltari@gmail.com
> > >  
> > > This patch adds support for defining memory-mapped GPIOs which
> > > are compatible with the existing gpio-mmio interface.
> >  
> > Overall very nice, just waiting for the next version.
>  
> K, will deliver. I noticed that you sent a mail in which you stated
> that you applied the dt binding already. Can you update your devel
> branch on git.kernel.org's linux-gpio? Then, I'll simply rebase my
> series and sent the remaining two patches.
> (unless you tell me otherwise).
>  
> > > The first user for this binding is "wd,mbl-gpio".
> >  
> > And that binding defines that we have a register named "dat".
>  
> Yeah, I had to remove all non wd related bits. But since this
> series was posted (over and over :D) on a public mailing-list
> the original "generic" linux-mmio binding is available for
> everybody to perusal[0] and study. I think what we can make
> would be something like a devicetree template out of it. This
> way people can remove unused flags and regnames for their
> compatible device tree binding. (But first: need to finish
> that ppc-gpio.txt).
>  
> > > + if (of_property_read_bool(dev->of_node, "no-output"))
> >  
> > And then this too.
> >  
> > Do we want these generic MMIO bindings (dat, no-output)
> > in a special document like
> > Documentation/devicetree/bindings/gpio/gpio-mmio.txt?
> >  
> > Going forward?
> Ah, I was thinking about Documentation/gpio... Since there's no
> way it would go in the devicetree/bindings without having a compatible?
> (And there's technically none). As far as I know the problem here is not
> that it would be impossible to do that (updating a .dts file is "easy"...),
> but updating .dtb to a tiny flash-rom on the device might not be. So we
> have to make every effort to preserve compatibility for those devices
> (and old/incomplete/broken dtbs) as long as the device is supported.
>  
> About adding new device:
> This will work in the following way:
> 1. new drives will need to supply their hardware-specific devicetree
> binding file to the dt maintainers (This "vendor,device.txt" file
> will be like the wd,mbl-gpio.txt - but modified for the hardware
> (this is where the template would be handy)
>  
> 2. Make a one-liner patch which adds a compatible string to
> gpio-mmio.c's bgpio_of_match table:
>  
> + { .compatible = "vendor,device", .data = bgpio_basic_mmio_parse_dt },
>  
> (Of course, not having parses for the "ngpio" property and the flags like
> big-endian, reg-output-reg,set, unreadable-reg-dir, ... properties from
> the get-go is sad, these can add back once a driver/binding needs it).
>  
> I think brcm63xx will be following shortly. So we can test the
> procedure.
> > This patch set mainly deals with refactorings, but in the
> > long run we want to slim things down a bit and use standard
> > bindings I think.
> Well, to do that, I think we need to collect enough devices to
> make it a real "class" of devices first.
>  
> Regards,
> Christian
>  
> [0]<https://lkml.org/lkml/2016/4/28/921

[-- Attachment #2: Type: text/html, Size: 4868 bytes --]

  reply	other threads:[~2016-05-11 11:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08 13:08 [PATCH v8 0/3] gpio: add DT support for memory-mapped GPIOs Christian Lamparter
2016-05-08 13:08 ` [PATCH v8 1/3] gpio: dt-bindings: add wd,mbl-gpio bindings Christian Lamparter
     [not found]   ` <9bc9349d6e13d81c6200b0cd8fa20c76263043f6.1462543458.git.chunkeey-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-05-10 11:58     ` Linus Walleij
2016-05-08 13:08 ` [PATCH v8 2/3] gpio: mmio: add DT support for memory-mapped GPIOs Christian Lamparter
2016-05-08 17:17   ` Joachim Eastwood
2016-05-08 18:27     ` Christian Lamparter
     [not found]   ` <535f785bf6116c0fb6f46afbb77e6d4bd3ef5f60.1462543458.git.chunkeey-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-05-10 12:08     ` Linus Walleij
2016-05-10 19:55       ` Christian Lamparter
2016-05-11 11:05         ` Álvaro Fernández Rojas [this message]
2016-05-08 13:08 ` [PATCH v8 3/3] gpio: move clps711x, moxart, ts4800 and gpio-ge into gpio-mmio Christian Lamparter
2016-05-08 13:19 ` [PATCH v8 0/3] gpio: add DT support for memory-mapped GPIOs Andy Shevchenko

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=e8213986-22b9-465f-9a4a-44d6d45e38b4@Spark \
    --to=noltari@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=chunkeey@googlemail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gnurou@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shc_work@mail.ru \
    /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).