public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Sekhar Nori <nsekhar@ti.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Landley <rob@landley.net>,
	Russell King <linux@arm.linux.org.uk>,
	Grant Likely <grant.likely@linaro.org>,
	Alex Elder <alex.elder@linaro.org>,
	LDOC <linux-doc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	LAK <linux-arm-kernel@lists.infradead.org>,
	dlos <davinci-linux-open-source@linux.davincidsp.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v4 4/6] gpio: davinci: add OF support
Date: Wed, 6 Nov 2013 13:55:10 +0200	[thread overview]
Message-ID: <527A2E1E.8030308@ti.com> (raw)
In-Reply-To: <CA+V-a8tJ7yDJOPamoCiaX6Twnnqxp_o_L0rzo2dEeSDS2VoYLw@mail.gmail.com>

On 11/06/2013 12:08 PM, Prabhakar Lad wrote:
> Hi Grygorii,
>
> On Tue, Nov 5, 2013 at 10:29 PM, Grygorii Strashko
> <grygorii.strashko@ti.com> wrote:
>> On 11/05/2013 10:53 AM, Prabhakar Lad wrote:> Hi Grygorii,
>>
>>>
>>> Thanks for the review.
>>>
>>> On Mon, Nov 4, 2013 at 11:58 PM, Grygorii Strashko
>>> <grygorii.strashko@ti.com> wrote:
>>>> Hi Prabhakar Lad,
>>>>
>>>>
>>>> On 11/02/2013 05:39 PM, Lad, Prabhakar wrote:
>>>>>
>>>>> From: KV Sujith <sujithkv@ti.com>
>>>>>
>>>>> This patch adds OF parser support for davinci gpio
>>>>> driver and also appropriate documentation in gpio-davinci.txt
>>>>> located at Documentation/devicetree/bindings/gpio/.
>>>>
>>>>
>>>> I worry, do we need to have gpio_chip.of_xlate() callback implemented?
>>>
>>> I looked for the other OF GPIO implementations with same "ngpio"
>>> property (marvel, msm) but I don’t see of_xlate() callback implemented.
>>
>> The question: will below definitions in DT work or not after this series?
>>   Will of_get_gpio()/of_get_named_gpio() work?
>>
>> Example1 - leds:
>>          leds {
>>                  compatible = "gpio-leds";
>>                  debug0 {
>>                          label = "green:debug0";
>>                          gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
>>                  };
>>          };
>>
>> Example2 - any dev:
>> devA {
>>          compatible = "devA";
>>          gpios = <&gpio 120 GPIO_ACTIVE_LOW>;
>>
>> }
>>
>>
> Agreed of_get_gpio()/of_get_named_gpio() wont work without
> xlate callback implemented, but I think this can be added as a
> incremental patch later.
>
>>>
>>>> - From one side, Davinci GPIO controller in DT described by one entry
>>>> which defines number of supported GPIOs as "ti,ngpio = <144>;"
>>>>
>>>> - From other side, on Linux level more than one gpio_chip objects are
>>>> instantiated (one per each 32 GPIO).
>>>>
>>>> How the standard GPIO biding will work in this case? .. And will they?
>>>>
>>>> Linus, I'd very appreciate if you will be able to clarify this point.
>>>>
>>>>
>>>>>
>>>>> Signed-off-by: KV Sujith <sujithkv@ti.com>
>>>>> Signed-off-by: Philip Avinash <avinashphilip@ti.com>
>>>>> [prabhakar.csengg@gmail.com: simplified the OF code, removed
>>>>>                   unnecessary DT property and also simplified
>>>>>                   the commit message]
>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>> ---
>>>>>     .../devicetree/bindings/gpio/gpio-davinci.txt      |   32
>>>>> ++++++++++++
>>>>>     drivers/gpio/gpio-davinci.c                        |   54
>>>>> ++++++++++++++++++--
>>>>>     2 files changed, 83 insertions(+), 3 deletions(-)
>>>>>     create mode 100644
>>>>> Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>>>>> b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>>>>> new file mode 100644
>>>>> index 0000000..55aae1c
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>>>>> @@ -0,0 +1,32 @@
>>>>> +Davinci GPIO controller bindings29
>>
>>>>> +
>>>>> +Required Properties:
>>>>> +- compatible: should be "ti,dm6441-gpio"
>>>>> +
>>>>> +- reg: Physical base address of the controller and the size of memory
>>>>> mapped
>>>>> +       registers.
>>>>> +
>>>>> +- gpio-controller : Marks the device node as a gpio controller.
>>>>> +
>>>>> +- interrupts: Array of GPIO interrupt number.
>>>>
>>>>
>>>> May be meaning of <interrupts> property need to be extended, because,
>>>> as of now, only banked or unbanked IRQs are supported - and not both.
>>>>
>>>>
>>> OK
>>>
>>>>> +
>>>>> +- ti,ngpio: The number of GPIO pins supported.
>>>>> +
>>>>> +- ti,davinci-gpio-unbanked: The number of GPIOs that have an individual
>>>>> interrupt
>>>>> +                            line to processor.
>>>>
>>>>
>>>> Should interrupt-controller; specifier be added here?
>>>>
>>> No
>>
>> So, it would be impossible to map GPIO IRQ to device through DT. Right?
>> Like:
>>          devX@0 {
>>                  compatible = "devX";
>>                  interrupt-parent = <&gpio>;
>>                  interrupts = <50 IRQ_TYPE_EDGE_FALLING>; /* gpio line 50 */
>>
>>
>>          };
>>
>>
> may be I took you wrong here, the interrupt-controller is inherited
> property taken from its parent, so didn’t mention that in the documentation

