RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME

2014-07-21 Thread Divneil Wadhawan

Hi Hans,

 This patch is all messed up and doesn't apply.

 Check your mailer settings: it clearly replaced hard tabs by a space.

 Can you repost?

I tried to find out if I can change the mailer settings. Seems, that is the 
problem.


I tried using mutt, but, seems the configuration is missing.

If you have a simple method, on using mutt, I will send it from there, as, mutt 
is respecting the TAB spaces.

I didn't spend much time with it for time being.


Regards,

Divneil   --
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 06/29] [media] coda: Add encoder/decoder support for CODA960

2014-07-21 Thread Robert Schwebel
Hi Fabio,

On Fri, Jul 11, 2014 at 02:33:18PM +0200, Robert Schwebel wrote:
 On Wed, Jul 02, 2014 at 09:16:42PM +0200, Robert Schwebel wrote:
   It would be really nice if the firmware was available in the
   linux-firmware repository. Do you think this would be possible?
   
   Best wishes,
   -- 
   Kamil Debski
   Samsung RD Institute Poland
  
  I tried to convince Freescale to put the firmware into linux-firmware
  for 15 months now, but recently got no reply any more.
  
  Fabio, Shawn, could you try to discuss this with the responsible folks
  inside FSL again? Maybe responsibilities have changed in the meantime
  and I might have tried to talk to the wrong people.
 
 Any news?

Did you get some feedback? I didn't.

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME

2014-07-21 Thread Ricardo Ribalda Delgado
Why dont you use git send-email ?

On Mon, Jul 21, 2014 at 8:03 AM, Divneil Wadhawan divn...@outlook.com wrote:

 Hi Hans,

 This patch is all messed up and doesn't apply.

 Check your mailer settings: it clearly replaced hard tabs by a space.

 Can you repost?

 I tried to find out if I can change the mailer settings. Seems, that is the 
 problem.


 I tried using mutt, but, seems the configuration is missing.

 If you have a simple method, on using mutt, I will send it from there, as, 
 mutt is respecting the TAB spaces.

 I didn't spend much time with it for time being.


 Regards,

 Divneil   --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Ricardo Ribalda
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH for v3.17] v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps

2014-07-21 Thread Hans Verkuil
V4L2_CAP_EXT_PIX_FORMAT is set for capabilities, but it needs to be set for
device_caps as well: device_caps should report all caps relevant to the
device node, and this is one of them.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index e620387..00ceedf 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1014,6 +1014,7 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
ret = ops-vidioc_querycap(file, fh, cap);
 
cap-capabilities |= V4L2_CAP_EXT_PIX_FORMAT;
+   cap-device_caps |= V4L2_CAP_EXT_PIX_FORMAT;
 
return ret;
 }
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH for v3.17] v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps

2014-07-21 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Monday 21 July 2014 09:14:46 Hans Verkuil wrote:
 V4L2_CAP_EXT_PIX_FORMAT is set for capabilities, but it needs to be set for
 device_caps as well: device_caps should report all caps relevant to the
 device node, and this is one of them.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
 b/drivers/media/v4l2-core/v4l2-ioctl.c index e620387..00ceedf 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -1014,6 +1014,7 @@ static int v4l_querycap(const struct v4l2_ioctl_ops
 *ops, ret = ops-vidioc_querycap(file, fh, cap);
 
   cap-capabilities |= V4L2_CAP_EXT_PIX_FORMAT;
 + cap-device_caps |= V4L2_CAP_EXT_PIX_FORMAT;
 
   return ret;
  }

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Sunday 20 July 2014 15:10:03 Hans Verkuil wrote:
 Regression fix:
 
 V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
 VIDEO_OUTPUT buffer types, and not for any others. In the case of
 the win format this overwrites a pointer value that is passed in from
 userspace.
 
 Since it is already set for the VIDEO_CAPTURE and VIDEO_OUTPUT cases
 anyway this line can just be dropped.

It's set after calling the vidioc_g_fmt_vid_cap or vidioc_g_fmt_vid_out 
operation, which means that driver will not see the flag being set. Couldn't 
that be an issue ?

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/media/v4l2-core/v4l2-ioctl.c | 2 --
  1 file changed, 2 deletions(-)
 
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
 b/drivers/media/v4l2-core/v4l2-ioctl.c index e620387..c11a13d 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -1143,8 +1143,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
   int ret;
 
 - p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 -
   /*
* fmt can't be cleared for these overlay types due to the 'clips'
* 'clipcount' and 'bitmap' pointers in struct v4l2_window.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Hans Verkuil
On 07/21/2014 11:11 AM, Laurent Pinchart wrote:
 Hi Hans,
 
 Thank you for the patch.
 
 On Sunday 20 July 2014 15:10:03 Hans Verkuil wrote:
 Regression fix:

 V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
 VIDEO_OUTPUT buffer types, and not for any others. In the case of
 the win format this overwrites a pointer value that is passed in from
 userspace.

 Since it is already set for the VIDEO_CAPTURE and VIDEO_OUTPUT cases
 anyway this line can just be dropped.
 
 It's set after calling the vidioc_g_fmt_vid_cap or vidioc_g_fmt_vid_out 
 operation, which means that driver will not see the flag being set. Couldn't 
 that be an issue ?

While I don't think it is necessary as such, it is better for consistency.
I'll post a new patch.

Regards,

Hans

 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/media/v4l2-core/v4l2-ioctl.c | 2 --
  1 file changed, 2 deletions(-)

 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
 b/drivers/media/v4l2-core/v4l2-ioctl.c index e620387..c11a13d 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -1143,8 +1143,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
  int ret;

 -p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 -
  /*
   * fmt can't be cleared for these overlay types due to the 'clips'
   * 'clipcount' and 'bitmap' pointers in struct v4l2_window.
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Hans Verkuil
Regression fix:

V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
VIDEO_OUTPUT buffer types, and not for any others. In the case of
the win format this overwrote a pointer value that is passed in from
userspace.

Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT and not anywhere
else. Also set it before the callback is called rather than after it,
just as is done for try/s_fmt.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index e620387..e876bb9 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1141,9 +1141,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
-   int ret;
-
-   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 
/*
 * fmt can't be cleared for these overlay types due to the 'clips'
@@ -1164,6 +1161,15 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
p-fmt.win.bitmap = bitmap;
break;
}
+   case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+   case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+   memset(p-fmt, 0, sizeof(p-fmt));
+   /*
+* Fill in the priv field to signal that the extended
+* v4l2_pix_format fields are valid.
+*/
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+   break;
default:
memset(p-fmt, 0, sizeof(p-fmt));
break;
@@ -1173,9 +1179,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (unlikely(!is_rx || !is_vid || !ops-vidioc_g_fmt_vid_cap))
break;
-   ret = ops-vidioc_g_fmt_vid_cap(file, fh, arg);
-   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
-   return ret;
+   return ops-vidioc_g_fmt_vid_cap(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!is_rx || !is_vid || 
!ops-vidioc_g_fmt_vid_cap_mplane))
break;
@@ -1195,9 +1199,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
if (unlikely(!is_tx || !is_vid || !ops-vidioc_g_fmt_vid_out))
break;
-   ret = ops-vidioc_g_fmt_vid_out(file, fh, arg);
-   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
-   return ret;
+   return ops-vidioc_g_fmt_vid_out(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
if (unlikely(!is_tx || !is_vid || 
!ops-vidioc_g_fmt_vid_out_mplane))
break;
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Monday 21 July 2014 11:31:46 Hans Verkuil wrote:
 Regression fix:
 
 V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
 VIDEO_OUTPUT buffer types, and not for any others. In the case of
 the win format this overwrote a pointer value that is passed in from
 userspace.
 
 Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT and not anywhere
 else. Also set it before the callback is called rather than after it,
 just as is done for try/s_fmt.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
 b/drivers/media/v4l2-core/v4l2-ioctl.c index e620387..e876bb9 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -1141,9 +1141,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
   bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
   bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
 - int ret;
 -
 - p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 
   /*
* fmt can't be cleared for these overlay types due to the 'clips'
 @@ -1164,6 +1161,15 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops
 *ops, p-fmt.win.bitmap = bitmap;
   break;
   }
 + case V4L2_BUF_TYPE_VIDEO_CAPTURE:
 + case V4L2_BUF_TYPE_VIDEO_OUTPUT:
 + memset(p-fmt, 0, sizeof(p-fmt));
 + /*
 +  * Fill in the priv field to signal that the extended
 +  * v4l2_pix_format fields are valid.
 +  */
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 + break;
   default:
   memset(p-fmt, 0, sizeof(p-fmt));
   break;
 @@ -1173,9 +1179,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
   if (unlikely(!is_rx || !is_vid || !ops-vidioc_g_fmt_vid_cap))
   break;
 - ret = ops-vidioc_g_fmt_vid_cap(file, fh, arg);
 - p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 - return ret;
 + return ops-vidioc_g_fmt_vid_cap(file, fh, arg);

If a driver zeroes the priv field in vidioc_g_fmt_vid_cap or 
(vidioc_g_fmt_vid_out below) this will break. We should really set the field 
before and after calling the operation.

   case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
   if (unlikely(!is_rx || !is_vid || 
 !ops-vidioc_g_fmt_vid_cap_mplane))
   break;
 @@ -1195,9 +1199,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
   if (unlikely(!is_tx || !is_vid || !ops-vidioc_g_fmt_vid_out))
   break;
 - ret = ops-vidioc_g_fmt_vid_out(file, fh, arg);
 - p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 - return ret;
 + return ops-vidioc_g_fmt_vid_out(file, fh, arg);
   case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
   if (unlikely(!is_tx || !is_vid || 
 !ops-vidioc_g_fmt_vid_out_mplane))
   break;

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Hans Verkuil
Regression fix:

V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
VIDEO_OUTPUT buffer types, and not for any others. In the case of
the win format this overwrote a pointer value that is passed in from
userspace.

Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Also set
it before the callback is called, just as is done for try/s_fmt.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index e620387..22c8d48 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1143,8 +1143,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
int ret;
 
-   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
-
/*
 * fmt can't be cleared for these overlay types due to the 'clips'
 * 'clipcount' and 'bitmap' pointers in struct v4l2_window.
@@ -1164,6 +1162,15 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
p-fmt.win.bitmap = bitmap;
break;
}
+   case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+   case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+   memset(p-fmt, 0, sizeof(p-fmt));
+   /*
+* Fill in the priv field to signal that the extended
+* v4l2_pix_format fields are valid.
+*/
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+   break;
default:
memset(p-fmt, 0, sizeof(p-fmt));
break;
@@ -1174,6 +1181,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_rx || !is_vid || !ops-vidioc_g_fmt_vid_cap))
break;
ret = ops-vidioc_g_fmt_vid_cap(file, fh, arg);
+   /* just in case the driver zeroed it again */
p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
return ret;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
@@ -1196,6 +1204,7 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_tx || !is_vid || !ops-vidioc_g_fmt_vid_out))
break;
ret = ops-vidioc_g_fmt_vid_out(file, fh, arg);
+   /* just in case the driver zeroed it again */
p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
return ret;
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv4 for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Hans Verkuil
Regression fix:

V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
VIDEO_OUTPUT buffer types, and not for any others. In the case of
the win format this overwrote a pointer value that is passed in from
userspace.

Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Set
it before the callback is called, just as is done for try/s_fmt, and
again afterwards in case the driver zeroed it. The latter was missing
in try/s_fmt, so add it there as well. Currently it is quite likely
that drivers clear priv (that was needed for a long time), so it makes
sense to set it twice.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index e620387..9fc8076 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1143,8 +1143,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
int ret;
 
-   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
-
/*
 * fmt can't be cleared for these overlay types due to the 'clips'
 * 'clipcount' and 'bitmap' pointers in struct v4l2_window.
@@ -1173,7 +1171,9 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (unlikely(!is_rx || !is_vid || !ops-vidioc_g_fmt_vid_cap))
break;
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
ret = ops-vidioc_g_fmt_vid_cap(file, fh, arg);
+   /* just in case the driver zeroed it again */
p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
return ret;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
@@ -1195,7 +1195,9 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
if (unlikely(!is_tx || !is_vid || !ops-vidioc_g_fmt_vid_out))
break;
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
ret = ops-vidioc_g_fmt_vid_out(file, fh, arg);
+   /* just in case the driver zeroed it again */
p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
return ret;
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
@@ -1231,6 +1233,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
+   int ret;
 
v4l_sanitize_format(p);
 
@@ -1239,7 +1242,10 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_rx || !is_vid || !ops-vidioc_s_fmt_vid_cap))
break;
CLEAR_AFTER_FIELD(p, fmt.pix);
-   return ops-vidioc_s_fmt_vid_cap(file, fh, arg);
+   ret = ops-vidioc_s_fmt_vid_cap(file, fh, arg);
+   /* just in case the driver zeroed it again */
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+   return ret;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!is_rx || !is_vid || 
!ops-vidioc_s_fmt_vid_cap_mplane))
break;
@@ -1264,7 +1270,10 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_tx || !is_vid || !ops-vidioc_s_fmt_vid_out))
break;
CLEAR_AFTER_FIELD(p, fmt.pix);
-   return ops-vidioc_s_fmt_vid_out(file, fh, arg);
+   ret = ops-vidioc_s_fmt_vid_out(file, fh, arg);
+   /* just in case the driver zeroed it again */
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+   return ret;
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
if (unlikely(!is_tx || !is_vid || 
!ops-vidioc_s_fmt_vid_out_mplane))
break;
@@ -1303,6 +1312,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
+   int ret;
 
v4l_sanitize_format(p);
 
@@ -1311,7 +1321,10 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_rx || !is_vid || !ops-vidioc_try_fmt_vid_cap))
break;
CLEAR_AFTER_FIELD(p, fmt.pix);
-   return ops-vidioc_try_fmt_vid_cap(file, fh, arg);
+   ret = ops-vidioc_try_fmt_vid_cap(file, fh, arg);
+   /* just in case the driver zeroed it again */
+   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+   return ret;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!is_rx || !is_vid || 
!ops-vidioc_try_fmt_vid_cap_mplane))
break;
@@ -1336,7 +1349,10 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
if 

Re: [PATCHv4 for v3.17] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

2014-07-21 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Monday 21 July 2014 12:50:39 Hans Verkuil wrote:
 Regression fix:
 
 V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
 VIDEO_OUTPUT buffer types, and not for any others. In the case of
 the win format this overwrote a pointer value that is passed in from
 userspace.
 
 Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Set
 it before the callback is called, just as is done for try/s_fmt, and
 again afterwards in case the driver zeroed it. The latter was missing
 in try/s_fmt, so add it there as well. Currently it is quite likely
 that drivers clear priv (that was needed for a long time), so it makes
 sense to set it twice.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
 b/drivers/media/v4l2-core/v4l2-ioctl.c index e620387..9fc8076 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -1143,8 +1143,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
   int ret;
 
 - p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 -
   /*
* fmt can't be cleared for these overlay types due to the 'clips'
* 'clipcount' and 'bitmap' pointers in struct v4l2_window.
 @@ -1173,7 +1171,9 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
   if (unlikely(!is_rx || !is_vid || !ops-vidioc_g_fmt_vid_cap))
   break;
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
   ret = ops-vidioc_g_fmt_vid_cap(file, fh, arg);
 + /* just in case the driver zeroed it again */
   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
   return ret;
   case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
 @@ -1195,7 +1195,9 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
   if (unlikely(!is_tx || !is_vid || !ops-vidioc_g_fmt_vid_out))
   break;
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
   ret = ops-vidioc_g_fmt_vid_out(file, fh, arg);
 + /* just in case the driver zeroed it again */
   p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
   return ret;
   case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
 @@ -1231,6 +1233,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
 bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
   bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
   bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
 + int ret;
 
   v4l_sanitize_format(p);
 
 @@ -1239,7 +1242,10 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops
 *ops, if (unlikely(!is_rx || !is_vid || !ops-vidioc_s_fmt_vid_cap))
   break;
   CLEAR_AFTER_FIELD(p, fmt.pix);
 - return ops-vidioc_s_fmt_vid_cap(file, fh, arg);
 + ret = ops-vidioc_s_fmt_vid_cap(file, fh, arg);
 + /* just in case the driver zeroed it again */
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 + return ret;
   case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
   if (unlikely(!is_rx || !is_vid || 
 !ops-vidioc_s_fmt_vid_cap_mplane))
   break;
 @@ -1264,7 +1270,10 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops
 *ops, if (unlikely(!is_tx || !is_vid || !ops-vidioc_s_fmt_vid_out))
   break;
   CLEAR_AFTER_FIELD(p, fmt.pix);
 - return ops-vidioc_s_fmt_vid_out(file, fh, arg);
 + ret = ops-vidioc_s_fmt_vid_out(file, fh, arg);
 + /* just in case the driver zeroed it again */
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 + return ret;
   case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
   if (unlikely(!is_tx || !is_vid || 
 !ops-vidioc_s_fmt_vid_out_mplane))
   break;
 @@ -1303,6 +1312,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops
 *ops, bool is_sdr = vfd-vfl_type == VFL_TYPE_SDR;
   bool is_rx = vfd-vfl_dir != VFL_DIR_TX;
   bool is_tx = vfd-vfl_dir != VFL_DIR_RX;
 + int ret;
 
   v4l_sanitize_format(p);
 
 @@ -1311,7 +1321,10 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops
 *ops, if (unlikely(!is_rx || !is_vid || !ops-vidioc_try_fmt_vid_cap))
 break;
   CLEAR_AFTER_FIELD(p, fmt.pix);
 - return ops-vidioc_try_fmt_vid_cap(file, fh, arg);
 + ret = ops-vidioc_try_fmt_vid_cap(file, fh, arg);
 + /* just in case the driver zeroed it again */
 + p-fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
 + return ret;
   case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
   if (unlikely(!is_rx || !is_vid || !ops-
vidioc_try_fmt_vid_cap_mplane))
   break;
 @@ -1336,7 +1349,10 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops
 *ops, if 

Re: [PATCH/RFC v4 15/21] media: Add registration helpers for V4L2 flash

2014-07-21 Thread Sakari Ailus
Hi Jacek,

Jacek Anaszewski wrote:
 This patch adds helper functions for registering/unregistering
 LED class flash devices as V4L2 subdevs. The functions should
 be called from the LED subsystem device driver. In case the
 support for V4L2 Flash sub-devices is disabled in the kernel
 config the functions' empty versions will be used.
 
 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Acked-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Sakari Ailus sakari.ai...@iki.fi
 Cc: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/media/v4l2-core/Kconfig  |   11 +
  drivers/media/v4l2-core/Makefile |2 +
  drivers/media/v4l2-core/v4l2-flash.c |  580 
 ++
  include/media/v4l2-flash.h   |  137 
  4 files changed, 730 insertions(+)
  create mode 100644 drivers/media/v4l2-core/v4l2-flash.c
  create mode 100644 include/media/v4l2-flash.h
 
 diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
 index 9ca0f8d..3ae3f0f 100644
 --- a/drivers/media/v4l2-core/Kconfig
 +++ b/drivers/media/v4l2-core/Kconfig
 @@ -35,6 +35,17 @@ config V4L2_MEM2MEM_DEV
  tristate
  depends on VIDEOBUF2_CORE
  
 +# Used by LED subsystem flash drivers
 +config V4L2_FLASH_LED_CLASS
 + bool Enable support for Flash sub-devices
 + depends on VIDEO_V4L2_SUBDEV_API
 + depends on LEDS_CLASS_FLASH
 + ---help---
 +   Say Y here to enable support for Flash sub-devices, which allow
 +   to control LED class devices with use of V4L2 Flash controls.
 +
 +   When in doubt, say N.
 +
  # Used by drivers that need Videobuf modules
  config VIDEOBUF_GEN
   tristate
 diff --git a/drivers/media/v4l2-core/Makefile 
 b/drivers/media/v4l2-core/Makefile
 index 63d29f2..44e858c 100644
 --- a/drivers/media/v4l2-core/Makefile
 +++ b/drivers/media/v4l2-core/Makefile
 @@ -22,6 +22,8 @@ obj-$(CONFIG_VIDEO_TUNER) += tuner.o
  
  obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o
  
 +obj-$(CONFIG_V4L2_FLASH_LED_CLASS) += v4l2-flash.o
 +
  obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o
  obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o
  obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o
 diff --git a/drivers/media/v4l2-core/v4l2-flash.c 
 b/drivers/media/v4l2-core/v4l2-flash.c
 new file mode 100644
 index 000..21080c6
 --- /dev/null
 +++ b/drivers/media/v4l2-core/v4l2-flash.c
 @@ -0,0 +1,580 @@
 +/*
 + * V4L2 Flash LED sub-device registration helpers.
 + *
 + *   Copyright (C) 2014 Samsung Electronics Co., Ltd
 + *   Author: Jacek Anaszewski j.anaszew...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +#include linux/led-class-flash.h
 +#include linux/mutex.h
 +#include linux/of_led_flash_manager.h
 +#include linux/slab.h
 +#include media/v4l2-flash.h
 +
 +#define call_flash_op(v4l2_flash, op, args...)   \
 + (v4l2_flash-ops-op  ? \
 + v4l2_flash-ops-op(args) : \
 + -EINVAL)
 +
 +static struct v4l2_device *v4l2_dev;
 +static int registered_flashes;
 +
 +static inline enum led_brightness v4l2_flash_intensity_to_led_brightness(
 + struct v4l2_ctrl_config *config,
 + s32 intensity)
 +{
 + return ((intensity - config-min) / config-step) + 1;
 +}
 +
 +static inline s32 v4l2_flash_led_brightness_to_intensity(
 + struct v4l2_ctrl_config *config,
 + enum led_brightness brightness)
 +{
 + return ((brightness - 1) * config-step) + config-min;
 +}
 +
 +static int v4l2_flash_g_volatile_ctrl(struct v4l2_ctrl *c)
 +
 +{
 + struct v4l2_flash *v4l2_flash = v4l2_ctrl_to_v4l2_flash(c);
 + struct led_classdev_flash *flash = v4l2_flash-flash;
 + struct led_classdev *led_cdev = flash-led_cdev;
 + struct v4l2_flash_ctrl_config *config = v4l2_flash-config;
 + struct v4l2_flash_ctrl *ctrl = v4l2_flash-ctrl;
 + bool is_strobing;
 + int ret;
 +
 + switch (c-id) {
 + case V4L2_CID_FLASH_TORCH_INTENSITY:
 + /*
 +  * Update torch brightness only if in TORCH_MODE,
 +  * as otherwise brightness_update op returns 0,
 +  * which would spuriously inform user space that
 +  * V4L2_CID_FLASH_TORCH_INTENSITY control value
 +  * has changed.
 +  */
 + if (ctrl-led_mode-val == V4L2_FLASH_LED_MODE_TORCH) {
 + ret = call_flash_op(v4l2_flash, torch_brightness_update,
 + led_cdev);
 + if (ret  0)
 + return ret;
 + ctrl-torch_intensity-val =
 + 

Re: Configurable Video Controller Driver

2014-07-21 Thread Sakari Ailus
Hi Julien,

On Thu, Jul 10, 2014 at 04:19:06PM +0200, Julien BERAUD wrote:
 We are developing a driver for our video controller which has the
 particularity of being very reconfigurable.
 
 We have reached a point at which the complexity and variety of the
 applications we need to implement forces us to
 design an api/library that allows us to configure the
 interconnection of the different video processing units(Camera
 interfaces,
 LCD interfaces, scalers, rotators, demosaicing, dead pixel
 correction, etc...) from userland.
 
 The media controller api has the limitation of not being able to
 create links but just browsing and activating/deactivating them.
 If we just allowed a user to activate/deactivate links, then we
 would have to declare all the possible connections between
 the different blocks, which would make it very confusing from a
 userland point of view. Moreover, the interconnection constraints
 would have to be dealt with very generically, which would make it
 very difficult in the kernel too.

How many different blocks do you have? Can they be connected in arbitrary
ways? If not, what kind of limitations do you have?

The Media controller is originally intended for modelling complex devices
with hardware data paths between the sub-blocks. The question is: does your
device fit into that group, even if could be a little more complex than the
devices that are currently supported?

 The conclusion we have reached yet is that we have to design an API
 that allows us to create v4l2 subdevices that have certain
 capabilities(scaling,rotating, demosaicing, etc...) and then to
 create links between them from a userland library.

Can you create arbitrary devices at will, or do these devices exist on
hardware all the time?

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] DocBook media typo

