All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 5/5] smiapp: Switch to gpiod API for GPIO control
Date: Wed, 31 Aug 2016 15:42:32 +0300	[thread overview]
Message-ID: <57C6D0B8.4090306@linux.intel.com> (raw)
In-Reply-To: <20160831120956.2ij6bslmf6jg3gpy@earth>

Hi Sebastian,

Thanks for the review!

On 08/31/16 15:09, Sebastian Reichel wrote:
> 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.

Good point. I'll fix that.

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

  reply	other threads:[~2016-08-31 12:42 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
2016-08-31 12:42     ` Sakari Ailus [this message]
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=57C6D0B8.4090306@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sre@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.