From: "Jérôme Pouiller" <Jerome.Pouiller@silabs.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [[PATCH staging] 6/7] staging: wfx: use sleeping gpio accessors
Date: Tue, 11 Feb 2020 10:41:26 +0000 [thread overview]
Message-ID: <1829603.oaOZQPt0r4@pc-42> (raw)
In-Reply-To: <01ac32e4318da8a7db085c82cfca9831ecec5d40.1581410026.git.mirq-linux@rere.qmqm.pl>
On Tuesday 11 February 2020 09:46:55 CET Michał Mirosław wrote:
> Driver calls GPIO get/set only from non-atomic context and so can use any
> GPIOs.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> drivers/staging/wfx/bh.c | 6 +++---
> drivers/staging/wfx/bus_spi.c | 4 ++--
> drivers/staging/wfx/main.c | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> index 983c41d1fe7c..c6319ab7e71a 100644
> --- a/drivers/staging/wfx/bh.c
> +++ b/drivers/staging/wfx/bh.c
> @@ -20,10 +20,10 @@ static void device_wakeup(struct wfx_dev *wdev)
> {
> if (!wdev->pdata.gpio_wakeup)
> return;
> - if (gpiod_get_value(wdev->pdata.gpio_wakeup))
> + if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup))
> return;
>
> - gpiod_set_value(wdev->pdata.gpio_wakeup, 1);
> + gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
> if (wfx_api_older_than(wdev, 1, 4)) {
> if (!completion_done(&wdev->hif.ctrl_ready))
> udelay(2000);
> @@ -45,7 +45,7 @@ static void device_release(struct wfx_dev *wdev)
> if (!wdev->pdata.gpio_wakeup)
> return;
>
> - gpiod_set_value(wdev->pdata.gpio_wakeup, 0);
> + gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0);
> }
>
> static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
> diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
> index c5f78161234d..634b4e5bb055 100644
> --- a/drivers/staging/wfx/bus_spi.c
> +++ b/drivers/staging/wfx/bus_spi.c
> @@ -208,9 +208,9 @@ static int wfx_spi_probe(struct spi_device *func)
> } else {
> if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
> gpiod_toggle_active_low(bus->gpio_reset);
> - gpiod_set_value(bus->gpio_reset, 1);
> + gpiod_set_value_cansleep(bus->gpio_reset, 1);
> udelay(100);
> - gpiod_set_value(bus->gpio_reset, 0);
> + gpiod_set_value_cansleep(bus->gpio_reset, 0);
> udelay(2000);
> }
>
> diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
> index 84adad64fc30..e8bdeb9aa3a9 100644
> --- a/drivers/staging/wfx/main.c
> +++ b/drivers/staging/wfx/main.c
> @@ -420,7 +420,7 @@ int wfx_probe(struct wfx_dev *wdev)
> "enable 'quiescent' power mode with gpio %d and PDS file %s\n",
> desc_to_gpio(wdev->pdata.gpio_wakeup),
> wdev->pdata.file_pds);
> - gpiod_set_value(wdev->pdata.gpio_wakeup, 1);
> + gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
> control_reg_write(wdev, 0);
> hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT);
> } else {
> --
> 2.20.1
>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
--
Jérôme Pouiller
next prev parent reply other threads:[~2020-02-11 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1581410026.git.mirq-linux@rere.qmqm.pl>
[not found] ` <8f0c51acc3b98fc55d6960036daef7556445cd0a.1581410026.git.mirq-linux@rere.qmqm.pl>
2020-02-11 9:23 ` [[PATCH staging] 3/7] staging: wfx: fix init/remove vs IRQ race Dan Carpenter
2020-02-11 10:39 ` Michał Mirosław
2020-02-11 12:52 ` Dan Carpenter
[not found] ` <c47c0b645071aff141fa0d39d92184b6dc5e4f52.1581410026.git.mirq-linux@rere.qmqm.pl>
2020-02-11 10:34 ` [[PATCH staging] 4/7] staging: wfx: annotate nested gc_list vs tx queue locking Jérôme Pouiller
[not found] ` <01ac32e4318da8a7db085c82cfca9831ecec5d40.1581410026.git.mirq-linux@rere.qmqm.pl>
2020-02-11 10:41 ` Jérôme Pouiller [this message]
[not found] ` <f32c850dcb02bf26faf04655c01aee4c4d20c139.1581410026.git.mirq-linux@rere.qmqm.pl>
2020-02-11 10:45 ` [[PATCH staging] 7/7] staging: wfx: use more power-efficient sleep for reset Jérôme Pouiller
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=1829603.oaOZQPt0r4@pc-42 \
--to=jerome.pouiller@silabs.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
/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