Re: [PATCH] drivers: media: video: Add support for Aptina ar0130 sensor

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

 



Hello,

I've spotted a minor issue while glancing through the code.

Cheers,
Nicolas

On 2012-09-07 11:30, Prashanth Subramanya wrote:
> This driver adds basic support for Aptina ar0130 1.2M sensor.
> 
> Signed-off-by: Prashanth Subramanya <sprashanth@xxxxxxxxxx>
> ---
[snip]
> +/***************************************************
> +               v4l2_subdev_video_ops
> +****************************************************/
> +static int ar0130_s_stream(struct v4l2_subdev *sd, int enable)
> +{
> +       struct i2c_client *client = v4l2_get_subdevdata(sd);
> +       struct ar0130_priv *ar0130 = container_of(sd,
> +                                       struct ar0130_priv, subdev);
> +       int ret;
> +
> +       if (!enable) {
> +               ret = ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_OFF);
> +               return 0;
> +       }
> +
> +       ret = ar0130_linear_mode_setup(client);
> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to setup linear mode: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret = ar0130_set_resolution(client, ar0130->res_index);
> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to setup resolution: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret |= ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_OFF);
> +       ret |= ar0130_write(client, AR0130_HDR_COMP, 0x0001);
> +
> +       ret = ar0130_pll_enable(ar0130);

The previous value of ret is overwritten here.

> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to enable pll: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret  = ar0130_set_autoexposure(client, AR0130_ENABLE);
> +       ret |= ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_ON);
> +
> +       return ret;
> +}��.n��������+%������w��{.n�����{��g����^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[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