Re: [PULL] For 4.2 (or even 4.1?) add support for cx24120/Technisat SkyStar S2

2015-05-15 Thread Patrick Boettcher
Hi Mauro,

On Thu, 14 May 2015 18:40:40 -0300 Mauro Carvalho Chehab
mche...@osg.samsung.com wrote:

 Em Wed, 29 Apr 2015 08:55:26 -0300
 Mauro Carvalho Chehab mche...@osg.samsung.com escreveu:
 
  Em Wed, 29 Apr 2015 13:35:01 +0200
  Patrick Boettcher patrick.boettc...@posteo.de escreveu:
  
   Hi Mauro,
   
   On Mon, 27 Apr 2015 21:40:22 -0300 Mauro Carvalho Chehab
   mche...@osg.samsung.com wrote:
 Could we send an additional patch for coding-style or would you prefer
 a new patch which has everything inside? This would maintain the
 author-attribution of the initial commit.

An additional patch is fine.
   
   I fixed the files cx24120.[ch] in a --strict manner. 
  
  Thanks
  
   Do you want me to
   send each of these patches to the list? They are not really
   interesting. But if it might help to review for any obvious mistakes...
  
  Yes, please send to ML.
 
 Ping.

Thanks for the ping.

 
 I'll be marking the original patch at patchwork:
   http://patchwork.linuxtv.org/patch/29162/
 
 As changes requested.
 
 Please submit the new version of the pull request when ready.

Of course. Jemma and me (mainly Jemma) are progressing and might be
able to resubmit everything this weekend.

regards,
--
Patrick.

--
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 RFCv1] v4l2: add support for SDR transmitter

2015-05-15 Thread Hans Verkuil
Hi Antti,

Looks good, but the DocBook updates are missing. You probably planned to do 
that in
RFCv2 or similar.

Which device will have sdr_out? What's the cheapest device and where can I buy 
it? I'd
like to be able to test it (and add qv4l2 support),

Regards,

Hans

On 05/14/2015 07:51 PM, Antti Palosaari wrote:
 New IOCTL ops:
 vidioc_enum_fmt_sdr_out
 vidioc_g_fmt_sdr_out
 vidioc_s_fmt_sdr_out
 vidioc_try_fmt_sdr_out
 
 New vb2 buffertype:
 V4L2_BUF_TYPE_SDR_OUTPUT
 
 New v4l2 capability:
 V4L2_CAP_SDR_OUTPUT
 
 Cc: Hans Verkuil hverk...@xs4all.nl
 Signed-off-by: Antti Palosaari cr...@iki.fi
 ---
  drivers/media/v4l2-core/v4l2-dev.c  | 14 --
  drivers/media/v4l2-core/v4l2-ioctl.c| 25 +
  drivers/media/v4l2-core/videobuf-core.c |  4 +++-
  include/media/v4l2-ioctl.h  |  8 
  include/trace/events/v4l2.h |  1 +
  include/uapi/linux/videodev2.h  |  5 -
  6 files changed, 53 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
 b/drivers/media/v4l2-core/v4l2-dev.c
 index 71a1b93..6b1eaed 100644
 --- a/drivers/media/v4l2-core/v4l2-dev.c
 +++ b/drivers/media/v4l2-core/v4l2-dev.c
 @@ -637,8 +637,8 @@ static void determine_valid_ioctls(struct video_device 
 *vdev)
  ops-vidioc_try_fmt_sliced_vbi_out)))
   set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
   SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, 
 vidioc_g_sliced_vbi_cap);
 - } else if (is_sdr) {
 - /* SDR specific ioctls */
 + } else if (is_sdr  is_rx) {
 + /* SDR receiver specific ioctls */
   if (ops-vidioc_enum_fmt_sdr_cap)
   set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
   if (ops-vidioc_g_fmt_sdr_cap)
 @@ -647,6 +647,16 @@ static void determine_valid_ioctls(struct video_device 
 *vdev)
   set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
   if (ops-vidioc_try_fmt_sdr_cap)
   set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
 + } else if (is_sdr  is_tx) {
 + /* SDR transmitter specific ioctls */
 + if (ops-vidioc_enum_fmt_sdr_out)
 + set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
 + if (ops-vidioc_g_fmt_sdr_out)
 + set_bit(_IOC_NR(VIDIOC_G_FMT), valid_ioctls);
 + if (ops-vidioc_s_fmt_sdr_out)
 + set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
 + if (ops-vidioc_try_fmt_sdr_out)
 + set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
   }
  
   if (is_vid || is_vbi || is_sdr) {
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
 b/drivers/media/v4l2-core/v4l2-ioctl.c
 index 1476602..e78b7b8 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -153,6 +153,7 @@ const char *v4l2_type_names[] = {
   [V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE] = vid-cap-mplane,
   [V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE] = vid-out-mplane,
   [V4L2_BUF_TYPE_SDR_CAPTURE]= sdr-cap,
 + [V4L2_BUF_TYPE_SDR_OUTPUT] = sdr-out,
  };
  EXPORT_SYMBOL(v4l2_type_names);
  
 @@ -325,6 +326,7 @@ static void v4l_print_format(const void *arg, bool 
 write_only)
   sliced-service_lines[1][i]);
   break;
   case V4L2_BUF_TYPE_SDR_CAPTURE:
 + case V4L2_BUF_TYPE_SDR_OUTPUT:
   sdr = p-fmt.sdr;
   pr_cont(, pixelformat=%c%c%c%c\n,
   (sdr-pixelformat   0)  0xff,
 @@ -973,6 +975,10 @@ static int check_fmt(struct file *file, enum 
 v4l2_buf_type type)
   if (is_sdr  is_rx  ops-vidioc_g_fmt_sdr_cap)
   return 0;
   break;
 + case V4L2_BUF_TYPE_SDR_OUTPUT:
 + if (is_sdr  is_tx  ops-vidioc_g_fmt_sdr_out)
 + return 0;
 + break;
   default:
   break;
   }
 @@ -1321,6 +1327,11 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops 
 *ops,
   break;
   ret = ops-vidioc_enum_fmt_sdr_cap(file, fh, arg);
   break;
 + case V4L2_BUF_TYPE_SDR_OUTPUT:
 + if (unlikely(!is_tx || !is_sdr || 
 !ops-vidioc_enum_fmt_sdr_out))
 + break;
 + ret = ops-vidioc_enum_fmt_sdr_out(file, fh, arg);
 + break;
   }
   if (ret == 0)
   v4l_fill_fmtdesc(p);
 @@ -1415,6 +1426,10 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
   if (unlikely(!is_rx || !is_sdr || !ops-vidioc_g_fmt_sdr_cap))
   break;
   return ops-vidioc_g_fmt_sdr_cap(file, fh, arg);
 + case V4L2_BUF_TYPE_SDR_OUTPUT:
 + if (unlikely(!is_tx || !is_sdr || !ops-vidioc_g_fmt_sdr_out))
 + break;
 + return 

Re: [PATCH 2/2] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

2015-05-15 Thread Ricardo Ribalda Delgado
Hello Hans

My bad sorry, I should have send this patch myself.

Shouldn't it be? :

00 high
00 low
01 high
01 low
02 high
02 low
03 high
03 low

10 high
10 low
11 high
11 low
12 high
12 low
13 high
13 low

20 high
20 low
21 high
21 low
22 high
22 low
23 high
23 low

30 high
30 low
31 high
31 low
32 high
32 low
33 high
33 low


Thanks


ps: I am sending the patch for libv4lconvert right away, and the patch
for qv4l during next week (I havent dont gl before)
--
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 2/2] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

2015-05-15 Thread Hans Verkuil
You are completely right. I confused bits and bytes :-(

I've posted a v2.

Thanks!

Hans

On 05/15/2015 02:02 PM, Ricardo Ribalda Delgado wrote:
 Hello Hans
 
 My bad sorry, I should have send this patch myself.
 
 Shouldn't it be? :
 
 00 high
 00 low
 01 high
 01 low
 02 high
 02 low
 03 high
 03 low
 
 10 high
 10 low
 11 high
 11 low
 12 high
 12 low
 13 high
 13 low
 
 20 high
 20 low
 21 high
 21 low
 22 high
 22 low
 23 high
 23 low
 
 30 high
 30 low
 31 high
 31 low
 32 high
 32 low
 33 high
 33 low
 
 
 Thanks
 
 
 ps: I am sending the patch for libv4lconvert right away, and the patch
 for qv4l during next week (I havent dont gl before)
 

--
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 2/2] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

2015-05-15 Thread Ricardo Ribalda Delgado
For this v2:

Acked-by: Ricardo Ribalda Delgado ricardo.riba...@gmail.com


Thanks a lot :)
--
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 1/4] v4l2-dv-timings: Add interlace support in detect cvt/gtf

2015-05-15 Thread Hans Verkuil
Hi Prashant,

Sorry for the very late review, I finally have time today to go through
my pending patches.

I have one question, see below:

