Re: [PATCH 5/5] smiapp: Switch to gpiod API for GPIO control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux