linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	Lee Jones <lee.jones@linaro.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Rob Landley <rob@landley.net>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	Grant Likely <grant.likely@linaro.org>,
	Florian Lobmaier <florian.lobmaier@ams.com>
Subject: Re: [rtc-linux] [PATCH V3 2/3] pincntrl: add support for AMS AS3722 pin control driver
Date: Tue, 24 Sep 2013 22:46:47 +0530	[thread overview]
Message-ID: <5241C8FF.4080708@nvidia.com> (raw)
In-Reply-To: <CACRpkda3m4ipTsS8FZoU1QDwrvwmKFn4awyfXOy2VOiuV63y6A@mail.gmail.com>

On Tuesday 24 September 2013 06:22 PM, Linus Walleij wrote:
> On Tue, Sep 24, 2013 at 1:58 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>> +static int as_pci_to_irq(struct gpio_chip *chip, unsigned offset)
>> +{
>> +       struct as3722_pctrl_info *as_pci = to_as_pci(chip);
>> +
>> +       return as3722_irq_get_virq(as_pci->as3722, offset);
>> +}
>> +
>> +static int as_pci_request(struct gpio_chip *chip, unsigned offset)
>> +{
>> +       struct as3722_pctrl_info *as_pci = to_as_pci(chip);
>> +
>> +       if (as_pci->gpio_control[offset].io_function)
>> +               return -EBUSY;
>> +       return 0;
>> +}
> Why is this not calling pinctrl_request_gpio(as_pci->chip.base + offset)
> instead of just checking if we happen to be GPIO and failing if
> we are not?
>
> I would implement .free calling pinctrl_free_gpio(gpio) as well.
>
> See e.g. pinctrl-abx500.c
>
>

Wow, cool, I saw and it is simple,  the gpios callback is wrapper over 
the pincontrol mux APIs.

I also see opportunity to re-factor the 
request/free/direction_input/direction_output to move to core so that 
need not to implement locally, the gpio_chip's callback can use directly.

Will post once this driver is accepted.

  reply	other threads:[~2013-09-24 17:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 11:58 [PATCH V3 0/3] Add AMS AS3722 mfd, pincontrol, regulator and RTC driver Laxman Dewangan
2013-09-24 11:58 ` [PATCH V3 1/3] mfd: add support for AMS AS3722 PMIC Laxman Dewangan
2013-10-01  8:59   ` Laxman Dewangan
2013-10-01 11:46   ` Lee Jones
2013-10-01 20:39   ` Stephen Warren
     [not found] ` <1380023921-29867-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-24 11:58   ` [PATCH V3 2/3] pincntrl: add support for AMS AS3722 pin control driver Laxman Dewangan
2013-09-24 12:52     ` [rtc-linux] " Linus Walleij
2013-09-24 17:16       ` Laxman Dewangan [this message]
2013-09-24 11:58 ` [PATCH V3 3/3] drivers/rtc/rtc-as3722: add RTC driver Laxman Dewangan

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=5241C8FF.4080708@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.lobmaier@ams.com \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).