From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A867BC433EF for ; Wed, 8 Dec 2021 14:35:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BDBEC82F96; Wed, 8 Dec 2021 15:35:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 217E682F96; Wed, 8 Dec 2021 15:35:06 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id E241080FCC for ; Wed, 8 Dec 2021 15:35:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF092101E; Wed, 8 Dec 2021 06:34:59 -0800 (PST) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 408CC3F73B; Wed, 8 Dec 2021 06:34:59 -0800 (PST) Date: Wed, 8 Dec 2021 14:34:56 +0000 From: Andre Przywara To: Frank Wunderlich Cc: Javad Rahimi , Jagan Teki , u-boot@lists.denx.de Subject: Re: [PATCH v2] Cubieboard2:SUN7I:Add LED BOOT support Message-ID: <20211208143456.53b9e996@donnerap.cambridge.arm.com> In-Reply-To: References: <20211208142238.127247-1-javad321javad@gmail.com> Organization: ARM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Wed, 8 Dec 2021 15:25:54 +0100 Frank Wunderlich wrote: Hi, > you should add maintainer email for your patch > > $ scripts/get_maintainer.pl board/sunxi/board.c > Jagan Teki (maintainer:ARM SUNXI) > Andre Przywara (maintainer:ARM SUNXI) > u-boot@lists.denx.de (open list) Thanks Frank! > > Gesendet: Mittwoch, 08. Dezember 2021 um 15:22 Uhr > > Von: "Javad Rahimi" > > An: u-boot@lists.denx.de > > Cc: "Javad Rahimi" > > Betreff: [PATCH v2] Cubieboard2:SUN7I:Add LED BOOT support > > > > This feature makes it possible to assign one of > > LED1(PH20) and LED2(PH21) to BOOT process LED. > > User should activates the "Enable status LED API" in > > "Device Drivers -> LED Support" Please have a look at the current pinephone_defconfig, because that uses the boot LED already in a much easier fashion: https://source.denx.de/u-boot/u-boot/-/commit/0534153fd1 Cheers, Andre > > > > Signed-off-by: Javad Rahimi > > --- > > This is my first contributation in open source world. > > I'm sorry if I have mistakes in my commits and versioning. > > I do my best to learn fast. > > > > Changes in v2: > > - Missed braces added > > - Unnecessary debug removed > > - Some typo fixed > > > > board/sunxi/board.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 49 insertions(+) > > > > diff --git a/board/sunxi/board.c b/board/sunxi/board.c > > index 4f5747c34a..5e2f6ae902 100644 > > --- a/board/sunxi/board.c > > +++ b/board/sunxi/board.c > > @@ -1002,3 +1002,52 @@ int board_fit_config_name_match(const char *name) > > return ret; > > } > > #endif > > + > > +#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT) && defined(CONFIG_LED_STATUS_BOARD_SPECIFIC) > > + > > +#define CUBIE2_LED_BOOT_GPIO "PH20" > > +static int gpio_boot_led; > > + > > +void __led_init(led_id_t mask, int state) > > +{ > > + int ret; > > + > > + if (mask != CONFIG_LED_STATUS_BOOT) > > + return; > > + > > + ret = gpio_lookup_name(CUBIE2_LED_BOOT_GPIO, NULL, NULL, &gpio_boot_led); > > + > > + if (ret) > > + return; > > + > > + ret = gpio_request(gpio_boot_led, "boot_led"); > > + if (ret == -1) { > > + debug("[gpio_request] Error:%d\n", ret); > > + return; > > + } > > + > > + ret = gpio_direction_output(gpio_boot_led, 1); > > + if (ret == -1) { > > + debug("[gpio_direction_output] Error:%d\n", ret); > > + return; > > + } > > + __led_set(mask, state); > > +} > > + > > +void __led_set(led_id_t mask, int state) > > +{ > > + if (mask != CONFIG_LED_STATUS_BOOT) > > + return; > > + > > + gpio_set_value(gpio_boot_led, state); > > +} > > + > > +void __led_toggle(led_id_t mask) > > +{ > > + if (mask != CONFIG_LED_STATUS_BOOT) > > + return; > > + > > + gpio_set_value(gpio_boot_led, !gpio_get_value(gpio_boot_led)); > > +} > > + > > +#endif > > -- > > 2.25.1 > > > >