2014-07-21 Thread Sakari Ailus
On Sun, Jul 20, 2014 at 10:16:41PM +0200, Hans Verkuil wrote:
 V4L2_CID_BASE_LASTP1 should be V4L2_CID_LASTP1. This has probably been wrong
 since the earliest days of this documentation until I did a copy-and-paste
 and found out that V4L2_CID_BASE_LASTP1 doesn't actually exist :-)
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Acked-by: Sakari Ailus sakari.ai...@linux.intel.com

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2014-07-21 Thread Peter Meerwald
Hello,

how can I query the supported pixel format(s) of a sensor connected via 
media-ctl and exposed via /dev/videoX

there is 
VIDIOC_ENUM_FMT (which fails)
and
VIDIOC_SUBDEV_ENUM_MBUS_CODE (which works, but on a subdev, not on 
/dev/videoX)

v4l2_subdev_video_ops has .enum_mbus_fmt (this is SoC camera stuff?)

v4l2_subdev_pad_ops has .enum_mbus_code


the application just sees /dev/videoX and cannot do VIDIOC_ENUM_FMT
what is the logic behind this?
shouldn't a compabatibility layer be added turning VIDIOC_ENUM_FMT into 
VIDIOC_SUBDEV_ENUM_MBUS_CODE?

thanks, p.

-- 

Peter Meerwald
+43-664-218 (mobile)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] exynos-gsc: Remove PM_RUNTIME dependency

2014-07-21 Thread Sylwester Nawrocki
On 21/07/14 06:54, Shaik Ameer Basha wrote:
 1] Currently Gscaler clock is enabled only inside pm_runtime callbacks.
If PM_RUNTIME is disabled, driver hangs. This patch removes the
PM_RUNTIME dependency by keeping the clock enable/disable functions
in m2m start/stop streaming callbacks.
 
 2] For Exynos5420/5800, Gscaler clock has to be Turned ON before powering
on/off the Gscaler power domain. This dependency is taken care by
this patch at driver level.
 
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com

Acked-by: Sylwester Nawrocki s.nawro...@samsung.com

-- 
Regards,
Sylwester
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH] Docbook/media: improve data_offset/bytesused documentation

2014-07-21 Thread Hans Verkuil
This patch explicitly documents the relationship between bytesused and 
data_offset.

But looking in the kernel there isn't a single driver that actually sets 
data_offset.
Do such beasts exist? It's also annoying that there is no such equivalent for 
the
single planar API, so it is asymmetrical. What was the reason that we never did 
that
for single planar? Because existing applications wouldn't know what to do with 
it?

Regards,

Hans

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/Documentation/DocBook/media/v4l/io.xml 
b/Documentation/DocBook/media/v4l/io.xml
index 8c4ee74..e5e8325 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -870,7 +870,8 @@ should set this to 0./entry
  If the application sets this to 0 for an output stream, then
  structfieldbytesused/structfield will be set to the size of 
the
  plane (see the structfieldlength/structfield field of this 
struct)
- by the driver./entry
+ by the driver. Note that the actual image data starts at
+ structfielddata_offset/structfield which may not be 0./entry
  /row
  row
entry__u32/entry
@@ -919,6 +920,10 @@ should set this to 0./entry
entryOffset in bytes to video data in the plane.
  Drivers must set this field when structfieldtype/structfield
  refers to an input stream, applications when it refers to an 
output stream.
+ Note that data_offset is included in 
structfieldbytesused/structfield.
+ So the size of the image in the plane is
+ 
structfieldbytesused/structfield-structfielddata_offset/structfield at
+ offset structfielddata_offset/structfield from the start of 
the plane.
/entry
  /row
  row
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH] Docbook/media: improve data_offset/bytesused documentation

2014-07-21 Thread Nicolas Dufresne
Le lundi 21 juillet 2014 à 15:16 +0200, Hans Verkuil a écrit :
 + Note that data_offset is included in 
 structfieldbytesused/structfield.
 + So the size of the image in the plane is
 + 
 structfieldbytesused/structfield-structfielddata_offset/structfield at
 + offset structfielddata_offset/structfield from the start of 
 the plane.

This seem like messing applications a lot. Let's say you have a well
known format, NV12, but your driver add some customer header at the
beginning. Pretty much all the application in the world would work just
fine ignoring that header, but in fact most of them will not work,
because bytesused is including the header. Considering this wasn't
documented before, I would strongly suggest to keep the bytesused as
being the size for the format know by everyone.


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] v4l2-ctrls: add RX RDS controls.

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

The radio-miropcm20 driver has firmware that decodes the RDS signals. So in that
case the RDS data becomes available in the form of controls.

Add support for these controls to the control framework, allowing the miro 
driver
to use them.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 19 +--
 include/uapi/linux/v4l2-controls.h   |  6 ++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 9a22f2c..a7b4d4c 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -881,7 +881,6 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_FM_RX_CLASS:  return FM Radio Receiver 
Controls;
case V4L2_CID_TUNE_DEEMPHASIS:  return De-Emphasis;
case V4L2_CID_RDS_RECEPTION:return RDS Reception;
-
case V4L2_CID_RF_TUNER_CLASS:   return RF Tuner Controls;
case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:   return LNA Gain, Auto;
case V4L2_CID_RF_TUNER_LNA_GAIN:return LNA Gain;
@@ -892,6 +891,12 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:  return Bandwidth, Auto;
case V4L2_CID_RF_TUNER_BANDWIDTH:   return Bandwidth;
case V4L2_CID_RF_TUNER_PLL_LOCK:return PLL Lock;
+   case V4L2_CID_RDS_RX_PTY:   return RDS Program Type;
+   case V4L2_CID_RDS_RX_PS_NAME:   return RDS PS Name;
+   case V4L2_CID_RDS_RX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT: return RDS Traffic 
Announcement;
+   case V4L2_CID_RDS_RX_TRAFFIC_PROGRAM:   return RDS Traffic Program;
+   case V4L2_CID_RDS_RX_MUSIC_SPEECH:  return RDS Music;
 
/* Detection controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -900,7 +905,6 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD: return MD Global Threshold;
case V4L2_CID_DETECT_MD_THRESHOLD_GRID: return MD Threshold Grid;
case V4L2_CID_DETECT_MD_REGION_GRID:return MD Region Grid;
-
default:
return NULL;
}
@@ -963,6 +967,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_RDS_TX_TRAFFIC_PROGRAM:
case V4L2_CID_RDS_TX_MUSIC_SPEECH:
case V4L2_CID_RDS_TX_ALT_FREQS_ENABLE:
+   case V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT:
+   case V4L2_CID_RDS_RX_TRAFFIC_PROGRAM:
+   case V4L2_CID_RDS_RX_MUSIC_SPEECH:
*type = V4L2_CTRL_TYPE_BOOLEAN;
*min = 0;
*max = *step = 1;
@@ -1035,6 +1042,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
break;
case V4L2_CID_RDS_TX_PS_NAME:
case V4L2_CID_RDS_TX_RADIO_TEXT:
+   case V4L2_CID_RDS_RX_PS_NAME:
+   case V4L2_CID_RDS_RX_RADIO_TEXT:
*type = V4L2_CTRL_TYPE_STRING;
break;
case V4L2_CID_ISO_SENSITIVITY:
@@ -1166,6 +1175,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_DV_TX_RXSENSE:
case V4L2_CID_DV_TX_EDID_PRESENT:
case V4L2_CID_DV_RX_POWER_PRESENT:
+   case V4L2_CID_RDS_RX_PTY:
+   case V4L2_CID_RDS_RX_PS_NAME:
+   case V4L2_CID_RDS_RX_RADIO_TEXT:
+   case V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT:
+   case V4L2_CID_RDS_RX_TRAFFIC_PROGRAM:
+   case V4L2_CID_RDS_RX_MUSIC_SPEECH:
*flags |= V4L2_CTRL_FLAG_READ_ONLY;
break;
case V4L2_CID_RF_TUNER_PLL_LOCK:
diff --git a/include/uapi/linux/v4l2-controls.h 
b/include/uapi/linux/v4l2-controls.h
index a13e6fe..e946e43 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -910,6 +910,12 @@ enum v4l2_deemphasis {
 };
 
 #define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_RX_PTY(V4L2_CID_FM_RX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_RX_PS_NAME
(V4L2_CID_FM_RX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_RX_RADIO_TEXT (V4L2_CID_FM_RX_CLASS_BASE + 5)
+#define V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT   (V4L2_CID_FM_RX_CLASS_BASE + 6)
+#define V4L2_CID_RDS_RX_TRAFFIC_PROGRAM
(V4L2_CID_FM_RX_CLASS_BASE + 7)
+#define V4L2_CID_RDS_RX_MUSIC_SPEECH   (V4L2_CID_FM_RX_CLASS_BASE + 8)
 
 #define V4L2_CID_RF_TUNER_CLASS_BASE   (V4L2_CTRL_CLASS_RF_TUNER | 
0x900)
 #define V4L2_CID_RF_TUNER_CLASS
(V4L2_CTRL_CLASS_RF_TUNER | 1)
-- 
2.0.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

[PATCH 3/7] si4713: add the missing RDS functionality.

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Not all the RDS features of the si4713 were supported. Add
the missing bits to fully support the hardware capabilities.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/radio/si4713/si4713.c | 76 -
 drivers/media/radio/si4713/si4713.h |  9 +
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/drivers/media/radio/si4713/si4713.c 
b/drivers/media/radio/si4713/si4713.c
index dbe4726..b576555 100644
--- a/drivers/media/radio/si4713/si4713.c
+++ b/drivers/media/radio/si4713/si4713.c
@@ -957,6 +957,41 @@ static int si4713_choose_econtrol_action(struct 
si4713_device *sdev, u32 id,
*bit = 5;
*mask = 0x1F  5;
break;
+   case V4L2_CID_RDS_TX_DYNAMIC_PTY:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 15;
+   *mask = 1  15;
+   break;
+   case V4L2_CID_RDS_TX_COMPRESSED:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 14;
+   *mask = 1  14;
+   break;
+   case V4L2_CID_RDS_TX_ARTIFICIAL_HEAD:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 13;
+   *mask = 1  13;
+   break;
+   case V4L2_CID_RDS_TX_MONO_STEREO:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 12;
+   *mask = 1  12;
+   break;
+   case V4L2_CID_RDS_TX_TRAFFIC_PROGRAM:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 10;
+   *mask = 1  10;
+   break;
+   case V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 4;
+   *mask = 1  4;
+   break;
+   case V4L2_CID_RDS_TX_MUSIC_SPEECH:
+   *property = SI4713_TX_RDS_PS_MISC;
+   *bit = 3;
+   *mask = 1  3;
+   break;
case V4L2_CID_AUDIO_LIMITER_ENABLED:
*property = SI4713_TX_ACOMP_ENABLE;
*bit = 1;
@@ -1122,6 +1157,17 @@ static int si4713_s_ctrl(struct v4l2_ctrl *ctrl)
}
break;
 
+   case V4L2_CID_RDS_TX_ALT_FREQS_ENABLE:
+   case V4L2_CID_RDS_TX_ALT_FREQS:
+   if (sdev-rds_alt_freqs_enable-val) {
+   val = sdev-rds_alt_freqs-p_new.p_u32[0];
+   val = val / 100 - 876 + 0xe101;
+   } else {
+   val = 0xe0e0;
+   }
+   ret = si4713_write_property(sdev, SI4713_TX_RDS_PS_AF, 
val);
+   break;
+
default:
ret = si4713_choose_econtrol_action(sdev, ctrl-id, 
bit,
mask, property, mul, table, size);
@@ -1355,6 +1401,17 @@ static const struct v4l2_subdev_ops si4713_subdev_ops = {
.tuner  = si4713_subdev_tuner_ops,
 };
 
+static const struct v4l2_ctrl_config si4713_alt_freqs_ctrl = {
+   .id = V4L2_CID_RDS_TX_ALT_FREQS,
+   .type = V4L2_CTRL_TYPE_U32,
+   .min = 87600,
+   .max = 107900,
+   .step = 100,
+   .def = 87600,
+   .dims = { 1 },
+   .elem_size = sizeof(u32),
+};
+
 /*
  * I2C driver interface
  */
@@ -1410,6 +1467,23 @@ static int si4713_probe(struct i2c_client *client,
V4L2_CID_RDS_TX_PI, 0, 0x, 1, DEFAULT_RDS_PI);
sdev-rds_pty = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
V4L2_CID_RDS_TX_PTY, 0, 31, 1, DEFAULT_RDS_PTY);
+   sdev-rds_compressed = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_COMPRESSED, 0, 1, 1, 0);
+   sdev-rds_art_head = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_ARTIFICIAL_HEAD, 0, 1, 1, 0);
+   sdev-rds_stereo = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_MONO_STEREO, 0, 1, 1, 1);
+   sdev-rds_tp = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_TRAFFIC_PROGRAM, 0, 1, 1, 0);
+   sdev-rds_ta = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT, 0, 1, 1, 0);
+   sdev-rds_ms = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_MUSIC_SPEECH, 0, 1, 1, 1);
+   sdev-rds_dyn_pty = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_DYNAMIC_PTY, 0, 1, 1, 0);
+   sdev-rds_alt_freqs_enable = v4l2_ctrl_new_std(hdl, si4713_ctrl_ops,
+   V4L2_CID_RDS_TX_ALT_FREQS_ENABLE, 0, 1, 1, 0);
+   sdev-rds_alt_freqs = v4l2_ctrl_new_custom(hdl, si4713_alt_freqs_ctrl, 
NULL);
sdev-rds_deviation = v4l2_ctrl_new_std(hdl, 

[PATCH 5/7] DocBook/media: document the new RDS RX controls

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Document the new RDS receiver controls. This will be used by the radio-miropcm20
driver.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 Documentation/DocBook/media/v4l/controls.xml | 51 
 1 file changed, 51 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 3ec85f6..9f5ffd8 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -5089,6 +5089,57 @@ description of this control class./entry
   /rowrowentry spanname=descrEnables/disables RDS
  reception by the radio tuner/entry
   /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrGets RDS Programme Type field.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrGets the Programme Service name 
(PS_NAME).
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection.  In Annex E of xref linkend=iec62106 /, the 
RDS specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+Also from RDS specification, PS is usually a single eight character text. 
However, it is also possible
+to find receivers which can scroll strings sized as 8 x N characters. So, this 
control must be configured
+with steps of 8 characters. The result is it must always contain a string with 
size multiple of 8./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_RADIO_TEXT/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrGets the Radio Text info. It is a 
textual description of
+what is being broadcasted. RDS Radio Text can be applied when broadcaster 
wishes to transmit longer PS names,
+programme-related information or any other text. In these cases, RadioText can 
be used in addition to
+constantV4L2_CID_RDS_RX_PS_NAME/constant. The encoding for Radio Text 
strings is also fully described
+in Annex E of xref linkend=iec62106 /. The length of Radio Text strings 
depends on which RDS Block is being
+used to transmit it, either 32 (2A block) or 64 (2B block).  However, it is 
also possible
+to find receivers which can scroll strings sized as 32 x N or 64 x N 
characters. So, this control must be configured
+with steps of 32 or 64 characters. The result is it must always contain a 
string with size multiple of 32 or 64. /entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then a traffic announcement is 
in progress./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_TRAFFIC_PROGRAM/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then the tuned programme carries 
traffic announcements./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RX_MUSIC_SPEECH/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then this channel broadcasts 
music. If cleared, then it
+broadcasts speech. If the transmitter doesn't make this distinction, then it 
will be set./entry
+ /row
   row
entry 
spanname=idconstantV4L2_CID_TUNE_DEEMPHASIS/constantnbsp;/entry
entryenum v4l2_deemphasis/entry
-- 
2.0.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] v4l2-ctrls: add new RDS TX controls

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

The si4713 supports several RDS features not yet implemented in the driver.

This patch adds the missing RDS functionality to the list of RDS controls.

The ALT_FREQS control is a compound control containing an array of up
to 25 (the maximum according to the RDS standard) frequencies. To support
that the V4L2_CTRL_TYPE_U32 was added.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 35 +++
 include/media/v4l2-ctrls.h   |  2 ++
 include/uapi/linux/v4l2-controls.h   |  9 +
 include/uapi/linux/videodev2.h   |  2 ++
 4 files changed, 48 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 1acc7aa..9a22f2c 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -805,6 +805,15 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_RDS_TX_MONO_STEREO:   return RDS Stereo;