The GPIO controller uses interrupts form parent controller INTC/GIC
from one side, but from other side it can provide interrupts to its
users.
And as result can be interrupt-controller.

INTC/GIC -> GPIO -> user

It could work for banked IRQs only now :)


>
> Regards,
> --Prabhakar Lad
>


  reply	other threads:[~2013-11-06 11:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02 15:39 [PATCH v4 0/6] gpio: daVinci: Fixes and feature enhancement Lad, Prabhakar
2013-11-02 15:39 ` [PATCH v4 1/6] gpio: davinci: Fixed a check for unbanked gpio Lad, Prabhakar
2013-11-05 12:39   ` Linus Walleij
2013-11-06  9:33     ` Prabhakar Lad
2013-11-06  9:56       ` Linus Walleij
2013-11-06 10:15         ` Prabhakar Lad
2013-11-06 10:49           ` Sekhar Nori
2013-11-06 11:33             ` Grygorii Strashko
2013-11-06 11:42               ` Sekhar Nori
2013-11-06 11:36           ` Linus Walleij
2013-11-02 15:39 ` [PATCH v4 2/6] gpio: davinci: remove unnecessary printk Lad, Prabhakar
2013-11-02 15:39 ` [PATCH v4 3/6] gpio: davinci: use irqdomain Lad, Prabhakar
2013-11-04 18:27   ` Grygorii Strashko
2013-11-05  8:00     ` Prabhakar Lad
2013-11-02 15:39 ` [PATCH v4 4/6] gpio: davinci: add OF support Lad, Prabhakar
2013-11-04 18:28   ` Grygorii Strashko
2013-11-05  8:53     ` Prabhakar Lad
2013-11-05 16:59       ` Grygorii Strashko
2013-11-06 10:08         ` Prabhakar Lad
2013-11-06 11:55           ` Grygorii Strashko [this message]
2013-11-02 15:39 ` [PATCH v4 5/6] ARM: davinci: da850: add GPIO DT node Lad, Prabhakar
2013-11-02 15:39 ` [PATCH v4 6/6] ARM: davinci: da850 evm: add GPIO pinumux entries " Lad, Prabhakar

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=527A2E1E.8030308@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=alex.elder@linaro.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=nsekhar@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=swarren@wwwdotorg.org \
    /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