On 04/23/2015 10:59 AM, Prashant Laddha wrote:
 Extended detect_cvt/gtf API to indicate the format type (interlaced
 or progressive). In case of interlaced, the vertical front and back
 porch and vsync values for both (odd,even) fields are considered to
 derive image height. Populated vsync, verical front, back porch
 values in bt timing structure for even and odd fields and updated
 the flags appropriately.
 
 Also modified the functions calling the detect_cvt/gtf(). As of now
 these functions are calling detect_cvt/gtf() with interlaced flag
 set to false.
 
 Cc: Hans Verkuil hans.verk...@cisco.com
 Cc: Martin Bugge marbu...@cisco.com
 Cc: Mats Randgaard matra...@cisco.com
 Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
 Signed-off-by: Prashant Laddha prlad...@cisco.com
 ---
  drivers/media/i2c/adv7604.c  |  4 +--
  drivers/media/i2c/adv7842.c  |  4 +--
  drivers/media/platform/vivid/vivid-vid-cap.c |  5 ++--
  drivers/media/v4l2-core/v4l2-dv-timings.c| 39 
 +++-
  include/media/v4l2-dv-timings.h  |  6 +++--
  5 files changed, 44 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
 index 60ffcf0..74abfd4 100644
 --- a/drivers/media/i2c/adv7604.c
 +++ b/drivers/media/i2c/adv7604.c
 @@ -1304,12 +1304,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd,
   if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs,
   (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) |
   (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0),
 - timings))
 + false, timings))
   return 0;
   if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs,
   (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) |
   (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0),
 - state-aspect_ratio, timings))
 + false, state-aspect_ratio, timings))
   return 0;
  
   v4l2_dbg(2, debug, sd,
 diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
 index b5a37fe..90cbead 100644
 --- a/drivers/media/i2c/adv7842.c
 +++ b/drivers/media/i2c/adv7842.c
 @@ -1333,12 +1333,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd,
   if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs,
   (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) |
   (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0),
 - timings))
 + false, timings))
   return 0;
   if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs,
   (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) |
   (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0),
 - state-aspect_ratio, timings))
 + false, state-aspect_ratio, timings))
   return 0;
  
   v4l2_dbg(2, debug, sd,
 diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c 
 b/drivers/media/platform/vivid/vivid-vid-cap.c
 index be10b72..a3b19dc 100644
 --- a/drivers/media/platform/vivid/vivid-vid-cap.c
 +++ b/drivers/media/platform/vivid/vivid-vid-cap.c
 @@ -1623,7 +1623,7 @@ static bool valid_cvt_gtf_timings(struct 
 v4l2_dv_timings *timings)
  
   if (bt-standards == 0 || (bt-standards  V4L2_DV_BT_STD_CVT)) {
   if (v4l2_detect_cvt(total_v_lines, h_freq, bt-vsync,
 - bt-polarities, timings))
 + bt-polarities, false, timings))
   return true;
   }
  
 @@ -1634,7 +1634,8 @@ static bool valid_cvt_gtf_timings(struct 
 v4l2_dv_timings *timings)
 aspect_ratio.numerator,
 aspect_ratio.denominator);
   if (v4l2_detect_gtf(total_v_lines, h_freq, bt-vsync,
 - bt-polarities, aspect_ratio, timings))
 + bt-polarities, false,
 + aspect_ratio, timings))
   return true;
   }
   return false;
 diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c 
 b/drivers/media/v4l2-core/v4l2-dv-timings.c
 index 37f0d6f..86e11d1 100644
 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c
 +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c
 @@ -338,6 +338,7 @@ EXPORT_SYMBOL_GPL(v4l2_print_dv_timings);
   * @vsync - the height of the vertical sync in lines.
   * @polarities - the horizontal and vertical polarities (same as struct
   *   v4l2_bt_timings polarities).
 + * @interlaced - if this flag is true, it indicates interlaced format
   * @fmt - the resulting timings.
   *
   * This function will attempt to detect if the given values 

[GIT PULL FOR v4.2] Various fixes

2015-05-15 Thread Hans Verkuil
The following changes since commit 0fae1997f09796aca8ada5edc028aef587f6716c:

  [media] dib0700: avoid the risk of forgetting to add the adapter's size 
(2015-05-14 19:31:34 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-4.2h

for you to fetch changes up to ac640baa8ee43f01529e8ca5b98972ed50de1f7d:

  DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE (2015-05-15 12:30:54 
+0200)


Hans Verkuil (7):
  DocBook/media: fix querycap error code
  sta2x11: use monotonic timestamp
  rcar-vin: use monotonic timestamps
  DocBook/media: remove spurious space.
  DocBook/media: improve timestamp documentation
  DocBook/media: fix syntax error
  DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

Prashant Laddha (1):
  v4l2-dv-timings: fix overflow in gtf timings calculation

Ricardo Ribalda Delgado (4):
  media/vivid: Add support for Y16 format
  media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE
  media/vivid: Add support for Y16_BE format
  media/vivid: Code cleanout

 Documentation/DocBook/media/v4l/io.xml  |  2 +-
 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml   | 81 
+
 Documentation/DocBook/media/v4l/pixfmt.xml  |  1 +
 Documentation/DocBook/media/v4l/vidioc-dqevent.xml  |  5 -
 Documentation/DocBook/media/v4l/vidioc-qbuf.xml |  4 +++-
 Documentation/DocBook/media/v4l/vidioc-querycap.xml |  2 +-
 drivers/media/pci/sta2x11/sta2x11_vip.c |  3 ++-
 drivers/media/platform/soc_camera/rcar_vin.c|  2 +-
 drivers/media/platform/vivid/vivid-tpg.c| 20 ++
 drivers/media/platform/vivid/vivid-vid-common.c | 16 +++
 drivers/media/v4l2-core/v4l2-dv-timings.c   | 28 
-
 drivers/media/v4l2-core/v4l2-ioctl.c|  1 +
 include/uapi/linux/videodev2.h  |  1 +
 13 files changed, 146 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml
--
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/6] videodev2.h: add COLORSPACE_RAW

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

V4L2_COLORSPACE_RAW is added for raw image formats where the picture
is minimally processed and is in the internal colorspace of the sensor.

This is typically used in digital cameras where the image processing is
done later.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 include/uapi/linux/videodev2.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 7810376..3837030 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -226,6 +226,9 @@ enum v4l2_colorspace {
 
/* BT.2020 colorspace, used for UHDTV. */
V4L2_COLORSPACE_BT2020= 10,
+
+   /* Raw colorspace: for RAW unprocessed images */
+   V4L2_COLORSPACE_RAW   = 11,
 };
 
 enum v4l2_ycbcr_encoding {
-- 
2.1.4

--
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/6] vivid: use new V4L2_MAP_*_DEFAULT defines

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Use these defines instead of hardcoding this in any driver that needs it.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/platform/vivid/vivid-tpg.c | 51 ++--
 1 file changed, 9 insertions(+), 42 deletions(-)

diff --git a/drivers/media/platform/vivid/vivid-tpg.c 
b/drivers/media/platform/vivid/vivid-tpg.c
index 4df755a..5f98ca0 100644
--- a/drivers/media/platform/vivid/vivid-tpg.c
+++ b/drivers/media/platform/vivid/vivid-tpg.c
@@ -1640,48 +1640,15 @@ static void tpg_recalc(struct tpg_data *tpg)
tpg-recalc_lines = true;
tpg-real_ycbcr_enc = tpg-ycbcr_enc;
tpg-real_quantization = tpg-quantization;
-   if (tpg-ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT) {
-   switch (tpg-colorspace) {
-   case V4L2_COLORSPACE_REC709:
-   tpg-real_ycbcr_enc = V4L2_YCBCR_ENC_709;
-   break;
-   case V4L2_COLORSPACE_SRGB:
-   tpg-real_ycbcr_enc = V4L2_YCBCR_ENC_SYCC;
-   break;
-   case V4L2_COLORSPACE_BT2020:
-   tpg-real_ycbcr_enc = V4L2_YCBCR_ENC_BT2020;
-   break;
-   case V4L2_COLORSPACE_SMPTE240M:
-   tpg-real_ycbcr_enc = V4L2_YCBCR_ENC_SMPTE240M;
-   break;
-   case V4L2_COLORSPACE_SMPTE170M:
-   case V4L2_COLORSPACE_470_SYSTEM_M:
-   case V4L2_COLORSPACE_470_SYSTEM_BG:
-   case V4L2_COLORSPACE_ADOBERGB:
-   default:
-   tpg-real_ycbcr_enc = V4L2_YCBCR_ENC_601;
-   break;
-   }
-   }
-   if (tpg-quantization == V4L2_QUANTIZATION_DEFAULT) {
-   tpg-real_quantization = V4L2_QUANTIZATION_FULL_RANGE;
-   if (tpg-is_yuv) {
-   switch (tpg-real_ycbcr_enc) {
-   case V4L2_YCBCR_ENC_SYCC:
-   case V4L2_YCBCR_ENC_XV601:
-   case V4L2_YCBCR_ENC_XV709:
-   break;
-   default:
-   tpg-real_quantization =
-   V4L2_QUANTIZATION_LIM_RANGE;
-   break;
-   }
-   } else if (tpg-colorspace == V4L2_COLORSPACE_BT2020) {
-   /* R'G'B' BT.2020 is limited range */
-   tpg-real_quantization =
-   V4L2_QUANTIZATION_LIM_RANGE;
-   }
-   }
+   if (tpg-ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT)
+   tpg-real_ycbcr_enc =
+   V4L2_MAP_YCBCR_ENC_DEFAULT(tpg-colorspace);
+
+   if (tpg-quantization == V4L2_QUANTIZATION_DEFAULT)
+   tpg-real_quantization =
+   V4L2_MAP_QUANTIZATION_DEFAULT(!tpg-is_yuv,
+   tpg-colorspace, tpg-real_ycbcr_enc);
+
tpg_precalculate_colors(tpg);
}
if (tpg-recalc_square_border) {
-- 
2.1.4

--
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/6] DocBook/media: document COLORSPACE_RAW.

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Document this new colorspace define.

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

diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index e6d2d42..0dae181 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -538,6 +538,13 @@ BT.2020 which uses limited range R'G'B' 
quantization./para
entryconstantV4L2_COLORSPACE_JPEG/constant/entry
entrySee xref linkend=col-jpeg /./entry
  /row
+ row
+   entryconstantV4L2_COLORSPACE_RAW/constant/entry
+   entryThe raw colorspace. This is used for raw image capture where
+   the image is minimally processed and is using the internal 
colorspace
+   of the device. The software that processes an image using this
+   'colorspace' will have to know the internals of the capture 
device./entry
+ /row
/tbody
   /tgroup
 /table
-- 
2.1.4

--
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 5/6] videodev2.h: add macros to map colorspace defaults

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

The mapping of COLORSPACE_DEFAULT, YCBCR_ENC_DEFAULT or QUANTIZATION_DEFAULT
to proper non-default values is fairly complex, and it is something that
needs to be done both in the kernel and in userspace.

So add macros that can do this conversion, making this available to both
kernel and userspace.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 include/uapi/linux/videodev2.h | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 3837030..0f68d84 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -231,6 +231,15 @@ enum v4l2_colorspace {
V4L2_COLORSPACE_RAW   = 11,
 };
 
