Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1478748pxk; Fri, 4 Sep 2020 10:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe6nQ1wc8j1h6R8qHCbmyGKwu3YM8kQTuMOi5u8Apj6sTsb732wFIHMO2eMNEdDDEBz7uq X-Received: by 2002:a17:906:5f96:: with SMTP id a22mr8880393eju.335.1599239833170; Fri, 04 Sep 2020 10:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599239833; cv=none; d=google.com; s=arc-20160816; b=rVn1IgONgRszsKNLV718t9Vqu0xJhiq2j8SleseemuHGGkxaOcsiw6dI1VuO0eLLYU Y8KTz92VscyNYjPp8w2NVv+VZ3naLxRP/rsYyl7M3b1sWxAr0f12pLdo8hXNZAGRWDVU /a+g+P6N9H4SEBKAH4EX8tReMcMZuO9LxCaOJCN7BVqkA7I4E/CpP8XQILjqimFXtfB6 B2XWbwB/fAi7XqKodkWieofwSndvVekpA04T7zzjTXPLUuCqrYtj+2mQuLA0UUr38dbB XGJNxBs4NN2EW0Upo7aCF4Ywa/TRKcbBT+64mYQWQbWfudardyBFckpJ6BP7GTKNEXAX Pp9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=a/SS7L6jjq/PkiHi0BpEL2RJG6KnZ3YeAsUX9aGxPLU=; b=P+4n2l2flpZKDra47fSfflhIyUicLV0tObxELUhTa0XeUjmTG0A3pi654U8cZClmvq 26+35qJlOFs6q/wzsCzPi9NyCHy9WfuqCHraSd8U/FlWb3Eq+SfdDZ+CnDHLg2hpbHmv 8gZRwuahHKipf5sxrIYEHRLRVlnFYGsDwdZ8cVV5Fe4Y12VQ9Q9KWwigQCfQW7CynfT+ LSzo0nkMTuNxSndIN4tEJkzPjWkPkb0qlanB8LIXEUI9qM4h+4ZWLMzlu7yP4SBLnSz4 9wwzplw6WqSoAWDhUOaV1Y0Y91OeUWLHWyXWHrbEYAPj46uRxe6Gsfjj1r37sNEeH/EH h+WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZmznAuNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm15si4256751edb.236.2020.09.04.10.16.46; Fri, 04 Sep 2020 10:17:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZmznAuNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbgIDRPz (ORCPT + 99 others); Fri, 4 Sep 2020 13:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbgIDRPv (ORCPT ); Fri, 4 Sep 2020 13:15:51 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B49EC061244; Fri, 4 Sep 2020 10:15:51 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id x10so4886253ybj.13; Fri, 04 Sep 2020 10:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a/SS7L6jjq/PkiHi0BpEL2RJG6KnZ3YeAsUX9aGxPLU=; b=ZmznAuNwO3nYNA0dLCjo1WUEdDHaj1pw+oBHIZUTdVnrg+aig8CreNfiqbzygj59fi YebSJafUdoCrE1zHKoU3ciYQD8YFRJwQjuo5xRbRA4O4vkxuy42dzIBJZRP5y086h08h UaJcOQQLwg1Ei3oYrsqw7TnATYKVxu1IPz61mcenKpGvv73pvXSdpAjJ9bJ9LyLRrWBu z9Iqnvh9xb1FNFYTGcYj4qINQ9Kv71MU3EOQdi6DsVJHGMAvALCqebA5/JvkyHNQMPWo txr2oz0OlzudipPSVssC8HBXCAwyXa9ZlvPQuamv26paxh5o8EE+lxM68PZtYuruFSlV xZHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a/SS7L6jjq/PkiHi0BpEL2RJG6KnZ3YeAsUX9aGxPLU=; b=jNrytltLxjOSjIDYmF67piqb9aM7NbduEgb97PX7BmH5Jhc/rILjcg8I67ml31oMBw FgZOJurtMtnYDlz8JDI1MDpE0f0zDvJn0TO3PbOzIA5gAiShEGt+1Xd67095AlBNz0id rNWi02WfePEX8MKBC7a9Ijw1ZLNVTk3rkkmoo+QE8HcogdcKC4LT7UMrV0nThroH7eSW q3+mDt/sw5yoxR6vI/34RqRX3Pgw9I9gjhh9mZl/SwP5lOxTlqLa0BotYllau/tJDjuR k2BpWg0CKlnNg/xHwjyNT+uP5xhaIVnMxLdtOPuKI5tsD5kVGzApmlBmN/kGgXXs76v4 Mgsw== X-Gm-Message-State: AOAM532XeoGrw+YrRkhN/Ynp6fkOsPqOcCvOUSfZ+2Zdmh96MVJk9QG7 82gXbaxbB2O4asriJXI2Vj0pD1KM9dCN46RDB/k= X-Received: by 2002:a25:ada0:: with SMTP id z32mr10674783ybi.401.1599239750386; Fri, 04 Sep 2020 10:15:50 -0700 (PDT) MIME-Version: 1.0 References: <20200825162718.5838-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200825162718.5838-5-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Fri, 4 Sep 2020 18:15:23 +0100 Message-ID: Subject: Re: [PATCH 4/4] ARM: dts: r8a7742-iwg21d-q7: Enable SD2 LED indication To: Geert Uytterhoeven Cc: Lad Prabhakar , Magnus Damm , Rob Herring , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thank you for the review. On Thu, Sep 3, 2020 at 1:20 PM Geert Uytterhoeven wrote: > > Hi Prabhakar, > > On Tue, Aug 25, 2020 at 6:28 PM Lad Prabhakar > wrote: > > Add support for LED trigger on SD2 interface. > > > > Signed-off-by: Lad Prabhakar > > Reviewed-by: Chris Paterson > > > --- 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 > > 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