Re: [PATCH 35/38] media: adv7180: add power pin control

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

 



On 06/15/2016 12:49 AM, Steve Longerbeam wrote:
> +		usleep_range(5000, 5001);

That's kind of not how usleep_range() (the emphasis is on range) is supposed
to be used. You typically dont care too much about the upper limit here so
something like maybe 10000 is more appropriate.


> +static int adv7180_of_parse(struct adv7180_state *state)
> +{
> +	struct i2c_client *client = state->client;
> +	struct device_node *np = client->dev.of_node;
> +	int ret;
> +
> +	ret = of_get_named_gpio(np, "pwdn-gpio", 0);
> +
> +	if (gpio_is_valid(ret)) {
> +		state->pwdn_gpio = ret;
> +		ret = devm_gpio_request_one(&client->dev,
> +					    state->pwdn_gpio,
> +					    GPIOF_OUT_INIT_HIGH,
> +					    "adv7180_pwdn");


This should use the new GPIO descriptor API. That will also make the code
devicetree independent. Otherwise patch looks OK.

> +		if (ret < 0) {
> +			v4l_err(client, "request for power pin failed\n");
> +			return ret;
> +		}
> +	} else {
> +		if (ret == -EPROBE_DEFER)
> +			return ret;
> +		/* assume a power-down gpio is not required */
> +		state->pwdn_gpio = -1;
> +	}
> +
> +	return 0;
> +}

--
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