All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Daniel Scally <djrscally@gmail.com>, linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com, andriy.shevchenko@linux.intel.com,
	laurent.pinchart@ideasonboard.com, yong.zhi@intel.com,
	bingbu.cao@intel.com, tian.shu.qiu@intel.com,
	jeanmichel.hautbois@ideasonboard.com,
	kieran.bingham@ideasonboard.com
Subject: Re: [PATCH v5 4/5] media: i2c: ov5693: Rename ov5693_sw_standby() to ov5693_enable_streaming()
Date: Tue, 2 Nov 2021 10:24:09 +0100	[thread overview]
Message-ID: <0e565823-735f-6472-7336-493e068b5abc@redhat.com> (raw)
In-Reply-To: <20211101232144.134590-5-djrscally@gmail.com>

Hi,

On 11/2/21 00:21, Daniel Scally wrote:
> From: Hans de Goede <hdegoede@redhat.com>
> 
> ov5693_sw_standby() starts/stops streaming rename it so that it is actually
> named after what it does.
> 
> This also removes the weird enable inverting going on before.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/media/i2c/ov5693.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
> index 8ad51f8f88cf..2613bad49f78 100644
> --- a/drivers/media/i2c/ov5693.c
> +++ b/drivers/media/i2c/ov5693.c
> @@ -742,13 +742,13 @@ static int ov5693_mode_configure(struct ov5693_device *ov5693)
>  	return ret;
>  }
>  
> -static int ov5693_sw_standby(struct ov5693_device *ov5693, bool standby)
> +static int ov5693_enable_streaming(struct ov5693_device *ov5693, bool enable)
>  {
>  	int ret = 0;
>  
>  	ov5693_write_reg(ov5693, OV5693_SW_STREAM_REG,
> -			 standby ? OV5693_STOP_STREAMING :
> -				   OV5693_START_STREAMING, &ret);
> +			 enable ? OV5693_STOP_STREAMING :
> +				  OV5693_START_STREAMING, &ret);

In this version of this patch the function still behaves as if it is
setting the sensor in a standby mode, my original version had this:

	ov5693_write_reg(ov5693, OV5693_SW_STREAM_REG,
			 enable ? OV5693_START_STREAMING : OV5693_STOP_STREAMING,
			 &ret);

Which makes the function behave more logical.


>  
>  	return ret;
>  }
> @@ -784,9 +784,9 @@ static int ov5693_sensor_init(struct ov5693_device *ov5693)
>  		return ret;
>  	}
>  
> -	ret = ov5693_sw_standby(ov5693, true);
> +	ret = ov5693_enable_streaming(ov5693, true);

And my original version changes the true to false here, stopping
streaming on init (as before when setting standby to true,
including the error messages being different:

	ret = ov5693_enable_streaming(ov5693, false);
	if (ret)
		dev_err(ov5693->dev, "%s stop streaming error\n", __func__);



>  	if (ret)
> -		dev_err(ov5693->dev, "software standby error\n");
> +		dev_err(ov5693->dev, "enable streaming error\n");
>  
>  	return ret;
>  }
> @@ -1119,7 +1119,7 @@ static int ov5693_s_stream(struct v4l2_subdev *sd, int enable)
>  	}
>  
>  	mutex_lock(&ov5693->lock);
> -	ret = ov5693_sw_standby(ov5693, enable);
> +	ret = ov5693_enable_streaming(ov5693, enable);

And this used to be a change from !enable -> enable.

Note that the current version cannot work, you pass enable
(instead of !enable) but ov5693_enable_streaming() still
sends OV5693_STOP_STREAMING if enable is true, so you are
now stopping streaming when called to enable it ?

>  	mutex_unlock(&ov5693->lock);
>  
>  	if (ret)
> 

Besides this needing some work, it is fine with me, and
I believe that it is best, to just squash this and
patch 5/5 into patch 2 (since your introducing this
driver in this series it is a bit to then apply fixes
to it in the same series).

Regards,

Hans



  reply	other threads:[~2021-11-02  9:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 23:21 [PATCH v5 0/5] Add support for OV5693 sensor Daniel Scally
2021-11-01 23:21 ` [PATCH v5 1/5] media: ipu3-cio2: Toggle sensor streaming in pm runtime ops Daniel Scally
2021-11-01 23:21 ` [PATCH v5 2/5] media: i2c: Add support for ov5693 sensor Daniel Scally
2021-11-02  9:15   ` Hans de Goede
2021-11-02  9:49   ` Sakari Ailus
2021-11-01 23:21 ` [PATCH v5 3/5] media: ipu3-cio2: Add link freq for INT33BE entry Daniel Scally
2021-11-01 23:21 ` [PATCH v5 4/5] media: i2c: ov5693: Rename ov5693_sw_standby() to ov5693_enable_streaming() Daniel Scally
2021-11-02  9:24   ` Hans de Goede [this message]
2021-11-02  9:29     ` Daniel Scally
2021-11-01 23:21 ` [PATCH v5 5/5] media: i2c: ov5693: Fix lockdep error Daniel Scally

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=0e565823-735f-6472-7336-493e068b5abc@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=djrscally@gmail.com \
    --cc=jeanmichel.hautbois@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@intel.com \
    --cc=yong.zhi@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 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.