+   case V4L2_CID_RDS_TX_ARTIFICIAL_HEAD:   return RDS Artificial Head;
+   case V4L2_CID_RDS_TX_COMPRESSED:return RDS Compressed;
+   case V4L2_CID_RDS_TX_DYNAMIC_PTY:   return RDS Dynamic PTY;
+   case V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT: return RDS Traffic 
Announcement;
+   case V4L2_CID_RDS_TX_TRAFFIC_PROGRAM:   return RDS Traffic Program;
+   case V4L2_CID_RDS_TX_MUSIC_SPEECH:  return RDS Music;
+   case V4L2_CID_RDS_TX_ALT_FREQS_ENABLE:  return RDS Enable Alt 
Frequencies;
+   case V4L2_CID_RDS_TX_ALT_FREQS: return RDS Alternate 
Frequencies;
case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
@@ -946,6 +955,14 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:
case V4L2_CID_RF_TUNER_PLL_LOCK:
+   case V4L2_CID_RDS_TX_MONO_STEREO:
+   case V4L2_CID_RDS_TX_ARTIFICIAL_HEAD:
+   case V4L2_CID_RDS_TX_COMPRESSED:
+   case V4L2_CID_RDS_TX_DYNAMIC_PTY:
+   case V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT:
+   case V4L2_CID_RDS_TX_TRAFFIC_PROGRAM:
+   case V4L2_CID_RDS_TX_MUSIC_SPEECH:
+   case V4L2_CID_RDS_TX_ALT_FREQS_ENABLE:
*type = V4L2_CTRL_TYPE_BOOLEAN;
*min = 0;
*max = *step = 1;
@@ -1089,6 +1106,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_DETECT_MD_THRESHOLD_GRID:
*type = V4L2_CTRL_TYPE_U16;
break;
+   case V4L2_CID_RDS_TX_ALT_FREQS:
+   *type = V4L2_CTRL_TYPE_U32;
+   break;
default:
*type = V4L2_CTRL_TYPE_INTEGER;
break;
@@ -1209,6 +1229,8 @@ static bool std_equal(const struct v4l2_ctrl *ctrl, u32 
idx,
return ptr1.p_u8[idx] == ptr2.p_u8[idx];
case V4L2_CTRL_TYPE_U16:
return ptr1.p_u16[idx] == ptr2.p_u16[idx];
+   case V4L2_CTRL_TYPE_U32:
+   return ptr1.p_u32[idx] == ptr2.p_u32[idx];
default:
if (ctrl-is_int)
return ptr1.p_s32[idx] == ptr2.p_s32[idx];
@@ -1242,6 +1264,9 @@ static void std_init(const struct v4l2_ctrl *ctrl, u32 
idx,
case V4L2_CTRL_TYPE_U16:
ptr.p_u16[idx] = ctrl-default_value;
break;
+   case V4L2_CTRL_TYPE_U32:
+   ptr.p_u32[idx] = ctrl-default_value;
+   break;
default:
idx *= ctrl-elem_size;
memset(ptr.p + idx, 0, ctrl-elem_size);
@@ -1289,6 +1314,9 @@ static void std_log(const struct v4l2_ctrl *ctrl)
case V4L2_CTRL_TYPE_U16:
pr_cont(%u, (unsigned)*ptr.p_u16);
break;
+   case V4L2_CTRL_TYPE_U32:
+   pr_cont(%u, (unsigned)*ptr.p_u32);
+   break;
default:
pr_cont(unknown type %d, ctrl-type);
break;
@@ -1335,6 +1363,8 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 
idx,
return ROUND_TO_RANGE(ptr.p_u8[idx], u8, ctrl);
case V4L2_CTRL_TYPE_U16:
return ROUND_TO_RANGE(ptr.p_u16[idx], u16, ctrl);
+   case V4L2_CTRL_TYPE_U32:
+   return ROUND_TO_RANGE(ptr.p_u32[idx], u32, ctrl);
 
case V4L2_CTRL_TYPE_BOOLEAN:
ptr.p_s32[idx] = !!ptr.p_s32[idx];
@@ -1567,6 +1597,7 @@ static int check_range(enum v4l2_ctrl_type type,
  

[PATCH 7/7] radio-miropcm20: add RDS support.

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Once upon a time the radio-miropcm20 driver had RDS support. However, after
some internal kernel changes that support was removed. Now that we have a
nice RDS API I have been working on adding back this support. It has been
tested with the si4713 RDS transmitter and it is working quite nicely.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/radio/radio-miropcm20.c | 303 --
 1 file changed, 286 insertions(+), 17 deletions(-)

diff --git a/drivers/media/radio/radio-miropcm20.c 
b/drivers/media/radio/radio-miropcm20.c
index 3d12edf..72df00e 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -1,20 +1,35 @@
-/* Miro PCM20 radio driver for Linux radio support
+/*
+ * Miro PCM20 radio driver for Linux radio support
  * (c) 1998 Ruurd Reitsma r.a.reit...@wbmt.tudelft.nl
  * Thanks to Norberto Pellici for the ACI device interface specification
  * The API part is based on the radiotrack driver by M. Kirkwood
  * This driver relies on the aci mixer provided by the snd-miro
  * ALSA driver.
  * Look there for further info...
- */
-
-/* What ever you think about the ACI, version 0x07 is not very well!
- * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono
- * conditions...Robert
+ *
+ * From the original miro RDS sources:
+ *
+ *  (c) 2001 Robert Siemer robert.sie...@gmx.de
+ *
+ *  Many thanks to Fred Seidel sei...@metabox.de, the
+ *  designer of the RDS decoder hardware. With his help
+ *  I was able to code this driver.
+ *  Thanks also to Norberto Pellicci, Dominic Mounteney
+ *  dmounte...@pinnaclesys.com and www.teleauskunft.de
+ *  for good hints on finding Fred. It was somewhat hard
+ *  to locate him here in Germany... [:
+ *
+ * This code has been reintroduced and converted to use
+ * the new V4L2 RDS API by:
+ *
+ * Hans Verkuil hans.verk...@cisco.com
  */
 
 #include linux/module.h
 #include linux/init.h
+#include linux/delay.h
 #include linux/videodev2.h
+#include linux/kthread.h
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-ctrls.h
@@ -22,6 +37,22 @@
 #include media/v4l2-event.h
 #include sound/aci.h
 
+#define RDS_DATASHIFT  2   /* Bit 2 */
+#define RDS_DATAMASK(1  RDS_DATASHIFT)
+#define RDS_BUSYMASK0x10   /* Bit 4 */
+#define RDS_CLOCKMASK   0x08   /* Bit 3 */
+#define RDS_DATA(x) (((x)  RDS_DATASHIFT)  1)
+
+#define RDS_STATUS  0x01
+#define RDS_STATIONNAME 0x02
+#define RDS_TEXT0x03
+#define RDS_ALTFREQ 0x04
+#define RDS_TIMEDATE0x05
+#define RDS_PI_CODE 0x06
+#define RDS_PTYTATP 0x07
+#define RDS_RESET   0x08
+#define RDS_RXVALUE 0x09
+
 static int radio_nr = -1;
 module_param(radio_nr, int, 0);
 MODULE_PARM_DESC(radio_nr, Set radio device number (/dev/radioX).  Default: 
-1 (autodetect));
@@ -30,6 +61,14 @@ struct pcm20 {
struct v4l2_device v4l2_dev;
struct video_device vdev;
struct v4l2_ctrl_handler ctrl_handler;
+   struct v4l2_ctrl *rds_pty;
+   struct v4l2_ctrl *rds_ps_name;
+   struct v4l2_ctrl *rds_radio_test;
+   struct v4l2_ctrl *rds_ta;
+   struct v4l2_ctrl *rds_tp;
+   struct v4l2_ctrl *rds_ms;
+   /* thread for periodic RDS status checking */
+   struct task_struct *kthread;
unsigned long freq;
u32 audmode;
struct snd_miro_aci *aci;
@@ -41,6 +80,103 @@ static struct pcm20 pcm20_card = {
.audmode = V4L2_TUNER_MODE_STEREO,
 };
 
+
+static int rds_waitread(struct snd_miro_aci *aci)
+{
+   u8 byte;
+   int i = 2000;
+
+   do {
+   byte = inb(aci-aci_port + ACI_REG_RDS);
+   i--;
+   } while ((byte  RDS_BUSYMASK)  i);
+
+   /*
+* It's magic, but without this the data that you read later on
+* is unreliable and full of bit errors. With this 1 usec delay
+* everything is fine.
+*/
+   udelay(1);
+   return i ? byte : -1;
+}
+
+static int rds_rawwrite(struct snd_miro_aci *aci, u8 byte)
+{
+   if (rds_waitread(aci) = 0) {
+   outb(byte, aci-aci_port + ACI_REG_RDS);
+   return 0;
+   }
+   return -1;
+}
+
+static int rds_write(struct snd_miro_aci *aci, u8 byte)
+{
+   u8 sendbuffer[8];
+   int i;
+
+   for (i = 7; i = 0; i--)
+   sendbuffer[7 - i] = (byte  (1  i)) ? RDS_DATAMASK : 0;
+   sendbuffer[0] |= RDS_CLOCKMASK;
+
+   for (i = 0; i  8; i++)
+   rds_rawwrite(aci, sendbuffer[i]);
+   return 0;
+}
+
+static int rds_readcycle_nowait(struct snd_miro_aci *aci)
+{
+   outb(0, aci-aci_port + ACI_REG_RDS);
+   return rds_waitread(aci);
+}
+
+static int rds_readcycle(struct snd_miro_aci *aci)
+{
+   if (rds_rawwrite(aci, 0)  0)
+   return -1;
+   return rds_waitread(aci);
+}
+
+static int rds_ack(struct snd_miro_aci *aci)
+{
+   int i = 

[PATCH 2/7] DocBook/media: document the new RDS TX controls

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Document the new RDS features that will be supported by the si4713 driver.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Eduardo Valentin edubez...@gmail.com
---
 Documentation/DocBook/media/v4l/controls.xml | 62 
 1 file changed, 62 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 74f5755..3ec85f6 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4051,6 +4051,68 @@ to find receivers which can scroll strings sized as 32 x 
N or 64 x N characters.
 with steps of 32 or 64 characters. The result is it must always contain a 
string with size multiple of 32 or 64. /entry
  /row
  row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_MONO_STEREO/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrSets the Mono/Stereo bit of the Decoder 
Identification code. If set,
+then the audio was recorded as stereo./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_ARTIFICIAL_HEAD/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrSets the
+ulink url=http://en.wikipedia.org/wiki/Artificial_head;Artificial 
Head/ulink bit of the Decoder
+Identification code. If set, then the audio was recorded using an artificial 
head./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_COMPRESSED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrSets the Compressed bit of the Decoder 
Identification code. If set,
+then the audio is compressed./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_DYNAMIC_PTY/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrSets the Dynamic PTY bit of the Decoder 
Identification code. If set,
+then the PTY code is dynamically switched./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then a traffic announcement is 
in progress./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_TRAFFIC_PROGRAM/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then the tuned programme carries 
traffic announcements./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_MUSIC_SPEECH/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then this channel broadcasts 
music. If cleared, then it
+broadcasts speech. If the transmitter doesn't make this distinction, then it 
should be set./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_ALT_FREQS_ENABLE/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrIf set, then transmit alternate 
frequencies./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_ALT_FREQS/constantnbsp;/entry
+   entry__u32 array/entry
+ /row
+ rowentry spanname=descrThe alternate frequencies in kHz units. 
The RDS standard allows
+for up to 25 frequencies to be defined. Drivers may support fewer frequencies 
so check
+the array size./entry
+ /row
+ row
entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_ENABLED/constantnbsp;/entry
entryboolean/entry
  /row
-- 
2.0.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] si4713/miropcm20: RDS enhancements

2014-07-21 Thread Hans Verkuil
This patch series adds a bunch of missing RDS TX controls and implements
them in the si4713 driver. It also adds back RDS support to the miropcm20
driver.

The Alternate Frequencies control is a u32 array since there can be up to
25 alternate frequencies. This was also the reason why I am only now posting
this series since it had to wait for compound control support to go in.

I've tested both drivers with my si4713 and miropcm20 boards.

Regards,

Hans

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] v4l2-ctrls: add support for setting string controls

2014-07-21 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Rather than always having to use a v4l2_ext_control struct to set
a control value from within a driver, switch to just setting the
new value. This is faster and it makes it possible to set more
complex types such as a string control as is added by this
patch.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 47 +++-
 include/media/v4l2-ctrls.h   | 24 ++
 2 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index a7b4d4c..848169c 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -3159,26 +3159,22 @@ static int set_ctrl(struct v4l2_fh *fh, struct 
v4l2_ctrl *ctrl,
struct v4l2_ctrl *master = ctrl-cluster[0];
int i;
 
-   /* Compound controls are not supported. The user_to_new() and
-* cur_to_user() calls below would need to be modified not to access
-* userspace memory when called from set_ctrl().
-*/
-   if (ctrl-is_ptr)
-   return -EINVAL;
-
/* Reset the 'is_new' flags of the cluster */
for (i = 0; i  master-ncontrols; i++)
if (master-cluster[i])
master-cluster[i]-is_new = 0;
 
+   if (c)
+   user_to_new(c, ctrl);
+
/* For autoclusters with volatiles that are switched from auto to
   manual mode we have to update the current volatile values since
   those will become the initial manual values after such a switch. */
if (master-is_auto  master-has_volatiles  ctrl == master 
-   !is_cur_manual(master)  c-value == master-manual_mode_value)
+   !is_cur_manual(master)  ctrl-val == master-manual_mode_value)
update_from_auto_cluster(master);
 
-   user_to_new(c, ctrl);
+   ctrl-is_new = 1;
return try_or_set_cluster(fh, master, true, ch_flags);
 }
 
@@ -3226,40 +3222,37 @@ EXPORT_SYMBOL(v4l2_subdev_s_ctrl);
 
 int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
 {
-   struct v4l2_ext_control c;
-   int rval;
-
lockdep_assert_held(ctrl-handler-lock);
 
/* It's a driver bug if this happens. */
WARN_ON(!ctrl-is_int);
-   c.value = val;
-   rval = set_ctrl(NULL, ctrl, c, 0);
-   if (!rval)
-   cur_to_user(c, ctrl);
-
-   return rval;
+   ctrl-val = val;
+   return set_ctrl(NULL, ctrl, NULL, 0);
 }
 EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl);
 
 int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
 {
-   struct v4l2_ext_control c;
-   int rval;
-
lockdep_assert_held(ctrl-handler-lock);
 
/* It's a driver bug if this happens. */
WARN_ON(ctrl-is_ptr || ctrl-type != V4L2_CTRL_TYPE_INTEGER64);
-   c.value64 = val;
-   rval = set_ctrl(NULL, ctrl, c, 0);
-   if (!rval)
-   cur_to_user(c, ctrl);
-
-   return rval;
+   *ctrl-p_new.p_s64 = val;
+   return set_ctrl(NULL, ctrl, NULL, 0);
 }
 EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_int64);
 
+int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s)
+{
+   lockdep_assert_held(ctrl-handler-lock);
+
+   /* It's a driver bug if this happens. */
+   WARN_ON(ctrl-type != V4L2_CTRL_TYPE_STRING);
+   strlcpy(ctrl-p_new.p_char, s, ctrl-maximum + 1);
+   return set_ctrl(NULL, ctrl, NULL, 0);
+}
+EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_string);
+
 void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, 
void *priv)
 {
if (ctrl == NULL)
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index a674bf7..b7cd7a6 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -739,6 +739,30 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl 
*ctrl, s64 val)
return rval;
 }
 
+/** __v4l2_ctrl_s_ctrl_string() - Unlocked variant of 
v4l2_ctrl_s_ctrl_string(). */
+int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s);
+
+/** v4l2_ctrl_s_ctrl_string() - Helper function to set a control's string 
value from within a driver.
+  * @ctrl: The control.
+  * @s:The new string.
+  *
+  * This set the control's new string safely by going through the control
+  * framework. This function will lock the control's handler, so it cannot be
+  * used from within the v4l2_ctrl_ops functions.
+  *
+  * This function is for string type controls only.
+  */
+static inline int v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char 
*s)
+{
+   int rval;
+
+   v4l2_ctrl_lock(ctrl);
+   rval = __v4l2_ctrl_s_ctrl_string(ctrl, s);
+   v4l2_ctrl_unlock(ctrl);
+
+   return rval;
+}
+
 /* Internal helper functions that deal with control events. */
 extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops;
 void v4l2_ctrl_replace(struct v4l2_event 

Re: [PATCH 0/7] si4713/miropcm20: RDS enhancements

2014-07-21 Thread Hans Verkuil
On 07/21/2014 03:45 PM, Hans Verkuil wrote:
 This patch series adds a bunch of missing RDS TX controls and implements
 them in the si4713 driver. It also adds back RDS support to the miropcm20
 driver.
 
 The Alternate Frequencies control is a u32 array since there can be up to
 25 alternate frequencies. This was also the reason why I am only now posting
 this series since it had to wait for compound control support to go in.
 
 I've tested both drivers with my si4713 and miropcm20 boards.

I forgot to mention that this sits on top of the ctrls patches from this
pull request:

https://patchwork.linuxtv.org/patch/24885/

Regards,

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


[GIT PULL FOR v3.17] Various fixes and moving solo6x10/go7007 to mainline

2014-07-21 Thread Hans Verkuil
Hi Mauro,

Here is a set of various fixes: two important ones in v4l2-ioctl and one
in vb2. Also some DocBook fixes, a few VBI defines added and documented,
a davinci bugfix (reported by the new gcc-4.9 compiler I'm now using for the
daily build) and last but not least the move of the solo6x10 and go7007 out
of staging into the mainline.

Regards,

Hans

The following changes since commit 0ca1ba2aac5f6b26672099b13040c5b40db93486:

  [media] zoran: remove duplicate ZR050_MO_COMP define (2014-07-17 20:07:57 
-0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v3.17d

for you to fetch changes up to f50a1bf86405d8377b245145d3e2d1ef5ced6e32:

  media: davinci: vpif: fix array out of bound warnings (2014-07-21 16:01:32 
+0200)


Hans Verkuil (12):
  vb2: fix bytesused == 0 handling
  DocBook media: fix incorrect note about packed RGB and colorspace
  go7007: update the README, fix checkpatch warnings
  go7007: move out of staging into drivers/media/usb.
  solo6x10: a few checkpatch fixes
  solo6x10: move out of staging into drivers/media/pci.
  videodev2.h: add defines for the VBI field start lines
  DocBook media: document new VBI defines
  v4l2-ctrls: fix corner case in round-to-range code
  DocBook media typo
  v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps
  v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

Prabhakar Lad (1):
  media: davinci: vpif: fix array out of bound warnings

 Documentation/DocBook/media/v4l/dev-raw-vbi.xml   | 12 
++---
 Documentation/DocBook/media/v4l/dev-sliced-vbi.xml|  9 ++-
 Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml |  3 ---
 Documentation/DocBook/media/v4l/vidioc-queryctrl.xml  |  2 +-
 drivers/media/pci/Kconfig |  1 +
 drivers/media/pci/Makefile|  1 +
 drivers/{staging/media = media/pci}/solo6x10/Kconfig |  2 +-
 drivers/{staging/media = media/pci}/solo6x10/Makefile|  2 +-
 drivers/{staging/media = media/pci}/solo6x10/TODO|  0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-core.c |  6 +
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-disp.c |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-eeprom.c   |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-enc.c  |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-g723.c |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-gpio.c |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-i2c.c  |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-jpeg.h |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-offsets.h  |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-p2m.c  |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-regs.h |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.c |  5 +---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.h |  4 ---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2-enc.c |  7 +++---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2.c |  8 +++---
 drivers/{staging/media = media/pci}/solo6x10/solo6x10.h  |  4 ---
 drivers/media/platform/davinci/vpif_capture.c |  2 +-
 drivers/media/platform/davinci/vpif_display.c |  2 +-
 drivers/media/usb/Kconfig |  1 +
 drivers/media/usb/Makefile|  1 +
 drivers/{staging/media = media/usb}/go7007/Kconfig   |  0
 drivers/{staging/media = media/usb}/go7007/Makefile  |  0
 drivers/{staging/media = media/usb}/go7007/README|  1 -
 drivers/{staging/media = media/usb}/go7007/go7007-driver.c   |  6 +
 drivers/{staging/media = media/usb}/go7007/go7007-fw.c   |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007-i2c.c  |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007-loader.c   |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007-priv.h |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007-usb.c  |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007-v4l2.c |  4 ---
 drivers/{staging/media = media/usb}/go7007/go7007.txt|  0
 drivers/{staging/media = media/usb}/go7007/s2250-board.c |  9 +++
 drivers/{staging/media = media/usb}/go7007/saa7134-go7007.c  | 34 
+++---
 drivers/{staging/media = media/usb}/go7007/snd-go7007.c  |  4 ---
 drivers/media/v4l2-core/v4l2-ctrls.c  | 17 
++---
 drivers/media/v4l2-core/v4l2-ioctl.c 

Re: [PATCH/RFC v4 16/21] leds: Add support for max77693 mfd flash cell

2014-07-21 Thread Sakari Ailus
Hi Jacek,

Thanks for the patchset.

Jacek Anaszewski wrote:
 This patch adds led-flash support to Maxim max77693 chipset.
 A device can be exposed to user space through LED subsystem
 sysfs interface or through V4L2 subdevice when the support
 for V4L2 Flash sub-devices is enabled. Device supports up to
 two leds which can work in flash and torch mode. Leds can
 be triggered externally or by software.
 
 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Signed-off-by: Andrzej Hajda a.ha...@samsung.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Acked-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Bryan Wu coolo...@gmail.com
 Cc: Richard Purdie rpur...@rpsys.net
 Cc: SangYoung Son hello@smasung.com
 Cc: Samuel Ortiz sa...@linux.intel.com
 ---
  drivers/leds/Kconfig |9 +
  drivers/leds/Makefile|1 +
  drivers/leds/leds-max77693.c | 1070 
 ++
  drivers/mfd/max77693.c   |5 +-
  include/linux/mfd/max77693.h |   40 ++
  5 files changed, 1124 insertions(+), 1 deletion(-)
  create mode 100644 drivers/leds/leds-max77693.c
 
 diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
 index 5032c6f..794055e 100644
 --- a/drivers/leds/Kconfig
 +++ b/drivers/leds/Kconfig
 @@ -457,6 +457,15 @@ config LEDS_TCA6507
 LED driver chips accessed via the I2C bus.
 Driver support brightness control and hardware-assisted blinking.
  
 +config LEDS_MAX77693
 + tristate LED support for MAX77693 Flash
 + depends on LEDS_CLASS_FLASH
 + depends on MFD_MAX77693
 + help
 +   This option enables support for the flash part of the MAX77693
 +   multifunction device. It has build in control for two leds in flash
 +   and torch mode.
 +
  config LEDS_MAX8997
   tristate LED support for MAX8997 PMIC
   depends on LEDS_CLASS  MFD_MAX8997
 diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
 index 237c5ba..da1a4ba 100644
 --- a/drivers/leds/Makefile
 +++ b/drivers/leds/Makefile
 @@ -55,6 +55,7 @@ obj-$(CONFIG_LEDS_MC13783)  += leds-mc13783.o
  obj-$(CONFIG_LEDS_NS2)   += leds-ns2.o
  obj-$(CONFIG_LEDS_NETXBIG)   += leds-netxbig.o
  obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o
 +obj-$(CONFIG_LEDS_MAX77693)  += leds-max77693.o
  obj-$(CONFIG_LEDS_MAX8997)   += leds-max8997.o
  obj-$(CONFIG_LEDS_LM355x)+= leds-lm355x.o
  obj-$(CONFIG_LEDS_BLINKM)+= leds-blinkm.o
 diff --git a/drivers/leds/leds-max77693.c b/drivers/leds/leds-max77693.c
 new file mode 100644
 index 000..38a2398
 --- /dev/null
 +++ b/drivers/leds/leds-max77693.c
 @@ -0,0 +1,1070 @@
 +/*
 + * LED Flash Class driver for the flash cell of max77693 mfd.
 + *
 + *   Copyright (C) 2014, Samsung Electronics Co., Ltd.
 + *
 + *   Authors: Jacek Anaszewski j.anaszew...@samsung.com
 + *Andrzej Hajda a.ha...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + */
 +
 +#include asm/div64.h
 +#include linux/led-class-flash.h
 +#include linux/led-flash-manager.h
 +#include linux/mfd/max77693.h
 +#include linux/mfd/max77693-private.h
 +#include linux/module.h
 +#include linux/mutex.h
 +#include linux/platform_device.h
 +#include linux/regmap.h
 +#include linux/slab.h
 +#include linux/workqueue.h
 +#include media/v4l2-flash.h
 +
 +#define MAX77693_LED_NAME_1  max77693-flash_1
 +#define MAX77693_LED_NAME_2  max77693-flash_2
 +
 +#define MAX77693_TORCH_IOUT_BITS 4
 +
 +#define MAX77693_TORCH_NO_TIMER  0x40
 +#define MAX77693_FLASH_TIMER_LEVEL   0x80
 +
 +#define MAX77693_FLASH_EN_OFF0
 +#define MAX77693_FLASH_EN_FLASH  1
 +#define MAX77693_FLASH_EN_TORCH  2
 +#define MAX77693_FLASH_EN_ON 3
 +
 +#define MAX77693_FLASH_EN1_SHIFT 6
 +#define MAX77693_FLASH_EN2_SHIFT 4
 +#define MAX77693_TORCH_EN1_SHIFT 2
 +#define MAX77693_TORCH_EN2_SHIFT 0

Which registers are these definitions related to? Could they be defined
next to the registers instead?

You could parameterise these macros, e.g.

#define MAX77693_FLASH_EN_SHIFT(a)  (6 - ((a) - 1) * 2)

 +#define MAX77693_FLASH_LOW_BATTERY_EN0x80
 +
 +#define MAX77693_FLASH_BOOST_FIXED   0x04
 +#define MAX77693_FLASH_BOOST_LEDNUM_20x80
 +
 +#define MAX77693_FLASH_TIMEOUT_MIN   62500
 +#define MAX77693_FLASH_TIMEOUT_MAX   100
 +#define MAX77693_FLASH_TIMEOUT_STEP  62500
 +
 +#define MAX77693_TORCH_TIMEOUT_MIN   262000
 +#define MAX77693_TORCH_TIMEOUT_MAX   15728000
 +
 +#define MAX77693_FLASH_IOUT_MIN  15625
 +#define MAX77693_FLASH_IOUT_MAX_1LED 100
 +#define MAX77693_FLASH_IOUT_MAX_2LEDS625000
 +#define MAX77693_FLASH_IOUT_STEP 15625
 +
 +#define MAX77693_TORCH_IOUT_MIN  15625
 +#define MAX77693_TORCH_IOUT_MAX  

Re: [GIT PULL FOR v3.16] mt9p031 fixes

2014-07-21 Thread Enric Balletbo Serra
Hi Laurent,

2014-07-10 0:29 GMT+02:00 Laurent Pinchart laurent.pinch...@ideasonboard.com:
 Hi Enric,

 On Wednesday 09 July 2014 17:56:59 Enric Balletbo Serra wrote:
 2014-05-16 2:45 GMT+02:00 Laurent Pinchart wrote:
  Hi Mauro,
 
  The following changes since commit
  ba0d342ecc21fbbe2f6c178f4479944d1fb34f3b:
saa7134-alsa: include vmalloc.h (2014-05-13 23:05:15 -0300)
 
  are available in the git repository at:
git://linuxtv.org/pinchartl/media.git sensors/next
 
  for you to fetch changes up to a3a7145c6cecbd9752311b8ae1e431f6755ad5f3:
mt9p031: Fix BLC configuration restore when disabling test pattern
 
  (2014-05-16 02:43:50 +0200)
 
  
 
  Laurent Pinchart (2):
mt9p031: Really disable Black Level Calibration in test pattern mode
mt9p031: Fix BLC configuration restore when disabling test pattern
 
   drivers/media/i2c/mt9p031.c | 53 ++--
 
   1 file changed, 39 insertions(+), 14 deletions(-)

 I'm trying to test omap3-isp and a board with mt9p031 sensor with
 current mainline. For now I'm using tag version 3.15 (which is close
 to current mainline). First, when I tried to use the test patterns I
 only saw a black screen, but after applying these two patches I saw an
 improvement, although I can see the test pattern correctly.

 After some modifications the subdevs_group for my board is as follows:

 +static struct isp_v4l2_subdevs_group igep00x0_camera_subdevs[] = {
 +   {
 +   .subdevs = cam0020_primary_subdevs,
 +   .interface = ISP_INTERFACE_PARALLEL,
 +   .bus = {
 +   .parallel = {
 +   /* CAM[11:0] */
 +   .data_lane_shift = ISP_LANE_SHIFT_2,
 +   /* Sample on falling edge */
 +   .clk_pol = 1,
 +   }
 +   },
 +   },
 +   { },
 +};

 As I have some problems I would ask some questions, maybe you can help me.

 In the past in the data_lane_shift was ISP_LANE_SHIFT_0, but now, it
 seems I should to use ISP_LANE_SHIFT_2 (CAM[11:0] - as I saw in the
 include file). ISP_LANE_SHIFT_0 is for CAM[13:0] but OMAP3 has only 12
 data bus signals. Is that right ?

 Not really. The CCDC input is actually 16 bits wide. The ISP parallel bus is
 limited to 12 bits, the CSI2 receivers output up to 14 bits, and the bridge
 can merge two 8-bit samples into a 16-bit sample for YUV formats.

 When using a 12 bit parallel sensor, unless you want to restrict the dynamic
 of the input image, you should use a data lane shift value of 0. This will
 cause the CAMEXT[13:0] signal to be mapped to CAM[13:0]. As the parallel bus
 is limited to 12 bits, the CAM[13:12] bits will be set to zero. When capturing
 from the CCDC output to memory each pixel will be stored on 16 bits, with bits
 [15:12] set to zero, and bits [11:0] containing image data. When forwarding
 data to the preview engine, which has an input width of 10 bits, the ISP
 driver will configure the CCDC video port to output bits [11:2] to the preview
 engine, dropping the two LSBs.


Clear now, thank you for the explanations ...

 Another thing is I'm not able to capture the image correctly, also if
 if configure to ouput a test pattern, doesn't looks good. See as
 example [1] and [2]. Do you know what could be the problem ?

 For your information these are the pipeline that I'm using :

   media-ctl -v -r -l 'mt9p031 1-005d:0-OMAP3 ISP CCDC:0[1],
 OMAP3 ISP CCDC:2-OMAP3 ISP preview:0[1], OMAP3 ISP
 preview:1-OMAP3 ISP resizer:0[1], OMAP3 ISP resizer:1-OMAP3
 ISP resizer output:0[1]'

   media-ctl -v -f 'mt9p031 1-005d:0[SGRBG12 720x480], OMAP3 ISP
 CCDC:2[SGRBG8 720x480], OMAP3 ISP preview:1[UYVY 720x480], OMAP3
 ISP resizer:1[UYVY 720x480]'

 I would configure the pipeline with SGRBG10 at the output of the CCDC. The
 resolutions you request through the pipeline can't be achieved exactly, as the
 sensor can only perform binning/skipping to downscale. The resizer will take
 care to scale the image to the requested 720x480, but it will get distorted.
 You should use media-ctl -p to see what resolutions the above command actually
 sets, and fix the configuration with appropriate cropping if you want to keep
 the sensor aspect ratio intact.


Right. with configuration fixed works as expected. Thanks :)

 # Set Vertical Color Bars as test pattern
   yavta -w '0x009f0903 9' /dev/v4l-subdev8

 # Capture data with
   yavta  -f UYVY -s 720x480 --capture=5 --skip=1 --file=image-# /dev/video6

 # And convert with
   raw2rgbpnm -s 720x480 image-0.uyuv image-0.pnm

 Thanks in advance and any help will be appreciate.

 Regards,
   Enric

 [1] http://downloads.isee.biz/pub/files/tmp/9-Vertical Color Bars.pnm
 [2] http://downloads.isee.biz/pub/files/tmp/9-Vertical Color Bars.uyvy

 --
 Regards,

 Laurent Pinchart


