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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0D0AC25B10 for ; Mon, 6 May 2024 20:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=58b3eba0WuIuXCk/2kMDlOhgQH4bXlEf0xDFj1G1d9w=; b=Vsna6AXcHJ1hOe DWZJrIvrk1yh/iSo0ZUVN0WUgvs0DvfXc9oRfJu4R43d0r1vZXHfZOPlfbpQT48ESxP5cixpSLe4Q seYjDmPgB42f8FzyvX2N7yI5CkeTkDhEHrqX1eGgeUjXZoDSP4mhQQ28ghE9b0NNEGlHDbtXaSZpw Wn2xp9ezLNIADP+SCc080d660h0A0EmVHUgZOlMfRqpt6T6u1oqVe62vdWlmfXKMRMfHCfAnvOueu GoOzvM8qbaw8EYMMPWTo6YFxoNnRxkGK22ubOawfyuPWJnv78wC3MuqDcW59k/tkA1LS9Uqdor7Ct 66JKo+hzMkFY58lG3EXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s44zX-00000008gLl-2RrA; Mon, 06 May 2024 20:31:19 +0000 Received: from fgw23-7.mail.saunalahti.fi ([62.142.5.84]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s44zT-00000008gKb-3WS9 for linux-arm-kernel@lists.infradead.org; Mon, 06 May 2024 20:31:17 +0000 Received: from localhost (88-113-25-208.elisa-laajakaista.fi [88.113.25.208]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 91d287b0-0be7-11ef-b972-005056bdfda7; Mon, 06 May 2024 23:31:09 +0300 (EEST) From: Andy Shevchenko Date: Mon, 6 May 2024 23:31:07 +0300 To: Stefan Wahren Cc: Linus Walleij , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Ray Jui , Scott Branden , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski , Phil Elwell , Kent Gibson Subject: Re: [PATCH V2] pinctrl: bcm2835: Make pin freeing behavior configurable Message-ID: References: <20240503062745.11298-1-wahrenst@gmx.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240503062745.11298-1-wahrenst@gmx.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_133116_067230_2356700A X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fri, May 03, 2024 at 08:27:45AM +0200, Stefan Wahren kirjoitti: > Until now after a bcm2835 pin was freed its pinmux was set to GPIO_IN. > So in case it was configured as GPIO_OUT before the configured output > level also get lost. As long as GPIO sysfs was used this wasn't > actually a problem because the pins and their possible output level > were kept by sysfs. > > Since more and more Raspberry Pi users start using libgpiod they are > confused about this behavior. So make the pin freeing behavior of > GPIO_OUT configurable via module parameter. In case > pinctrl-bcm2835.persist_gpio_outputs is set to 1, the output level is > kept. > > This patch based on the downstream work of Phil Elwell. ... > +static bool persist_gpio_outputs; > +module_param(persist_gpio_outputs, bool, 0644); Do you need 'w' attribute? ... > + dev_info(dev, "GPIO_OUT persistence: %s\n", > + persist_gpio_outputs ? "yes" : "no"); str_yes_no() and with it can be put on a single line. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel