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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C7ABC7EE24 for ; Mon, 15 May 2023 09:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240625AbjEOJvk (ORCPT ); Mon, 15 May 2023 05:51:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240112AbjEOJvR (ORCPT ); Mon, 15 May 2023 05:51:17 -0400 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B271FC2 for ; Mon, 15 May 2023 02:50:36 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <120117b6-feda-e7aa-4f09-a126a0747388@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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