Best regards,
   Enric

Re: Fresco Logic FL2000

2014-07-21 Thread Laurent Pinchart
Hi Michael,

On Tuesday 20 May 2014 18:32:08 Michael Durkin wrote:
 It was suggested to me to inquire here if anyone was working on
 drivers or support for the Fresco Logic FL2000 1d5c:2000

Could you please post the output of

lsusb -v -d 1d5c:2000

(if possible running as root) ?

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] xc4000: add module meta-tag with the firmware names

2014-07-21 Thread Mauro Carvalho Chehab
This meta-tag is used by some distros to help them package
the firmware and generate proper initrd images.

So, add the firmware names there.

Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/tuners/xc4000.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index 44df271a78f8..7d008b4d3595 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -1770,3 +1770,5 @@ EXPORT_SYMBOL(xc4000_attach);
 MODULE_AUTHOR(Steven Toth, Davide Ferri);
 MODULE_DESCRIPTION(Xceive xc4000 silicon tuner driver);
 MODULE_LICENSE(GPL);
+MODULE_FIRMWARE(XC4000_DEFAULT_FIRMWARE_NEW);
+MODULE_FIRMWARE(XC4000_DEFAULT_FIRMWARE);
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Fix support for PCTV 340e

2014-07-21 Thread Mauro Carvalho Chehab
Support for PCTV340e was broken for a long time. The regression
happened due to changeset 6fe1099c7aec.

The above changeset was right, as it improves device tuning, but
there's a bug at xc4000 get_frequency(): instead of returning
the tuned frequency, it was returning the frequency minus an
offset.

While there, I noticed that the firmware name was wrong (or
not updated), as the xc4000 firmware main source is:
http://www.kernellabs.com/firmware/xc4000/

So, add support for both firmware names, trying first:
dvb-fe-xc4000-1.4.1.fw
If it fails, try the previous firmware name:
dvb-fe-xc4000-1.4.fw

This way, we warrand backward compatibility.

Mauro Carvalho Chehab (3):
  xc4000: Update firmware name
  xc4000: add module meta-tag with the firmware names
  xc4000: Fix get_frequency()

 drivers/media/tuners/xc4000.c | 47 ++-
 1 file changed, 33 insertions(+), 14 deletions(-)

-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] xc4000: Update firmware name

2014-07-21 Thread Mauro Carvalho Chehab
The firmware name at:
   http://www.kernellabs.com/firmware/xc4000/

Is different from the one at the Kernel. Update it
try first the new name, falling back to the previous one
if the new name can't be found.

Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/tuners/xc4000.c | 25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index 2018befabb5a..44df271a78f8 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -116,6 +116,7 @@ struct xc4000_priv {
 #define XC4000_AUDIO_STD_MONO  32
 
 #define XC4000_DEFAULT_FIRMWARE dvb-fe-xc4000-1.4.fw
+#define XC4000_DEFAULT_FIRMWARE_NEW dvb-fe-xc4000-1.4.1.fw
 
 /* Misc Defines */
 #define MAX_TV_STANDARD24
@@ -730,13 +731,25 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
char  name[33];
const char*fname;
 
-   if (firmware_name[0] != '\0')
+   if (firmware_name[0] != '\0') {
fname = firmware_name;
-   else
-   fname = XC4000_DEFAULT_FIRMWARE;
 
-   dprintk(1, Reading firmware %s\n, fname);
-   rc = request_firmware(fw, fname, priv-i2c_props.adap-dev.parent);
+   dprintk(1, Reading custom firmware %s\n, fname);
+   rc = request_firmware(fw, fname,
+ priv-i2c_props.adap-dev.parent);
+   } else {
+   fname = XC4000_DEFAULT_FIRMWARE_NEW;
+   dprintk(1, Trying to read firmware %s\n, fname);
+   rc = request_firmware(fw, fname,
+ priv-i2c_props.adap-dev.parent);
+   if (rc == -ENOENT) {
+   fname = XC4000_DEFAULT_FIRMWARE;
+   dprintk(1, Trying to read firmware %s\n, fname);
+   rc = request_firmware(fw, fname,
+ priv-i2c_props.adap-dev.parent);
+   }
+   }
+
if (rc  0) {
if (rc == -ENOENT)
printk(KERN_ERR Error: firmware %s not found.\n, 
fname);
@@ -746,6 +759,8 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
 
return rc;
}
+   dprintk(1, Loading Firmware: %s\n, fname);
+
p = fw-data;
endp = p + fw-size;
 
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] xc4000: Fix get_frequency()

2014-07-21 Thread Mauro Carvalho Chehab
The programmed frequency on xc4000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

This works fine on set_frontend, as the device calculates
the needed offset. However, at get_frequency(), the returned
value is the initial frequency. That's generally not a big
problem on most drivers, however, starting with changeset
6fe1099c7aec, the frequency drift is taken into account at
dib7000p driver.

This broke support for PCTV 340e, with uses dib7000p demod and
xc4000 tuner.

Cc: sta...@vger.kernel.org

Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/tuners/xc4000.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index 7d008b4d3595..a19ef1046f89 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -93,7 +93,7 @@ struct xc4000_priv {
struct firmware_description *firm;
int firm_size;
u32 if_khz;
-   u32 freq_hz;
+   u32 freq_hz, freq_offset;
u32 bandwidth;
u8  video_standard;
u8  rf_mode;
@@ -1172,14 +1172,14 @@ static int xc4000_set_params(struct dvb_frontend *fe)
case SYS_ATSC:
dprintk(1, %s() VSB modulation\n, __func__);
priv-rf_mode = XC_RF_MODE_AIR;
-   priv-freq_hz = c-frequency - 175;
+   priv-freq_offset = 175;
priv-video_standard = XC4000_DTV6;
type = DTV6;
break;
case SYS_DVBC_ANNEX_B:
dprintk(1, %s() QAM modulation\n, __func__);
priv-rf_mode = XC_RF_MODE_CABLE;
-   priv-freq_hz = c-frequency - 175;
+   priv-freq_offset = 175;
priv-video_standard = XC4000_DTV6;
type = DTV6;
break;
@@ -1188,23 +1188,23 @@ static int xc4000_set_params(struct dvb_frontend *fe)
dprintk(1, %s() OFDM\n, __func__);
if (bw == 0) {
if (c-frequency  4) {
-   priv-freq_hz = c-frequency - 225;
+   priv-freq_offset= 225;
} else {
-   priv-freq_hz = c-frequency - 275;
+   priv-freq_offset = 275;
}
priv-video_standard = XC4000_DTV7_8;
type = DTV78;
} else if (bw = 600) {
priv-video_standard = XC4000_DTV6;
-   priv-freq_hz = c-frequency - 175;
+   priv-freq_offset = 175;
type = DTV6;
} else if (bw = 700) {
priv-video_standard = XC4000_DTV7;
-   priv-freq_hz = c-frequency - 225;
+   priv-freq_offset = 225;
type = DTV7;
} else {
priv-video_standard = XC4000_DTV8;
-   priv-freq_hz = c-frequency - 275;
+   priv-freq_offset = 275;
type = DTV8;
}
priv-rf_mode = XC_RF_MODE_AIR;
@@ -1215,6 +1215,8 @@ static int xc4000_set_params(struct dvb_frontend *fe)
goto fail;
}
 
+   priv-freq_hz = c-frequency - priv-freq_offset;
+
dprintk(1, %s() frequency=%d (compensated)\n,
__func__, priv-freq_hz);
 
