Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1404125 > unrolled thread

Re: [PATCH v3] gpio: UniPhier: add driver for UniPhier GPIO controller

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-05-20 06:40 +0200
Last post2016-05-26 11:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3] gpio: UniPhier: add driver for UniPhier GPIO controller Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-20 06:40 +0200
    Re: [PATCH v3] gpio: UniPhier: add driver for UniPhier GPIO controller Linus Walleij <linus.walleij@linaro.org> - 2016-05-26 11:10 +0200

#1404125 — Re: [PATCH v3] gpio: UniPhier: add driver for UniPhier GPIO controller

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-05-20 06:40 +0200
SubjectRe: [PATCH v3] gpio: UniPhier: add driver for UniPhier GPIO controller
Message-ID<rAKo9-TE-7@gated-at.bofh.it>
Hi Linus,


2015-07-16 16:48 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Hi Linus,

>
> OK, I will do it in v4.


I has been away from my GPIO driver upstreaming
for a long time for some reason.

I sent v3 ten months ago.
http://patchwork.ozlabs.org/patch/494860/


In the meantime, there have been various updates
in the GPIO frame-work.

So, I'd like to know the recommended driver coding style
based on 4.7-rc1.


Diving into the git-log so far, I came up the following list:

[1] The "dev" member of gpiochip was renamed to "parent"

[2] The most recommended register function is now
    devm_gpiochip_add_data()

[3] Pass the driver private data to the
    3rd argument of devm_gpiochip_add_data().

[4] Do not use container_of() to covert
    from gpiochip to driver private data.
    Instead, gpiochip_get_data() should be used.

    (I used of_mm_gpio_chip in v3,
     but I needed to use container_of() to
     convert from gpiochip to of_mm_gpio_chip.
     I am wondering if you are happy with it or not.)

[5] gpiochip.owner is being deprecated.
    So, platform drivers need not set
     "gpiochip.owner =  THIS_MODULE".


Correct?
Is there anything else missing?

Any advice is appreciated.


-- 
Best Regards
Masahiro Yamada

[toc] | [next] | [standalone]


#1407468

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-05-26 11:10 +0200
Message-ID<rCZsK-4u8-9@gated-at.bofh.it>
In reply to#1404125
On Fri, May 20, 2016 at 6:30 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:

> So, I'd like to know the recommended driver coding style
> based on 4.7-rc1.

Sure, best is to look at other recently added drivers
I guess.

> Diving into the git-log so far, I came up the following list:
>
> [1] The "dev" member of gpiochip was renamed to "parent"

Yes.

> [2] The most recommended register function is now
>     devm_gpiochip_add_data()

Yes, saves some code.

> [3] Pass the driver private data to the
>     3rd argument of devm_gpiochip_add_data().

Yes.

> [4] Do not use container_of() to covert
>     from gpiochip to driver private data.
>     Instead, gpiochip_get_data() should be used.

Yes.

>     (I used of_mm_gpio_chip in v3,
>      but I needed to use container_of() to
>      convert from gpiochip to of_mm_gpio_chip.
>      I am wondering if you are happy with it or not.)

We will see when we look at the code ;)
I guess it is OK. The alternative is to use gpio-generic instead,
see commit 42178e2a1e42b480ada954750f248b53d3fb5940
"drivers/gpio: Switch gpio-mpc8xxx to use gpio-generic"
for an example of that approach.

> [5] gpiochip.owner is being deprecated.
>     So, platform drivers need not set
>      "gpiochip.owner =  THIS_MODULE".

Yes.

> Correct?

Yes.

> Is there anything else missing?

I advice to add a .get_direction() callback if possible and
also .set_single_ended() if the GPIO chip supports open
drain / open source in hardware.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web