+/*
+ * Determine how COLORSPACE_DEFAULT should map to a proper colorspace.
+ * This depends on whether this is a SDTV image (use SMPTE 170M), an
+ * HDTV image (use Rec. 709), or something else (use sRGB).
+ */
+#define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv, is_hdtv) \
+   ((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : \
+((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB))
+
 enum v4l2_ycbcr_encoding {
/*
 * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the
@@ -275,6 +284,16 @@ enum v4l2_ycbcr_encoding {
V4L2_YCBCR_ENC_SMPTE240M  = 8,
 };
 
+/*
+ * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
+ * This depends on the colorspace.
+ */
+#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) \
+   ((colsp) == V4L2_COLORSPACE_REC709 ? V4L2_YCBCR_ENC_709 : \
+((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : \
+ ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : \
+  V4L2_YCBCR_ENC_601)))
+
 enum v4l2_quantization {
/*
 * The default for R'G'B' quantization is always full range, except
@@ -287,6 +306,17 @@ enum v4l2_quantization {
V4L2_QUANTIZATION_LIM_RANGE   = 2,
 };
 
+/*
+ * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.
+ * This depends on whether the image is RGB or not, the colorspace and the
+ * Y'CbCr encoding.
+ */
+#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
+   (((is_rgb)  (colsp) == V4L2_COLORSPACE_BT2020) ? 
V4L2_QUANTIZATION_LIM_RANGE : \
+(((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
+ (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == 
V4L2_COLORSPACE_JPEG) ? \
+V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
+
 enum v4l2_priority {
V4L2_PRIORITY_UNSET   = 0,  /* not initialized */
V4L2_PRIORITY_BACKGROUND  = 1,
-- 
2.1.4

--
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/6] Add COLORSPACE_DEFAULT and COLORSPACE_RAW

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This patch series adds a few new colorspace-related things that have been
in my tree for some time now.

- V4L2_COLORSPACE_DEFAULT is added to represent the value 0 that was used until
  now. This really should have a proper define that's in line with
  V4L2_YCBCR_ENC_DEFAULT and V4L2_QUANTIZATION_DEFAULT.
- Add V4L2_COLORSPACE_RAW to signal raw colorspaces such as produced by digital
  cameras. Here no colorspace processing is done at all. This was requested
  during the mini-summit in San Jose.
- Add new V4L2_MAP_*_DEFAULT defines to make the mapping of DEFAULT values to
  actual colorspace/ycbcr_enc/quantization values consistent for both kernel
  and userspace.

Regards,

Hans

Hans Verkuil (6):
  videodev2.h: add COLORSPACE_DEFAULT
  DocBook/media: document COLORSPACE_DEFAULT
  videodev2.h: add COLORSPACE_RAW
  DocBook/media: document COLORSPACE_RAW.
  videodev2.h: add macros to map colorspace defaults
  vivid: use new V4L2_MAP_*_DEFAULT defines

 Documentation/DocBook/media/v4l/pixfmt.xml | 12 +++
 drivers/media/platform/vivid/vivid-tpg.c   | 51 ++
 include/uapi/linux/videodev2.h | 39 +++
 3 files changed, 60 insertions(+), 42 deletions(-)

-- 
2.1.4

--
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/6] DocBook/media: document COLORSPACE_DEFAULT

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Document this new colorspace define.

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

diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index fcde4e2..e6d2d42 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -498,6 +498,11 @@ BT.2020 which uses limited range R'G'B' 
quantization./para
/thead
tbody valign=top
  row
+   entryconstantV4L2_COLORSPACE_DEFAULT/constant/entry
+   entryThe default colorspace. This can be used by applications to 
let the
+   driver fill in the colorspace./entry
+ /row
+ row
entryconstantV4L2_COLORSPACE_SMPTE170M/constant/entry
entrySee xref linkend=col-smpte-170m /./entry
  /row
-- 
2.1.4

--
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/6] videodev2.h: add COLORSPACE_DEFAULT

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

V4L2_COLORSPACE_DEFAULT is added so we have a specific define for
the default case where applications do not set it but leave it to 0.
In that case the driver will set the colorspace based on what it
captures.

This is already used, but we never had a define for the value 0.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 include/uapi/linux/videodev2.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 0f5a467..7810376 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -178,6 +178,12 @@ enum v4l2_memory {
 
 /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
 enum v4l2_colorspace {
+   /*
+* Default colorspace, i.e. let the driver figure it out.
+* Can only be used with video capture.
+*/
+   V4L2_COLORSPACE_DEFAULT   = 0,
+
/* SMPTE 170M: used for broadcast NTSC/PAL SDTV */
V4L2_COLORSPACE_SMPTE170M = 1,
 
-- 
2.1.4

--
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 2/2] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

2015-05-15 Thread Hans Verkuil
This format was added but not documented. Do this now.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Ricardo Ribalda Delgado ricardo.riba...@gmail.com
---
 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml | 81 +++
 Documentation/DocBook/media/v4l/pixfmt.xml|  1 +
 2 files changed, 82 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml 
b/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml
new file mode 100644
index 000..cea53e1
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml
@@ -0,0 +1,81 @@
+refentry id=V4L2-PIX-FMT-Y16-BE
+  refmeta
+refentrytitleV4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 lt;lt; 
31))/refentrytitle
+manvol;
+  /refmeta
+  refnamediv
+refnameconstantV4L2_PIX_FMT_Y16_BE/constant/refname
+refpurposeGrey-scale image/refpurpose
+  /refnamediv
+  refsect1
+titleDescription/title
+
+paraThis is a grey-scale image with a depth of 16 bits per
+pixel. The most significant byte is stored at lower memory addresses
+(big-endian). Note the actual sampling precision may be lower than
+16 bits, for example 10 bits per pixel with values in range 0 to
+1023./para
+
+example
+  titleconstantV4L2_PIX_FMT_Y16_BE/constant 4 times; 4
+pixel image/title
+
+  formalpara
+   titleByte Order./title
+   paraEach cell is one byte.
+ informaltable frame=none
+   tgroup cols=9 align=center
+ colspec align=left colwidth=2* /
+ tbody valign=top
+   row
+ entrystartnbsp;+nbsp;0:/entry
+ entryY'subscript00high/subscript/entry
+ entryY'subscript00low/subscript/entry
+ entryY'subscript01high/subscript/entry
+ entryY'subscript01low/subscript/entry
+ entryY'subscript02high/subscript/entry
+ entryY'subscript02low/subscript/entry
+ entryY'subscript03high/subscript/entry
+ entryY'subscript03low/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;8:/entry
+ entryY'subscript10high/subscript/entry
+ entryY'subscript10low/subscript/entry
+ entryY'subscript11high/subscript/entry
+ entryY'subscript11low/subscript/entry
+ entryY'subscript12high/subscript/entry
+ entryY'subscript12low/subscript/entry
+ entryY'subscript13high/subscript/entry
+ entryY'subscript13low/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;16:/entry
+ entryY'subscript20high/subscript/entry
+ entryY'subscript20low/subscript/entry
+ entryY'subscript21high/subscript/entry
+ entryY'subscript21low/subscript/entry
+ entryY'subscript22high/subscript/entry
+ entryY'subscript22low/subscript/entry
+ entryY'subscript23high/subscript/entry
+ entryY'subscript23low/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;24:/entry
+ entryY'subscript30high/subscript/entry
+ entryY'subscript30low/subscript/entry
+ entryY'subscript31high/subscript/entry
+ entryY'subscript31low/subscript/entry
+ entryY'subscript32high/subscript/entry
+ entryY'subscript32low/subscript/entry
+ entryY'subscript33high/subscript/entry
+ entryY'subscript33low/subscript/entry
+   /row
+ /tbody
+   /tgroup
+ /informaltable
+   /para
+  /formalpara
+/example
+  /refsect1
+/refentry
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index fcde4e2..ddff8d9 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -1429,6 +1429,7 @@ information./para
 sub-y12;
 sub-y10b;
 sub-y16;
+sub-y16-be;
 sub-uv8;
 sub-yuyv;
 sub-uyvy;
-- 
2.1.4

--
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/2] DocBook/media: fix syntax error

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Missing varlistentry tags.

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

diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml 
b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
index 6cfc53b..8b98a0e 100644
--- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
@@ -186,13 +186,15 @@ In that case the application should be able to safely 
reuse the buffer and
 continue streaming.
/para
/listitem
+  /varlistentry
+  varlistentry
termerrorcodeEPIPE/errorcode/term
listitem
  paraconstantVIDIOC_DQBUF/constant returns this on an empty
 capture queue for mem2mem codecs if a buffer with the
 constantV4L2_BUF_FLAG_LAST/constant was already dequeued and no new buffers
 are expected to become available.
-   /para
+ /para
/listitem
   /varlistentry
 /variablelist
-- 
2.1.4

--
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/2] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BE

2015-05-15 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This format was added but not documented. Do this now.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Ricardo Ribalda Delgado ricardo.riba...@gmail.com
---
 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml | 81 +++
 Documentation/DocBook/media/v4l/pixfmt.xml|  1 +
 2 files changed, 82 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-y16-be.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml 
b/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml
new file mode 100644
index 000..2212703
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml
@@ -0,0 +1,81 @@
+refentry id=V4L2-PIX-FMT-Y16-BE
+  refmeta
+refentrytitleV4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 lt;lt; 
31))/refentrytitle
+manvol;
+  /refmeta
+  refnamediv
+refnameconstantV4L2_PIX_FMT_Y16_BE/constant/refname
+refpurposeGrey-scale image/refpurpose
+  /refnamediv
+  refsect1
+titleDescription/title
+
+paraThis is a grey-scale image with a depth of 16 bits per
+pixel. The most significant byte is stored at lower memory addresses
+(big-endian). Note the actual sampling precision may be lower than
+16 bits, for example 10 bits per pixel with values in range 0 to
+1023./para
+
+example
+  titleconstantV4L2_PIX_FMT_Y16_BE/constant 4 times; 4
+pixel image/title
+
+  formalpara
+   titleByte Order./title
+   paraEach cell is one byte.
+ informaltable frame=none
+   tgroup cols=9 align=center
+ colspec align=left colwidth=2* /
+ tbody valign=top
+   row
+ entrystartnbsp;+nbsp;0:/entry
+ entryY'subscript30low/subscript/entry
+ entryY'subscript30high/subscript/entry
+ entryY'subscript31low/subscript/entry
+ entryY'subscript31high/subscript/entry
+ entryY'subscript32low/subscript/entry
+ entryY'subscript32high/subscript/entry
+ entryY'subscript33low/subscript/entry
+ entryY'subscript33high/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;8:/entry
+ entryY'subscript20low/subscript/entry
+ entryY'subscript20high/subscript/entry
+ entryY'subscript21low/subscript/entry
+ entryY'subscript21high/subscript/entry
+ entryY'subscript22low/subscript/entry
+ entryY'subscript22high/subscript/entry
+ entryY'subscript23low/subscript/entry
+ entryY'subscript23high/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;16:/entry
+ entryY'subscript10low/subscript/entry
+ entryY'subscript10high/subscript/entry
+ entryY'subscript11low/subscript/entry
+ entryY'subscript11high/subscript/entry
+ entryY'subscript12low/subscript/entry
+ entryY'subscript12high/subscript/entry
+ entryY'subscript13low/subscript/entry
+ entryY'subscript13high/subscript/entry
+   /row
+   row
+ entrystartnbsp;+nbsp;24:/entry
+ entryY'subscript00low/subscript/entry
+ entryY'subscript00high/subscript/entry
+ entryY'subscript01low/subscript/entry
+ entryY'subscript01high/subscript/entry
+ entryY'subscript02low/subscript/entry
+ entryY'subscript02high/subscript/entry
+ entryY'subscript03low/subscript/entry
+ entryY'subscript03high/subscript/entry
+   /row
+ /tbody
+   /tgroup
+ /informaltable
+   /para
+  /formalpara
+/example
+  /refsect1
+/refentry
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index fcde4e2..ddff8d9 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -1429,6 +1429,7 @@ information./para
 sub-y12;
 sub-y10b;
 sub-y16;
+sub-y16-be;
 sub-uv8;
 sub-yuyv;
 sub-uyvy;
-- 
2.1.4

--
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 RFCv1] v4l2: add support for SDR transmitter