@@ -1535,7 +1537,7 @@ static int xc4000_get_frequency(struct dvb_frontend *fe, 
u32 *freq)
 {
struct xc4000_priv *priv = fe-tuner_priv;
 
-   *freq = priv-freq_hz;
+   *freq = priv-freq_hz + priv-freq_offset;
 
if (debug) {
mutex_lock(priv-lock);
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-07-21 Thread Laurent Pinchart
On Monday 09 June 2014 12:27:37 Johannes Berg wrote:
 On Mon, 2014-06-09 at 11:59 +0200, Johannes Berg wrote:
   Johannes, could you enable USB debugging in the linus/master kernel and
   provide a kernel log ?
  
  I'll try to get some logs (wasn't there tracing added to xhci too? will
  check)
 
 Here we go - log + tracing:
 log: http://p.sipsolutions.net/d5926c43d531e3af.txt
 trace: http://johannes.sipsolutions.net/files/xhci.trace.dat.xz
 
 I plugged in the device, waited a bit, tried to run a camera application
 (didn't work) and then ran lsusb -t and lsusb -v.

Mathias, would you have time to give this a quick look ?

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] xc5000: Fix get_frequency()

2014-07-21 Thread Mauro Carvalho Chehab
The programmed frequency on xc5000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/tuners/xc5000.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index 2b3d514be672..3091cf7be7a1 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -56,7 +56,7 @@ struct xc5000_priv {
 
u32 if_khz;
u16 xtal_khz;
-   u32 freq_hz;
+   u32 freq_hz, freq_offset;
u32 bandwidth;
u8  video_standard;
u8  rf_mode;
@@ -749,13 +749,13 @@ static int xc5000_set_params(struct dvb_frontend *fe)
case SYS_ATSC:
dprintk(1, %s() VSB modulation\n, __func__);
priv-rf_mode = XC_RF_MODE_AIR;
-   priv-freq_hz = freq - 175;
+   priv-freq_offset = 175;
priv-video_standard = DTV6;
break;
case SYS_DVBC_ANNEX_B:
dprintk(1, %s() QAM modulation\n, __func__);
priv-rf_mode = XC_RF_MODE_CABLE;
-   priv-freq_hz = freq - 175;
+   priv-freq_offset = 175;
priv-video_standard = DTV6;
break;
case SYS_ISDBT:
@@ -770,15 +770,15 @@ static int xc5000_set_params(struct dvb_frontend *fe)
switch (bw) {
case 600:
priv-video_standard = DTV6;
-   priv-freq_hz = freq - 175;
+   priv-freq_offset = 175;
break;
case 700:
priv-video_standard = DTV7;
-   priv-freq_hz = freq - 225;
+   priv-freq_offset = 225;
break;
case 800:
priv-video_standard = DTV8;
-   priv-freq_hz = freq - 275;
+   priv-freq_offset = 275;
break;
default:
printk(KERN_ERR xc5000 bandwidth not set!\n);
@@ -792,15 +792,15 @@ static int xc5000_set_params(struct dvb_frontend *fe)
priv-rf_mode = XC_RF_MODE_CABLE;
if (bw = 600) {
priv-video_standard = DTV6;
-   priv-freq_hz = freq - 175;
+   priv-freq_offset = 175;
b = 6;
} else if (bw = 700) {
priv-video_standard = DTV7;
-   priv-freq_hz = freq - 225;
+   priv-freq_offset = 225;
b = 7;
} else {
priv-video_standard = DTV7_8;
-   priv-freq_hz = freq - 275;
+   priv-freq_offset = 275;
b = 8;
}
dprintk(1, %s() Bandwidth %dMHz (%d)\n, __func__,
@@ -811,6 +811,8 @@ static int xc5000_set_params(struct dvb_frontend *fe)
return -EINVAL;
}
 
+   priv-freq_hz = freq - priv-freq_offset;
+
dprintk(1, %s() frequency=%d (compensated to %d)\n,
__func__, freq, priv-freq_hz);
 
@@ -1061,7 +1063,7 @@ static int xc5000_get_frequency(struct dvb_frontend *fe, 
u32 *freq)
 {
struct xc5000_priv *priv = fe-tuner_priv;
dprintk(1, %s()\n, __func__);
-   *freq = priv-freq_hz;
+   *freq = priv-freq_hz + priv-freq_offset;
return 0;
 }
 
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL for 3.16-rc7] media fixes for master

2014-07-21 Thread Mauro Carvalho Chehab
Linus,

Please pull from:
  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
v4l_for_linus

For a series of driver fixes:
- Fix DVB-S tuning with tda1071;
- Fix tuner probe on af9035 when the device has a bad eeprom;
- Some fixes for the new si2168/2157 drivers;
- one Kconfig build fix (for omap4iss);
- Fixes at vpif error path;
- Don't lock saa7134 ioctl at driver's base core level, as it now
  uses V4L2 and VB2 locking schema;
- Fix audio at hdpvr driver;
- Fix the aspect ratio at the digital timings table;
- One new USB ID (at gspca_pac7302): Genius i-Look 317 webcam

Regards,
Mauro

The following changes since commit a2668e10d7246e782f7708dc47c00f035da23a81:

  [media] au0828-dvb: restore its permission to 644 (2014-06-04 15:19:36 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
v4l_for_linus

for you to fetch changes up to 242841d3d71191348f98310e2d2001e1001d8630:

  [media] gspca_pac7302: Add new usb-id for Genius i-Look 317 (2014-07-14 
21:06:35 -0300)


Antti Palosaari (8):
  [media] si2168: add one missing parenthesis
  [media] si2157: add one missing parenthesis
  [media] si2168: firmware download fix
  [media] af9035: override tuner id when bad value set into eeprom
  [media] tda10071: force modulation to QPSK on DVB-S
  [media] tda10071: add missing DVB-S2/PSK-8 FEC AUTO
  [media] tda10071: fix spec inversion reporting
  [media] tda10071: fix returned symbol rate calculation

Arnd Bergmann (1):
  [media] staging: tighten omap4iss dependencies

Dan Carpenter (1):
  [media] davinci: vpif: missing unlocks on error

Hans Verkuil (2):
  [media] saa7134: use unlocked_ioctl instead of ioctl
  [media] hdpvr: fix two audio bugs

Hans de Goede (1):
  [media] gspca_pac7302: Add new usb-id for Genius i-Look 317

Rickard Strandqvist (1):
  [media] media: v4l2-core: v4l2-dv-timings.c: Cleaning up code wrong value 
used in aspect ratio

 drivers/media/dvb-frontends/si2168.c  | 16 +--
 drivers/media/dvb-frontends/si2168_priv.h |  2 +-
 drivers/media/dvb-frontends/tda10071.c| 12 +---
 drivers/media/dvb-frontends/tda10071_priv.h   |  1 +
 drivers/media/pci/saa7134/saa7134-empress.c   |  2 +-
 drivers/media/platform/davinci/vpif_capture.c |  1 +
 drivers/media/platform/davinci/vpif_display.c |  1 +
 drivers/media/tuners/si2157.c |  2 +-
 drivers/media/usb/dvb-usb-v2/af9035.c | 40 ++-
 drivers/media/usb/gspca/pac7302.c |  1 +
 drivers/media/usb/hdpvr/hdpvr-video.c |  6 ++--
 drivers/media/v4l2-core/v4l2-dv-timings.c |  4 +--
 drivers/staging/media/omap4iss/Kconfig|  2 +-
 13 files changed, 55 insertions(+), 35 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] mb86a20s: fix ISDB-T mode handling

2014-07-21 Thread Mauro Carvalho Chehab
The driver was reporting an incorrect mode, when mode 2
is selected.

While testing it, noticed that neither mode 1 or guard
interval 1/32 is supported by this device. Document it,
and ensure that it will report _AUTO when it doesn't lock,
in order to not report a wrong detection to userspace.

Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/dvb-frontends/mb86a20s.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
b/drivers/media/dvb-frontends/mb86a20s.c
index 227a420f7069..b931179c70a4 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -711,11 +711,10 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe)
rc = mb86a20s_readreg(state, 0x07);
if (rc  0)
return rc;
+   c-transmission_mode = TRANSMISSION_MODE_AUTO;
if ((rc  0x60) == 0x20) {
-   switch (rc  0x0c  2) {
-   case 0:
-   c-transmission_mode = TRANSMISSION_MODE_2K;
-   break;
+   /* Only modes 2 and 3 are supported */
+   switch ((rc  2)  0x03) {
case 1:
c-transmission_mode = TRANSMISSION_MODE_4K;
break;
@@ -724,7 +723,9 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe)
break;
}
}
+   c-guard_interval = GUARD_INTERVAL_AUTO;
if (!(rc  0x10)) {
+   /* Guard interval 1/32 is not supported */
switch (rc  0x3) {
case 0:
c-guard_interval = GUARD_INTERVAL_1_4;
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mb86a20s: fix ISDB-T mode handling

2014-07-21 Thread Mauro Carvalho Chehab
Em Sat, 12 Jul 2014 21:52:46 +0300
Antti Palosaari cr...@iki.fi escreveu:

 Mauro, you have forgot some debug hacks to that patch.

Thanks for noticing. Actually, it got merged by mistake with
a hack I'm using to debug another driver.

Just sent a version 2 of this patch.

Regards,
Mauro

 
 Antti
 
 On 07/12/2014 07:39 PM, Mauro Carvalho Chehab wrote:
  The driver was reporting an incorrect mode, when mode 2
  is selected.
 
  While testing it, noticed that neither mode 1 or guard
  interval 1/32 is supported by this device. Document it,
  and ensure that it will report _AUTO when it doesn't lock,
  in order to not report a wrong detection to userspace.
 
  Cc: sta...@vger.kernel.org
  Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
  ---
drivers/media/dvb-frontends/dib0090.c   | 6 +-
drivers/media/dvb-frontends/mb86a20s.c  | 9 +
drivers/media/usb/dvb-usb/dib0700_devices.c | 3 +++
3 files changed, 13 insertions(+), 5 deletions(-)
 
  diff --git a/drivers/media/dvb-frontends/dib0090.c 
  b/drivers/media/dvb-frontends/dib0090.c
  index 68e2af2650d3..27d5c5cd439c 100644
  --- a/drivers/media/dvb-frontends/dib0090.c
  +++ b/drivers/media/dvb-frontends/dib0090.c
  @@ -24,6 +24,8 @@
 *
 */
 
  +#define DEBUG_AGC
  +
#include linux/kernel.h
#include linux/slab.h
#include linux/i2c.h
  @@ -1199,11 +1201,13 @@ int dib0090_gain_control(struct dvb_frontend *fe)
  state-rf_gain_limit = state-rf_ramp[0]  WBD_ALPHA;
  state-current_gain = ((state-rf_ramp[0] + state-bb_ramp[0]) 
  / 2)  GAIN_ALPHA;
 
  +dprintk(Current gain: %d\n, state-current_gain);
  +
  *tune_state = CT_AGC_STEP_0;
  } else if (!state-agc_freeze) {
  s16 wbd = 0, i, cnt;
 
  -   int adc;
  +   int adc = 0;
  wbd_val = dib0090_get_slow_adc_val(state);
 
  if (*tune_state == CT_AGC_STEP_0)
  diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
  b/drivers/media/dvb-frontends/mb86a20s.c
  index 227a420f7069..b931179c70a4 100644
  --- a/drivers/media/dvb-frontends/mb86a20s.c
  +++ b/drivers/media/dvb-frontends/mb86a20s.c
  @@ -711,11 +711,10 @@ static int mb86a20s_get_frontend(struct dvb_frontend 
  *fe)
  rc = mb86a20s_readreg(state, 0x07);
  if (rc  0)
  return rc;
  +   c-transmission_mode = TRANSMISSION_MODE_AUTO;
  if ((rc  0x60) == 0x20) {
  -   switch (rc  0x0c  2) {
  -   case 0:
  -   c-transmission_mode = TRANSMISSION_MODE_2K;
  -   break;
  +   /* Only modes 2 and 3 are supported */
  +   switch ((rc  2)  0x03) {
  case 1:
  c-transmission_mode = TRANSMISSION_MODE_4K;
  break;
  @@ -724,7 +723,9 @@ static int mb86a20s_get_frontend(struct dvb_frontend 
  *fe)
  break;
  }
  }
  +   c-guard_interval = GUARD_INTERVAL_AUTO;
  if (!(rc  0x10)) {
  +   /* Guard interval 1/32 is not supported */
  switch (rc  0x3) {
  case 0:
  c-guard_interval = GUARD_INTERVAL_1_4;
  diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c 
  b/drivers/media/usb/dvb-usb/dib0700_devices.c
  index 501947eaacfe..cad359fcd690 100644
  --- a/drivers/media/usb/dvb-usb/dib0700_devices.c
  +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
  @@ -1645,6 +1645,8 @@ static int dib8096_set_param_override(struct 
  dvb_frontend *fe)
  int ret = 0;
  enum frontend_tune_state tune_state = CT_SHUTDOWN;
 
  +printk(%s called.\n, __func__);
  +
  switch (band) {
  default:
  deb_info(Warning : Rf frequency  (%iHz) is not in the 
  supported range, using VHF switch , fe-dtv_property_cache.frequency);
  @@ -1714,6 +1716,7 @@ static int dib8096_set_param_override(struct 
  dvb_frontend *fe)
  } else {
  /* for everything else than CBAND we are using standard AGC */
  deb_info(not tuning in CBAND - standard AGC startup\n);
  +printk(%s: calling dib0090_pwm_gain_reset\n, __func__);
  dib0090_pwm_gain_reset(fe);
  }
 
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 06/32] [media] coda: Add encoder/decoder support for CODA960

2014-07-21 Thread Mauro Carvalho Chehab
Em Fri, 11 Jul 2014 11:36:17 +0200
Philipp Zabel p.za...@pengutronix.de escreveu:

 This patch adds support for the CODA960 VPU in Freescale i.MX6 SoCs.
 
 It enables h.264 and MPEG4 encoding and decoding support. Besides the usual
 register shifting, the CODA960 gains frame memory control and GDI registers
 that are set up for linear mapping right now, needs ENC_PIC_SRC_INDEX to be
 set beyond the number of internal buffers for some reason, and has subsampling
 buffers that need to be set up. Also, the work buffer size is increased to
 80 KiB.
 
 The CODA960 firmware spins if there is not enough input data in the bitstream
 buffer. To make it continue, buffers need to be copied into the bitstream as
 soon as they are queued. As the bitstream fifo is written into from two 
 places,
 it must be protected with a mutex. For that, using a threaded interrupt 
 handler
 is necessary.
 
 Signed-off-by: Philipp Zabel p.za...@pengutronix.de
 ---

...

 + [CODA_IMX6Q] = {
 + .firmware   = v4l-coda960-imx6q.bin,
 + .product= CODA_960,
 + .codecs = coda9_codecs,
 + .num_codecs = ARRAY_SIZE(coda9_codecs),
 + },
 + [CODA_IMX6DL] = {
 + .firmware   = v4l-coda960-imx6dl.bin,
 + .product= CODA_960,
 + .codecs = coda9_codecs,
 + .num_codecs = ARRAY_SIZE(coda9_codecs),
 + },

Where are those firmware files available?

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 18/32] [media] v4l2-mem2mem: export v4l2_m2m_try_schedule

2014-07-21 Thread Mauro Carvalho Chehab
Em Fri, 11 Jul 2014 11:36:29 +0200
Philipp Zabel p.za...@pengutronix.de escreveu:

 From: Michael Olbrich m.olbr...@pengutronix.de
 
 Some drivers might allow to decode remaining frames from an internal 
 ringbuffer
 after a decoder stop command. Allow those to call v4l2_m2m_try_schedule
 directly.
 
 Signed-off-by: Michael Olbrich m.olbr...@pengutronix.de
 Signed-off-by: Philipp Zabel p.za...@pengutronix.de
 ---
  drivers/media/v4l2-core/v4l2-mem2mem.c | 3 ++-
  include/media/v4l2-mem2mem.h   | 2 ++
  2 files changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c 
 b/drivers/media/v4l2-core/v4l2-mem2mem.c
 index 178ce96..5f5c175 100644
 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c
 +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
 @@ -208,7 +208,7 @@ static void v4l2_m2m_try_run(struct v4l2_m2m_dev *m2m_dev)
   * An example of the above could be an instance that requires more than one
   * src/dst buffer per transaction.
   */
 -static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
 +void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
  {
   struct v4l2_m2m_dev *m2m_dev;
   unsigned long flags_job, flags_out, flags_cap;
 @@ -274,6 +274,7 @@ static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx 
 *m2m_ctx)
  
   v4l2_m2m_try_run(m2m_dev);
  }
 +EXPORT_SYMBOL(v4l2_m2m_try_schedule);

Please use EXPORT_SYMBOL_GPL() instead.

Regards,
Mauro

  
  /**
   * v4l2_m2m_cancel_job() - cancel pending jobs for the context
 diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
 index 12ea5a6..c5f3914 100644
 --- a/include/media/v4l2-mem2mem.h
 +++ b/include/media/v4l2-mem2mem.h
 @@ -95,6 +95,8 @@ void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev);
  struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx,
  enum v4l2_buf_type type);
  
 +void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx);
 +
  void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev,
struct v4l2_m2m_ctx *m2m_ctx);
  
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 06/32] [media] coda: Add encoder/decoder support for CODA960

2014-07-21 Thread Robert Schwebel
Hi Mauro,

On Mon, Jul 21, 2014 at 04:01:28PM -0300, Mauro Carvalho Chehab wrote:
  This patch adds support for the CODA960 VPU in Freescale i.MX6 SoCs.
  
  It enables h.264 and MPEG4 encoding and decoding support. Besides the usual
  register shifting, the CODA960 gains frame memory control and GDI registers
  that are set up for linear mapping right now, needs ENC_PIC_SRC_INDEX to be
  set beyond the number of internal buffers for some reason, and has 
  subsampling
  buffers that need to be set up. Also, the work buffer size is increased to
  80 KiB.
  
  The CODA960 firmware spins if there is not enough input data in the 
  bitstream
  buffer. To make it continue, buffers need to be copied into the bitstream as
  soon as they are queued. As the bitstream fifo is written into from two 
  places,
  it must be protected with a mutex. For that, using a threaded interrupt 
  handler
  is necessary.
  
  Signed-off-by: Philipp Zabel p.za...@pengutronix.de
  ---
 
 ...
 
  +   [CODA_IMX6Q] = {
  +   .firmware   = v4l-coda960-imx6q.bin,
  +   .product= CODA_960,
  +   .codecs = coda9_codecs,
  +   .num_codecs = ARRAY_SIZE(coda9_codecs),
  +   },
  +   [CODA_IMX6DL] = {
  +   .firmware   = v4l-coda960-imx6dl.bin,
  +   .product= CODA_960,
  +   .codecs = coda9_codecs,
  +   .num_codecs = ARRAY_SIZE(coda9_codecs),
  +   },
 
 Where are those firmware files available?

Freescale currently distributes the firmware with their multimedia
packages, but in header hex array form; we are trying to find a proper
solution (hopefully by using the linux firmware repository) for
mainline.

The Freescale kernel people are currently discussing this internally
with their legal folks, see this discussion:

http://www.spinics.net/lists/linux-media/msg78273.html

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l: Add ARGB555X and XRGB555X pixel formats

2014-07-21 Thread Laurent Pinchart
The existing RGB555X pixel format is ill-defined in respect to its alpha
bit and its meaning is driver dependent. Create new standard ARGB555X
and XRGB555X variants with clearly defined meanings and make the
existing variant deprecated.

The new pixel formats 4CC values have been selected to match the DRM
4CCs for the same in-memory formats.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 .../DocBook/media/v4l/pixfmt-packed-rgb.xml| 50 --
 include/uapi/linux/videodev2.h |  3 ++
 2 files changed, 50 insertions(+), 3 deletions(-)

Hello,

These two formats where missing from commit 977ff0e4fb3460df (v4l: Add ARGB
and XRGB pixel formats). By popular request, here they are.

I've decided to reuse the DRM 4CC values to ease future compatibility, but as
DRM makes big-endian 4CCs by OR'ing the little-endian 4CC with (1  31), I'll
be flexible if values are frowned upon.

diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
index 5f1602f..32feac9 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
@@ -240,9 +240,9 @@ colorspace constantV4L2_COLORSPACE_SRGB/constant./para
entrygsubscript4/subscript/entry
entrygsubscript3/subscript/entry
  /row
- row id=V4L2-PIX-FMT-RGB555X
-   entryconstantV4L2_PIX_FMT_RGB555X/constant/entry
-   entry'RGBQ'/entry
+ row id=V4L2-PIX-FMT-ARGB555X
+   entryconstantV4L2_PIX_FMT_ARGB555X/constant/entry
+   entry'AR15' | (1 lt;lt; 31)/entry
entry/entry
entrya/entry
entryrsubscript4/subscript/entry
@@ -262,6 +262,28 @@ colorspace 
constantV4L2_COLORSPACE_SRGB/constant./para
entrybsubscript1/subscript/entry
entrybsubscript0/subscript/entry
  /row
+ row id=V4L2-PIX-FMT-XRGB555X
+   entryconstantV4L2_PIX_FMT_XRGB555X/constant/entry
+   entry'XR15' | (1 lt;lt; 31)/entry
+   entry/entry
+   entry-/entry
+   entryrsubscript4/subscript/entry
+   entryrsubscript3/subscript/entry
+   entryrsubscript2/subscript/entry
+   entryrsubscript1/subscript/entry
+   entryrsubscript0/subscript/entry
+   entrygsubscript4/subscript/entry
+   entrygsubscript3/subscript/entry
+   entry/entry
+   entrygsubscript2/subscript/entry
+   entrygsubscript1/subscript/entry
+   entrygsubscript0/subscript/entry
+   entrybsubscript4/subscript/entry
+   entrybsubscript3/subscript/entry
+   entrybsubscript2/subscript/entry
+   entrybsubscript1/subscript/entry
+   entrybsubscript0/subscript/entry
+ /row
  row id=V4L2-PIX-FMT-RGB565X
entryconstantV4L2_PIX_FMT_RGB565X/constant/entry
entry'RGBR'/entry
@@ -803,6 +825,28 @@ image/title
entrygsubscript4/subscript/entry
entrygsubscript3/subscript/entry
  /row
+ row id=V4L2-PIX-FMT-RGB555X
+   entryconstantV4L2_PIX_FMT_RGB555X/constant/entry
+   entry'RGBQ'/entry
+   entry/entry
+   entrya/entry
+   entryrsubscript4/subscript/entry
+   entryrsubscript3/subscript/entry
+   entryrsubscript2/subscript/entry
+   entryrsubscript1/subscript/entry
+   entryrsubscript0/subscript/entry
+   entrygsubscript4/subscript/entry
+   entrygsubscript3/subscript/entry
+   entry/entry
+   entrygsubscript2/subscript/entry
+   entrygsubscript1/subscript/entry
+   entrygsubscript0/subscript/entry
+   entrybsubscript4/subscript/entry
+   entrybsubscript3/subscript/entry
+   entrybsubscript2/subscript/entry
+   entrybsubscript1/subscript/entry
+   entrybsubscript0/subscript/entry
+ /row
  row id=V4L2-PIX-FMT-BGR32
entryconstantV4L2_PIX_FMT_BGR32/constant/entry
entry'BGR4'/entry
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 1f1a65c..8ccaa0a 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -79,6 +79,7 @@
 /*  Four-character-code (FOURCC) */
 #define v4l2_fourcc(a, b, c, d)\
((__u32)(a) | ((__u32)(b)  8) | ((__u32)(c)  16) | ((__u32)(d)  
24))
+#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1  31))
 
 /*
  * E N U M S
@@ -307,6 +308,8 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16  
XRGB-1-5-5-5  */
 #define V4L2_PIX_FMT_RGB565  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5  
   */
 #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 
BE  */
+#define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16  
ARGB-5-5-5 BE */

[PATCH] v4l: Clarify RGB666 pixel format definition

2014-07-21 Thread Laurent Pinchart
The RGB666 pixel format doesn't include an alpha channel. Document it as
such.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 .../DocBook/media/v4l/pixfmt-packed-rgb.xml  | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
index 32feac9..c47692a 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
@@ -330,20 +330,12 @@ colorspace 
constantV4L2_COLORSPACE_SRGB/constant./para
entry/entry
entryrsubscript1/subscript/entry
entryrsubscript0/subscript/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
-   entry/entry
+   entry-/entry
+   entry-/entry
+   entry-/entry
+   entry-/entry
+   entry-/entry
+   entry-/entry
  /row
  row id=V4L2-PIX-FMT-BGR24
entryconstantV4L2_PIX_FMT_BGR24/constant/entry
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 03/23] v4l: Support extending the v4l2_pix_format structure

2014-07-21 Thread Laurent Pinchart
Hi Hans,

On Thursday 17 July 2014 23:04:09 Hans Verkuil wrote:
 Hi Laurent,
 
 Something that just caught my eye:
 
 On 06/24/2014 01:54 AM, Laurent Pinchart wrote:
  The v4l2_pix_format structure has no reserved field. It is embedded in
  the v4l2_framebuffer structure which has no reserved fields either, and
  in the v4l2_format structure which has reserved fields that were not
  previously required to be zeroed out by applications.
  
  To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer
  structure, and use the priv field as a magic value to indicate that the
  application has set all v4l2_pix_format extended fields and zeroed all
  reserved fields following the v4l2_pix_format field in the v4l2_format
  structure.
  
  The availability of this API extension is reported to userspace through
  the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the
  priv field is still set to the magic value at [GS]_FMT return wouldn't
  be enough, as older kernels don't zero the priv field on return.
  
  To simplify the internal API towards drivers zero the extended fields
  and set the priv field to the magic value for applications not aware of
  the extensions.
  
  Signed-off-by: Laurent Pinchart
  laurent.pinchart+rene...@ideasonboard.com
  ---
  
  diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml
  b/Documentation/DocBook/media/v4l/pixfmt.xml index 91dcbc8..8c56cacd
  100644
  --- a/Documentation/DocBook/media/v4l/pixfmt.xml
  +++ b/Documentation/DocBook/media/v4l/pixfmt.xml

[snip]

  +paraTo use the extended fields, applications must set the
  +structfieldpriv/structfield field to
  +constantV4L2_PIX_FMT_PRIV_MAGIC/constant, initialize all the extended
  fields
  +and zero the unused bytes of the structnamev4l2_format/structname
  +structfieldraw_data/structfield field./para
 
 Easy to write, much harder to implement. You would end up with something
 like:
 
 memset(fmt.fmt.pix.flags + sizeof(fmt.fmt.pix.flags), 0,
   sizeof(fmt.fmt.raw_data) - sizeof(fmt.fmt.pix));
 
 Not user-friendly and error-prone.

Or, rather, memset the whole v4l2_format structure to 0 and then fill it.

 I would suggest adding a reserved array to pix_format instead, of at least
 size (10 + 2 * 7) / 4 = 6 __u32. So: __u32 reserved[6]. Better would be to
 go with 10 + 17 = 27 elements (same as the number of reserved elements in
 v4l2_pix_format_mplane and one struct v4l2_plane_pix_format).

Maybe it's a bit late, but I'm not sure to see where you got those values. If 
we want to use a reserved array, it would make more sense to make it cover the 
whole raw_data array, otherwise future extensions could require an API change. 
On the other hand this would result in the v4l2_pix_format structure suddenly 
consuming 200 bytes instead of 36 today. That wouldn't be good when allocated 
on the stack.

 That will allow you to just say that the app should zero the reserved array.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Clarify RGB666 pixel format definition

2014-07-21 Thread Hans Verkuil
On 07/21/2014 10:39 PM, Laurent Pinchart wrote:
 The RGB666 pixel format doesn't include an alpha channel. Document it as
 such.
 
 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---
  .../DocBook/media/v4l/pixfmt-packed-rgb.xml  | 20 
 ++--
  1 file changed, 6 insertions(+), 14 deletions(-)
 
 diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
 b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 index 32feac9..c47692a 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 @@ -330,20 +330,12 @@ colorspace 
 constantV4L2_COLORSPACE_SRGB/constant./para
   entry/entry
   entryrsubscript1/subscript/entry
   entryrsubscript0/subscript/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 - entry/entry
 + entry-/entry
 + entry-/entry
 + entry-/entry
 + entry-/entry
 + entry-/entry
 + entry-/entry

Just to clarify: BGR666 is a three byte format, not a four byte format?

If so, then:

Acked-by: Hans Verkuil hans.verk...@cisco.com

Regards,

Hans

 /row
 row id=V4L2-PIX-FMT-BGR24
   entryconstantV4L2_PIX_FMT_BGR24/constant/entry
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Add ARGB555X and XRGB555X pixel formats

2014-07-21 Thread Hans Verkuil
On 07/21/2014 10:37 PM, Laurent Pinchart wrote:
 The existing RGB555X pixel format is ill-defined in respect to its alpha
 bit and its meaning is driver dependent. Create new standard ARGB555X
 and XRGB555X variants with clearly defined meanings and make the
 existing variant deprecated.
 
 The new pixel formats 4CC values have been selected to match the DRM
 4CCs for the same in-memory formats.

Acked-by: Hans Verkuil hans.verk...@cisco.com

But: I've double-checked your chosen fourcc's for the RGB32 formats, and I see
you made a mistake in the docbook (the videodev2.h header is OK): the fourcc
for the ARGB32 should be 'BA24' instead of 'AX24'. You might want to fix that
up at the same time.

Regards,

Hans

 
 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---
  .../DocBook/media/v4l/pixfmt-packed-rgb.xml| 50 
 --
  include/uapi/linux/videodev2.h |  3 ++
  2 files changed, 50 insertions(+), 3 deletions(-)
 
 Hello,
 
 These two formats where missing from commit 977ff0e4fb3460df (v4l: Add ARGB
 and XRGB pixel formats). By popular request, here they are.
 
 I've decided to reuse the DRM 4CC values to ease future compatibility, but as
 DRM makes big-endian 4CCs by OR'ing the little-endian 4CC with (1  31), I'll
 be flexible if values are frowned upon.
 
 diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
 b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 index 5f1602f..32feac9 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 @@ -240,9 +240,9 @@ colorspace 
 constantV4L2_COLORSPACE_SRGB/constant./para
   entrygsubscript4/subscript/entry
   entrygsubscript3/subscript/entry
 /row
 -   row id=V4L2-PIX-FMT-RGB555X
 - entryconstantV4L2_PIX_FMT_RGB555X/constant/entry
 - entry'RGBQ'/entry
 +   row id=V4L2-PIX-FMT-ARGB555X
 + entryconstantV4L2_PIX_FMT_ARGB555X/constant/entry
 + entry'AR15' | (1 lt;lt; 31)/entry
   entry/entry
   entrya/entry
   entryrsubscript4/subscript/entry
 @@ -262,6 +262,28 @@ colorspace 
 constantV4L2_COLORSPACE_SRGB/constant./para
   entrybsubscript1/subscript/entry
   entrybsubscript0/subscript/entry
 /row
 +   row id=V4L2-PIX-FMT-XRGB555X
 + entryconstantV4L2_PIX_FMT_XRGB555X/constant/entry
 + entry'XR15' | (1 lt;lt; 31)/entry
 + entry/entry
 + entry-/entry
 + entryrsubscript4/subscript/entry
 + entryrsubscript3/subscript/entry
 + entryrsubscript2/subscript/entry
 + entryrsubscript1/subscript/entry
 + entryrsubscript0/subscript/entry
 + entrygsubscript4/subscript/entry
 + entrygsubscript3/subscript/entry
 + entry/entry
 + entrygsubscript2/subscript/entry
 + entrygsubscript1/subscript/entry
 + entrygsubscript0/subscript/entry
 + entrybsubscript4/subscript/entry
 + entrybsubscript3/subscript/entry
 + entrybsubscript2/subscript/entry
 + entrybsubscript1/subscript/entry
 + entrybsubscript0/subscript/entry
 +   /row
 row id=V4L2-PIX-FMT-RGB565X
   entryconstantV4L2_PIX_FMT_RGB565X/constant/entry
   entry'RGBR'/entry
 @@ -803,6 +825,28 @@ image/title
   entrygsubscript4/subscript/entry
   entrygsubscript3/subscript/entry
 /row
 +   row id=V4L2-PIX-FMT-RGB555X
 + entryconstantV4L2_PIX_FMT_RGB555X/constant/entry
 + entry'RGBQ'/entry
 + entry/entry
 + entrya/entry
 + entryrsubscript4/subscript/entry
 + entryrsubscript3/subscript/entry
 + entryrsubscript2/subscript/entry
 + entryrsubscript1/subscript/entry
 + entryrsubscript0/subscript/entry
 + entrygsubscript4/subscript/entry
 + entrygsubscript3/subscript/entry
 + entry/entry
 + entrygsubscript2/subscript/entry
 + entrygsubscript1/subscript/entry
 + entrygsubscript0/subscript/entry
 + entrybsubscript4/subscript/entry
 + entrybsubscript3/subscript/entry
 + entrybsubscript2/subscript/entry
 + entrybsubscript1/subscript/entry
 + entrybsubscript0/subscript/entry
 +   /row
 row id=V4L2-PIX-FMT-BGR32
   entryconstantV4L2_PIX_FMT_BGR32/constant/entry
   entry'BGR4'/entry
 diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
 index 1f1a65c..8ccaa0a 100644
 --- a/include/uapi/linux/videodev2.h
 +++ b/include/uapi/linux/videodev2.h
 @@ -79,6 +79,7 @@
  /*  Four-character-code (FOURCC) */
  #define v4l2_fourcc(a, b, c, d)\
   ((__u32)(a) | ((__u32)(b)  8) | ((__u32)(c)  16) | ((__u32)(d)  
 24))
 +#define v4l2_fourcc_be(a, b, c, d)   (v4l2_fourcc(a, b, c, d) | (1  31))
  
  /*
   *   E N U M S
 @@ -307,6 +308,8 @@ struct v4l2_pix_format {
  

Re: [PATCH v2 03/23] v4l: Support extending the v4l2_pix_format structure

2014-07-21 Thread Hans Verkuil
On 07/21/2014 10:56 PM, Laurent Pinchart wrote:
 Hi Hans,
 
 On Thursday 17 July 2014 23:04:09 Hans Verkuil wrote:
 Hi Laurent,

 Something that just caught my eye:

 On 06/24/2014 01:54 AM, Laurent Pinchart wrote:
 The v4l2_pix_format structure has no reserved field. It is embedded in
 the v4l2_framebuffer structure which has no reserved fields either, and
 in the v4l2_format structure which has reserved fields that were not
 previously required to be zeroed out by applications.

 To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer
 structure, and use the priv field as a magic value to indicate that the
 application has set all v4l2_pix_format extended fields and zeroed all
 reserved fields following the v4l2_pix_format field in the v4l2_format
 structure.

 The availability of this API extension is reported to userspace through
 the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the
 priv field is still set to the magic value at [GS]_FMT return wouldn't
 be enough, as older kernels don't zero the priv field on return.

 To simplify the internal API towards drivers zero the extended fields
 and set the priv field to the magic value for applications not aware of
 the extensions.

 Signed-off-by: Laurent Pinchart
 laurent.pinchart+rene...@ideasonboard.com
 ---

 diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml
 b/Documentation/DocBook/media/v4l/pixfmt.xml index 91dcbc8..8c56cacd
 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
 
 [snip]
 
 +paraTo use the extended fields, applications must set the
 +structfieldpriv/structfield field to
 +constantV4L2_PIX_FMT_PRIV_MAGIC/constant, initialize all the extended
 fields
 +and zero the unused bytes of the structnamev4l2_format/structname
 +structfieldraw_data/structfield field./para

 Easy to write, much harder to implement. You would end up with something
 like:

 memset(fmt.fmt.pix.flags + sizeof(fmt.fmt.pix.flags), 0,
  sizeof(fmt.fmt.raw_data) - sizeof(fmt.fmt.pix));

 Not user-friendly and error-prone.
 
 Or, rather, memset the whole v4l2_format structure to 0 and then fill it.
 
 I would suggest adding a reserved array to pix_format instead, of at least
 size (10 + 2 * 7) / 4 = 6 __u32. So: __u32 reserved[6]. Better would be to
 go with 10 + 17 = 27 elements (same as the number of reserved elements in
 v4l2_pix_format_mplane and one struct v4l2_plane_pix_format).
 
 Maybe it's a bit late, but I'm not sure to see where you got those values.

I'm making the assumption that anything we might want to add to pix_format, we
also want to add to pix_format_mplane. And the latter has 10 reserved bytes in
the pix_format_mplane struct and another 7 __u16's in each plane_pix_format.
So for a single plane format that means that there are 10 + 2 * 7 bytes reserved
space available in the multiplanar case (for the main struct + one plane 
struct).

We could add a __u8 reserved[24] to pix_format. Then the amount of reserved 
fields
in pix_format is identical to that in pix_format_mplane. That makes it easy to
keep in sync. The alignment looks to be OK too (no holes in the struct).
(BTW, when I wrote '10 + 17' in my earlier email I meant '10 + 14'. Sorry about
that confusion.)

But perhaps I am just over-analyzing and the real problem is the text in the 
spec
'initialize all the extended fields and zero the unused bytes of the v4l2_format
raw_data field.'. It might be better to add something along the lines of:

It is good practice to either call VIDIOC_G_FMT first, and then modify any 
fields,
or to memset to 0 the whole v4l2_format structure before filling in fields.

 If we want to use a reserved array, it would make more sense to make it cover 
 the 
 whole raw_data array, otherwise future extensions could require an API 
 change. 
 On the other hand this would result in the v4l2_pix_format structure suddenly 
 consuming 200 bytes instead of 36 today. That wouldn't be good when allocated 
 on the stack.

I think the amount of available space in the multiplanar structs puts an upper
limit to what can be done with pix_format anyway. So reserving more space seems
unnecessary. It's not as if we'll see a huge number of new fields appearing.
I know of one flag that might be needed to signal alternate quantization ranges
to enhance the colorspace information, but that's all I know about.

Regards,

Hans

 
 That will allow you to just say that the app should zero the reserved array.
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Clarify RGB666 pixel format definition

2014-07-21 Thread Laurent Pinchart
Hi Hans,

On Monday 21 July 2014 23:43:16 Hans Verkuil wrote:
 On 07/21/2014 10:39 PM, Laurent Pinchart wrote:
  The RGB666 pixel format doesn't include an alpha channel. Document it as
  such.
  
  Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
  ---
  
   .../DocBook/media/v4l/pixfmt-packed-rgb.xml  | 20 +--
  1 file changed, 6 insertions(+), 14 deletions(-)
  
  diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index
  32feac9..c47692a 100644
  --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  @@ -330,20 +330,12 @@ colorspace
  constantV4L2_COLORSPACE_SRGB/constant./para 
  entry/entry
  entryrsubscript1/subscript/entry
  entryrsubscript0/subscript/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  -   entry/entry
  +   entry-/entry
  +   entry-/entry
  +   entry-/entry
  +   entry-/entry
  +   entry-/entry
  +   entry-/entry
 
 Just to clarify: BGR666 is a three byte format, not a four byte format?

Well... :-)

Three drivers seem to support the BGR666 in mainline : sh_veu, s3c-camif and 
exynos4-is. Further investigation shows that the sh_veu driver lists the 
BGR666 format internally but doesn't expose it to userspace and doesn't 
actually support it, so we're down to two drivers.

Looking at the S3C6410 datasheet, it's unclear how the hardware stores RGB666 
pixels in memory. It could be either

Byte 0   Byte 1   Byte 2   Byte 3

 --RR  GGBB

or

GGBB  --RR 

None of those correspond to the RGB666 format defined in the spec.

The Exynos4 FIMC isn't documented in the public datasheet, so I can't check 
how the format is defined.

Furthermore, various Renesas video-related IP cores support many different 
RGB666 variants, on either 32 or 24 bits per pixel, with and without alpha.

Beside a loud *sigh*, any comment ? :-)

/row
row id=V4L2-PIX-FMT-BGR24
  entryconstantV4L2_PIX_FMT_BGR24/constant/entry

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l: Fix ARGB32 fourcc value in the documentation

2014-07-21 Thread Laurent Pinchart
The ARGB32 pixel format's fourcc value is defined to 'BA24' in the
videodev2.h header, but documented as 'AX24'. Fix the documentation.

Reported-by: Acked-by: Hans Verkuil hans.verk...@cisco.com
Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
index 32feac9..4209542 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
@@ -489,7 +489,7 @@ colorspace constantV4L2_COLORSPACE_SRGB/constant./para
  /row
  row id=V4L2-PIX-FMT-ARGB32
entryconstantV4L2_PIX_FMT_ARGB32/constant/entry
-   entry'AX24'/entry
+   entry'BA24'/entry
entry/entry
entryasubscript7/subscript/entry
entryasubscript6/subscript/entry
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Clarify RGB666 pixel format definition

2014-07-21 Thread Hans Verkuil
On 07/22/2014 12:30 AM, Laurent Pinchart wrote:
 Hi Hans,
 
 On Monday 21 July 2014 23:43:16 Hans Verkuil wrote:
 On 07/21/2014 10:39 PM, Laurent Pinchart wrote:
 The RGB666 pixel format doesn't include an alpha channel. Document it as
 such.

 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---

  .../DocBook/media/v4l/pixfmt-packed-rgb.xml  | 20 +--
 1 file changed, 6 insertions(+), 14 deletions(-)

 diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index
 32feac9..c47692a 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 @@ -330,20 +330,12 @@ colorspace
 constantV4L2_COLORSPACE_SRGB/constant./para 
 entry/entry
 entryrsubscript1/subscript/entry
 entryrsubscript0/subscript/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 -   entry/entry
 +   entry-/entry
 +   entry-/entry
 +   entry-/entry
 +   entry-/entry
 +   entry-/entry
 +   entry-/entry

 Just to clarify: BGR666 is a three byte format, not a four byte format?
 
 Well... :-)
 
 Three drivers seem to support the BGR666 in mainline : sh_veu, s3c-camif and 
 exynos4-is. Further investigation shows that the sh_veu driver lists the 
 BGR666 format internally but doesn't expose it to userspace and doesn't 
 actually support it, so we're down to two drivers.
 
 Looking at the S3C6410 datasheet, it's unclear how the hardware stores RGB666 
 pixels in memory. It could be either
 
 Byte 0   Byte 1   Byte 2   Byte 3
 
  --RR  GGBB
 
 or
 
 GGBB  --RR 
 
 None of those correspond to the RGB666 format defined in the spec.
 
 The Exynos4 FIMC isn't documented in the public datasheet, so I can't check 
 how the format is defined.
 
 Furthermore, various Renesas video-related IP cores support many different 
 RGB666 variants, on either 32 or 24 bits per pixel, with and without alpha.
 
 Beside a loud *sigh*, any comment ? :-)

You'll have to check with Samsung then. Sylwester, can you shed any light on
what this format *really* is?

Regards,

Hans

 
   /row
   row id=V4L2-PIX-FMT-BGR24
 entryconstantV4L2_PIX_FMT_BGR24/constant/entry
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Fix ARGB32 fourcc value in the documentation

2014-07-21 Thread Hans Verkuil
On 07/22/2014 12:41 AM, Laurent Pinchart wrote:
 The ARGB32 pixel format's fourcc value is defined to 'BA24' in the
 videodev2.h header, but documented as 'AX24'. Fix the documentation.
 
 Reported-by: Acked-by: Hans Verkuil hans.verk...@cisco.com

Reported-by or Acked-by? :-)

Anyway:

Acked-by: Hans Verkuil hans.verk...@cisco.com

 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---
  Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml 
 b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 index 32feac9..4209542 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 @@ -489,7 +489,7 @@ colorspace 
 constantV4L2_COLORSPACE_SRGB/constant./para
 /row
 row id=V4L2-PIX-FMT-ARGB32
   entryconstantV4L2_PIX_FMT_ARGB32/constant/entry
 - entry'AX24'/entry
 + entry'BA24'/entry
   entry/entry
   entryasubscript7/subscript/entry
   entryasubscript6/subscript/entry
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Fix ARGB32 fourcc value in the documentation

2014-07-21 Thread Laurent Pinchart
On Tuesday 22 July 2014 00:45:05 Hans Verkuil wrote:
 On 07/22/2014 12:41 AM, Laurent Pinchart wrote:
  The ARGB32 pixel format's fourcc value is defined to 'BA24' in the
  videodev2.h header, but documented as 'AX24'. Fix the documentation.
  
  Reported-by: Acked-by: Hans Verkuil hans.verk...@cisco.com
 
 Reported-by or Acked-by? :-)
 
 Anyway:
 
 Acked-by: Hans Verkuil hans.verk...@cisco.com

See ? git was predicting the future :-)

Linus is getting grumpy about the amount of 3.16-rc fixes. I'm thus 
considering delaying this patch to 3.17. Any objection ?

  Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
  ---
  
   Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index
  32feac9..4209542 100644
  --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
  @@ -489,7 +489,7 @@ colorspace
  constantV4L2_COLORSPACE_SRGB/constant./para 
/row
row id=V4L2-PIX-FMT-ARGB32
  entryconstantV4L2_PIX_FMT_ARGB32/constant/entry
  -   entry'AX24'/entry
  +   entry'BA24'/entry
  entry/entry
  entryasubscript7/subscript/entry
  entryasubscript6/subscript/entry

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l: Fix ARGB32 fourcc value in the documentation

2014-07-21 Thread Hans Verkuil
On 07/22/2014 12:46 AM, Laurent Pinchart wrote:
 On Tuesday 22 July 2014 00:45:05 Hans Verkuil wrote:
 On 07/22/2014 12:41 AM, Laurent Pinchart wrote:
 The ARGB32 pixel format's fourcc value is defined to 'BA24' in the
 videodev2.h header, but documented as 'AX24'. Fix the documentation.

 Reported-by: Acked-by: Hans Verkuil hans.verk...@cisco.com

 Reported-by or Acked-by? :-)

 Anyway:

 Acked-by: Hans Verkuil hans.verk...@cisco.com
 
 See ? git was predicting the future :-)
 
 Linus is getting grumpy about the amount of 3.16-rc fixes. I'm thus 
 considering delaying this patch to 3.17. Any objection ?

No objection, the actual code is OK after all.

Hans

 
 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---

  Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index
 32feac9..4209542 100644
 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
 @@ -489,7 +489,7 @@ colorspace
 constantV4L2_COLORSPACE_SRGB/constant./para 
   /row
   row id=V4L2-PIX-FMT-ARGB32
 entryconstantV4L2_PIX_FMT_ARGB32/constant/entry
 -   entry'AX24'/entry
 +   entry'BA24'/entry
 entry/entry
 entryasubscript7/subscript/entry
 entryasubscript6/subscript/entry
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] SDR stuff

2014-07-21 Thread Mauro Carvalho Chehab
Em Fri, 18 Jul 2014 04:14:32 +0300
Antti Palosaari cr...@iki.fi escreveu:

 * AirSpy SDR driver
 * all SDR drivers moved out of staging
 * few new SDR stream formats
 
 regards
 Antti
 
 
 The following changes since commit 3445857b22eafb70a6ac258979e955b116bfd2c6:
 
[media] hdpvr: fix two audio bugs (2014-07-04 15:13:02 -0300)
 
 are available in the git repository at:
 
git://linuxtv.org/anttip/media_tree.git sdr_pull
 
 for you to fetch changes up to 1c3378e1c17d6acd9b6d392ff75addad4c63cc6c:
 
MAINTAINERS: add airspy driver (2014-07-18 04:12:27 +0300)
 
 
 Antti Palosaari (23):
v4l: uapi: add SDR format RU12LE
DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'
airspy: AirSpy SDR driver
v4l: uapi: add SDR format CS8
DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'
v4l: uapi: add SDR format CS14
DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'
msi001: move out of staging
MAINTAINERS: update MSI001 driver location
Kconfig: add SDR support
Kconfig: sub-driver auto-select SPI bus
msi2500: move msi3101 out of staging and rename

There are several issues pointed by checkpath on this driver:

WARNING: line over 80 characters
#55: FILE: drivers/media/usb/msi2500/msi2500.c:55:
+#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */

WARNING: line over 80 characters
#56: FILE: drivers/media/usb/msi2500/msi2500.c:56:
+#define V4L2_PIX_FMT_SDR_S12v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */

WARNING: line over 80 characters
#57: FILE: drivers/media/usb/msi2500/msi2500.c:57:
+#define V4L2_PIX_FMT_SDR_S14v4l2_fourcc('D', 'S', '1', '4') /* signed 
14-bit */

WARNING: line over 80 characters
#58: FILE: drivers/media/usb/msi2500/msi2500.c:58:
+#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */

The above are OK, however those formats should be moved to videodev2.h,
where those API bits belong.

There are several warnings, not all are mandatory for moving it out of
staging. I'll point the critical ones below:

WARNING: Missing a blank line after declarations
#135: FILE: drivers/media/usb/msi2500/msi2500.c:135:
+   struct urb *urbs[MAX_ISO_BUFS];
+   int (*convert_stream)(struct msi3101_state *s, u8 *dst, u8 *src,

WARNING: line over 80 characters
#188: FILE: drivers/media/usb/msi2500/msi2500.c:188:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
src[0]  0;

WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
time_before and friends
#211: FILE: drivers/media/usb/msi2500/msi2500.c:211:
+   if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {

This one is a real bug, as jiffies may reset to zero. you should, instead,
use the time macros, like time_is_before_jiffies() and
time_is_after_jiffies().

WARNING: line over 80 characters
#213: FILE: drivers/media/usb/msi2500/msi2500.c:213:
+   unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);

This also seems wrong for the same reasons.

WARNING: Missing a blank line after declarations
#215: FILE: drivers/media/usb/msi2500/msi2500.c:215:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = jiffies_now;

WARNING: line over 80 characters
#242: FILE: drivers/media/usb/msi2500/msi2500.c:242:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
src[0]  0;

WARNING: Missing a blank line after declarations
#272: FILE: drivers/media/usb/msi2500/msi2500.c:272:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = jiffies + msecs_to_jiffies(MSECS);

WARNING: line over 80 characters
#339: FILE: drivers/media/usb/msi2500/msi2500.c:339:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
src[0]  0;

WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
time_before and friends
#363: FILE: drivers/media/usb/msi2500/msi2500.c:363:
+   if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {

Same here.

WARNING: line over 80 characters
#365: FILE: drivers/media/usb/msi2500/msi2500.c:365:
+   unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);

Same here.

WARNING: Missing a blank line after declarations
#367: FILE: drivers/media/usb/msi2500/msi2500.c:367:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = jiffies_now;

WARNING: line over 80 characters
#405: FILE: drivers/media/usb/msi2500/msi2500.c:405:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
src[0]  0;

WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
time_before and friends
#428: FILE: drivers/media/usb/msi2500/msi2500.c:428:
+   if ((s-jiffies_next + 

Re: [GIT PULL] SDR stuff

2014-07-21 Thread Mauro Carvalho Chehab
Em Mon, 21 Jul 2014 20:50:05 -0300
Mauro Carvalho Chehab m.che...@samsung.com escreveu:

 Em Fri, 18 Jul 2014 04:14:32 +0300
 Antti Palosaari cr...@iki.fi escreveu:
 
  * AirSpy SDR driver
  * all SDR drivers moved out of staging
  * few new SDR stream formats
  
  regards
  Antti
  
  
  The following changes since commit 3445857b22eafb70a6ac258979e955b116bfd2c6:
  
 [media] hdpvr: fix two audio bugs (2014-07-04 15:13:02 -0300)
  
  are available in the git repository at:
  
 git://linuxtv.org/anttip/media_tree.git sdr_pull
  
  for you to fetch changes up to 1c3378e1c17d6acd9b6d392ff75addad4c63cc6c:
  
 MAINTAINERS: add airspy driver (2014-07-18 04:12:27 +0300)
  
  
  Antti Palosaari (23):
 v4l: uapi: add SDR format RU12LE
 DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'
 airspy: AirSpy SDR driver
 v4l: uapi: add SDR format CS8
 DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'
 v4l: uapi: add SDR format CS14
 DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'
 msi001: move out of staging
 MAINTAINERS: update MSI001 driver location
 Kconfig: add SDR support
 Kconfig: sub-driver auto-select SPI bus
 msi2500: move msi3101 out of staging and rename
 
 There are several issues pointed by checkpath on this driver:
 
 WARNING: line over 80 characters
 #55: FILE: drivers/media/usb/msi2500/msi2500.c:55:
 +#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
 8-bit */
 
 WARNING: line over 80 characters
 #56: FILE: drivers/media/usb/msi2500/msi2500.c:56:
 +#define V4L2_PIX_FMT_SDR_S12v4l2_fourcc('D', 'S', '1', '2') /* signed 
 12-bit */
 
 WARNING: line over 80 characters
 #57: FILE: drivers/media/usb/msi2500/msi2500.c:57:
 +#define V4L2_PIX_FMT_SDR_S14v4l2_fourcc('D', 'S', '1', '4') /* signed 
 14-bit */
 
 WARNING: line over 80 characters
 #58: FILE: drivers/media/usb/msi2500/msi2500.c:58:
 +#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* 
 Mirics MSi2500 format 384 */
 
 The above are OK, however those formats should be moved to videodev2.h,
 where those API bits belong.
 
 There are several warnings, not all are mandatory for moving it out of
 staging. I'll point the critical ones below:
 
 WARNING: Missing a blank line after declarations
 #135: FILE: drivers/media/usb/msi2500/msi2500.c:135:
 + struct urb *urbs[MAX_ISO_BUFS];
 + int (*convert_stream)(struct msi3101_state *s, u8 *dst, u8 *src,
 
 WARNING: line over 80 characters
 #188: FILE: drivers/media/usb/msi2500/msi2500.c:188:
 + sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
 src[0]  0;
 
 WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
 time_before and friends
 #211: FILE: drivers/media/usb/msi2500/msi2500.c:211:
 + if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {
 
 This one is a real bug, as jiffies may reset to zero. you should, instead,
 use the time macros, like time_is_before_jiffies() and
 time_is_after_jiffies().
 
 WARNING: line over 80 characters
 #213: FILE: drivers/media/usb/msi2500/msi2500.c:213:
 + unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
 jiffies_to_msecs(s-jiffies_next);
 
 This also seems wrong for the same reasons.
 
 WARNING: Missing a blank line after declarations
 #215: FILE: drivers/media/usb/msi2500/msi2500.c:215:
 + unsigned int samples = sample_num[i_max - 1] - s-sample;
 + s-jiffies_next = jiffies_now;
 
 WARNING: line over 80 characters
 #242: FILE: drivers/media/usb/msi2500/msi2500.c:242:
 + sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
 src[0]  0;
 
 WARNING: Missing a blank line after declarations
 #272: FILE: drivers/media/usb/msi2500/msi2500.c:272:
 + unsigned int samples = sample_num[i_max - 1] - s-sample;
 + s-jiffies_next = jiffies + msecs_to_jiffies(MSECS);
 
 WARNING: line over 80 characters
 #339: FILE: drivers/media/usb/msi2500/msi2500.c:339:
 + sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
 src[0]  0;
 
 WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
 time_before and friends
 #363: FILE: drivers/media/usb/msi2500/msi2500.c:363:
 + if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {
 
 Same here.
 
 WARNING: line over 80 characters
 #365: FILE: drivers/media/usb/msi2500/msi2500.c:365:
 + unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
 jiffies_to_msecs(s-jiffies_next);
 
 Same here.
 
 WARNING: Missing a blank line after declarations
 #367: FILE: drivers/media/usb/msi2500/msi2500.c:367:
 + unsigned int samples = sample_num[i_max - 1] - s-sample;
 + s-jiffies_next = jiffies_now;
 
 WARNING: line over 80 characters
 #405: FILE: drivers/media/usb/msi2500/msi2500.c:405:
 + sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
 src[0]  0;

Re: [GIT PULL] SDR stuff

2014-07-21 Thread Antti Palosaari
So what. Those were mostly WARNING only and all but long lines were some 
new checks added to checkpatch recently. chekcpatch gets all the time 
new and new checks, these were added after I have made that driver. I 
will surely clean those later when I do some new changes to driver and 
my checkpatch updates.



regards
Antti



On 07/22/2014 02:50 AM, Mauro Carvalho Chehab wrote:

Em Fri, 18 Jul 2014 04:14:32 +0300
Antti Palosaari cr...@iki.fi escreveu:


* AirSpy SDR driver
* all SDR drivers moved out of staging
* few new SDR stream formats

regards
Antti


The following changes since commit 3445857b22eafb70a6ac258979e955b116bfd2c6:

[media] hdpvr: fix two audio bugs (2014-07-04 15:13:02 -0300)

are available in the git repository at:

git://linuxtv.org/anttip/media_tree.git sdr_pull

for you to fetch changes up to 1c3378e1c17d6acd9b6d392ff75addad4c63cc6c:

MAINTAINERS: add airspy driver (2014-07-18 04:12:27 +0300)


Antti Palosaari (23):
v4l: uapi: add SDR format RU12LE
DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'
airspy: AirSpy SDR driver
v4l: uapi: add SDR format CS8
DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'
v4l: uapi: add SDR format CS14
DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'
msi001: move out of staging
MAINTAINERS: update MSI001 driver location
Kconfig: add SDR support
Kconfig: sub-driver auto-select SPI bus
msi2500: move msi3101 out of staging and rename


There are several issues pointed by checkpath on this driver:

WARNING: line over 80 characters
#55: FILE: drivers/media/usb/msi2500/msi2500.c:55:
+#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */

WARNING: line over 80 characters
#56: FILE: drivers/media/usb/msi2500/msi2500.c:56:
+#define V4L2_PIX_FMT_SDR_S12v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */

WARNING: line over 80 characters
#57: FILE: drivers/media/usb/msi2500/msi2500.c:57:
+#define V4L2_PIX_FMT_SDR_S14v4l2_fourcc('D', 'S', '1', '4') /* signed 
14-bit */

WARNING: line over 80 characters
#58: FILE: drivers/media/usb/msi2500/msi2500.c:58:
+#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */

The above are OK, however those formats should be moved to videodev2.h,
where those API bits belong.

There are several warnings, not all are mandatory for moving it out of
staging. I'll point the critical ones below:

WARNING: Missing a blank line after declarations
#135: FILE: drivers/media/usb/msi2500/msi2500.c:135:
+   struct urb *urbs[MAX_ISO_BUFS];
+   int (*convert_stream)(struct msi3101_state *s, u8 *dst, u8 *src,

WARNING: line over 80 characters
#188: FILE: drivers/media/usb/msi2500/msi2500.c:188:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | src[0] 
 0;

WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
time_before and friends
#211: FILE: drivers/media/usb/msi2500/msi2500.c:211:
+   if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {

This one is a real bug, as jiffies may reset to zero. you should, instead,
use the time macros, like time_is_before_jiffies() and
time_is_after_jiffies().

WARNING: line over 80 characters
#213: FILE: drivers/media/usb/msi2500/msi2500.c:213:
+   unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);

This also seems wrong for the same reasons.

WARNING: Missing a blank line after declarations
#215: FILE: drivers/media/usb/msi2500/msi2500.c:215:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = jiffies_now;

WARNING: line over 80 characters
#242: FILE: drivers/media/usb/msi2500/msi2500.c:242:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | src[0] 
 0;

WARNING: Missing a blank line after declarations
#272: FILE: drivers/media/usb/msi2500/msi2500.c:272:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = jiffies + msecs_to_jiffies(MSECS);

WARNING: line over 80 characters
#339: FILE: drivers/media/usb/msi2500/msi2500.c:339:
+   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | src[0] 
 0;

WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
time_before and friends
#363: FILE: drivers/media/usb/msi2500/msi2500.c:363:
+   if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {

Same here.

WARNING: line over 80 characters
#365: FILE: drivers/media/usb/msi2500/msi2500.c:365:
+   unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);

Same here.

WARNING: Missing a blank line after declarations
#367: FILE: drivers/media/usb/msi2500/msi2500.c:367:
+   unsigned int samples = sample_num[i_max - 1] - s-sample;
+   s-jiffies_next = 

Re: [GIT PULL] SDR stuff

2014-07-21 Thread Antti Palosaari

On 07/22/2014 03:05 AM, Mauro Carvalho Chehab wrote:


total: 1 errors, 45 warnings, 1517 lines checked

drivers/media/usb/msi2500/msi2500.c has style problems, please review.


FYI, I applied the rest of this patch series, except for those patches:
msi2500: move msi3101 out of staging and rename
MAINTAINERS: update MSI3101 / MSI2500 driver location
msi2500: change supported formats
msi2500: print notice to point SDR API is not 100% stable yet

Because the latter ones depend on the first patch.


Hey, just apply these too. As I explained, those are coming from new 
checkpatch checks added recently, after I have made that MSi3101/MSi2500 
driver. We should not start begin run new checkpatch tests for old 
drivers. One reason I really want these out from staging is checkpatch 
terrorism newbies are doing in staging. There is all kind of people 
doing some eucalyptys challenge, running very latest checkpatch and 
sending useless patches for these driver, just wasting only my time.


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] SDR stuff

2014-07-21 Thread Mauro Carvalho Chehab
Em Tue, 22 Jul 2014 03:08:19 +0300
Antti Palosaari cr...@iki.fi escreveu:

 So what. Those were mostly WARNING only and all but long lines were some 
 new checks added to checkpatch recently. chekcpatch gets all the time 
 new and new checks, these were added after I have made that driver. I 
 will surely clean those later when I do some new changes to driver and 
 my checkpatch updates.

Antti,

I think you didn't read my comments in the middle of the checkpatch stuff.
Please read my email again. I'm not requiring you to fix the newer checkpatch
warning (Missing a blank line after declarations), and not even about the
80-cols warning. The thing is that there are two issues there:

1) you're adding API bits at msi2500 driver, instead of moving them
   to videodev2.h (or reusing the fourcc types you already added there);

2) you're handling jiffies wrong inside the driver.

As you may know, adding a driver at staging is easier than at the main
tree, as we don't care much about checkpatch issues (and not even about
some more serious issues). However, when moving stuff out of staging,
we review the entire driver again, to be sure that it is ok.

Regards,
Mauro

 
 
 regards
 Antti
 
 
 
 On 07/22/2014 02:50 AM, Mauro Carvalho Chehab wrote:
  Em Fri, 18 Jul 2014 04:14:32 +0300
  Antti Palosaari cr...@iki.fi escreveu:
 
  * AirSpy SDR driver
  * all SDR drivers moved out of staging
  * few new SDR stream formats
 
  regards
  Antti
 
 
  The following changes since commit 
  3445857b22eafb70a6ac258979e955b116bfd2c6:
 
  [media] hdpvr: fix two audio bugs (2014-07-04 15:13:02 -0300)
 
  are available in the git repository at:
 
  git://linuxtv.org/anttip/media_tree.git sdr_pull
 
  for you to fetch changes up to 1c3378e1c17d6acd9b6d392ff75addad4c63cc6c:
 
  MAINTAINERS: add airspy driver (2014-07-18 04:12:27 +0300)
 
  
  Antti Palosaari (23):
  v4l: uapi: add SDR format RU12LE
  DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'
  airspy: AirSpy SDR driver
  v4l: uapi: add SDR format CS8
  DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'
  v4l: uapi: add SDR format CS14
  DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'
  msi001: move out of staging
  MAINTAINERS: update MSI001 driver location
  Kconfig: add SDR support
  Kconfig: sub-driver auto-select SPI bus
  msi2500: move msi3101 out of staging and rename
 
  There are several issues pointed by checkpath on this driver:
 
  WARNING: line over 80 characters
  #55: FILE: drivers/media/usb/msi2500/msi2500.c:55:
  +#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
  8-bit */
 
  WARNING: line over 80 characters
  #56: FILE: drivers/media/usb/msi2500/msi2500.c:56:
  +#define V4L2_PIX_FMT_SDR_S12v4l2_fourcc('D', 'S', '1', '2') /* signed 
  12-bit */
 
  WARNING: line over 80 characters
  #57: FILE: drivers/media/usb/msi2500/msi2500.c:57:
  +#define V4L2_PIX_FMT_SDR_S14v4l2_fourcc('D', 'S', '1', '4') /* signed 
  14-bit */
 
  WARNING: line over 80 characters
  #58: FILE: drivers/media/usb/msi2500/msi2500.c:58:
  +#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* 
  Mirics MSi2500 format 384 */
 
  The above are OK, however those formats should be moved to videodev2.h,
  where those API bits belong.
 
  There are several warnings, not all are mandatory for moving it out of
  staging. I'll point the critical ones below:
 
  WARNING: Missing a blank line after declarations
  #135: FILE: drivers/media/usb/msi2500/msi2500.c:135:
  +   struct urb *urbs[MAX_ISO_BUFS];
  +   int (*convert_stream)(struct msi3101_state *s, u8 *dst, u8 *src,
 
  WARNING: line over 80 characters
  #188: FILE: drivers/media/usb/msi2500/msi2500.c:188:
  +   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
  src[0]  0;
 
  WARNING: Comparing jiffies is almost always wrong; prefer time_after, 
  time_before and friends
  #211: FILE: drivers/media/usb/msi2500/msi2500.c:211:
  +   if ((s-jiffies_next + msecs_to_jiffies(1)) = jiffies) {
 
  This one is a real bug, as jiffies may reset to zero. you should, instead,
  use the time macros, like time_is_before_jiffies() and
  time_is_after_jiffies().
 
  WARNING: line over 80 characters
  #213: FILE: drivers/media/usb/msi2500/msi2500.c:213:
  +   unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
  jiffies_to_msecs(s-jiffies_next);
 
  This also seems wrong for the same reasons.
 
  WARNING: Missing a blank line after declarations
  #215: FILE: drivers/media/usb/msi2500/msi2500.c:215:
  +   unsigned int samples = sample_num[i_max - 1] - s-sample;
  +   s-jiffies_next = jiffies_now;
 
  WARNING: line over 80 characters
  #242: FILE: drivers/media/usb/msi2500/msi2500.c:242:
  +   sample_num[i] = src[3]  24 | src[2]  16 | src[1]  8 | 
  src[0]  0;
 
  WARNING: Missing a blank line after 

Re: [GIT PULL] SDR stuff

2014-07-21 Thread Antti Palosaari

On 07/22/2014 03:51 AM, Mauro Carvalho Chehab wrote:

Em Tue, 22 Jul 2014 03:08:19 +0300
Antti Palosaari cr...@iki.fi escreveu:


So what. Those were mostly WARNING only and all but long lines were some
new checks added to checkpatch recently. chekcpatch gets all the time
new and new checks, these were added after I have made that driver. I
will surely clean those later when I do some new changes to driver and
my checkpatch updates.


Antti,

I think you didn't read my comments in the middle of the checkpatch stuff.
Please read my email again. I'm not requiring you to fix the newer checkpatch
warning (Missing a blank line after declarations), and not even about the
80-cols warning. The thing is that there are two issues there:

1) you're adding API bits at msi2500 driver, instead of moving them
to videodev2.h (or reusing the fourcc types you already added there);


If you look inside driver code, you will see those defines are not used 
- but commented out. It is simply dead definition compiler optimizes 
away. It is code I used on my tests, but finally decided to comment out 
to leave some time add those later to API. I later moved 2 of those to 
API, that is done in same patch serie.


No issue here.


2) you're handling jiffies wrong inside the driver.

As you may know, adding a driver at staging is easier than at the main
tree, as we don't care much about checkpatch issues (and not even about
some more serious issues). However, when moving stuff out of staging,
we review the entire driver again, to be sure that it is ok.


That jiffie check is also rather new and didn't exists time drive was 
done. Jiffie is used to calculate debug sample rate. There is multiple 
times very similar code piece, which could be optimized to one. My plan 
merge all those ~5 functions to one and use jiffies using macros as 
checkpatch now likes. I don't see meaningful fix it now as you are going 
to rewrite that stuff in near future in any case.



Silencing all those checkpatch things is not very hard job though. If 
you merge that stuff to media/master I can do it right away (I am 
running older kernel and older checkpatch currently).



regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] SDR stuff

2014-07-21 Thread Mauro Carvalho Chehab
Em Tue, 22 Jul 2014 04:05:05 +0300
Antti Palosaari cr...@iki.fi escreveu:

 On 07/22/2014 03:51 AM, Mauro Carvalho Chehab wrote:
  Em Tue, 22 Jul 2014 03:08:19 +0300
  Antti Palosaari cr...@iki.fi escreveu:
 
  So what. Those were mostly WARNING only and all but long lines were some
  new checks added to checkpatch recently. chekcpatch gets all the time
  new and new checks, these were added after I have made that driver. I
  will surely clean those later when I do some new changes to driver and
  my checkpatch updates.
 
  Antti,
 
  I think you didn't read my comments in the middle of the checkpatch stuff.
  Please read my email again. I'm not requiring you to fix the newer 
  checkpatch
  warning (Missing a blank line after declarations), and not even about the
  80-cols warning. The thing is that there are two issues there:
 
  1) you're adding API bits at msi2500 driver, instead of moving them
  to videodev2.h (or reusing the fourcc types you already added there);
 
 If you look inside driver code, you will see those defines are not used 
 - but commented out. It is simply dead definition compiler optimizes 
 away. It is code I used on my tests, but finally decided to comment out 
 to leave some time add those later to API. I later moved 2 of those to 
 API, that is done in same patch serie.
 
 No issue here.
 
  2) you're handling jiffies wrong inside the driver.
 
  As you may know, adding a driver at staging is easier than at the main
  tree, as we don't care much about checkpatch issues (and not even about
  some more serious issues). However, when moving stuff out of staging,
  we review the entire driver again, to be sure that it is ok.
 
 That jiffie check is also rather new and didn't exists time drive was 
 done. Jiffie is used to calculate debug sample rate. There is multiple 
 times very similar code piece, which could be optimized to one. My plan 
 merge all those ~5 functions to one and use jiffies using macros as 
 checkpatch now likes. I don't see meaningful fix it now as you are going 
 to rewrite that stuff in near future in any case.

