Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1784252rwd; Mon, 15 May 2023 03:03:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CnwtX0Sr3Hq4b2NxDCkcVNvp2OdocpXl/EoKUGeXxQcqATFRWWzDmY97AGjdfCHEhZ9/w X-Received: by 2002:a05:6a20:1581:b0:101:530a:1d12 with SMTP id h1-20020a056a20158100b00101530a1d12mr25578030pzj.44.1684144989425; Mon, 15 May 2023 03:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144989; cv=none; d=google.com; s=arc-20160816; b=oeEPFbZufHkcroxcSu/6u6UuSBCZ08iIaCnS7aRtNuY0ZYEPqM6lZE0GlK8w4qz7zn zZYMjqqlki/RoENz8TPYcwJXsKSM8ACH2+XXg99z9ksSWZPCua7sX/sH1bSVI3cp9r+6 L7J4DpboyoXWIIa3cvT1Ma592JhHnxTe2k3NWRNcZzZJrNIrIxAPhO0mkSxhmYOO3y46 BkRO4ldz9imwJ3xS+Lju+DRCj08hlDTqLC9nJti130FfqaDbK6dBe6Ry4ikHcbTSiHrS DjzEGASWISck+itLZoXDXOq5CWEyp9ZN/OfE5yC1sqm3Ol3Zua3kro1z62S2WQfVKnko payw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=a+uHdz/amtbJsXzEBbM1gekdhRe2jCU09p81N1KRpzQ=; b=LGqgAb1KKhrP3KaR+rr8595GQxgSKWXZpExQtx84P0p6A9wrL0COgJtfQYI0MI9pQU CmKVrmQbcIWp4CphsEAQSeXRRL8YYjipsTfjZd8Rf+dOub9gCdFxEHI/dpO46WNxjcnB 8wA/NZfk63wpEnD5XMk/cqe//kZDAZqQO6TZYpmsmhEtRAAG398bDAqxNCNOjLaqXD1v 81iaJrrOvpfrspZ3T8soVoH07KB7ke4FZMDuxBtWL808bgcxvwmGvHp4vYbz1fKbckZG PZt8H+zuJDO+mbrXScQNsFzGvxJdV8kyXVgRzZY5ZjQGDlE95X0YGAUM1a1FcdbatiTC xoGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z25-20020aa79f99000000b00642ea71f6d9si17363244pfr.336.2023.05.15.03.02.55; Mon, 15 May 2023 03:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240215AbjEOJvh (ORCPT + 99 others); Mon, 15 May 2023 05:51:37 -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> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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