2015-05-15 Thread Antti Palosaari

Moikka!

On 05/15/2015 12:25 PM, Hans Verkuil wrote:

Hi Antti,

Looks good, but the DocBook updates are missing. You probably planned to do 
that in
RFCv2 or similar.


Yep, first code then doc.


Which device will have sdr_out? What's the cheapest device and where can I buy 
it? I'd
like to be able to test it (and add qv4l2 support),


I used HackRF One, it is likely 150-250e used one.

Currently I have implemented almost all radio features it has, only 
option to enable antenna power supply is missing (and firmware upgrade, 
but it is not radio feature).


Device is half-duplex - only RX or TX could be used at the time. Driver 
creates two device nodes, one for receiver and another for transmitter.


There is:
2 x struct video_device
2 x struct v4l2_device
2 x struct vb2_queue
2 x struct v4l2_ctrl_handler

Locking is still missing. I am not sure how it should be done, but 
likely I try add lock to start/stop streaming. When start streaming is 
called it sets some flag/lock and if another device node tries start 
streaming at same time error is returned.


Device uses Complex S8 format for both receiver and transmitter. I will 
add that format to vivid and then it should be possible generate beep 
using vivid and transmit it using HackRF (cat /dev/swradio0  
/dev/swradio1), where swradio0 is vivid and swradio1 is HackRF.


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: [PULL] For 4.2 (or even 4.1?) add support for cx24120/Technisat SkyStar S2

2015-05-15 Thread Jemma Denson

Hi Mauro,

On 15/05/15 15:24, Mauro Carvalho Chehab wrote:

Of course. Jemma and me (mainly Jemma) are progressing and might be
able to resubmit everything this weekend.

Good! Thanks for the good work!

Mauro



The only thing left now is moving UCB  BER over to DVBv5 stats - we 
haven't got anything close to any specs for this demod so I'm struggling 
to work out how to handle the counter increment.
It's not helped by my signal not being marginal enough to see any errors 
anyway!


What's the best course of action here - either leave those two out 
entirely or fudge something to get the numbers to about the right 
magnitude and worry about making it more accurate at a later date?



Jemma.

--
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 1/2] gspca: sn9c2028: Add support for Genius Videocam Live v2

2015-05-15 Thread Vasily Khoruzhick
Ping?