Ok, I'll apply the remaining patches.

 Silencing all those checkpatch things is not very hard job though. If 
 you merge that stuff to media/master I can do it right away (I am 
 running older kernel and older checkpatch currently).

FYI, I always use the checkpatch available on our tree, no matter what
Kernel I'm running. My scripts just call ./scripts/checkpatch.pl.

Regards,
Mauro

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Bug 80871 - WARNING: CPU: 0 PID: 1498 at fs/sysfs/group.c:219 sysfs_remove_group+0x98/0xa0()

2014-07-21 Thread João M. S. Silva

Hi,

Per request of Greg Kroah-Hartman, I'm sending this bug's reference:

  https://bugzilla.kernel.org/show_bug.cgi?id=80871#c1

Regards,
--
João M. S. Silva
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: ERRORS

2014-07-21 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Tue Jul 22 04:00:38 CEST 2014
git branch: test
git hash:   1b303e1a58599e42f858805285f03ccb5a4e18d2
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-16-g1db35d0
host hardware:  x86_64
host os:3.15-5.slh.2-amd64

linux-git-arm-at91: ERRORS
linux-git-arm-davinci: ERRORS
linux-git-arm-exynos: ERRORS
linux-git-arm-mx: ERRORS
linux-git-arm-omap: ERRORS
linux-git-arm-omap1: ERRORS
linux-git-arm-pxa: ERRORS
linux-git-blackfin: ERRORS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: ERRORS
linux-git-powerpc64: OK
linux-git-sh: ERRORS
linux-git-x86_64: OK
linux-2.6.31.14-i686: ERRORS
linux-2.6.32.27-i686: ERRORS
linux-2.6.33.7-i686: ERRORS
linux-2.6.34.7-i686: ERRORS
linux-2.6.35.9-i686: ERRORS
linux-2.6.36.4-i686: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-3.0.60-i686: ERRORS
linux-3.1.10-i686: ERRORS
linux-3.2.37-i686: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.4.27-i686: ERRORS
linux-3.5.7-i686: ERRORS
linux-3.6.11-i686: ERRORS
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16-rc1-i686: OK
linux-2.6.31.14-x86_64: ERRORS
linux-2.6.32.27-x86_64: ERRORS
linux-2.6.33.7-x86_64: ERRORS
linux-2.6.34.7-x86_64: ERRORS
linux-2.6.35.9-x86_64: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.60-x86_64: ERRORS
linux-3.1.10-x86_64: ERRORS
linux-3.2.37-x86_64: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-x86_64: ERRORS
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16-rc1-x86_64: OK
apps: OK
spec-git: OK
ABI WARNING: change for arm-at91
ABI WARNING: change for arm-davinci
ABI WARNING: change for arm-exynos
ABI WARNING: change for arm-mx
ABI WARNING: change for arm-omap
ABI WARNING: change for arm-omap1
ABI WARNING: change for arm-pxa
ABI WARNING: change for blackfin
ABI WARNING: change for i686
ABI WARNING: change for m32r
ABI WARNING: change for mips
ABI WARNING: change for powerpc64
ABI WARNING: change for sh
ABI WARNING: change for x86_64
sparse: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] SDR stuff

