From: Sebastian Reichel <sre@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 5/5] smiapp: Switch to gpiod API for GPIO control
Date: Wed, 31 Aug 2016 14:09:57 +0200 [thread overview]
Message-ID: <20160831120956.2ij6bslmf6jg3gpy@earth> (raw)
In-Reply-To: <1472629325-30875-6-git-send-email-sakari.ailus@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]
Hi Sakari,
On Wed, Aug 31, 2016 at 10:42:05AM +0300, Sakari Ailus wrote:
> - if (gpio_is_valid(sensor->hwcfg->xshutdown)) {
> + if (client->dev.of_node) {
> + sensor->xshutdown =
> + devm_gpiod_get_optional(&client->dev, "xshutdown",
> + GPIOD_OUT_LOW);
> + } else if (gpio_is_valid(sensor->hwcfg->xshutdown)) {
> rval = devm_gpio_request_one(
> &client->dev, sensor->hwcfg->xshutdown, 0,
> "SMIA++ xshutdown");
> @@ -2581,8 +2582,13 @@ static int smiapp_init(struct smiapp_sensor *sensor)
> sensor->hwcfg->xshutdown);
> return rval;
> }
> +
> + sensor->xshutdown = gpio_to_desc(sensor->hwcfg->xshutdown);
> }
You can drop the devm_gpio_request_one() part and xshutdown from
smiapp_platform_data. The gpiod consumer interface can also be
used with data provided from boardfiles as documented in
Documentation/gpio/board.txt, section "Platform Data". It basically
works like assigning regulators to devices from platform data.
You will obviously have to change every platform_device users of
smiapp, but it looks like upstream has none:
~/linux/arch $ git grep smiapp_platform_data || echo "Not found"
Not found
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-08-31 12:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 7:42 [PATCH 0/5] smiapp cleanups, retry probe if getting clock fails Sakari Ailus
2016-08-31 7:42 ` [PATCH 1/5] smiapp: Unify enforced and need-based 8-bit read Sakari Ailus
2016-08-31 7:42 ` [PATCH 2/5] smiapp: Rename smiapp_platform_data as smiapp_hwconfig Sakari Ailus
2016-08-31 7:42 ` [PATCH 3/5] smiapp: Return -EPROBE_DEFER if the clock cannot be obtained Sakari Ailus
2016-08-31 12:13 ` Sebastian Reichel
2016-08-31 12:57 ` [PATCH v1.1 " Sakari Ailus
2016-08-31 13:57 ` Sebastian Reichel
2016-08-31 13:00 ` [PATCH v1.1 5/5] smiapp: Switch to gpiod API for GPIO control Sakari Ailus
2016-08-31 14:18 ` Sebastian Reichel
2016-09-01 6:48 ` [PATCH v1.2 " Sakari Ailus
2016-09-01 11:50 ` Sebastian Reichel
2016-08-31 7:42 ` [PATCH 4/5] smiapp: Constify the regs argument to smiapp_write_8s() Sakari Ailus
2016-08-31 7:42 ` [PATCH 5/5] smiapp: Switch to gpiod API for GPIO control Sakari Ailus
2016-08-31 12:09 ` Sebastian Reichel [this message]
2016-08-31 12:42 ` Sakari Ailus
2016-08-31 12:21 ` [PATCH 0/5] smiapp cleanups, retry probe if getting clock fails Sebastian Reichel
2016-08-31 13:01 ` [PATCH v1.1 6/6] smiapp: Remove set_xclk() callback from hwconfig Sakari Ailus
2016-08-31 14:21 ` Sebastian Reichel
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=20160831120956.2ij6bslmf6jg3gpy@earth \
--to=sre@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@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