On Fri, Apr 24, 2015 at 10:04 AM, Vasily Khoruzhick anars...@gmail.com wrote:
 This cam seems to return different values on long commands, so make status 
 check
 in sn9c2028_long_command() more tolerant. Anyway, read value isn't used 
 anywhere
 later.

 Signed-off-by: Vasily Khoruzhick anars...@gmail.com
 ---
 v2: update commit message to explain change in sn9c2028_long_command()

  drivers/media/usb/gspca/sn9c2028.c | 120 
 -
  1 file changed, 119 insertions(+), 1 deletion(-)

 diff --git a/drivers/media/usb/gspca/sn9c2028.c 
 b/drivers/media/usb/gspca/sn9c2028.c
 index 39b6b2e..317b02c 100644
 --- a/drivers/media/usb/gspca/sn9c2028.c
 +++ b/drivers/media/usb/gspca/sn9c2028.c
 @@ -2,6 +2,7 @@
   * SN9C2028 library
   *
   * Copyright (C) 2009 Theodore Kilgore kilg...@auburn.edu
 + * Copyright (C) 2015 Vasily Khoruzhick anars...@gmail.com
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
 @@ -128,7 +129,7 @@ static int sn9c2028_long_command(struct gspca_dev 
 *gspca_dev, u8 *command)
 status = -1;
 for (i = 0; i  256  status  2; i++)
 status = sn9c2028_read1(gspca_dev);
 -   if (status != 2) {
 +   if (status  0) {
 pr_err(long command status read error %d\n, status);
 return (status  0) ? status : -EIO;
 }
 @@ -178,6 +179,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
 case 0x7005:
 PDEBUG(D_PROBE, Genius Smart 300 camera);
 break;
 +   case 0x7003:
 +   PDEBUG(D_PROBE, Genius Videocam Live v2);
 +   break;
 case 0x8000:
 PDEBUG(D_PROBE, DC31VC);
 break;
 @@ -530,6 +534,116 @@ static int start_genius_cam(struct gspca_dev *gspca_dev)
   ARRAY_SIZE(genius_start_commands));
  }

 +static int start_genius_videocam_live(struct gspca_dev *gspca_dev)
 +{
 +   int r;
 +   struct sd *sd = (struct sd *) gspca_dev;
 +   struct init_command genius_vcam_live_start_commands[] = {
 +   {{0x0c, 0x01, 0x00, 0x00, 0x00, 0x00}, 0},
 +   {{0x16, 0x01, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x25, 0x01, 0x16, 0x00, 0x00}, 4},
 +   {{0x13, 0x26, 0x01, 0x12, 0x00, 0x00}, 4},
 +
 +   {{0x13, 0x28, 0x01, 0x0e, 0x00, 0x00}, 4},
 +   {{0x13, 0x27, 0x01, 0x20, 0x00, 0x00}, 4},
 +   {{0x13, 0x29, 0x01, 0x22, 0x00, 0x00}, 4},
 +   {{0x13, 0x2c, 0x01, 0x02, 0x00, 0x00}, 4},
 +   {{0x13, 0x2d, 0x01, 0x02, 0x00, 0x00}, 4},
 +   {{0x13, 0x2e, 0x01, 0x09, 0x00, 0x00}, 4},
 +   {{0x13, 0x2f, 0x01, 0x07, 0x00, 0x00}, 4},
 +   {{0x11, 0x20, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x21, 0x2d, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x22, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x23, 0x03, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x10, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x11, 0x64, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x12, 0x00, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x13, 0x91, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x14, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x15, 0x20, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x16, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x17, 0x60, 0x00, 0x00, 0x00}, 4},
 +   {{0x1c, 0x20, 0x00, 0x2d, 0x00, 0x00}, 4},
 +   {{0x13, 0x20, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x21, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x22, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x23, 0x01, 0x01, 0x00, 0x00}, 4},
 +   {{0x13, 0x24, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x25, 0x01, 0x16, 0x00, 0x00}, 4},
 +   {{0x13, 0x26, 0x01, 0x12, 0x00, 0x00}, 4},
 +   {{0x13, 0x27, 0x01, 0x20, 0x00, 0x00}, 4},
 +   {{0x13, 0x28, 0x01, 0x0e, 0x00, 0x00}, 4},
 +   {{0x13, 0x29, 0x01, 0x22, 0x00, 0x00}, 4},
 +   {{0x13, 0x2a, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x2b, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x2c, 0x01, 0x02, 0x00, 0x00}, 4},
 +   {{0x13, 0x2d, 0x01, 0x02, 0x00, 0x00}, 4},
 +   {{0x13, 0x2e, 0x01, 0x09, 0x00, 0x00}, 4},
 +   {{0x13, 0x2f, 0x01, 0x07, 0x00, 0x00}, 4},
 +   {{0x12, 0x34, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x13, 0x34, 0x01, 0xa1, 0x00, 0x00}, 4},
 +   {{0x13, 0x35, 0x01, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x01, 0x04, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x02, 0x92, 0x00, 0x00, 0x00}, 4},
 +   {{0x11, 0x10, 0x00, 0x00, 0x00, 

Re: ATI TV Wonder regression since at least 3.19.6

2015-05-15 Thread Patrice Levesque

Hi Hans,


 Function isn't used; when compiling I get:
 That makes no sense. This function is most definitely used.

Idiot guy here did not follow simple instructions and didn't patch the
right kernel source.  He just did, and function is used.


 Did you start a capturing video first before running dmesg? I want to
 see if capturing video will generate messages in dmesg.

Sending you again my (truncated) dmesg, but here's the annotated salient bit:

Starting video capture first time:
[Fri May 15 11:01:43 2015] restart_video_queue
[Fri May 15 11:01:44 2015] restart_video_queue
[Fri May 15 11:01:55 2015] restart_video_queue
[Fri May 15 11:01:56 2015] restart_video_queue
[Fri May 15 11:01:56 2015] restart_video_queue
[Fri May 15 11:02:00 2015] restart_video_queue
[Fri May 15 11:02:05 2015] restart_video_queue
[Fri May 15 11:02:06 2015] restart_video_queue
[Fri May 15 11:02:06 2015] restart_video_queue
[Fri May 15 11:02:06 2015] restart_video_queue
[Fri May 15 11:02:07 2015] restart_video_queue
[Fri May 15 11:02:07 2015] restart_video_queue
[Fri May 15 11:02:07 2015] restart_video_queue
[Fri May 15 11:02:09 2015] restart_video_queue
Stopping video capture:
[Fri May 15 11:03:26 2015] restart_video_queue
Re-Starting video capture:
[Fri May 15 11:03:40 2015] restart_video_queue
Stopping video capture:
[Fri May 15 11:04:18 2015] restart_video_queue

Changing channels didn't provoke restart_video_queue events.



-- 
· Patrice Levesque
· http://ptaff.ca/
· video4linux.wa...@ptaff.ca
--

[Fri May 15 10:58:18 2015] bus: 'platform': add device pata_legacy.1
[Fri May 15 10:58:18 2015] device: 'ata8': device_add
[Fri May 15 10:58:18 2015] device: 'ata8': device_add
[Fri May 15 10:58:18 2015] device: 'link8': device_add
[Fri May 15 10:58:18 2015] device: 'link8': device_add
[Fri May 15 10:58:18 2015] device: 'dev8.0': device_add
[Fri May 15 10:58:18 2015] device: 'dev8.0': device_add
[Fri May 15 10:58:18 2015] device: 'dev8.1': device_add
[Fri May 15 10:58:18 2015] device: 'dev8.1': device_add
[Fri May 15 10:58:18 2015] scsi host7: pata_legacy
[Fri May 15 10:58:18 2015] device: 'host7': device_add
[Fri May 15 10:58:18 2015] bus: 'scsi': add device host7
[Fri May 15 10:58:18 2015] device: 'host7': device_add
[Fri May 15 10:58:18 2015] ata8: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[Fri May 15 10:58:18 2015] device: 'host7': device_unregister
[Fri May 15 10:58:18 2015] bus: 'scsi': remove device host7
[Fri May 15 10:58:18 2015] bus: 'platform': remove device pata_legacy.1
[Fri May 15 10:58:18 2015] bus: 'pci': add driver r8169
[Fri May 15 10:58:18 2015] bus: 'pci': driver_probe_device: matched device 
:03:00.0 with driver r8169
[Fri May 15 10:58:18 2015] bus: 'pci': really_probe: probing driver r8169 with 
device :03:00.0
[Fri May 15 10:58:18 2015] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[Fri May 15 10:58:18 2015] r8169 :03:00.0: can't disable ASPM; OS doesn't 
have ASPM control
[Fri May 15 10:58:18 2015] device: 'eth0': device_add
[Fri May 15 10:58:18 2015] r8169 :03:00.0 eth0: RTL8168f/8111f at 
0xf3822000, 74:d0:2b:36:44:fe, XID 08000800 IRQ 16
[Fri May 15 10:58:18 2015] r8169 :03:00.0 eth0: jumbo features [frames: 
9200 bytes, tx checksumming: ko]
[Fri May 15 10:58:18 2015] driver: 'r8169': driver_bound: bound to device 
':03:00.0'
[Fri May 15 10:58:18 2015] bus: 'pci': really_probe: bound device :03:00.0 
to driver r8169
[Fri May 15 10:58:18 2015] bus: 'pnp': add driver i8042 kbd
[Fri May 15 10:58:18 2015] bus: 'pnp': driver_probe_device: matched device 
00:06 with driver i8042 kbd
[Fri May 15 10:58:18 2015] bus: 'pnp': really_probe: probing driver i8042 kbd 
with device 00:06
[Fri May 15 10:58:18 2015] driver: 'i8042 kbd': driver_bound: bound to device 
'00:06'
[Fri May 15 10:58:18 2015] bus: 'pnp': really_probe: bound device 00:06 to 
driver i8042 kbd
[Fri May 15 10:58:18 2015] bus: 'pnp': add driver i8042 aux
[Fri May 15 10:58:18 2015] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 
0x60,0x64 irq 1
[Fri May 15 10:58:18 2015] i8042: PNP: PS/2 appears to have AUX port disabled, 
if this is incorrect please boot with i8042.nopnp
[Fri May 15 10:58:18 2015] Registering platform device 'i8042'. Parent at 
platform
[Fri May 15 10:58:18 2015] device: 'i8042': device_add
[Fri May 15 10:58:18 2015] bus: 'platform': add device i8042
[Fri May 15 10:58:18 2015] bus: 'platform': add driver i8042
[Fri May 15 10:58:18 2015] bus: 'platform': driver_probe_device: matched device 
i8042 with driver i8042
[Fri May 15 10:58:18 2015] bus: 'platform': really_probe: probing driver i8042 
with device i8042
[Fri May 15 10:58:18 2015] serio: i8042 KBD port at 0x60,0x64 irq 1
[Fri May 15 10:58:18 2015] device: 'serio0': device_add
[Fri May 15 10:58:18 2015] bus: 'serio': add device serio0
[Fri May 15 10:58:18 2015] driver: 'i8042': driver_bound: bound to device 
'i8042'
[Fri May 15 10:58:18 2015] bus: 'platform': really_probe: bound device i8042 to 
driver i8042
[Fri May 15 10:58:18 2015] device: 'mice': 

Re: [PATCH v2 1/2] clk: change clk_ops' -round_rate() prototype

2015-05-15 Thread Boris Brezillon
Hi Stephen,

Adding Mikko in the loop (after all, he was the one complaining about
this signed long limitation in the first place, and I forgot to add
him in the Cc list :-/).

Mikko, are you okay with the approach proposed by Stephen (adding a
new method) ?

On Thu, 7 May 2015 09:37:02 +0200
Boris Brezillon boris.brezil...@free-electrons.com wrote:

 Hi Stephen,
 
 On Wed, 6 May 2015 23:39:53 -0700
 Stephen Boyd sb...@codeaurora.org wrote:
 
  On 04/30, Boris Brezillon wrote:
   Clock rates are stored in an unsigned long field, but -round_rate()
   (which returns a rounded rate from a requested one) returns a long
   value (errors are reported using negative error codes), which can lead
   to long overflow if the clock rate exceed 2Ghz.
   
   Change -round_rate() prototype to return 0 or an error code, and pass the
   requested rate as a pointer so that it can be adjusted depending on
   hardware capabilities.
   
   Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
   Tested-by: Heiko Stuebner he...@sntech.de
   Tested-by: Mikko Perttunen mikko.perttu...@kapsi.fi
   Reviewed-by: Heiko Stuebner he...@sntech.de
  
  This patch is fairly invasive, and it probably doesn't even
  matter for most of these clock providers to be able to round a
  rate above 2GHz.
 
 Fair enough.
 
  I've been trying to remove the .round_rate op
  from the framework by encouraging new features via the
  .determine_rate op.
 
 Oh, I wasn't aware of that (BTW, that's a good thing).
 Maybe this should be clearly stated (both in the struct clk_ops
 kerneldoc header and in Documentation/clk.txt).
 
  Sadly, we still have to do a flag day and
  change all the .determine_rate ops when we want to add things.
 
 Yes, but the number of clk drivers implementing -determine_rate() is
 still quite limited compared to those implementing -round_rate().
 
  
  What if we changed determine_rate ops to take a struct
  clk_determine_info (or some better named structure) instead of
  the current list of arguments that it currently takes? Then when
  we want to make these sorts of framework wide changes we can just
  throw a new member into that structure and be done.
 
 I really like this idea, especially since I was wondering if we could
 pass other 'clk rate requirements' like the rounding policy (down,
 closest, up), or the maximum clk inaccuracy.
 
  
  It doesn't solve the unsigned long to int return value problem
  though. We can solve that by gradually introducing a new op and
  handling another case in the rounding path. If we can come up
  with some good name for that new op like .decide_rate or
  something then it makes things nicer in the long run. I like the
  name .determine_rate though :/

Okay, if you want a new method, how about this one:

struct clk_adjust_rate_req {
/* fields filled by the caller */
unsigned long rate; /* rate is updated by the clk driver */
unsigned long min;
unsigned long max;

/* fields filled by the clk driver */
struct clk_hw *best_parent;
unsigned long best_parent_rate;

/*
 * new fields I'd like to add at some point:
 * unsigned long max_inaccuracy;
 * something about the power consumption constraints :-)
 */
};

int (*adjust_rate)(struct clk_hw *hw, struct clk_adjust_rate_req *req);

 
 Why not changing the -determine_rate() prototype. As said above, the
 number of clk drivers implementing this function is still quite
 limited, and I guess we can have an ack for all of them.
 
  
  The benefit of all this is that we don't have to worry about
  finding the random clk providers that get added into other
  subsystems and fixing them up. If drivers actually care about
  this problem then they'll be fixed to use the proper op. FYI,
  last time we updated the function signature of .determine_rate we
  broke a couple drivers along the way.
  
 
 Hm, IMHO, adding a new op is not a good thing. I agree that it eases
 the transition, but ITOH you'll have to live with old/deprecated ops in
 your clk_ops structure with people introducing new drivers still using
 the old ops (see the number of clk drivers implementing -round_rate()
 instead of -determine_rate()).
 
 Best Regards,
 
 Boris
 



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
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] radio-bcm2048: Fix region selection

2015-05-15 Thread Greg Kroah-Hartman
On Fri, May 15, 2015 at 11:32:51PM +0200, Pali Rohár wrote:
 From: maxx m...@spaceboyz.net

I need a real name here, sorry.

greg k-h
--
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] radio-bcm2048: Enable access to automute and ctrl registers

2015-05-15 Thread Greg Kroah-Hartman
On Fri, May 15, 2015 at 11:31:51PM +0200, Pali Rohár wrote:
 From: maxx m...@spaceboyz.net

Same here, real name please.

greg k-h
--
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: [PULL] For 4.2 (or even 4.1?) add support for cx24120/Technisat SkyStar S2

2015-05-15 Thread Mauro Carvalho Chehab
Em Fri, 15 May 2015 10:24:33 +0200
Patrick Boettcher patrick.boettc...@posteo.de escreveu:

 Hi Mauro,
 
 On Thu, 14 May 2015 18:40:40 -0300 Mauro Carvalho Chehab
 mche...@osg.samsung.com wrote:
 
  Em Wed, 29 Apr 2015 08:55:26 -0300
  Mauro Carvalho Chehab mche...@osg.samsung.com escreveu:
  
   Em Wed, 29 Apr 2015 13:35:01 +0200
   Patrick Boettcher patrick.boettc...@posteo.de escreveu:
   
Hi Mauro,

On Mon, 27 Apr 2015 21:40:22 -0300 Mauro Carvalho Chehab
mche...@osg.samsung.com wrote:
  Could we send an additional patch for coding-style or would you 
  prefer
  a new patch which has everything inside? This would maintain the
  author-attribution of the initial commit.
 
 An additional patch is fine.

I fixed the files cx24120.[ch] in a --strict manner. 
   
   Thanks
   
Do you want me to
send each of these patches to the list? They are not really
interesting. But if it might help to review for any obvious mistakes...
   
   Yes, please send to ML.
  
  Ping.
 
 Thanks for the ping.
 
  
  I'll be marking the original patch at patchwork:
  http://patchwork.linuxtv.org/patch/29162/
  
  As changes requested.
  
  Please submit the new version of the pull request when ready.
 
 Of course. Jemma and me (mainly Jemma) are progressing and might be
 able to resubmit everything this weekend.

Good! Thanks for the good work!

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


cron job: media_tree daily build: ERRORS

2015-05-15 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:   Sat May 16 04:00:16 CEST 2015
git branch: test
git hash:   0fae1997f09796aca8ada5edc028aef587f6716c
gcc version:i686-linux-gcc (GCC) 5.1.0
sparse version: v0.5.0-44-g40791b9
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:4.0.0-1.slh.2-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: WARNINGS
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: WARNINGS
linux-3.12.23-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
linux-3.19-i686: WARNINGS
linux-4.0-i686: WARNINGS
linux-4.1-rc1-i686: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12.23-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0-x86_64: WARNINGS
linux-4.1-rc1-x86_64: WARNINGS
apps: OK
spec-git: OK
sparse: ERRORS
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.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: [PATCH v2 1/2] gspca: sn9c2028: Add support for Genius Videocam Live v2

2015-05-15 Thread Vasily Khoruzhick
Hi Hans,

On Fri, May 15, 2015 at 8:51 PM, Hans de Goede hdego...@redhat.com wrote:
 Sorry for being a bit slow on this one, v2 looks good. I'll queue it up for
 merging into 4.2 as soon as I find some time to work on this,

Thanks!

Regards,
Vasily
--
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] [media] Fix more regressions in some dib0700 based devices