2014-07-21 Thread Antti Palosaari

On 07/22/2014 05:09 AM, Mauro Carvalho Chehab wrote:

Em Tue, 22 Jul 2014 04:05:05 +0300
Antti Palosaari cr...@iki.fi escreveu:


On 07/22/2014 03:51 AM, Mauro Carvalho Chehab wrote:

Em Tue, 22 Jul 2014 03:08:19 +0300
Antti Palosaari cr...@iki.fi escreveu:


So what. Those were mostly WARNING only and all but long lines were some
new checks added to checkpatch recently. chekcpatch gets all the time
new and new checks, these were added after I have made that driver. I
will surely clean those later when I do some new changes to driver and
my checkpatch updates.


Antti,

I think you didn't read my comments in the middle of the checkpatch stuff.
Please read my email again. I'm not requiring you to fix the newer checkpatch
warning (Missing a blank line after declarations), and not even about the
80-cols warning. The thing is that there are two issues there:

1) you're adding API bits at msi2500 driver, instead of moving them
 to videodev2.h (or reusing the fourcc types you already added there);


If you look inside driver code, you will see those defines are not used
- but commented out. It is simply dead definition compiler optimizes
away. It is code I used on my tests, but finally decided to comment out
to leave some time add those later to API. I later moved 2 of those to
API, that is done in same patch serie.

No issue here.


2) you're handling jiffies wrong inside the driver.

As you may know, adding a driver at staging is easier than at the main
tree, as we don't care much about checkpatch issues (and not even about
some more serious issues). However, when moving stuff out of staging,
we review the entire driver again, to be sure that it is ok.


That jiffie check is also rather new and didn't exists time drive was
done. Jiffie is used to calculate debug sample rate. There is multiple
times very similar code piece, which could be optimized to one. My plan
merge all those ~5 functions to one and use jiffies using macros as
checkpatch now likes. I don't see meaningful fix it now as you are going
to rewrite that stuff in near future in any case.


Ok, I'll apply the remaining patches.


Silencing all those checkpatch things is not very hard job though. If
you merge that stuff to media/master I can do it right away (I am
running older kernel and older checkpatch currently).


FYI, I always use the checkpatch available on our tree, no matter what
Kernel I'm running. My scripts just call ./scripts/checkpatch.pl.


I would like to also run/use *always* media/master, but it is not 
usually possible. Let me list here all the issues which makes it 
impossible in practice (issues which I see on current development process):


1) media/master is far behind Linus kernel master tree. It is usually 
updated only 2 times per RC cycle, RC1 and around RC5. Even I want test 
upstream RC, that makes it impossible.


2) RC1 is very often (more than 50%) unusable. It is simply too buggy. 
For example 3.16 there was GPU related problems at least (and again).


3) I send one fix (PULL requested) for brand new Silicon Labs Si2168 
driver on 2014-06-15. That was just before RC1 was released. It was 
merged to media/fixes, but not media/master. Unfortunately that driver 
gets very much interest and multiple other developers started hacking 
with it, adding support for new hw and so. There was huge headache to 
lead that development because code base was divided to 2 upstream git 
trees; one in media/fixes and another in media/development. Critical and 
problematic patch was still only in media/fixes, leaving media/master 
driver broken. So that forces me to use media/fixes as a base and add 
new patches top of it. Media/fixes is 3.15 whilst media/master is 3.16. 
I mentioned that already you and I have got bug reports too, latest one 
6 hours ago reporting his PCTV 292e stopped working...



So could it be possible to address those issues? Like media/master 
contains all latest upstream patches and is updated/rebased weekly top 
of Linus main tree?


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rtl2832_sdr: remove plain 64-bit divisions

2014-07-21 Thread Antti Palosaari
Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3
(v4l2-ctrls: increase internal min/max/step/def to 64 bit)
changes v4l2 controls to 64-bit. Driver it not working on 32-bit
arch as it uses directly control 'step' which is changed to 64-bit.

Reported-by: kbuild test robot fengguang...@intel.com
Cc: Hans Verkuil hans.verk...@cisco.com
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/rtl2832_sdr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c 
b/drivers/media/dvb-frontends/rtl2832_sdr.c
index f58bd74..023e0f4 100644
--- a/drivers/media/dvb-frontends/rtl2832_sdr.c
+++ b/drivers/media/dvb-frontends/rtl2832_sdr.c
@@ -1364,17 +1364,16 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl)
/* TODO: these controls should be moved to tuner drivers */
if (s-bandwidth_auto-val) {
/* Round towards the closest legal value */
-   s32 val = s-f_adc + s-bandwidth-step / 2;
+   s32 val = s-f_adc + div_u64(s-bandwidth-step, 2);
u32 offset;
 
val = clamp_t(s32, val, s-bandwidth-minimum,
  s-bandwidth-maximum);
offset = val - s-bandwidth-minimum;
offset = s-bandwidth-step *
-   (offset / s-bandwidth-step);
+   div_u64(offset, s-bandwidth-step);
s-bandwidth-val = s-bandwidth-minimum + offset;
}
-
c-bandwidth_hz = s-bandwidth-val;
 
