diff mbox series

[5/5] media: i2c: alvium: Move V4L2_CID_GAIN to V4L2_CID_ANALOG_GAIN

Message ID 20240416141905.454253-6-tomm.merciai@gmail.com (mailing list archive)
State New, archived
Headers show
Series Alvium improvements | expand

Commit Message

Tommaso Merciai April 16, 2024, 2:19 p.m. UTC
Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
---
 drivers/media/i2c/alvium-csi2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sakari Ailus April 24, 2024, 6:11 p.m. UTC | #1
Hi Tommaso,

On Tue, Apr 16, 2024 at 04:19:05PM +0200, Tommaso Merciai wrote:
> Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
> Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.
> 
> Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
> ---
>  drivers/media/i2c/alvium-csi2.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
> index 30ef9b905211..56d64f27df72 100644
> --- a/drivers/media/i2c/alvium-csi2.c
> +++ b/drivers/media/i2c/alvium-csi2.c
> @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
>  	int val;
>  
>  	switch (ctrl->id) {
> -	case V4L2_CID_GAIN:
> +	case V4L2_CID_ANALOGUE_GAIN:
>  		val = alvium_get_gain(alvium);
>  		if (val < 0)
>  			return val;
> @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
>  		return 0;
>  
>  	switch (ctrl->id) {
> -	case V4L2_CID_GAIN:
> +	case V4L2_CID_ANALOGUE_GAIN:
>  		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
>  		break;
>  	case V4L2_CID_AUTOGAIN:
> @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium)
>  
>  	if (alvium->avail_ft.gain) {
>  		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
> -						V4L2_CID_GAIN,
> +						V4L2_CID_ANALOGUE_GAIN,
>  						alvium->min_gain,
>  						alvium->max_gain,
>  						alvium->inc_gain,

This looks like a bugfix. Shouldn't it be cc'd to stable as well? A Fixes:
tag would be nice, too.
Tommaso Merciai April 26, 2024, 7:09 a.m. UTC | #2
Hi Sakari,
Thanks for your review.

On Wed, Apr 24, 2024 at 06:11:26PM +0000, Sakari Ailus wrote:
> Hi Tommaso,
> 
> On Tue, Apr 16, 2024 at 04:19:05PM +0200, Tommaso Merciai wrote:
> > Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
> > Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.
> > 
> > Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
> > ---
> >  drivers/media/i2c/alvium-csi2.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
> > index 30ef9b905211..56d64f27df72 100644
> > --- a/drivers/media/i2c/alvium-csi2.c
> > +++ b/drivers/media/i2c/alvium-csi2.c
> > @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
> >  	int val;
> >  
> >  	switch (ctrl->id) {
> > -	case V4L2_CID_GAIN:
> > +	case V4L2_CID_ANALOGUE_GAIN:
> >  		val = alvium_get_gain(alvium);
> >  		if (val < 0)
> >  			return val;
> > @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
> >  		return 0;
> >  
> >  	switch (ctrl->id) {
> > -	case V4L2_CID_GAIN:
> > +	case V4L2_CID_ANALOGUE_GAIN:
> >  		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
> >  		break;
> >  	case V4L2_CID_AUTOGAIN:
> > @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium)
> >  
> >  	if (alvium->avail_ft.gain) {
> >  		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
> > -						V4L2_CID_GAIN,
> > +						V4L2_CID_ANALOGUE_GAIN,
> >  						alvium->min_gain,
> >  						alvium->max_gain,
> >  						alvium->inc_gain,
> 
> This looks like a bugfix. Shouldn't it be cc'd to stable as well? A Fixes:
> tag would be nice, too.

Fully agree.
Plan is to add in v2 Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera")
like you suggest and stable@vger.kernel.org in CC.

Thanks & Regards,
Tommaso

> 
> -- 
> Regards,
> 
> Sakari Ailus
Sakari Ailus April 26, 2024, 7:13 a.m. UTC | #3
Hi Tommaso,

On Fri, Apr 26, 2024 at 09:09:35AM +0200, Tommaso Merciai wrote:
> Hi Sakari,
> Thanks for your review.
> 
> On Wed, Apr 24, 2024 at 06:11:26PM +0000, Sakari Ailus wrote:
> > Hi Tommaso,
> > 
> > On Tue, Apr 16, 2024 at 04:19:05PM +0200, Tommaso Merciai wrote:
> > > Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
> > > Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.
> > > 
> > > Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
> > > ---
> > >  drivers/media/i2c/alvium-csi2.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
> > > index 30ef9b905211..56d64f27df72 100644
> > > --- a/drivers/media/i2c/alvium-csi2.c
> > > +++ b/drivers/media/i2c/alvium-csi2.c
> > > @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
> > >  	int val;
> > >  
> > >  	switch (ctrl->id) {
> > > -	case V4L2_CID_GAIN:
> > > +	case V4L2_CID_ANALOGUE_GAIN:
> > >  		val = alvium_get_gain(alvium);
> > >  		if (val < 0)
> > >  			return val;
> > > @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
> > >  		return 0;
> > >  
> > >  	switch (ctrl->id) {
> > > -	case V4L2_CID_GAIN:
> > > +	case V4L2_CID_ANALOGUE_GAIN:
> > >  		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
> > >  		break;
> > >  	case V4L2_CID_AUTOGAIN:
> > > @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium)
> > >  
> > >  	if (alvium->avail_ft.gain) {
> > >  		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
> > > -						V4L2_CID_GAIN,
> > > +						V4L2_CID_ANALOGUE_GAIN,
> > >  						alvium->min_gain,
> > >  						alvium->max_gain,
> > >  						alvium->inc_gain,
> > 
> > This looks like a bugfix. Shouldn't it be cc'd to stable as well? A Fixes:
> > tag would be nice, too.
> 
> Fully agree.
> Plan is to add in v2 Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera")
> like you suggest and stable@vger.kernel.org in CC.

Just make sure git send-email won't actually cc the patch to the stable
e-mail address. Cc: tag is enough. The git config option is
sendemail.suppresscc.
Tommaso Merciai April 26, 2024, 8:41 a.m. UTC | #4
Hi Sakari,

On Fri, Apr 26, 2024 at 07:13:06AM +0000, Sakari Ailus wrote:
> Hi Tommaso,
> 
> On Fri, Apr 26, 2024 at 09:09:35AM +0200, Tommaso Merciai wrote:
> > Hi Sakari,
> > Thanks for your review.
> > 
> > On Wed, Apr 24, 2024 at 06:11:26PM +0000, Sakari Ailus wrote:
> > > Hi Tommaso,
> > > 
> > > On Tue, Apr 16, 2024 at 04:19:05PM +0200, Tommaso Merciai wrote:
> > > > Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
> > > > Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.
> > > > 
> > > > Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
> > > > ---
> > > >  drivers/media/i2c/alvium-csi2.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
> > > > index 30ef9b905211..56d64f27df72 100644
> > > > --- a/drivers/media/i2c/alvium-csi2.c
> > > > +++ b/drivers/media/i2c/alvium-csi2.c
> > > > @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
> > > >  	int val;
> > > >  
> > > >  	switch (ctrl->id) {
> > > > -	case V4L2_CID_GAIN:
> > > > +	case V4L2_CID_ANALOGUE_GAIN:
> > > >  		val = alvium_get_gain(alvium);
> > > >  		if (val < 0)
> > > >  			return val;
> > > > @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
> > > >  		return 0;
> > > >  
> > > >  	switch (ctrl->id) {
> > > > -	case V4L2_CID_GAIN:
> > > > +	case V4L2_CID_ANALOGUE_GAIN:
> > > >  		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
> > > >  		break;
> > > >  	case V4L2_CID_AUTOGAIN:
> > > > @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium)
> > > >  
> > > >  	if (alvium->avail_ft.gain) {
> > > >  		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
> > > > -						V4L2_CID_GAIN,
> > > > +						V4L2_CID_ANALOGUE_GAIN,
> > > >  						alvium->min_gain,
> > > >  						alvium->max_gain,
> > > >  						alvium->inc_gain,
> > > 
> > > This looks like a bugfix. Shouldn't it be cc'd to stable as well? A Fixes:
> > > tag would be nice, too.
> > 
> > Fully agree.
> > Plan is to add in v2 Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera")
> > like you suggest and stable@vger.kernel.org in CC.
> 
> Just make sure git send-email won't actually cc the patch to the stable
> e-mail address. Cc: tag is enough. The git config option is
> sendemail.suppresscc.

Sorry, just to clarify.
You are suggesting just to add sendemail.suppresscc. option right?
No cc stable@vger.kernel.org

Thanks & Regards,
Tommaso

> 
> -- 
> Regards,
> 
> Sakari Ailus
Sakari Ailus April 26, 2024, 10:49 a.m. UTC | #5
Hi Tommaso,

On Fri, Apr 26, 2024 at 10:41:36AM +0200, Tommaso Merciai wrote:
> Hi Sakari,
> 
> On Fri, Apr 26, 2024 at 07:13:06AM +0000, Sakari Ailus wrote:
> > Hi Tommaso,
> > 
> > On Fri, Apr 26, 2024 at 09:09:35AM +0200, Tommaso Merciai wrote:
> > > Hi Sakari,
> > > Thanks for your review.
> > > 
> > > On Wed, Apr 24, 2024 at 06:11:26PM +0000, Sakari Ailus wrote:
> > > > Hi Tommaso,
> > > > 
> > > > On Tue, Apr 16, 2024 at 04:19:05PM +0200, Tommaso Merciai wrote:
> > > > > Into alvium cameras REG_BCRM_GAIN_RW control the analog gain.
> > > > > Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl.
> > > > > 
> > > > > Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
> > > > > ---
> > > > >  drivers/media/i2c/alvium-csi2.c | 6 +++---
> > > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
> > > > > index 30ef9b905211..56d64f27df72 100644
> > > > > --- a/drivers/media/i2c/alvium-csi2.c
> > > > > +++ b/drivers/media/i2c/alvium-csi2.c
> > > > > @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
> > > > >  	int val;
> > > > >  
> > > > >  	switch (ctrl->id) {
> > > > > -	case V4L2_CID_GAIN:
> > > > > +	case V4L2_CID_ANALOGUE_GAIN:
> > > > >  		val = alvium_get_gain(alvium);
> > > > >  		if (val < 0)
> > > > >  			return val;
> > > > > @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
> > > > >  		return 0;
> > > > >  
> > > > >  	switch (ctrl->id) {
> > > > > -	case V4L2_CID_GAIN:
> > > > > +	case V4L2_CID_ANALOGUE_GAIN:
> > > > >  		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
> > > > >  		break;
> > > > >  	case V4L2_CID_AUTOGAIN:
> > > > > @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium)
> > > > >  
> > > > >  	if (alvium->avail_ft.gain) {
> > > > >  		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
> > > > > -						V4L2_CID_GAIN,
> > > > > +						V4L2_CID_ANALOGUE_GAIN,
> > > > >  						alvium->min_gain,
> > > > >  						alvium->max_gain,
> > > > >  						alvium->inc_gain,
> > > > 
> > > > This looks like a bugfix. Shouldn't it be cc'd to stable as well? A Fixes:
> > > > tag would be nice, too.
> > > 
> > > Fully agree.
> > > Plan is to add in v2 Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera")
> > > like you suggest and stable@vger.kernel.org in CC.
> > 
> > Just make sure git send-email won't actually cc the patch to the stable
> > e-mail address. Cc: tag is enough. The git config option is
> > sendemail.suppresscc.
> 
> Sorry, just to clarify.
> You are suggesting just to add sendemail.suppresscc. option right?
> No cc stable@vger.kernel.org

Yes, and adding a Cc: stable@vger.kernel.org tag.
diff mbox series

Patch

diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
index 30ef9b905211..56d64f27df72 100644
--- a/drivers/media/i2c/alvium-csi2.c
+++ b/drivers/media/i2c/alvium-csi2.c
@@ -1993,7 +1993,7 @@  static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
 	int val;
 
 	switch (ctrl->id) {
-	case V4L2_CID_GAIN:
+	case V4L2_CID_ANALOGUE_GAIN:
 		val = alvium_get_gain(alvium);
 		if (val < 0)
 			return val;
@@ -2025,7 +2025,7 @@  static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
 		return 0;
 
 	switch (ctrl->id) {
-	case V4L2_CID_GAIN:
+	case V4L2_CID_ANALOGUE_GAIN:
 		ret = alvium_set_ctrl_gain(alvium, ctrl->val);
 		break;
 	case V4L2_CID_AUTOGAIN:
@@ -2154,7 +2154,7 @@  static int alvium_ctrl_init(struct alvium_dev *alvium)
 
 	if (alvium->avail_ft.gain) {
 		ctrls->gain = v4l2_ctrl_new_std(hdl, ops,
-						V4L2_CID_GAIN,
+						V4L2_CID_ANALOGUE_GAIN,
 						alvium->min_gain,
 						alvium->max_gain,
 						alvium->inc_gain,