linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] ARM: dts: r8a7742-iwg21d-q7: Enable SD2 LED indication
Date: Fri, 4 Sep 2020 18:15:23 +0100	[thread overview]
Message-ID: <CA+V-a8uT8d8P8REuXcW9qtCxM84DH+Q4LXZnVTYhT--kswKF=g@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdXkGBfwNOwd5-=U3wg6U0O+3BErbXuybbuytgzsCmZqRQ@mail.gmail.com>

Hi Geert,

Thank you for the review.

On Thu, Sep 3, 2020 at 1:20 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Tue, Aug 25, 2020 at 6:28 PM Lad Prabhakar
> <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> > Add support for LED trigger on SD2 interface.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > Reviewed-by: Chris Paterson <Chris.Paterson2@renesas.com>
>
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7.dts
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7.dts
> > @@ -63,6 +63,16 @@
> >                 enable-gpios = <&gpio3 11 GPIO_ACTIVE_HIGH>;
> >         };
> >
> > +       leds {
> > +               compatible = "gpio-leds";
> > +
> > +               sdhi2_led {
> > +                       label = "sdio-led";
> > +                       gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
>
> GPIO_ACTIVE_HIGH?
>
I did try with GPIO_ACTIVE_HIGH and it didn't work as expected. To
make sure I can control the LED through sysfs I deleted the node from
DTS and exported the pin GP5_22 (858) and writing the value "out"
direction and setting the values 0/1 to value did not toggle the SDIO
LED as expected and it stayed OFF all the time.

Looks like there is some information missing in the schematics.

I did some experiments. I completely removed the SDHI, LED and
regulator  nodes and  booted the system and exported GP1_27 (989) and
wrote values 0/1  and this toggled the SDIO_LED.

U-boot sets the below, so in u-boot the SDIO_LED is ON:
    gpio_direction_output(GPIO_GP_1_27, 0); /* power on */
    gpio_set_value(GPIO_GP_1_27, 0);
    gpio_direction_output(GPIO_GP_5_22, 0); /* LED  */
    gpio_set_value(GPIO_GP_5_22, 1);
    gpio_direction_output(GPIO_GP_1_8, 0); /* 1: 3.3V, 0: 1.8V*/
    gpio_set_value(GPIO_GP_1_8, 1);

So in comparison we would need a hog node as below (and with this the
LED triggers correctly as expected),

&gpio5 {
    sdio-led-gpio {
        gpio-hog;
        gpios = <22 GPIO_ACTIVE_HIGH>;
        output-high;
        line-name = "sdio-led-gpio";
    };
};

Let me know if you are OK with the above.

Looks like the SDIO_PWR is tied up with an SDIO_LED pin and the
information is missing from schematics.

Cheers,
Prabhakar

> The LED is driven by an NPN transistor, with the LED between 3.3V and
> the transistor's collector.
>
> > +                       linux,default-trigger = "mmc1";
> > +               };
> > +       };
> > +
> >         lvds-receiver {
> >                 compatible = "ti,ds90cf384a", "lvds-decoder";
> >                 vcc-supply = <&vcc_3v3_tft1>;
>
> With the above fixed:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  reply	other threads:[~2020-09-04 18:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 16:27 [PATCH 0/4] iWave G21D-Q7 enable PCIe, flash, CAN and SD2 LED Lad Prabhakar
2020-08-25 16:27 ` [PATCH 1/4] ARM: dts: r8a7742-iwg21d-q7: Enable PCIe Controller Lad Prabhakar
2020-09-03 10:18   ` Geert Uytterhoeven
2020-09-03 11:18     ` Lad, Prabhakar
2020-09-03 11:29       ` Geert Uytterhoeven
2020-10-09  7:23   ` Pavel Machek
2020-10-09  9:01     ` Lad, Prabhakar
2020-08-25 16:27 ` [PATCH 2/4] ARM: dts: r8a7742-iwg21d-q7: Add SPI NOR support Lad Prabhakar
2020-09-03 11:59   ` Geert Uytterhoeven
2020-09-04 17:24     ` Lad, Prabhakar
2020-08-25 16:27 ` [PATCH 3/4] ARM: dts: r8a7742-iwg21d-q7: Add can0 support to carrier board Lad Prabhakar
2020-09-03 12:14   ` Geert Uytterhoeven
2020-09-04 17:17     ` Lad, Prabhakar
2020-08-25 16:27 ` [PATCH 4/4] ARM: dts: r8a7742-iwg21d-q7: Enable SD2 LED indication Lad Prabhakar
2020-09-03 12:20   ` Geert Uytterhoeven
2020-09-04 17:15     ` Lad, Prabhakar [this message]
2020-09-07  7:55       ` Geert Uytterhoeven
2020-09-07 15:23         ` Lad, Prabhakar
2020-10-09  7:26   ` Pavel Machek

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='CA+V-a8uT8d8P8REuXcW9qtCxM84DH+Q4LXZnVTYhT--kswKF=g@mail.gmail.com' \
    --to=prabhakar.csengg@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh+dt@kernel.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).