lkml.org 
[lkml]   [2013]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rtc-linux] [PATCH V3 2/3] pincntrl: add support for AMS AS3722 pin control driver
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.


\
 
 \ /
  Last update: 2013-09-24 19:21    [W:0.034 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site