lkml.org 
[lkml]   [2021]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2] gpio: mt7621: support gpio-line-names property
    On Fri, Jul 2, 2021 at 12:40 PM Sergio Paracuellos
    <sergio.paracuellos@gmail.com> wrote:
    > On Fri, Jul 2, 2021 at 11:27 AM Andy Shevchenko
    > <andy.shevchenko@gmail.com> wrote:
    > > On Sun, Jun 27, 2021 at 4:13 PM Sergio Paracuellos
    > > <sergio.paracuellos@gmail.com> wrote:
    > > > On Sun, Jun 27, 2021 at 3:01 PM Andy Shevchenko
    > > > <andy.shevchenko@gmail.com> wrote:
    > > > > On Sun, Jun 27, 2021 at 1:56 PM Sergio Paracuellos
    > > > > <sergio.paracuellos@gmail.com> wrote:

    ...

    > > > > Can you point out the DT in question?
    > > >
    > > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/mt7621-dts/mt7621.dtsi?h=staging-next
    > > >
    > > > Gpio node:
    > > >
    > > > gpio: gpio@600 {
    > > > #gpio-cells = <2>;
    > > > #interrupt-cells = <2>;
    > > > compatible = "mediatek,mt7621-gpio";
    > > > gpio-controller;
    > > > gpio-ranges = <&pinctrl 0 0 95>;
    > > > interrupt-controller;
    > > > reg = <0x600 0x100>;
    > > > interrupt-parent = <&gic>;
    > > > interrupts = <GIC_SHARED 12 IRQ_TYPE_LEVEL_HIGH>;
    > > > };
    > > >
    > > > My overlay:
    > > >
    > > > &gpio {
    > > > gpio-line-names = "", "", "", "",
    > > > "", "", "SFP LOS", "extcon port5 PoE compat",
    > > > "SFP module def0", "LED blue SFP", "SFP tx disable", "",
    > > > "switch USB power", "mode", "", "buzzer",
    > > > "LED blue pwr", "switch port5 PoE out", "reset";
    > > > };
    > > >
    > > > > > This commit populates the gc.names member of each bank from the
    > > > > > device-tree node within the driver. This overrides the default behavior
    > > > > > since devprop_gpiochip_set_names() will only be called if names is NULL.
    > > > >
    > > > > I believe this commit is not needed in the proposed (i.e. duplication) shape.
    > > > > The fwnode supports primary and secondary ones. Thus, we may create a
    > > > > pair of fwnodes when they will unify properties per device with
    > > > > properties per child together (child is primary and device, i.e.
    > > > > parent, is secondary).
    > > >
    > > > There are no child nodes, all the stuff is in the same parent node
    > > > and, as I said, belongs to the same device but internally uses three
    > > > gpiochips.
    > >
    > > And it can't be split into three children in the overlay?
    >
    > Original code before this being mainlined was using three children and
    > I was told in the review that three children were not allowed:
    >
    > See https://patchwork.ozlabs.org/project/linux-gpio/patch/1527924610-13135-3-git-send-email-sergio.paracuellos@gmail.com/#1932827

    Thanks for the pointer!

    > > Let's assume it can't, then the GPIO library function should be
    > > refactored in a way that it takes parameters like base index for the
    > > names and tries to satisfy the caller.
    >
    > Bartosz, Linus, any thoughts on this?

    Reading that discussion and seeing Linus there, I guess he himself
    signed (implicitly) for my idea :-)
    Otherwise we will have duplication of the code for almost no benefit
    when we can avoid it completely.

    --
    With Best Regards,
    Andy Shevchenko

    \
     
     \ /
      Last update: 2021-07-02 11:57    [W:11.193 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site