2015-05-15 Thread Laura Abbott
Several more devices need need to have size_of_priv set, otherwise
we oops:

 DVB: registering new adapter (Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity)
 BUG: unable to handle kernel NULL pointer dereference at 0080
 IP: [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
 PGD 0 
 Oops: 0002 [#1] SMP 
 Modules linked in: dib7000p dvb_usb_dib0700(+) dib7000m dib0090 dib0070
 dib3000mc dibx000_common dvb_usb dvb_core rc_core bnep bluetooth rfkill
 ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat
 ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat
 nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security
 ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4
 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security
 iptable_raw snd_hda_codec_analog snd_hda_codec_generic joydev coretemp kvm
 snd_hda_intel iTCO_wdt gpio_ich iTCO_vendor_support ppdev snd_hda_controller
 dell_wmi sparse_keymap snd_hda_codec snd_hwdep snd_seq snd_seq_device dcdbas
 hid_logitech_hidpp snd_pcm serio_raw lpc_ich mfd_core i2c_i801
 snd_timer snd parport_pc soundcore mei_me tpm_tis parport tpm wmi mei shpchp
 acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc hid_logitech_dj i915
 e1000e i2c_algo_bit video drm_kms_helper drm ptp pps_core ata_generic
 pata_acpi
 CPU: 0 PID: 23460 Comm: systemd-udevd Not tainted 3.19.5-200.fc21.x86_64 #1
 Hardware name: Dell Inc. OptiPlex 760 /0R230R, BIOS A05 
08/17/2009
 task: 880026e29360 ti: 880030b64000 task.ti: 880030b64000
 RIP: 0010:[a0669141]  [a0669141] dib7000p_attach+0x11/0xa0 
[dib7000p]
 RSP: 0018:880030b679f8  EFLAGS: 00010202
 RAX: 0010 RBX: 880047b71278 RCX: 0001
 RDX:  RSI: a06707d8 RDI: 0010
 RBP: 880030b679f8 R08: 81119fe0 R09: 00017840
 R10: 810b07e4 R11: 0246 R12: 
 R13: 0010 R14: 880047b71308 R15: 880047b71398
 FS:  7f005f380880() GS:88007c80() knlGS:
 CS:  0010 DS:  ES:  CR0: 8005003b
 CR2: 0080 CR3: 4e38d000 CR4: 000407f0
 Stack:
 880030b67a28 a06430fb 880047b71278 880047b71880
 880047b71278  880030b67a68 a0626872
 880047b7  880047b71280 880047b7
 Call Trace:
 [a06430fb] stk7700d_frontend_attach+0x3b/0x200 [dvb_usb_dib0700]
 [a0626872] dvb_usb_adapter_frontend_init+0xe2/0x1a0 [dvb_usb]
 [a0625ab7] dvb_usb_device_init+0x517/0x6f0 [dvb_usb]
 [a063f40e] dib0700_probe+0x6e/0x100 [dvb_usb_dib0700]
 [817731e6] ? mutex_lock+0x16/0x40
 [815598fb] usb_probe_interface+0x1bb/0x300
 [814c9e13] driver_probe_device+0xa3/0x400
 [814ca24b] __driver_attach+0x9b/0xa0
 [814ca1b0] ? __device_attach+0x40/0x40
 [814c7ad3] bus_for_each_dev+0x73/0xc0
 [814c987e] driver_attach+0x1e/0x20
 [814c9430] bus_add_driver+0x180/0x250
 [814caa44] driver_register+0x64/0xf0
 [81557ff2] usb_register_driver+0x82/0x160
 [a0663000] ? 0xa0663000
 [a066301e] dib0700_driver_init+0x1e/0x1000 [dvb_usb_dib0700]
 [81002148] do_one_initcall+0xd8/0x210
 [811fbb59] ? kmem_cache_alloc_trace+0x1a9/0x230
 [8111f053] ? load_module+0x2203/0x2800
 [8111f08b] load_module+0x223b/0x2800
 [8111a810] ? store_uevent+0x70/0x70
 [8111f71d] SyS_init_module+0xcd/0x120
 [817752c9] system_call_fastpath+0x12/0x17
 Code: 8b 87 18 03 00 00 55 48 89 e5 48 05 68 16 00 00 5d c3 0f 1f 84 00 00 00 
00 00 66 66 66 66 90 55 48 85 ff 48 89 f8 48 89 e5 74 7f 48 c7 47 70 b0 a9 66 
a0 48 c7 47 68 40 9a 66 a0 48 c7 47 30 90 
 RIP  [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
 RSP 880030b679f8
 CR2: 0080
 ---[ end trace 288814f44b010d3e ]---

Set it properly.

Signed-off-by: Laura Abbott labb...@fedoraproject.org
---
 drivers/media/usb/dvb-usb/dib0700_devices.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c 
b/drivers/media/usb/dvb-usb/dib0700_devices.c
index d7d55a2..8030670 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -3944,6 +3944,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
 
DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
}},
+   .size_of_priv = sizeof(struct 
dib0700_adapter_state),
}, {
.num_frontends = 1,
.fe = {{
@@ -3956,6 +3957,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
 
DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
}},
+  

Re: [PATCH] [media] Fix more regressions in some dib0700 based devices

2015-05-15 Thread Thomas Reitmayr
Hi Laura,
a similar patch (including one more missing initialization) was
submitted days ago and already sent to linux-stable, see
https://www.mail-archive.com/linux-media@vger.kernel.org/msg87882.html
and
http://article.gmane.org/gmane.linux.kernel.stable/135755
Best regards,
-Thomas


Am Freitag, den 15.05.2015, 10:42 -0700 schrieb Laura Abbott:
 Several more devices need need to have size_of_priv set, otherwise
 we oops:
 
  DVB: registering new adapter (Hauppauge Nova-TD Stick/Elgato Eye-TV 
 Diversity)
  BUG: unable to handle kernel NULL pointer dereference at 0080
  IP: [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
  PGD 0 
  Oops: 0002 [#1] SMP 
  Modules linked in: dib7000p dvb_usb_dib0700(+) dib7000m dib0090 dib0070
  dib3000mc dibx000_common dvb_usb dvb_core rc_core bnep bluetooth rfkill
  ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat
  ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat
  nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle 
 ip6table_security
  ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4
  nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle 
 iptable_security
  iptable_raw snd_hda_codec_analog snd_hda_codec_generic joydev coretemp kvm
  snd_hda_intel iTCO_wdt gpio_ich iTCO_vendor_support ppdev snd_hda_controller
  dell_wmi sparse_keymap snd_hda_codec snd_hwdep snd_seq snd_seq_device dcdbas
  hid_logitech_hidpp snd_pcm serio_raw lpc_ich mfd_core i2c_i801
  snd_timer snd parport_pc soundcore mei_me tpm_tis parport tpm wmi mei shpchp
  acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc hid_logitech_dj i915
  e1000e i2c_algo_bit video drm_kms_helper drm ptp pps_core ata_generic
  pata_acpi
  CPU: 0 PID: 23460 Comm: systemd-udevd Not tainted 3.19.5-200.fc21.x86_64 #1
  Hardware name: Dell Inc. OptiPlex 760 /0R230R, BIOS A05 
 08/17/2009
  task: 880026e29360 ti: 880030b64000 task.ti: 880030b64000
  RIP: 0010:[a0669141]  [a0669141] 
 dib7000p_attach+0x11/0xa0 [dib7000p]
  RSP: 0018:880030b679f8  EFLAGS: 00010202
  RAX: 0010 RBX: 880047b71278 RCX: 0001
  RDX:  RSI: a06707d8 RDI: 0010
  RBP: 880030b679f8 R08: 81119fe0 R09: 00017840
  R10: 810b07e4 R11: 0246 R12: 
  R13: 0010 R14: 880047b71308 R15: 880047b71398
  FS:  7f005f380880() GS:88007c80() knlGS:
  CS:  0010 DS:  ES:  CR0: 8005003b
  CR2: 0080 CR3: 4e38d000 CR4: 000407f0
  Stack:
  880030b67a28 a06430fb 880047b71278 880047b71880
  880047b71278  880030b67a68 a0626872
  880047b7  880047b71280 880047b7
  Call Trace:
  [a06430fb] stk7700d_frontend_attach+0x3b/0x200 [dvb_usb_dib0700]
  [a0626872] dvb_usb_adapter_frontend_init+0xe2/0x1a0 [dvb_usb]
  [a0625ab7] dvb_usb_device_init+0x517/0x6f0 [dvb_usb]
  [a063f40e] dib0700_probe+0x6e/0x100 [dvb_usb_dib0700]
  [817731e6] ? mutex_lock+0x16/0x40
  [815598fb] usb_probe_interface+0x1bb/0x300
  [814c9e13] driver_probe_device+0xa3/0x400
  [814ca24b] __driver_attach+0x9b/0xa0
  [814ca1b0] ? __device_attach+0x40/0x40
  [814c7ad3] bus_for_each_dev+0x73/0xc0
  [814c987e] driver_attach+0x1e/0x20
  [814c9430] bus_add_driver+0x180/0x250
  [814caa44] driver_register+0x64/0xf0
  [81557ff2] usb_register_driver+0x82/0x160
  [a0663000] ? 0xa0663000
  [a066301e] dib0700_driver_init+0x1e/0x1000 [dvb_usb_dib0700]
  [81002148] do_one_initcall+0xd8/0x210
  [811fbb59] ? kmem_cache_alloc_trace+0x1a9/0x230
  [8111f053] ? load_module+0x2203/0x2800
  [8111f08b] load_module+0x223b/0x2800
  [8111a810] ? store_uevent+0x70/0x70
  [8111f71d] SyS_init_module+0xcd/0x120
  [817752c9] system_call_fastpath+0x12/0x17
  Code: 8b 87 18 03 00 00 55 48 89 e5 48 05 68 16 00 00 5d c3 0f 1f 84 00 00 
 00 00 00 66 66 66 66 90 55 48 85 ff 48 89 f8 48 89 e5 74 7f 48 c7 47 70 b0 
 a9 66 a0 48 c7 47 68 40 9a 66 a0 48 c7 47 30 90 
  RIP  [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
  RSP 880030b679f8
  CR2: 0080
  ---[ end trace 288814f44b010d3e ]---
 
 Set it properly.
 
 Signed-off-by: Laura Abbott labb...@fedoraproject.org
 ---
  drivers/media/usb/dvb-usb/dib0700_devices.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c 
 b/drivers/media/usb/dvb-usb/dib0700_devices.c
 index d7d55a2..8030670 100644
 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c
 +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
 @@ -3944,6 +3944,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
  
   

Re: [PATCH] [media] Fix more regressions in some dib0700 based devices

2015-05-15 Thread Laura Abbott

On 05/15/2015 12:47 PM, Thomas Reitmayr wrote:

Hi Laura,
a similar patch (including one more missing initialization) was submitted days 
ago and already sent to linux-stable, see
https://www.mail-archive.com/linux-media@vger.kernel.org/msg87882.html
and
http://article.gmane.org/gmane.linux.kernel.stable/135755
Best regards,
-Thomas



Excellent, I hadn't seen that. Thanks for the pointer.


Am Freitag, den 15.05.2015, 10:42 -0700 schrieb Laura Abbott:

Several more devices need need to have size_of_priv set, otherwise
we oops:

  DVB: registering new adapter (Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity)
  BUG: unable to handle kernel NULL pointer dereference at 0080
  IP: [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
  PGD 0
  Oops: 0002 [#1] SMP
  Modules linked in: dib7000p dvb_usb_dib0700(+) dib7000m dib0090 dib0070
  dib3000mc dibx000_common dvb_usb dvb_core rc_core bnep bluetooth rfkill
  ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat
  ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat
  nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security
  ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4
  nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security
  iptable_raw snd_hda_codec_analog snd_hda_codec_generic joydev coretemp kvm
  snd_hda_intel iTCO_wdt gpio_ich iTCO_vendor_support ppdev snd_hda_controller
  dell_wmi sparse_keymap snd_hda_codec snd_hwdep snd_seq snd_seq_device dcdbas
  hid_logitech_hidpp snd_pcm serio_raw lpc_ich mfd_core i2c_i801
  snd_timer snd parport_pc soundcore mei_me tpm_tis parport tpm wmi mei shpchp
  acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc hid_logitech_dj i915
  e1000e i2c_algo_bit video drm_kms_helper drm ptp pps_core ata_generic
  pata_acpi
  CPU: 0 PID: 23460 Comm: systemd-udevd Not tainted 3.19.5-200.fc21.x86_64 #1
  Hardware name: Dell Inc. OptiPlex 760 /0R230R, BIOS A05 
08/17/2009
  task: 880026e29360 ti: 880030b64000 task.ti: 880030b64000
  RIP: 0010:[a0669141]  [a0669141] 
dib7000p_attach+0x11/0xa0 [dib7000p]
  RSP: 0018:880030b679f8  EFLAGS: 00010202
  RAX: 0010 RBX: 880047b71278 RCX: 0001
  RDX:  RSI: a06707d8 RDI: 0010
  RBP: 880030b679f8 R08: 81119fe0 R09: 00017840
  R10: 810b07e4 R11: 0246 R12: 
  R13: 0010 R14: 880047b71308 R15: 880047b71398
  FS:  7f005f380880() GS:88007c80() knlGS:
  CS:  0010 DS:  ES:  CR0: 8005003b
  CR2: 0080 CR3: 4e38d000 CR4: 000407f0
  Stack:
  880030b67a28 a06430fb 880047b71278 880047b71880
  880047b71278  880030b67a68 a0626872
  880047b7  880047b71280 880047b7
  Call Trace:
  [a06430fb] stk7700d_frontend_attach+0x3b/0x200 [dvb_usb_dib0700]
  [a0626872] dvb_usb_adapter_frontend_init+0xe2/0x1a0 [dvb_usb]
  [a0625ab7] dvb_usb_device_init+0x517/0x6f0 [dvb_usb]
  [a063f40e] dib0700_probe+0x6e/0x100 [dvb_usb_dib0700]
  [817731e6] ? mutex_lock+0x16/0x40
  [815598fb] usb_probe_interface+0x1bb/0x300
  [814c9e13] driver_probe_device+0xa3/0x400
  [814ca24b] __driver_attach+0x9b/0xa0
  [814ca1b0] ? __device_attach+0x40/0x40
  [814c7ad3] bus_for_each_dev+0x73/0xc0
  [814c987e] driver_attach+0x1e/0x20
  [814c9430] bus_add_driver+0x180/0x250
  [814caa44] driver_register+0x64/0xf0
  [81557ff2] usb_register_driver+0x82/0x160
  [a0663000] ? 0xa0663000
  [a066301e] dib0700_driver_init+0x1e/0x1000 [dvb_usb_dib0700]
  [81002148] do_one_initcall+0xd8/0x210
  [811fbb59] ? kmem_cache_alloc_trace+0x1a9/0x230
  [8111f053] ? load_module+0x2203/0x2800
  [8111f08b] load_module+0x223b/0x2800
  [8111a810] ? store_uevent+0x70/0x70
  [8111f71d] SyS_init_module+0xcd/0x120
  [817752c9] system_call_fastpath+0x12/0x17
  Code: 8b 87 18 03 00 00 55 48 89 e5 48 05 68 16 00 00 5d c3 0f 1f 84 00 00 00 00 00 
66 66 66 66 90 55 48 85 ff 48 89 f8 48 89 e5 74 7f 48 c7 47 70 b0 a9 66 a0 48 
c7 47 68 40 9a 66 a0 48 c7 47 30 90
  RIP  [a0669141] dib7000p_attach+0x11/0xa0 [dib7000p]
  RSP 880030b679f8
  CR2: 0080
  ---[ end trace 288814f44b010d3e ]---

Set it properly.

Signed-off-by: Laura Abbott labb...@fedoraproject.org  
mailto:labb...@fedoraproject.org
---
  drivers/media/usb/dvb-usb/dib0700_devices.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c 
b/drivers/media/usb/dvb-usb/dib0700_devices.c
index d7d55a2..8030670 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ 

Re: [PATCH v2 1/2] gspca: sn9c2028: Add support for Genius Videocam Live v2

2015-05-15 Thread Hans de Goede

Hi Vasily

On 15-05-15 17:55, Vasily Khoruzhick wrote:

Ping?


Sorry for being a bit slow on this one, v2 looks good. I'll queue it up for
merging into 4.2 as soon as I find some time to work on this,

Regards,

Hans



On Fri, Apr 24, 2015 at 10:04 AM, Vasily Khoruzhick anars...@gmail.com wrote:

This cam seems to return different values on long commands, so make status check
in sn9c2028_long_command() more tolerant. Anyway, read value isn't used anywhere
later.

Signed-off-by: Vasily Khoruzhick anars...@gmail.com
---
v2: update commit message to explain change in sn9c2028_long_command()

  drivers/media/usb/gspca/sn9c2028.c | 120 -
  1 file changed, 119 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/gspca/sn9c2028.c 
b/drivers/media/usb/gspca/sn9c2028.c
index 39b6b2e..317b02c 100644
--- a/drivers/media/usb/gspca/sn9c2028.c
+++ b/drivers/media/usb/gspca/sn9c2028.c
@@ -2,6 +2,7 @@
   * SN9C2028 library
   *
   * Copyright (C) 2009 Theodore Kilgore kilg...@auburn.edu
+ * Copyright (C) 2015 Vasily Khoruzhick anars...@gmail.com
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
@@ -128,7 +129,7 @@ static int sn9c2028_long_command(struct gspca_dev 
*gspca_dev, u8 *command)
 status = -1;
 for (i = 0; i  256  status  2; i++)
 status = sn9c2028_read1(gspca_dev);
-   if (status != 2) {
+   if (status  0) {
 pr_err(long command status read error %d\n, status);
 return (status  0) ? status : -EIO;
 }
@@ -178,6 +179,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
 case 0x7005:
 PDEBUG(D_PROBE, Genius Smart 300 camera);
 break;
+   case 0x7003:
+   PDEBUG(D_PROBE, Genius Videocam Live v2);
+   break;
 case 0x8000:
 PDEBUG(D_PROBE, DC31VC);
 break;
@@ -530,6 +534,116 @@ static int start_genius_cam(struct gspca_dev *gspca_dev)
   ARRAY_SIZE(genius_start_commands));
  }

+static int start_genius_videocam_live(struct gspca_dev *gspca_dev)
+{
+   int r;
+   struct sd *sd = (struct sd *) gspca_dev;
+   struct init_command genius_vcam_live_start_commands[] = {
+   {{0x0c, 0x01, 0x00, 0x00, 0x00, 0x00}, 0},
+   {{0x16, 0x01, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x25, 0x01, 0x16, 0x00, 0x00}, 4},
+   {{0x13, 0x26, 0x01, 0x12, 0x00, 0x00}, 4},
+
+   {{0x13, 0x28, 0x01, 0x0e, 0x00, 0x00}, 4},
+   {{0x13, 0x27, 0x01, 0x20, 0x00, 0x00}, 4},
+   {{0x13, 0x29, 0x01, 0x22, 0x00, 0x00}, 4},
+   {{0x13, 0x2c, 0x01, 0x02, 0x00, 0x00}, 4},
+   {{0x13, 0x2d, 0x01, 0x02, 0x00, 0x00}, 4},
+   {{0x13, 0x2e, 0x01, 0x09, 0x00, 0x00}, 4},
+   {{0x13, 0x2f, 0x01, 0x07, 0x00, 0x00}, 4},
+   {{0x11, 0x20, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x21, 0x2d, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x22, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x23, 0x03, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x10, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x11, 0x64, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x12, 0x00, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x13, 0x91, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x14, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x15, 0x20, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x16, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x17, 0x60, 0x00, 0x00, 0x00}, 4},
+   {{0x1c, 0x20, 0x00, 0x2d, 0x00, 0x00}, 4},
+   {{0x13, 0x20, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x21, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x22, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x23, 0x01, 0x01, 0x00, 0x00}, 4},
+   {{0x13, 0x24, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x25, 0x01, 0x16, 0x00, 0x00}, 4},
+   {{0x13, 0x26, 0x01, 0x12, 0x00, 0x00}, 4},
+   {{0x13, 0x27, 0x01, 0x20, 0x00, 0x00}, 4},
+   {{0x13, 0x28, 0x01, 0x0e, 0x00, 0x00}, 4},
+   {{0x13, 0x29, 0x01, 0x22, 0x00, 0x00}, 4},
+   {{0x13, 0x2a, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x2b, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x2c, 0x01, 0x02, 0x00, 0x00}, 4},
+   {{0x13, 0x2d, 0x01, 0x02, 0x00, 0x00}, 4},
+   {{0x13, 0x2e, 0x01, 0x09, 0x00, 0x00}, 4},
+   {{0x13, 0x2f, 0x01, 0x07, 0x00, 0x00}, 4},
+   {{0x12, 0x34, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x13, 0x34, 0x01, 0xa1, 0x00, 0x00}, 4},
+   {{0x13, 0x35, 0x01, 0x00, 0x00, 0x00}, 4},
+   {{0x11, 0x01, 

[PATCH] radio-bcm2048: Enable access to automute and ctrl registers

2015-05-15 Thread Pali Rohár
From: maxx m...@spaceboyz.net

This enables access to automute function of the chip via sysfs and
gives direct access to FM_AUDIO_CTRL0/1 registers, also via sysfs. I
don't think this is so important but helps in developing radio scanner
apps.

Patch writen by m...@spaceboyz.net

Signed-off-by: Pali Rohár pali.ro...@gmail.com
Cc: m...@spaceboyz.net
---
 drivers/staging/media/bcm2048/radio-bcm2048.c |   96 +
 1 file changed, 96 insertions(+)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 1482d4b..8f9ba7b 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -826,6 +826,93 @@ static int bcm2048_get_mute(struct bcm2048_device *bdev)
return err;
 }
 
+static int bcm2048_set_automute(struct bcm2048_device *bdev, u8 automute)
+{
+   int err;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_send_command(bdev, BCM2048_I2C_FM_AUDIO_PAUSE, automute);
+
+   mutex_unlock(bdev-mutex);
+   return err;
+}
+
+static int bcm2048_get_automute(struct bcm2048_device *bdev)
+{
+   int err;
+   u8 value;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_recv_command(bdev, BCM2048_I2C_FM_AUDIO_PAUSE, value);
+
+   mutex_unlock(bdev-mutex);
+
+   if (!err)
+   err = value;
+
+   return err;
+}
+
+static int bcm2048_set_ctrl0(struct bcm2048_device *bdev, u8 value)
+{
+   int err;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_send_command(bdev, BCM2048_I2C_FM_AUDIO_CTRL0, value);
+
+   mutex_unlock(bdev-mutex);
+   return err;
+}
+
+static int bcm2048_set_ctrl1(struct bcm2048_device *bdev, u8 value)
+{
+   int err;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_send_command(bdev, BCM2048_I2C_FM_AUDIO_CTRL1, value);
+
+   mutex_unlock(bdev-mutex);
+   return err;
+}
+
+static int bcm2048_get_ctrl0(struct bcm2048_device *bdev)
+{
+   int err;
+   u8 value;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_recv_command(bdev, BCM2048_I2C_FM_AUDIO_CTRL0, value);
+
+   mutex_unlock(bdev-mutex);
+
+   if (!err)
+   err = value;
+
+   return err;
+}
+
+static int bcm2048_get_ctrl1(struct bcm2048_device *bdev)
+{
+   int err;
+   u8 value;
+
+   mutex_lock(bdev-mutex);
+
+   err = bcm2048_recv_command(bdev, BCM2048_I2C_FM_AUDIO_CTRL1, value);
+
+   mutex_unlock(bdev-mutex);
+
+   if (!err)
+   err = value;
+
+   return err;
+}
+
 static int bcm2048_set_audio_route(struct bcm2048_device *bdev, u8 route)
 {
int err;
@@ -2058,6 +2145,9 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,  
\
 
 DEFINE_SYSFS_PROPERTY(power_state, unsigned, int, %u, 0)
 DEFINE_SYSFS_PROPERTY(mute, unsigned, int, %u, 0)
+DEFINE_SYSFS_PROPERTY(automute, unsigned, int, %x, 0)
+DEFINE_SYSFS_PROPERTY(ctrl0, unsigned, int, %x, 0)
+DEFINE_SYSFS_PROPERTY(ctrl1, unsigned, int, %x, 0)
 DEFINE_SYSFS_PROPERTY(audio_route, unsigned, int, %u, 0)
 DEFINE_SYSFS_PROPERTY(dac_output, unsigned, int, %u, 0)
 
@@ -2095,6 +2185,12 @@ static struct device_attribute attrs[] = {
bcm2048_power_state_write),
__ATTR(mute, S_IRUGO | S_IWUSR, bcm2048_mute_read,
bcm2048_mute_write),
+   __ATTR(automute, S_IRUGO | S_IWUSR, bcm2048_automute_read,
+   bcm2048_automute_write),
+   __ATTR(ctrl0, S_IRUGO | S_IWUSR, bcm2048_ctrl0_read,
+   bcm2048_ctrl0_write),
+   __ATTR(ctrl1, S_IRUGO | S_IWUSR, bcm2048_ctrl1_read,
+   bcm2048_ctrl1_write),
__ATTR(audio_route, S_IRUGO | S_IWUSR, bcm2048_audio_route_read,
bcm2048_audio_route_write),
__ATTR(dac_output, S_IRUGO | S_IWUSR, bcm2048_dac_output_read,
-- 
1.7.9.5

--
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] radio-bcm2048: Fix region selection

2015-05-15 Thread Pali Rohár
From: maxx m...@spaceboyz.net

This actually fixes region selection for BCM2048 FM receiver. To select
the japanese FM-band an additional bit in FM_CTRL register needs to be
set. This might not sound so important but it enables at least me to
listen to some 'very interesting' radio transmission below normal
FM-band.

Patch writen by m...@spaceboyz.net

Signed-off-by: Pali Rohár pali.ro...@gmail.com
Cc: m...@spaceboyz.net
---
 drivers/staging/media/bcm2048/radio-bcm2048.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index aeb6c3c..1482d4b 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -739,7 +739,20 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, 
u8 region)
return -EINVAL;
 
mutex_lock(bdev-mutex);
+
bdev-region_info = region_configs[region];
+
+   bdev-cache_fm_ctrl = ~BCM2048_BAND_SELECT;
+   if (region  2) {
+   bdev-cache_fm_ctrl |= BCM2048_BAND_SELECT;
+   err = bcm2048_send_command(bdev, BCM2048_I2C_FM_CTRL,
+   bdev-cache_fm_ctrl);
+   if (err) {
+   mutex_unlock(bdev-mutex);
+   goto done;
+   }
+   }
+
mutex_unlock(bdev-mutex);
 
if (bdev-frequency  region_configs[region].bottom_frequency ||
-- 
1.7.9.5

--
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