From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] pinctrl: Allow configuration of pins from gpiolib based drivers
Date: Thu, 19 Jan 2017 14:11:22 +0200 [thread overview]
Message-ID: <1484827882.2133.229.camel@linux.intel.com> (raw)
In-Reply-To: <20170119094820.83595-3-mika.westerberg@linux.intel.com>
On Thu, 2017-01-19 at 12:48 +0300, Mika Westerberg wrote:
> When a GPIO driver is backed by a pinctrl driver the GPIO driver
> sometimes needs to call the pinctrl driver to configure certain
> things,
> like whether the pin is used as input or output. In addition to this
> there are other configurations applicable to GPIOs such as setting
> debounce time of the GPIO.
>
> To support this we introduce a new function pinctrl_gpio_set_config()
> that can be used by gpiolib based driver to pass configuration
> requests
> to the backing pinctrl driver.
> + mutex_lock(&pctldev->mutex);
> + pin = gpio_to_pin(range, gpio);
> + ret = pinconf_set_config(pctldev, pin, configs,
> ARRAY_SIZE(configs));
> + mutex_unlock(&pctldev->mutex);
Does gpio_to_pin() require to be under lock?
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-01-19 12:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 9:48 [PATCH 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig Mika Westerberg
2017-01-19 9:48 ` [PATCH 1/3] pinctrl: Widen the generic pinconf argument from 16 to 24 bits Mika Westerberg
2017-01-19 12:04 ` Andy Shevchenko
2017-01-20 8:43 ` Linus Walleij
2017-01-19 9:48 ` [PATCH 2/3] pinctrl: Allow configuration of pins from gpiolib based drivers Mika Westerberg
2017-01-19 12:11 ` Andy Shevchenko [this message]
2017-01-20 8:48 ` Linus Walleij
2017-01-19 9:48 ` [PATCH 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Mika Westerberg
2017-01-19 12:17 ` Andy Shevchenko
2017-01-20 9:13 ` Linus Walleij
2017-01-20 9:24 ` Neil Armstrong
2017-01-20 9:49 ` Linus Walleij
2017-01-20 13:36 ` Mika Westerberg
2017-01-19 12:17 ` [PATCH 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig Andy Shevchenko
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=1484827882.2133.229.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/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).