Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
On Wed 11 July 2012 16:19:02 Federico Vaga wrote:
> > > > @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
> > > > adv7180_video_ops = {> 
> > > >  static const struct v4l2_subdev_core_ops adv7180_core_ops = {
> > > >  
> > > >   .g_chip_ident = adv7180_g_chip_ident,
> > > >   .s_std = adv7180_s_std,
> > > > 
> > > > - .queryctrl = adv7180_queryctrl,
> > > > - .g_ctrl = adv7180_g_ctrl,
> > > > - .s_ctrl = adv7180_s_ctrl,
> > > > + .queryctrl = v4l2_subdev_queryctrl,
> > > > + .g_ctrl = v4l2_subdev_g_ctrl,
> > > > + .s_ctrl = v4l2_subdev_s_ctrl,
> > > 
> > > I'm not sure to undestand this point. I "grepped" for the adv7180
> > > and it seem that I'm the only user of the adv7180 (sta2x11 VIP
> > > driver). In the VIP driver I don't use the control framework (there
> > > aren't controls), so I think these lines must be there. Am I wrong?
> > 
> > Correct. But once sta2x11 is converted to using the control framework,
> > then these lines can be dropped since no one else is using this
> > subdevice driver.
> 
> What do you suggest? I re-submit this patch and when sta2x11 is fixed a 
> I submit a new patch to remove these lines; or wait the full conversion 
> of the sta2x11 driver and submit both patch?

Choice 1: when sta2x11 is fixed submit a new patch to remove those lines.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Federico Vaga
> > > @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
> > > adv7180_video_ops = {> 
> > >  static const struct v4l2_subdev_core_ops adv7180_core_ops = {
> > >  
> > >   .g_chip_ident = adv7180_g_chip_ident,
> > >   .s_std = adv7180_s_std,
> > > 
> > > - .queryctrl = adv7180_queryctrl,
> > > - .g_ctrl = adv7180_g_ctrl,
> > > - .s_ctrl = adv7180_s_ctrl,
> > > + .queryctrl = v4l2_subdev_queryctrl,
> > > + .g_ctrl = v4l2_subdev_g_ctrl,
> > > + .s_ctrl = v4l2_subdev_s_ctrl,
> > 
> > I'm not sure to undestand this point. I "grepped" for the adv7180
> > and it seem that I'm the only user of the adv7180 (sta2x11 VIP
> > driver). In the VIP driver I don't use the control framework (there
> > aren't controls), so I think these lines must be there. Am I wrong?
> 
> Correct. But once sta2x11 is converted to using the control framework,
> then these lines can be dropped since no one else is using this
> subdevice driver.

What do you suggest? I re-submit this patch and when sta2x11 is fixed a 
I submit a new patch to remove these lines; or wait the full conversion 
of the sta2x11 driver and submit both patch?

-- 
Federico Vaga
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
On Wed 11 July 2012 15:36:25 Federico Vaga wrote:
> Hi Hans,
> 
> Thank you for your review
> 
> > > +static int adv7180_init_controls(struct adv7180_state *state)
> > > +{
> > > + v4l2_ctrl_handler_init(>ctrl_hdl, 2);
> > 
> > 2 -> 4, since there are 4 controls. It's a hint only, but it helps
> > optimizing the internal hash data structure.
> 
> Sure :)
> 
> > > 
> > > @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
> > > adv7180_video_ops = {> 
> > >  static const struct v4l2_subdev_core_ops adv7180_core_ops = {
> > >  
> > >   .g_chip_ident = adv7180_g_chip_ident,
> > >   .s_std = adv7180_s_std,
> > > 
> > > - .queryctrl = adv7180_queryctrl,
> > > - .g_ctrl = adv7180_g_ctrl,
> > > - .s_ctrl = adv7180_s_ctrl,
> > > + .queryctrl = v4l2_subdev_queryctrl,
> > > + .g_ctrl = v4l2_subdev_g_ctrl,
> > > + .s_ctrl = v4l2_subdev_s_ctrl,
> > 
> > If adv7180 is currently *only* used by bridge/platform drivers that
> > also use the control framework, then you can remove
> > queryctrl/g/s_ctrl altogether.
> 
> I'm not sure to undestand this point. I "grepped" for the adv7180 and it 
> seem that I'm the only user of the adv7180 (sta2x11 VIP driver). In the
> VIP driver I don't use the control framework (there aren't controls), so 
> I think these lines must be there. Am I wrong?

Correct. But once sta2x11 is converted to using the control framework, then
these lines can be dropped since no one else is using this subdevice driver.

> I think you are thinking at the "Inheriting Controls" section of the 
> v4l2-controls.txt document. Right?

Right.

Regards,

Hans

> 
> 
> > > - ret = i2c_smbus_write_byte_data(client, ADV7180_HUE_REG,
> > > state->hue); +ret = i2c_smbus_write_byte_data(client,
> > > ADV7180_HUE_REG,
> > > + ADV7180_HUE_DEF);
> > 
> > It shouldn't be necessary to initialize the controls since
> > v4l2_ctrl_handler_setup does that for you already.
> 
> Removed
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Federico Vaga
Hi Hans,

Thank you for your review

> > +static int adv7180_init_controls(struct adv7180_state *state)
> > +{
> > +   v4l2_ctrl_handler_init(>ctrl_hdl, 2);
> 
> 2 -> 4, since there are 4 controls. It's a hint only, but it helps
> optimizing the internal hash data structure.

Sure :)

> > 
> > @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
> > adv7180_video_ops = {> 
> >  static const struct v4l2_subdev_core_ops adv7180_core_ops = {
> >  
> > .g_chip_ident = adv7180_g_chip_ident,
> > .s_std = adv7180_s_std,
> > 
> > -   .queryctrl = adv7180_queryctrl,
> > -   .g_ctrl = adv7180_g_ctrl,
> > -   .s_ctrl = adv7180_s_ctrl,
> > +   .queryctrl = v4l2_subdev_queryctrl,
> > +   .g_ctrl = v4l2_subdev_g_ctrl,
> > +   .s_ctrl = v4l2_subdev_s_ctrl,
> 
> If adv7180 is currently *only* used by bridge/platform drivers that
> also use the control framework, then you can remove
> queryctrl/g/s_ctrl altogether.

I'm not sure to undestand this point. I "grepped" for the adv7180 and it 
seem that I'm the only user of the adv7180 (sta2x11 VIP driver). In the
VIP driver I don't use the control framework (there aren't controls), so 
I think these lines must be there. Am I wrong?

I think you are thinking at the "Inheriting Controls" section of the 
v4l2-controls.txt document. Right?


> > -   ret = i2c_smbus_write_byte_data(client, ADV7180_HUE_REG,
> > state->hue); +  ret = i2c_smbus_write_byte_data(client,
> > ADV7180_HUE_REG,
> > +   ADV7180_HUE_DEF);
> 
> It shouldn't be necessary to initialize the controls since
> v4l2_ctrl_handler_setup does that for you already.

Removed

-- 
Federico Vaga
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
Hi Federico!

A few small remarks:

On Wed July 11 2012 04:34:46 Federico Vaga wrote:
> Signed-off-by: Federico Vaga 
> ---
>  drivers/media/video/adv7180.c |  221 
> +
>  1 file changed, 90 insertions(+), 131 deletions(-)
> 
> diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c
> index 174bffa..7705456 100644
> --- a/drivers/media/video/adv7180.c
> +++ b/drivers/media/video/adv7180.c
> @@ -26,11 +26,10 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> -#define DRIVER_NAME "adv7180"
> -
>  #define ADV7180_INPUT_CONTROL_REG0x00
>  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM 0x00
>  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
> @@ -55,21 +54,21 @@
>  
>  #define ADV7180_AUTODETECT_ENABLE_REG0x07
>  #define ADV7180_AUTODETECT_DEFAULT   0x7f
> -
> +/* Contrast */
>  #define ADV7180_CON_REG  0x08/*Unsigned */
> -#define CON_REG_MIN  0
> -#define CON_REG_DEF  128
> -#define CON_REG_MAX  255
> -
> +#define ADV7180_CON_MIN  0
> +#define ADV7180_CON_DEF  128
> +#define ADV7180_CON_MAX  255
> +/* Brightness*/
>  #define ADV7180_BRI_REG  0x0a/*Signed */
> -#define BRI_REG_MIN  -128
> -#define BRI_REG_DEF  0
> -#define BRI_REG_MAX  127
> -
> +#define ADV7180_BRI_MIN  -128
> +#define ADV7180_BRI_DEF  0
> +#define ADV7180_BRI_MAX  127
> +/* Hue */
>  #define ADV7180_HUE_REG  0x0b/*Signed, inverted */
> -#define HUE_REG_MIN  -127
> -#define HUE_REG_DEF  0
> -#define HUE_REG_MAX  128
> +#define ADV7180_HUE_MIN  -127
> +#define ADV7180_HUE_DEF  0
> +#define ADV7180_HUE_MAX  128
>  
>  #define ADV7180_ADI_CTRL_REG 0x0e
>  #define ADV7180_ADI_CTRL_IRQ_SPACE   0x20
> @@ -98,12 +97,12 @@
>  #define ADV7180_ICONF1_ACTIVE_LOW0x01
>  #define ADV7180_ICONF1_PSYNC_ONLY0x10
>  #define ADV7180_ICONF1_ACTIVE_TO_CLR 0xC0
> -
> +/* Saturation */
>  #define ADV7180_SD_SAT_CB_REG0xe3/*Unsigned */
>  #define ADV7180_SD_SAT_CR_REG0xe4/*Unsigned */
> -#define SAT_REG_MIN  0
> -#define SAT_REG_DEF  128
> -#define SAT_REG_MAX  255
> +#define ADV7180_SAT_MIN  0
> +#define ADV7180_SAT_DEF  128
> +#define ADV7180_SAT_MAX  255
>  
>  #define ADV7180_IRQ1_LOCK0x01
>  #define ADV7180_IRQ1_UNLOCK  0x02
> @@ -121,18 +120,18 @@
>  #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND  0x4F
>  
>  struct adv7180_state {
> + struct v4l2_ctrl_handler ctrl_hdl;
>   struct v4l2_subdev  sd;
>   struct work_struct  work;
>   struct mutexmutex; /* mutual excl. when accessing chip */
>   int irq;
>   v4l2_std_id curr_norm;
>   boolautodetect;
> - s8  brightness;
> - s16 hue;
> - u8  contrast;
> - u8  saturation;
>   u8  input;
>  };
> +#define to_adv7180_sd(_ctrl) _of(_ctrl->handler,   \
> +struct adv7180_state,\
> +ctrl_hdl)->sd
>  
>  static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
>  {
> @@ -237,7 +236,7 @@ static int adv7180_s_routing(struct v4l2_subdev *sd, u32 
> input,
>   if (ret)
>   return ret;
>  
> - /*We cannot discriminate between LQFP and 40-pin LFCSP, so accept
> + /* We cannot discriminate between LQFP and 40-pin LFCSP, so accept
>* all inputs and let the card driver take care of validation
>*/
>   if ((input & ADV7180_INPUT_CONTROL_INSEL_MASK) != input)
> @@ -316,117 +315,39 @@ out:
>   return ret;
>  }
>  
> -static int adv7180_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl 
> *qc)
> -{
> - switch (qc->id) {
> - case V4L2_CID_BRIGHTNESS:
> - return v4l2_ctrl_query_fill(qc, BRI_REG_MIN, BRI_REG_MAX,
> - 1, BRI_REG_DEF);
> - case V4L2_CID_HUE:
> - return v4l2_ctrl_query_fill(qc, HUE_REG_MIN, HUE_REG_MAX,
> - 1, HUE_REG_DEF);
> - case V4L2_CID_CONTRAST:
> - return v4l2_ctrl_query_fill(qc, CON_REG_MIN, CON_REG_MAX,
> - 1, CON_REG_DEF);
> - case V4L2_CID_SATURATION:
> - return v4l2_ctrl_query_fill(qc, SAT_REG_MIN, SAT_REG_MAX,
> - 1, SAT_REG_DEF);
> - default:
> - break;
> - }
> -
> - return -EINVAL;
> -}
> -
> -static int adv7180_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
> -{
> - 

Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
Hi Federico!

A few small remarks:

On Wed July 11 2012 04:34:46 Federico Vaga wrote:
 Signed-off-by: Federico Vaga federico.v...@gmail.com
 ---
  drivers/media/video/adv7180.c |  221 
 +
  1 file changed, 90 insertions(+), 131 deletions(-)
 
 diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c
 index 174bffa..7705456 100644
 --- a/drivers/media/video/adv7180.c
 +++ b/drivers/media/video/adv7180.c
 @@ -26,11 +26,10 @@
  #include media/v4l2-ioctl.h
  #include linux/videodev2.h
  #include media/v4l2-device.h
 +#include media/v4l2-ctrls.h
  #include media/v4l2-chip-ident.h
  #include linux/mutex.h
  
 -#define DRIVER_NAME adv7180
 -
  #define ADV7180_INPUT_CONTROL_REG0x00
  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM 0x00
  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
 @@ -55,21 +54,21 @@
  
  #define ADV7180_AUTODETECT_ENABLE_REG0x07
  #define ADV7180_AUTODETECT_DEFAULT   0x7f
 -
 +/* Contrast */
  #define ADV7180_CON_REG  0x08/*Unsigned */
 -#define CON_REG_MIN  0
 -#define CON_REG_DEF  128
 -#define CON_REG_MAX  255
 -
 +#define ADV7180_CON_MIN  0
 +#define ADV7180_CON_DEF  128
 +#define ADV7180_CON_MAX  255
 +/* Brightness*/
  #define ADV7180_BRI_REG  0x0a/*Signed */
 -#define BRI_REG_MIN  -128
 -#define BRI_REG_DEF  0
 -#define BRI_REG_MAX  127
 -
 +#define ADV7180_BRI_MIN  -128
 +#define ADV7180_BRI_DEF  0
 +#define ADV7180_BRI_MAX  127
 +/* Hue */
  #define ADV7180_HUE_REG  0x0b/*Signed, inverted */
 -#define HUE_REG_MIN  -127
 -#define HUE_REG_DEF  0
 -#define HUE_REG_MAX  128
 +#define ADV7180_HUE_MIN  -127
 +#define ADV7180_HUE_DEF  0
 +#define ADV7180_HUE_MAX  128
  
  #define ADV7180_ADI_CTRL_REG 0x0e
  #define ADV7180_ADI_CTRL_IRQ_SPACE   0x20
 @@ -98,12 +97,12 @@
  #define ADV7180_ICONF1_ACTIVE_LOW0x01
  #define ADV7180_ICONF1_PSYNC_ONLY0x10
  #define ADV7180_ICONF1_ACTIVE_TO_CLR 0xC0
 -
 +/* Saturation */
  #define ADV7180_SD_SAT_CB_REG0xe3/*Unsigned */
  #define ADV7180_SD_SAT_CR_REG0xe4/*Unsigned */
 -#define SAT_REG_MIN  0
 -#define SAT_REG_DEF  128
 -#define SAT_REG_MAX  255
 +#define ADV7180_SAT_MIN  0
 +#define ADV7180_SAT_DEF  128
 +#define ADV7180_SAT_MAX  255
  
  #define ADV7180_IRQ1_LOCK0x01
  #define ADV7180_IRQ1_UNLOCK  0x02
 @@ -121,18 +120,18 @@
  #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND  0x4F
  
  struct adv7180_state {
 + struct v4l2_ctrl_handler ctrl_hdl;
   struct v4l2_subdev  sd;
   struct work_struct  work;
   struct mutexmutex; /* mutual excl. when accessing chip */
   int irq;
   v4l2_std_id curr_norm;
   boolautodetect;
 - s8  brightness;
 - s16 hue;
 - u8  contrast;
 - u8  saturation;
   u8  input;
  };
 +#define to_adv7180_sd(_ctrl) container_of(_ctrl-handler,   \
 +struct adv7180_state,\
 +ctrl_hdl)-sd
  
  static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
  {
 @@ -237,7 +236,7 @@ static int adv7180_s_routing(struct v4l2_subdev *sd, u32 
 input,
   if (ret)
   return ret;
  
 - /*We cannot discriminate between LQFP and 40-pin LFCSP, so accept
 + /* We cannot discriminate between LQFP and 40-pin LFCSP, so accept
* all inputs and let the card driver take care of validation
*/
   if ((input  ADV7180_INPUT_CONTROL_INSEL_MASK) != input)
 @@ -316,117 +315,39 @@ out:
   return ret;
  }
  
 -static int adv7180_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl 
 *qc)
 -{
 - switch (qc-id) {
 - case V4L2_CID_BRIGHTNESS:
 - return v4l2_ctrl_query_fill(qc, BRI_REG_MIN, BRI_REG_MAX,
 - 1, BRI_REG_DEF);
 - case V4L2_CID_HUE:
 - return v4l2_ctrl_query_fill(qc, HUE_REG_MIN, HUE_REG_MAX,
 - 1, HUE_REG_DEF);
 - case V4L2_CID_CONTRAST:
 - return v4l2_ctrl_query_fill(qc, CON_REG_MIN, CON_REG_MAX,
 - 1, CON_REG_DEF);
 - case V4L2_CID_SATURATION:
 - return v4l2_ctrl_query_fill(qc, SAT_REG_MIN, SAT_REG_MAX,
 - 1, SAT_REG_DEF);
 - default:
 - break;
 - }
 -
 - return -EINVAL;
 -}
 -
 -static int adv7180_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 -{
 - 

Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Federico Vaga
Hi Hans,

Thank you for your review

  +static int adv7180_init_controls(struct adv7180_state *state)
  +{
  +   v4l2_ctrl_handler_init(state-ctrl_hdl, 2);
 
 2 - 4, since there are 4 controls. It's a hint only, but it helps
 optimizing the internal hash data structure.

Sure :)

  
  @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
  adv7180_video_ops = { 
   static const struct v4l2_subdev_core_ops adv7180_core_ops = {
   
  .g_chip_ident = adv7180_g_chip_ident,
  .s_std = adv7180_s_std,
  
  -   .queryctrl = adv7180_queryctrl,
  -   .g_ctrl = adv7180_g_ctrl,
  -   .s_ctrl = adv7180_s_ctrl,
  +   .queryctrl = v4l2_subdev_queryctrl,
  +   .g_ctrl = v4l2_subdev_g_ctrl,
  +   .s_ctrl = v4l2_subdev_s_ctrl,
 
 If adv7180 is currently *only* used by bridge/platform drivers that
 also use the control framework, then you can remove
 queryctrl/g/s_ctrl altogether.

I'm not sure to undestand this point. I grepped for the adv7180 and it 
seem that I'm the only user of the adv7180 (sta2x11 VIP driver). In the
VIP driver I don't use the control framework (there aren't controls), so 
I think these lines must be there. Am I wrong?

I think you are thinking at the Inheriting Controls section of the 
v4l2-controls.txt document. Right?


  -   ret = i2c_smbus_write_byte_data(client, ADV7180_HUE_REG,
  state-hue); +  ret = i2c_smbus_write_byte_data(client,
  ADV7180_HUE_REG,
  +   ADV7180_HUE_DEF);
 
 It shouldn't be necessary to initialize the controls since
 v4l2_ctrl_handler_setup does that for you already.

Removed

-- 
Federico Vaga
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
On Wed 11 July 2012 15:36:25 Federico Vaga wrote:
 Hi Hans,
 
 Thank you for your review
 
   +static int adv7180_init_controls(struct adv7180_state *state)
   +{
   + v4l2_ctrl_handler_init(state-ctrl_hdl, 2);
  
  2 - 4, since there are 4 controls. It's a hint only, but it helps
  optimizing the internal hash data structure.
 
 Sure :)
 
   
   @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
   adv7180_video_ops = { 
static const struct v4l2_subdev_core_ops adv7180_core_ops = {

 .g_chip_ident = adv7180_g_chip_ident,
 .s_std = adv7180_s_std,
   
   - .queryctrl = adv7180_queryctrl,
   - .g_ctrl = adv7180_g_ctrl,
   - .s_ctrl = adv7180_s_ctrl,
   + .queryctrl = v4l2_subdev_queryctrl,
   + .g_ctrl = v4l2_subdev_g_ctrl,
   + .s_ctrl = v4l2_subdev_s_ctrl,
  
  If adv7180 is currently *only* used by bridge/platform drivers that
  also use the control framework, then you can remove
  queryctrl/g/s_ctrl altogether.
 
 I'm not sure to undestand this point. I grepped for the adv7180 and it 
 seem that I'm the only user of the adv7180 (sta2x11 VIP driver). In the
 VIP driver I don't use the control framework (there aren't controls), so 
 I think these lines must be there. Am I wrong?

Correct. But once sta2x11 is converted to using the control framework, then
these lines can be dropped since no one else is using this subdevice driver.

 I think you are thinking at the Inheriting Controls section of the 
 v4l2-controls.txt document. Right?

Right.

Regards,

Hans

 
 
   - ret = i2c_smbus_write_byte_data(client, ADV7180_HUE_REG,
   state-hue); +ret = i2c_smbus_write_byte_data(client,
   ADV7180_HUE_REG,
   + ADV7180_HUE_DEF);
  
  It shouldn't be necessary to initialize the controls since
  v4l2_ctrl_handler_setup does that for you already.
 
 Removed
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Federico Vaga
   @@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
   adv7180_video_ops = { 
static const struct v4l2_subdev_core_ops adv7180_core_ops = {

 .g_chip_ident = adv7180_g_chip_ident,
 .s_std = adv7180_s_std,
   
   - .queryctrl = adv7180_queryctrl,
   - .g_ctrl = adv7180_g_ctrl,
   - .s_ctrl = adv7180_s_ctrl,
   + .queryctrl = v4l2_subdev_queryctrl,
   + .g_ctrl = v4l2_subdev_g_ctrl,
   + .s_ctrl = v4l2_subdev_s_ctrl,
  
  I'm not sure to undestand this point. I grepped for the adv7180
  and it seem that I'm the only user of the adv7180 (sta2x11 VIP
  driver). In the VIP driver I don't use the control framework (there
  aren't controls), so I think these lines must be there. Am I wrong?
 
 Correct. But once sta2x11 is converted to using the control framework,
 then these lines can be dropped since no one else is using this
 subdevice driver.

What do you suggest? I re-submit this patch and when sta2x11 is fixed a 
I submit a new patch to remove these lines; or wait the full conversion 
of the sta2x11 driver and submit both patch?

-- 
Federico Vaga
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-11 Thread Hans Verkuil
On Wed 11 July 2012 16:19:02 Federico Vaga wrote:
@@ -445,9 +402,9 @@ static const struct v4l2_subdev_video_ops
adv7180_video_ops = { 
 static const struct v4l2_subdev_core_ops adv7180_core_ops = {
 
  .g_chip_ident = adv7180_g_chip_ident,
  .s_std = adv7180_s_std,

- .queryctrl = adv7180_queryctrl,
- .g_ctrl = adv7180_g_ctrl,
- .s_ctrl = adv7180_s_ctrl,
+ .queryctrl = v4l2_subdev_queryctrl,
+ .g_ctrl = v4l2_subdev_g_ctrl,
+ .s_ctrl = v4l2_subdev_s_ctrl,
   
   I'm not sure to undestand this point. I grepped for the adv7180
   and it seem that I'm the only user of the adv7180 (sta2x11 VIP
   driver). In the VIP driver I don't use the control framework (there
   aren't controls), so I think these lines must be there. Am I wrong?
  
  Correct. But once sta2x11 is converted to using the control framework,
  then these lines can be dropped since no one else is using this
  subdevice driver.
 
 What do you suggest? I re-submit this patch and when sta2x11 is fixed a 
 I submit a new patch to remove these lines; or wait the full conversion 
 of the sta2x11 driver and submit both patch?

Choice 1: when sta2x11 is fixed submit a new patch to remove those lines.

Regards,

Hans
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/