linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
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
Date: Mon, 15 May 2023 12:50:32 +0300	[thread overview]
Message-ID: <ZGIAaPSycsmOq690@surfacebook> (raw)
In-Reply-To: <120117b6-feda-e7aa-4f09-a126a0747388@microchip.com>

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



      reply	other threads:[~2023-05-15  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  8:21 GPIO set config argument value difference in pinconf and gpiolib Ryan.Wanner
2023-05-15  9:50 ` andy.shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGIAaPSycsmOq690@surfacebook \
    --to=andy.shevchenko@gmail.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Ryan.Wanner@microchip.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).