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 A104AC7EE22 for ; Mon, 15 May 2023 09:51:01 +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=ahHiJJXYVw4capLqCFWoOwttjIZDqm80ZaI0a8+l9+g=; b=nCpSzQ5UG5VsFf Daq45ztwCEi53R6HhyO7shtQj+4Hp5WKTQ1TT9JgD9QOn771OmyhjkYOFBCXtfNLn+iKNCCxeTrwb b7LQGIkjzbSLhYvxeDnmNAIejNP0MZB0tmIENF8CkjIEjQpY+Lj91DdFq7Dm8DK/thp+q+oy58hY8 qvXFPyRlPAzDRqki6AUSP9hPeZHh8xrmBlczc6xLpMGWuMhfY+DJ5TDzyacdObE+S5WlVWf+D09Hd amPkaMg1vMEuD5iV7uW5qDaBt7wu7h+aSMidWkaZ+uvxcm70OP8/JZHR1S4k1oYi+XUUwIT4BdBII Rylu9mn+qAsGCGmmrmGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUqn-001dLh-1m; Mon, 15 May 2023 09:50:41 +0000 Received: from fgw22-7.mail.saunalahti.fi ([62.142.5.83]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUql-001dGH-0i for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:50:40 +0000 Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id eea96ea3-f305-11ed-a9de-005056bdf889; Mon, 15 May 2023 12:50:33 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Mon, 15 May 2023 12:50:32 +0300 To: Ryan.Wanner@microchip.com Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, Claudiu.Beznea@microchip.com Subject: Re: GPIO set config argument value difference in pinconf and gpiolib Message-ID: References: <120117b6-feda-e7aa-4f09-a126a0747388@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <120117b6-feda-e7aa-4f09-a126a0747388@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_025039_417897_FC2A8A9E X-CRM114-Status: GOOD ( 16.68 ) 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 Mon, May 15, 2023 at 08:21:35AM +0000, Ryan.Wanner@microchip.com kirjoitti: > Hello, > > I have a question about gpiochip_generic_config function. I noticed when > calling this function the pin configuration is incorrect for > push-pull/open-drain in pinctrl-at91-pio4. I traced this down to a > argument value that is incorrect, this is extracted from the config > using pinconf_to_config_argument. The pinctrl driver processes this > config argument value correctly but when gpiolib calls this function > that value is not passed causing the argument to be 0 in the function > atmel_conf_pin_config_group_set. I see this same structure in other > pinctrl drivers as well. > > It seems that gpio_set_config is called which hard codes 0 into > gpio_set_config_with_arugment function call making the argument 0 when > passed into the pinctrl set config function. Correct. > It seems that the correct > way would to mimic the gpio_set_bias function handling of this argument > value. Doing a small local test seems to confirm my suggestion. Nope. The driver developer(s) didn't get this correctly. The state configuration are booleans, hence argument is ignored. It can be anything. Seems they missed to add the switch to PUSH_PULL. TL;DR: I'm pretty sure this is the bug in the above mentioned driver. -- 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