if (!test_bit(POWER_ON, s-flags))
-- 
http://palosaari.fi/

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL FOR v3.17] Various fixes and moving solo6x10/go7007 to mainline

2014-07-21 Thread Mauro Carvalho Chehab
Em Mon, 21 Jul 2014 16:08:41 +0200
Hans Verkuil hverk...@xs4all.nl escreveu:

 Hi Mauro,
 
 Here is a set of various fixes: two important ones in v4l2-ioctl and one
 in vb2. Also some DocBook fixes, a few VBI defines added and documented,
 a davinci bugfix (reported by the new gcc-4.9 compiler I'm now using for the
 daily build) and last but not least the move of the solo6x10 and go7007 out
 of staging into the mainline.
 
 Regards,
 
   Hans
 
 The following changes since commit 0ca1ba2aac5f6b26672099b13040c5b40db93486:
 
   [media] zoran: remove duplicate ZR050_MO_COMP define (2014-07-17 20:07:57 
 -0300)
 
 are available in the git repository at:
 
   git://linuxtv.org/hverkuil/media_tree.git for-v3.17d
 
 for you to fetch changes up to f50a1bf86405d8377b245145d3e2d1ef5ced6e32:
 
   media: davinci: vpif: fix array out of bound warnings (2014-07-21 16:01:32 
 +0200)
 
 
 Hans Verkuil (12):
   vb2: fix bytesused == 0 handling
   DocBook media: fix incorrect note about packed RGB and colorspace
   go7007: update the README, fix checkpatch warnings
   go7007: move out of staging into drivers/media/usb.
   solo6x10: a few checkpatch fixes
   solo6x10: move out of staging into drivers/media/pci.
   videodev2.h: add defines for the VBI field start lines
   DocBook media: document new VBI defines
   v4l2-ctrls: fix corner case in round-to-range code
   DocBook media typo
   v4l2-ioctl: set V4L2_CAP_EXT_PIX_FORMAT for device_caps
   v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()
 
 Prabhakar Lad (1):
   media: davinci: vpif: fix array out of bound warnings
 
  Documentation/DocBook/media/v4l/dev-raw-vbi.xml   | 12 
 ++---
  Documentation/DocBook/media/v4l/dev-sliced-vbi.xml|  9 
 ++-
  Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml |  3 ---
  Documentation/DocBook/media/v4l/vidioc-queryctrl.xml  |  2 +-
  drivers/media/pci/Kconfig |  1 +
  drivers/media/pci/Makefile|  1 +
  drivers/{staging/media = media/pci}/solo6x10/Kconfig |  2 +-
  drivers/{staging/media = media/pci}/solo6x10/Makefile|  2 +-
  drivers/{staging/media = media/pci}/solo6x10/TODO|  0

This should be removed, after everything there is done.

  drivers/{staging/media = media/pci}/solo6x10/solo6x10-core.c |  6 +
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-disp.c |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-eeprom.c   |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-enc.c  |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-g723.c |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-gpio.c |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-i2c.c  |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-jpeg.h |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-offsets.h  |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-p2m.c  |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-regs.h |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.c |  5 +---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.h |  4 ---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2-enc.c |  7 +++---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2.c |  8 +++---
  drivers/{staging/media = media/pci}/solo6x10/solo6x10.h  |  4 ---
  drivers/media/platform/davinci/vpif_capture.c |  2 +-
  drivers/media/platform/davinci/vpif_display.c |  2 +-
  drivers/media/usb/Kconfig |  1 +
  drivers/media/usb/Makefile|  1 +
  drivers/{staging/media = media/usb}/go7007/Kconfig   |  0
  drivers/{staging/media = media/usb}/go7007/Makefile  |  0
  drivers/{staging/media = media/usb}/go7007/README|  1 -

It seems you forgot this there too.

  drivers/{staging/media = media/usb}/go7007/go7007-driver.c   |  6 +
  drivers/{staging/media = media/usb}/go7007/go7007-fw.c   |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007-i2c.c  |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007-loader.c   |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007-priv.h |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007-usb.c  |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007-v4l2.c |  4 ---
  drivers/{staging/media = media/usb}/go7007/go7007.txt|  0
  drivers/{staging/media = media/usb}/go7007/s2250-board.c |  9 
 +++
  drivers/{staging/media = media/usb}/go7007/saa7134-go7007.c

[GIT PULL FOR v3.17] Move go7007 and solo6x10 out of staging

2014-07-21 Thread Hans Verkuil
Rebased and dropped the offending files as requested.

I plan on making the saa7134-go7007 patch work (which was why I kept it in
the mainline driver), but I'll just add it back later. That's probably
going to be for 3.18 anyway.

Regards,

Hans


The following changes since commit 9aabd95a2d531308ad997d2b92f46a3635782e0c:

  [media] media:platform: OMAP3 camera support needs VIDEOBUF2_DMA_CONTIG 
(2014-07-22 01:04:10 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v3.17e

for you to fetch changes up to 6265838d9fab40743a02f6d120b18af88473fb29:

  go7007: move out of staging into drivers/media/usb. (2014-07-22 06:23:01 
+0200)


Hans Verkuil (2):
  solo6x10: move out of staging into drivers/media/pci.
  go7007: move out of staging into drivers/media/usb.

 drivers/media/pci/Kconfig |   1 +
 drivers/media/pci/Makefile|   1 +
 drivers/{staging/media = media/pci}/solo6x10/Kconfig |   2 +-
 drivers/{staging/media = media/pci}/solo6x10/Makefile|   2 +-
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-core.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-disp.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-eeprom.c   |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-enc.c  |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-g723.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-gpio.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-i2c.c  |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-jpeg.h |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-offsets.h  |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-p2m.c  |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-regs.h |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.h |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2-enc.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10-v4l2.c |   0
 drivers/{staging/media = media/pci}/solo6x10/solo6x10.h  |   0
 drivers/media/usb/Kconfig |   1 +
 drivers/media/usb/Makefile|   1 +
 drivers/{staging/media = media/usb}/go7007/Kconfig   |   0
 drivers/{staging/media = media/usb}/go7007/Makefile  |   4 -
 drivers/{staging/media = media/usb}/go7007/go7007-driver.c   |   0
 drivers/{staging/media = media/usb}/go7007/go7007-fw.c   |   0
 drivers/{staging/media = media/usb}/go7007/go7007-i2c.c  |   0
 drivers/{staging/media = media/usb}/go7007/go7007-loader.c   |   0
 drivers/{staging/media = media/usb}/go7007/go7007-priv.h |   0
 drivers/{staging/media = media/usb}/go7007/go7007-usb.c  |   0
 drivers/{staging/media = media/usb}/go7007/go7007-v4l2.c |   0
 drivers/{staging/media = media/usb}/go7007/s2250-board.c |   0
 drivers/{staging/media = media/usb}/go7007/snd-go7007.c  |   0
 drivers/staging/media/Kconfig |   4 -
 drivers/staging/media/Makefile|   2 -
 drivers/staging/media/go7007/README   | 136 
--
 drivers/staging/media/go7007/go7007.txt   | 478 
-
 drivers/staging/media/go7007/saa7134-go7007.c | 560 
--
 drivers/staging/media/solo6x10/TODO   |  15 --
 39 files changed, 6 insertions(+), 1201 deletions(-)
 rename drivers/{staging/media = media/pci}/solo6x10/Kconfig (96%)
 rename drivers/{staging/media = media/pci}/solo6x10/Makefile (82%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-core.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-disp.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-eeprom.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-enc.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-g723.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-gpio.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-i2c.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-jpeg.h (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-offsets.h (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-p2m.c (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-regs.h (100%)
 rename drivers/{staging/media = media/pci}/solo6x10/solo6x10-tw28.c (100%)
 rename drivers/{staging/media = 

Re: [GIT PULL] SDR stuff

2014-07-21 Thread Mauro Carvalho Chehab
Em Tue, 22 Jul 2014 05:48:26 +0300
Antti Palosaari cr...@iki.fi escreveu:

 On 07/22/2014 05:09 AM, Mauro Carvalho Chehab wrote:
  Em Tue, 22 Jul 2014 04:05:05 +0300
  Antti Palosaari cr...@iki.fi escreveu:
 
  On 07/22/2014 03:51 AM, Mauro Carvalho Chehab wrote:
  Em Tue, 22 Jul 2014 03:08:19 +0300
  Antti Palosaari cr...@iki.fi escreveu:
 
  So what. Those were mostly WARNING only and all but long lines were some
  new checks added to checkpatch recently. chekcpatch gets all the time
  new and new checks, these were added after I have made that driver. I
  will surely clean those later when I do some new changes to driver and
  my checkpatch updates.
 
  Antti,
 
  I think you didn't read my comments in the middle of the checkpatch stuff.
  Please read my email again. I'm not requiring you to fix the newer 
  checkpatch
  warning (Missing a blank line after declarations), and not even about the
  80-cols warning. The thing is that there are two issues there:
 
  1) you're adding API bits at msi2500 driver, instead of moving them
   to videodev2.h (or reusing the fourcc types you already added there);
 
  If you look inside driver code, you will see those defines are not used
  - but commented out. It is simply dead definition compiler optimizes
  away. It is code I used on my tests, but finally decided to comment out
  to leave some time add those later to API. I later moved 2 of those to
  API, that is done in same patch serie.
 
  No issue here.
 
  2) you're handling jiffies wrong inside the driver.
 
  As you may know, adding a driver at staging is easier than at the main
  tree, as we don't care much about checkpatch issues (and not even about
  some more serious issues). However, when moving stuff out of staging,
  we review the entire driver again, to be sure that it is ok.
 
  That jiffie check is also rather new and didn't exists time drive was
  done. Jiffie is used to calculate debug sample rate. There is multiple
  times very similar code piece, which could be optimized to one. My plan
  merge all those ~5 functions to one and use jiffies using macros as
  checkpatch now likes. I don't see meaningful fix it now as you are going
  to rewrite that stuff in near future in any case.
 
  Ok, I'll apply the remaining patches.
 
  Silencing all those checkpatch things is not very hard job though. If
  you merge that stuff to media/master I can do it right away (I am
  running older kernel and older checkpatch currently).
 
  FYI, I always use the checkpatch available on our tree, no matter what
  Kernel I'm running. My scripts just call ./scripts/checkpatch.pl.
 
 I would like to also run/use *always* media/master, but it is not 
 usually possible. Let me list here all the issues which makes it 
 impossible in practice (issues which I see on current development process):
 
 1) media/master is far behind Linus kernel master tree. It is usually 
 updated only 2 times per RC cycle, RC1 and around RC5. Even I want test 
 upstream RC, that makes it impossible.

Hmm... you complained before that I was using a too new version of
checkpatch... Now you're complaining about just the opposite...

Anyway, nothing prevents you to pull from both Linus and my tree
at least for your testing purposes.

 
 2) RC1 is very often (more than 50%) unusable. It is simply too buggy. 
 For example 3.16 there was GPU related problems at least (and again).
 
 3) I send one fix (PULL requested) for brand new Silicon Labs Si2168 
 driver on 2014-06-15. That was just before RC1 was released. It was 
 merged to media/fixes, but not media/master. Unfortunately that driver 
 gets very much interest and multiple other developers started hacking 
 with it, adding support for new hw and so. There was huge headache to 
 lead that development because code base was divided to 2 upstream git 
 trees; one in media/fixes and another in media/development. Critical and 
 problematic patch was still only in media/fixes, leaving media/master 
 driver broken. So that forces me to use media/fixes as a base and add 
 new patches top of it. Media/fixes is 3.15 whilst media/master is 3.16. 
 I mentioned that already you and I have got bug reports too, latest one 
 6 hours ago reporting his PCTV 292e stopped working...
 
 
 So could it be possible to address those issues? Like media/master 
 contains all latest upstream patches and is updated/rebased weekly top 
 of Linus main tree?

If you take a look at other big subsystems (x86 tip, arm, network, ...)
most of them are even more fragmented: they use topic branches, e. g.
each conceptual patchset goes to its own branch.

One big advantage of topic branches is that maintainers can send
pull requests from each topic directly to Linus, avoiding the risk
that one broken topic would harm the entire patch merging.

I use topic branch on some cases, but v4l2 core changes too often
to allow doing it on a broader scale.

My main concern, as maintainer, is to be sure that the patches will
flow fine during 

[PATCH] rtl2832_sdr: fix Kconfig dependencies

2014-07-21 Thread Antti Palosaari
MEDIA_SDR_SUPPORT and I2C_MUX are needed for rtl2832_sdr.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/Kconfig  | 2 +-
 drivers/media/usb/dvb-usb-v2/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/Kconfig 
b/drivers/media/dvb-frontends/Kconfig
index 7225f05..78a95a6 100644
--- a/drivers/media/dvb-frontends/Kconfig
+++ b/drivers/media/dvb-frontends/Kconfig
@@ -448,7 +448,7 @@ config DVB_RTL2832
 
 config DVB_RTL2832_SDR
tristate Realtek RTL2832 SDR
-   depends on DVB_CORE  I2C  VIDEO_V4L2
+   depends on DVB_CORE  I2C  I2C_MUX  VIDEO_V4L2  MEDIA_SDR_SUPPORT
select DVB_RTL2832
select VIDEOBUF2_VMALLOC
default m if !MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/usb/dvb-usb-v2/Kconfig 
b/drivers/media/usb/dvb-usb-v2/Kconfig
index 0ea144e..66645b0 100644
--- a/drivers/media/usb/dvb-usb-v2/Kconfig
+++ b/drivers/media/usb/dvb-usb-v2/Kconfig
@@ -129,7 +129,7 @@ config DVB_USB_RTL28XXU
depends on DVB_USB_V2  I2C_MUX
select DVB_RTL2830
select DVB_RTL2832
-   select DVB_RTL2832_SDR if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_RTL2832_SDR if (MEDIA_SUBDRV_AUTOSELECT  MEDIA_SDR_SUPPORT)
select MEDIA_TUNER_QT1010 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_MT2060 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_MXL5005S if MEDIA_SUBDRV_AUTOSELECT
-- 
http://palosaari.fi/

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] exynos-gsc: Remove PM_RUNTIME dependency

2014-07-21 Thread Sachin Kamat
Hi Shaik,

On Mon, Jul 21, 2014 at 10:24 AM, Shaik Ameer Basha
shaik.am...@samsung.com wrote:
 1] Currently Gscaler clock is enabled only inside pm_runtime callbacks.
If PM_RUNTIME is disabled, driver hangs. This patch removes the
PM_RUNTIME dependency by keeping the clock enable/disable functions
in m2m start/stop streaming callbacks.

 2] For Exynos5420/5800, Gscaler clock has to be Turned ON before powering
on/off the Gscaler power domain. This dependency is taken care by
this patch at driver level.

 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 ---
  drivers/media/platform/exynos-gsc/gsc-core.c |   10 ++
  drivers/media/platform/exynos-gsc/gsc-m2m.c  |   13 +
  2 files changed, 15 insertions(+), 8 deletions(-)

 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
 b/drivers/media/platform/exynos-gsc/gsc-core.c
 index 9d0cc04..39c0953 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
 @@ -1132,23 +1132,17 @@ static int gsc_probe(struct platform_device *pdev)

 platform_set_drvdata(pdev, gsc);
 pm_runtime_enable(dev);
 -   ret = pm_runtime_get_sync(pdev-dev);
 -   if (ret  0)
 -   goto err_m2m;

 /* Initialize continious memory allocator */
 gsc-alloc_ctx = vb2_dma_contig_init_ctx(dev);
 if (IS_ERR(gsc-alloc_ctx)) {
 ret = PTR_ERR(gsc-alloc_ctx);
 -   goto err_pm;
 +   goto err_m2m;
 }

 dev_dbg(dev, gsc-%d registered successfully\n, gsc-id);
 -
 -   pm_runtime_put(dev);
 return 0;
 -err_pm:
 -   pm_runtime_put(dev);
 +
  err_m2m:
 gsc_unregister_m2m_device(gsc);
  err_v4l2:
 diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c 
 b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 index e434f1f0..a98462c 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 @@ -60,19 +60,32 @@ static void __gsc_m2m_job_abort(struct gsc_ctx *ctx)
  static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
  {
 struct gsc_ctx *ctx = q-drv_priv;
 +   struct gsc_dev *gsc = ctx-gsc_dev;
 int ret;

 +   ret = clk_enable(gsc-clock);
 +   if (ret)
 +   return ret;
 +
 ret = pm_runtime_get_sync(ctx-gsc_dev-pdev-dev);
 +
 +   if (!pm_runtime_enabled(gsc-pdev-dev)) {
 +   gsc_hw_set_sw_reset(gsc);
 +   gsc_wait_reset(gsc);
 +   }
 +
 return ret  0 ? 0 : ret;
  }

  static void gsc_m2m_stop_streaming(struct vb2_queue *q)
  {
 struct gsc_ctx *ctx = q-drv_priv;
 +   struct gsc_dev *gsc = ctx-gsc_dev;

 __gsc_m2m_job_abort(ctx);

 pm_runtime_put(ctx-gsc_dev-pdev-dev);
 +   clk_disable(gsc-clock);
  }

  void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state)
 --
 1.7.9.5


Looks like there is some issue while runtime PM is disabled. The
conversion operation hangs. Tested on 5420 based Arndale Octa
board with latest next kernel.

-- 
Regards,
Sachin.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Different Devices identical hardware

2014-07-21 Thread Matthias Schwarzott
Hi,

I want to add support for Hauppauge WinTV 930C-HD and PCTV QuatroStick 521e.
The namess and USB-IDs are different, but the hardware is the same.

Should there be in this case one card entry in cx231xx driver or two?
Two would have the advantage that the correct name of the device could
be displayed, but some code related to the card entry would be duplicated.

Regards
Matthias
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Different Devices identical hardware

2014-07-21 Thread Mauro Carvalho Chehab
Em Tue, 22 Jul 2014 07:33:27 +0200
Matthias Schwarzott z...@gentoo.org escreveu:

 Hi,
 
 I want to add support for Hauppauge WinTV 930C-HD and PCTV QuatroStick 521e.
 The namess and USB-IDs are different, but the hardware is the same.
 
 Should there be in this case one card entry in cx231xx driver or two?
 Two would have the advantage that the correct name of the device could
 be displayed, but some code related to the card entry would be duplicated.

One entry is enough. There are other similar cases on our tree. We
generally add both names at the string name, like:

[EM2820_BOARD_PINNACLE_DVC_90] = {
.name = Pinnacle Dazzle DVC 90/100/101/107 / Kaiser 
Baas Video to DVD maker 

[EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
.name = SIIG AVTuner-PVR / Pixelview Prolink PlayTV 
USB 2.0,

and others.

Regards,
Mauro

 
 Regards
 Matthias
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] msi2500: correct style issues

2014-07-21 Thread Antti Palosaari
Correct some style issues, mostly reported by checkpatch.pl.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/msi2500/msi2500.c | 70 +++--
 1 file changed, 51 insertions(+), 19 deletions(-)

diff --git a/drivers/media/usb/msi2500/msi2500.c 
b/drivers/media/usb/msi2500/msi2500.c
index 483dc6e..755f959 100644
--- a/drivers/media/usb/msi2500/msi2500.c
+++ b/drivers/media/usb/msi2500/msi2500.c
@@ -55,9 +55,14 @@ MODULE_PARM_DESC(emulated_formats, enable emulated formats 
(disappears in futur
 #define ISO_BUFFER_SIZE (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
 #define MAX_ISOC_ERRORS 20
 
-/* TODO: These should be moved to V4L2 API */
-#define V4L2_PIX_FMT_SDR_S12v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
-#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
+/*
+ * TODO: These formats should be moved to V4L2 API. Formats are currently
+ * disabled from formats[] table, not visible to userspace.
+ */
+ /* signed 12-bit */
+#define MSI2500_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2')
+/* Mirics MSi2500 format 384 */
+#define MSI2500_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4')
 
 static const struct v4l2_frequency_band bands[] = {
{
@@ -86,10 +91,10 @@ static struct msi3101_format formats[] = {
 #if 0
}, {
.name   = 10+2-bit signed,
-   .pixelformat= V4L2_PIX_FMT_SDR_MSI2500_384,
+   .pixelformat= MSI2500_PIX_FMT_SDR_MSI2500_384,
}, {
.name   = 12-bit signed,
-   .pixelformat= V4L2_PIX_FMT_SDR_S12,
+   .pixelformat= MSI2500_PIX_FMT_SDR_S12,
 #endif
}, {
.name   = Complex S14LE,
@@ -221,6 +226,7 @@ static int msi3101_convert_stream_504(struct msi3101_state 
*s, u8 *dst,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies_now;
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -278,6 +284,7 @@ static int msi3101_convert_stream_504_u8(struct 
msi3101_state *s, u8 *dst,
if (unlikely(time_is_before_jiffies(s-jiffies_next))) {
 #define MSECS 1UL
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies + msecs_to_jiffies(MSECS);
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -373,6 +380,7 @@ static int msi3101_convert_stream_384(struct msi3101_state 
*s, u8 *dst,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies_now;
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -438,6 +446,7 @@ static int msi3101_convert_stream_336(struct msi3101_state 
*s, u8 *dst,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies_now;
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -501,6 +510,7 @@ static int msi3101_convert_stream_252(struct msi3101_state 
*s, u8 *dst,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - 
jiffies_to_msecs(s-jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies_now;
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -521,7 +531,7 @@ static int msi3101_convert_stream_252_u16(struct 
msi3101_state *s, u8 *dst,
int i, j, i_max, dst_len = 0;
u32 sample_num[3];
u16 *u16dst = (u16 *) dst;
-   struct {signed int x:14;} se;
+   struct {signed int x:14; } se;
 
/* There could be 1-3 1024 bytes URB frames */
i_max = src_len / 1024;
@@ -573,6 +583,7 @@ static int msi3101_convert_stream_252_u16(struct 
msi3101_state *s, u8 *dst,
if (unlikely(time_is_before_jiffies(s-jiffies_next))) {
 #define MSECS 1UL
unsigned int samples = sample_num[i_max - 1] - s-sample;
+
s-jiffies_next = jiffies + msecs_to_jiffies(MSECS);
s-sample = sample_num[i_max - 1];
dev_dbg(s-udev-dev,
@@ -667,6 +678,7 @@ handler_end:
 static void msi3101_iso_stop(struct msi3101_state *s)
 {
int i;
+
dev_dbg(s-udev-dev, %s:\n, __func__);