[PATCH] documentation: DocBook/media : Fix typo in dvbproperty.xml

2013-03-24 Thread Masanari Iida
Correct spelling typos.

Signed-off-by: Masanari Iida standby2...@gmail.com
---
 Documentation/DocBook/media/dvb/dvbproperty.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml 
b/Documentation/DocBook/media/dvb/dvbproperty.xml
index 4a5eaee..31dc4df 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -1,6 +1,6 @@
 section id=FE_GET_SET_PROPERTY
 titleconstantFE_GET_PROPERTY/FE_SET_PROPERTY/constant/title
-paraThis section describes the DVB version 5 extention of the DVB-API, also
+paraThis section describes the DVB version 5 extension of the DVB-API, also
 called S2API, as this API were added to provide support for DVB-S2. It was
 designed to be able to replace the old frontend API. Yet, the DISEQC and
 the capability ioctls weren't implemented yet via the new way./para
@@ -952,7 +952,7 @@ enum fe_interleaving {
paraMeasures the amount of bits received before the inner 
code block, during the same period as
link 
linkend=DTV-STAT-PRE-ERROR-BIT-COUNTconstantDTV_STAT_PRE_ERROR_BIT_COUNT/constant/link
 measurement was taken./para
paraIt should be noticed that this measurement can be smaller 
than the total amount of bits on the transport stream,
- as the frontend may need to manually restart the 
measurement, loosing some data between each measurement interval./para
+ as the frontend may need to manually restart the 
measurement, losing some data between each measurement interval./para
paraThis measurement is monotonically increased, as the 
frontend gets more bit count measurements.
  The frontend may reset it when a channel/transponder is 
tuned./para
paraPossible scales for this metric are:/para
@@ -981,7 +981,7 @@ enum fe_interleaving {
paraMeasures the amount of bits received after the inner 
coding, during the same period as
link 
linkend=DTV-STAT-POST-ERROR-BIT-COUNTconstantDTV_STAT_POST_ERROR_BIT_COUNT/constant/link
 measurement was taken./para
paraIt should be noticed that this measurement can be smaller 
than the total amount of bits on the transport stream,
- as the frontend may need to manually restart the 
measurement, loosing some data between each measurement interval./para
+ as the frontend may need to manually restart the 
measurement, losing some data between each measurement interval./para
paraThis measurement is monotonically increased, as the 
frontend gets more bit count measurements.
  The frontend may reset it when a channel/transponder is 
tuned./para
paraPossible scales for this metric are:/para
-- 
1.8.2.135.g7b592fa

--
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.10] Remove core DV_PRESET support.

2013-03-24 Thread Hans Verkuil
There are no more drivers that use the obsolete DV_PRESET API, so remove it
from the V4L2 core code and the V4L2 documentation.

This is unchanged from the last 5 patches in this original RFC patch series:

http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/60904

except for the new last patch that updates the version number and documents
the 3.10 changes.

Regards,

Hans


The following changes since commit 69aa6f4ec669b9121057cc9e32cb10b5f744f6d6:

  [media] drivers: staging: davinci_vpfe: use resource_size() (2013-03-23 
11:35:44 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git remove-preset

for you to fetch changes up to 181baa6d806a6d145dea2bfefde369ac75914172:

  DocBook/media/v4l: Update version number and document 3.10 changes. 
(2013-03-24 10:10:05 +0100)


Hans Verkuil (6):
  v4l2-common: remove obsolete v4l_fill_dv_preset_info
  v4l2-subdev: remove obsolete dv_preset ops.
  v4l2 core: remove the obsolete dv_preset support.
  DocBook/media/v4l: remove the documentation of the obsolete dv_preset API.
  videodev2.h: remove obsolete DV_PRESET API.
  DocBook/media/v4l: Update version number and document 3.10 changes.

 Documentation/DocBook/media/v4l/common.xml |   14 ---
 Documentation/DocBook/media/v4l/compat.xml |   17 +++-
 Documentation/DocBook/media/v4l/v4l2.xml   |   15 ++-
 Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml |  240 
--
 Documentation/DocBook/media/v4l/vidioc-enuminput.xml   |5 -
 Documentation/DocBook/media/v4l/vidioc-enumoutput.xml  |5 -
 Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml |  113 
--
 Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml |   78 
---
 drivers/media/v4l2-core/v4l2-common.c  |   47 -
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c  |4 -
 drivers/media/v4l2-core/v4l2-dev.c |4 -
 drivers/media/v4l2-core/v4l2-ioctl.c   |   27 +-
 include/media/v4l2-common.h|1 -
 include/media/v4l2-ioctl.h |9 --
 include/media/v4l2-subdev.h|   16 
 include/uapi/linux/videodev2.h |   54 ---
 16 files changed, 29 insertions(+), 620 deletions(-)
 delete mode 100644 Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
 delete mode 100644 Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
 delete mode 100644 Documentation/DocBook/media/v4l/vidioc-query-dv-preset.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


[GIT PULL FOR v3.10] vivi: add v4l2_ctrl_modify_range test case.

2013-03-24 Thread Hans Verkuil
Very few drivers use v4l2_ctrl_modify_range. Add it to vivi so applications
can use vivi to test their support for v4l2_ctrl_modify_range.

Regards,

Hans

The following changes since commit 69aa6f4ec669b9121057cc9e32cb10b5f744f6d6:

  [media] drivers: staging: davinci_vpfe: use resource_size() (2013-03-23 
11:35:44 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git vivi

for you to fetch changes up to e9117118f71945f60c95371bea4260ba37f3a5b1:

  vivi: add v4l2_ctrl_modify_range test case. (2013-03-24 10:20:21 +0100)


Hans Verkuil (1):
  vivi: add v4l2_ctrl_modify_range test case.

 drivers/media/platform/vivi.c |9 +
 1 file changed, 9 insertions(+)
--
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: [REVIEWv2 PATCH 4/6] v4l2: add const to argument of write-only s_register ioctl.

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 18 Mar 2013 15:12:03 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 This ioctl is defined as IOW, so pass the argument as const.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
 Acked-by: Lad, Prabhakar prabhakar.cse...@gmail.com

...

 diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c 
 b/drivers/media/pci/ivtv/ivtv-ioctl.c
 index 080f179..15e08aa 100644
 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c
 +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
 @@ -711,49 +711,50 @@ static int ivtv_g_chip_ident(struct file *file, void 
 *fh, struct v4l2_dbg_chip_i
  }
  
  #ifdef CONFIG_VIDEO_ADV_DEBUG
 -static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
 +static volatile u8 __iomem *ivtv_itvc_start(struct ivtv *itv,
 + const struct v4l2_dbg_register *regs)
  {
 - struct v4l2_dbg_register *regs = arg;
 - volatile u8 __iomem *reg_start;
 -
 - if (!capable(CAP_SYS_ADMIN))
 - return -EPERM;
   if (regs-reg = IVTV_REG_OFFSET  regs-reg  IVTV_REG_OFFSET + 
 IVTV_REG_SIZE)
 - reg_start = itv-reg_mem - IVTV_REG_OFFSET;
 - else if (itv-has_cx23415  regs-reg = IVTV_DECODER_OFFSET 
 + return itv-reg_mem - IVTV_REG_OFFSET;
 + if (itv-has_cx23415  regs-reg = IVTV_DECODER_OFFSET 
   regs-reg  IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
 - reg_start = itv-dec_mem - IVTV_DECODER_OFFSET;
 - else if (regs-reg  IVTV_ENCODER_SIZE)
 - reg_start = itv-enc_mem;
 - else
 - return -EINVAL;
 -
 - regs-size = 4;
 - if (cmd == VIDIOC_DBG_G_REGISTER)
 - regs-val = readl(regs-reg + reg_start);
 - else
 - writel(regs-val, regs-reg + reg_start);
 - return 0;
 + return itv-dec_mem - IVTV_DECODER_OFFSET;
 + if (regs-reg  IVTV_ENCODER_SIZE)
 + return itv-enc_mem;
 + return NULL;
  }
  
  static int ivtv_g_register(struct file *file, void *fh, struct 
 v4l2_dbg_register *reg)
  {
   struct ivtv *itv = fh2id(fh)-itv;
  
 - if (v4l2_chip_match_host(reg-match))
 - return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
 + if (v4l2_chip_match_host(reg-match)) {
 + volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
 +
 + if (reg_start == NULL)
 + return -EINVAL;
 + reg-size = 4;
 + reg-val = readl(reg-reg + reg_start);
 + return 0;
 + }
   /* TODO: subdev errors should not be ignored, this should become a
  subdev helper function. */
   ivtv_call_all(itv, core, g_register, reg);
   return 0;
  }
  
 -static int ivtv_s_register(struct file *file, void *fh, struct 
 v4l2_dbg_register *reg)
 +static int ivtv_s_register(struct file *file, void *fh, const struct 
 v4l2_dbg_register *reg)
  {
   struct ivtv *itv = fh2id(fh)-itv;
  
 - if (v4l2_chip_match_host(reg-match))
 - return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
 + if (v4l2_chip_match_host(reg-match)) {
 + volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
 +
 + if (reg_start == NULL)
 + return -EINVAL;
 + writel(reg-val, reg-reg + reg_start);
 + return 0;
 + }
   /* TODO: subdev errors should not be ignored, this should become a
  subdev helper function. */
   ivtv_call_all(itv, core, s_register, reg);

I'm not convinced about the changes on ivtv. Why do you need volatile there?

Also, as you're doing changes there that aren't that trivial, and are not
just add const argument, please split those non-trivial ivtv changes into
a separate patch, and properly describe what you're doing and why.

Also, having it on a separate patch helps to bisect it, if it ever brings
any problem.

-- 

Cheers,
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: [REVIEWv2 PATCH 4/6] v4l2: add const to argument of write-only s_register ioctl.

2013-03-24 Thread Hans Verkuil
On Sun March 24 2013 11:07:03 Mauro Carvalho Chehab wrote:
 Em Mon, 18 Mar 2013 15:12:03 +0100
 Hans Verkuil hverk...@xs4all.nl escreveu:
 
  From: Hans Verkuil hans.verk...@cisco.com
  
  This ioctl is defined as IOW, so pass the argument as const.
  
  Signed-off-by: Hans Verkuil hans.verk...@cisco.com
  Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
  Acked-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 
 ...
 
  diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c 
  b/drivers/media/pci/ivtv/ivtv-ioctl.c
  index 080f179..15e08aa 100644
  --- a/drivers/media/pci/ivtv/ivtv-ioctl.c
  +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
  @@ -711,49 +711,50 @@ static int ivtv_g_chip_ident(struct file *file, void 
  *fh, struct v4l2_dbg_chip_i
   }
   
   #ifdef CONFIG_VIDEO_ADV_DEBUG
  -static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
  +static volatile u8 __iomem *ivtv_itvc_start(struct ivtv *itv,
  +   const struct v4l2_dbg_register *regs)
   {
  -   struct v4l2_dbg_register *regs = arg;
  -   volatile u8 __iomem *reg_start;
  -
  -   if (!capable(CAP_SYS_ADMIN))
  -   return -EPERM;
  if (regs-reg = IVTV_REG_OFFSET  regs-reg  IVTV_REG_OFFSET + 
  IVTV_REG_SIZE)
  -   reg_start = itv-reg_mem - IVTV_REG_OFFSET;
  -   else if (itv-has_cx23415  regs-reg = IVTV_DECODER_OFFSET 
  +   return itv-reg_mem - IVTV_REG_OFFSET;
  +   if (itv-has_cx23415  regs-reg = IVTV_DECODER_OFFSET 
  regs-reg  IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
  -   reg_start = itv-dec_mem - IVTV_DECODER_OFFSET;
  -   else if (regs-reg  IVTV_ENCODER_SIZE)
  -   reg_start = itv-enc_mem;
  -   else
  -   return -EINVAL;
  -
  -   regs-size = 4;
  -   if (cmd == VIDIOC_DBG_G_REGISTER)
  -   regs-val = readl(regs-reg + reg_start);
  -   else
  -   writel(regs-val, regs-reg + reg_start);
  -   return 0;
  +   return itv-dec_mem - IVTV_DECODER_OFFSET;
  +   if (regs-reg  IVTV_ENCODER_SIZE)
  +   return itv-enc_mem;
  +   return NULL;
   }
   
   static int ivtv_g_register(struct file *file, void *fh, struct 
  v4l2_dbg_register *reg)
   {
  struct ivtv *itv = fh2id(fh)-itv;
   
  -   if (v4l2_chip_match_host(reg-match))
  -   return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
  +   if (v4l2_chip_match_host(reg-match)) {
  +   volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
  +
  +   if (reg_start == NULL)
  +   return -EINVAL;
  +   reg-size = 4;
  +   reg-val = readl(reg-reg + reg_start);
  +   return 0;
  +   }
  /* TODO: subdev errors should not be ignored, this should become a
 subdev helper function. */
  ivtv_call_all(itv, core, g_register, reg);
  return 0;
   }
   
  -static int ivtv_s_register(struct file *file, void *fh, struct 
  v4l2_dbg_register *reg)
  +static int ivtv_s_register(struct file *file, void *fh, const struct 
  v4l2_dbg_register *reg)
   {
  struct ivtv *itv = fh2id(fh)-itv;
   
  -   if (v4l2_chip_match_host(reg-match))
  -   return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
  +   if (v4l2_chip_match_host(reg-match)) {
  +   volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
  +
  +   if (reg_start == NULL)
  +   return -EINVAL;
  +   writel(reg-val, reg-reg + reg_start);
  +   return 0;
  +   }
  /* TODO: subdev errors should not be ignored, this should become a
 subdev helper function. */
  ivtv_call_all(itv, core, s_register, reg);
 
 I'm not convinced about the changes on ivtv. Why do you need volatile there?

It was using volatile before and as I told Laurent as well, I don't want to
mix changing volatile removal with adding const support.

 Also, as you're doing changes there that aren't that trivial, and are not
 just add const argument, please split those non-trivial ivtv changes into
 a separate patch, and properly describe what you're doing and why.

OK, and I'll add a separate patch in that case to remove the volatile part.

 Also, having it on a separate patch helps to bisect it, if it ever brings
 any problem.

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


Re: [REVIEWv2 PATCH 5/6] v4l2-ioctl: simplify debug code.

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 18 Mar 2013 15:12:04 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 The core debug code can now be simplified since all the write-only ioctls are
 now const and will not modify the data they pass to the drivers.
 
 So instead of logging write-only ioctls before the driver is called this can
 now be done afterwards, which is cleaner when it comes to error reporting as
 well.
 
 This also fixes a logic error in the debugging code where there was one 'else'
 too many.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Patch looks ok, but I won't apply right now, as it seems it depends on 4/6.

Regards,
Mauro

 ---
  drivers/media/v4l2-core/v4l2-ioctl.c |   15 ++-
  1 file changed, 2 insertions(+), 13 deletions(-)
 
 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
 b/drivers/media/v4l2-core/v4l2-ioctl.c
 index 2abd13a..b3fe148 100644
 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
 +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
 @@ -2147,11 +2147,6 @@ static long __video_do_ioctl(struct file *file,
   }
  
   write_only = _IOC_DIR(cmd) == _IOC_WRITE;
 - if (write_only  debug  V4L2_DEBUG_IOCTL) {
 - v4l_printk_ioctl(video_device_node_name(vfd), cmd);
 - pr_cont(: );
 - info-debug(arg, write_only);
 - }
   if (info-flags  INFO_FL_STD) {
   typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
   const void *p = vfd-ioctl_ops;
 @@ -2170,16 +2165,10 @@ static long __video_do_ioctl(struct file *file,
  
  done:
   if (debug) {
 - if (write_only  debug  V4L2_DEBUG_IOCTL) {
 - if (ret  0)
 - printk(KERN_DEBUG %s: error %ld\n,
 - video_device_node_name(vfd), ret);
 - return ret;
 - }
   v4l_printk_ioctl(video_device_node_name(vfd), cmd);
   if (ret  0)
 - pr_cont(: error %ld\n, ret);
 - else if (debug == V4L2_DEBUG_IOCTL)
 + pr_cont(: error %ld, ret);
 + if (debug == V4L2_DEBUG_IOCTL)
   pr_cont(\n);
   else if (_IOC_DIR(cmd) == _IOC_NONE)
   info-debug(arg, write_only);


-- 

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


[GIT PULL FOR v3.10] v4l2: add const to argument of write-only s_register ioctl.

2013-03-24 Thread Hans Verkuil
It's identical to:

http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/62324

except it's rebased and as requested by Mauro the cx18 and ivtv changes have
been split off to their own patches.

I did not change the volatile part, changing that is a completely separate
issue and it's still not clear to me whether I can safely remove volatile.
If someone knows a reliable source that tells me that volatile is really
not needed in combination with __iomem, then I can make another patch removing
that, but then I will need to do some testing as well.

Regards,

Hans

The following changes since commit 27d5a87cf4b44cbcbd0f4706a433e4a68d496236:

  [media] v4l2-ioctl: add precision when printing names (2013-03-24 07:13:54 
-0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git const2

for you to fetch changes up to bdc960ffda5c9517e5171b4063e5d4f83eb5a9b5:

  v4l2-ioctl: simplify debug code. (2013-03-24 11:30:32 +0100)


Hans Verkuil (4):
  v4l2: add const to argument of write-only s_register ioctl.
  cx18: add const to argument of write-only s_register ioctl.
  ivtv: add const to argument of write-only s_register ioctl.
  v4l2-ioctl: simplify debug code.

 drivers/media/dvb-frontends/au8522_decoder.c|2 +-
 drivers/media/i2c/ad9389b.c |2 +-
 drivers/media/i2c/adv7183.c |2 +-
 drivers/media/i2c/adv7604.c |2 +-
 drivers/media/i2c/ak881x.c  |2 +-
 drivers/media/i2c/cs5345.c  |2 +-
 drivers/media/i2c/cx25840/cx25840-core.c|2 +-
 drivers/media/i2c/m52790.c  |2 +-
 drivers/media/i2c/mt9m032.c |2 +-
 drivers/media/i2c/mt9v011.c |2 +-
 drivers/media/i2c/ov7670.c  |2 +-
 drivers/media/i2c/saa7115.c |2 +-
 drivers/media/i2c/saa7127.c |2 +-
 drivers/media/i2c/saa717x.c |2 +-
 drivers/media/i2c/soc_camera/mt9m001.c  |2 +-
 drivers/media/i2c/soc_camera/mt9m111.c  |2 +-
 drivers/media/i2c/soc_camera/mt9t031.c  |2 +-
 drivers/media/i2c/soc_camera/mt9t112.c  |2 +-
 drivers/media/i2c/soc_camera/mt9v022.c  |2 +-
 drivers/media/i2c/soc_camera/ov2640.c   |2 +-
 drivers/media/i2c/soc_camera/ov5642.c   |2 +-
 drivers/media/i2c/soc_camera/ov6650.c   |2 +-
 drivers/media/i2c/soc_camera/ov772x.c   |2 +-
 drivers/media/i2c/soc_camera/ov9640.c   |2 +-
 drivers/media/i2c/soc_camera/ov9740.c   |2 +-
 drivers/media/i2c/soc_camera/rj54n1cb0c.c   |2 +-
 drivers/media/i2c/soc_camera/tw9910.c   |2 +-
 drivers/media/i2c/ths7303.c |2 +-
 drivers/media/i2c/tvp5150.c |2 +-
 drivers/media/i2c/tvp7002.c |2 +-
 drivers/media/i2c/upd64031a.c   |2 +-
 drivers/media/i2c/upd64083.c|2 +-
 drivers/media/i2c/vs6624.c  |2 +-
 drivers/media/pci/bt8xx/bttv-driver.c   |5 ++---
 drivers/media/pci/cx18/cx18-av-core.c   |2 +-
 drivers/media/pci/cx18/cx18-ioctl.c |   36 
++--
 drivers/media/pci/cx23885/cx23885-ioctl.c   |9 +++--
 drivers/media/pci/cx23885/cx23885-ioctl.h   |2 +-
 drivers/media/pci/cx23885/cx23888-ir.c  |2 +-
 drivers/media/pci/cx25821/cx25821-video.c   |2 +-
 drivers/media/pci/cx25821/cx25821-video.h   |2 +-
 drivers/media/pci/cx88/cx88-video.c |2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c |   51 
++-
 drivers/media/pci/saa7134/saa7134-video.c   |2 +-
 drivers/media/pci/saa7146/mxb.c |3 +--
 drivers/media/pci/saa7164/saa7164-encoder.c |2 +-
 drivers/media/platform/blackfin/bfin_capture.c  |2 +-
 drivers/media/platform/davinci/vpbe_display.c   |2 +-
 drivers/media/platform/davinci/vpif_capture.c   |3 ++-
 drivers/media/platform/davinci/vpif_display.c   |3 ++-
 drivers/media/platform/marvell-ccic/mcam-core.c |2 +-
 drivers/media/platform/sh_vou.c |2 +-
 drivers/media/platform/soc_camera/soc_camera.c  |2 +-
 drivers/media/usb/au0828/au0828-video.c |2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c   |2 +-
 drivers/media/usb/cx231xx/cx231xx.h |2 +-
 drivers/media/usb/em28xx/em28xx-video.c |2 +-
 drivers/media/usb/gspca/gspca.c |2 +-
 drivers/media/usb/gspca/gspca.h |8 +---
 drivers/media/usb/gspca/pac7302.c   |2 +-
 drivers/media/usb/gspca/sn9c20x.c

Re: [PATCH v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Mauro Carvalho Chehab
Em Sat, 23 Mar 2013 18:27:08 +0100
Frank Schäfer fschaefer@googlemail.com escreveu:

 The webcam SpeedLink VAD Laplace (em2765 + ov2640) uses a special algorithm
 for i2c communication with the sensor, which is connected to a second i2c bus.
 
 We don't know yet how to find out which devices support/use it.
 It's very likely used by all em25xx and em276x+ bridges.
 Tests with other em28xx chips (em2820, em2882/em2883) show, that this
 algorithm always succeeds there although no slave device is connected.
 
 The algorithm likely also works for real i2c client devices (OV2640 uses 
 SCCB),
 because the Windows driver seems to use it for probing Samsung and Kodak
 sensors.
 
 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-cards.c |8 +-
  drivers/media/usb/em28xx/em28xx-i2c.c   |  229 
 +--
  drivers/media/usb/em28xx/em28xx.h   |   10 +-
  3 Dateien geändert, 205 Zeilen hinzugefügt(+), 42 Zeilen entfernt(-)
 
 diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
 b/drivers/media/usb/em28xx/em28xx-cards.c
 index cb7cdd3..033b6cb 100644
 --- a/drivers/media/usb/em28xx/em28xx-cards.c
 +++ b/drivers/media/usb/em28xx/em28xx-cards.c
 @@ -3139,15 +3139,19 @@ static int em28xx_init_dev(struct em28xx *dev, struct 
 usb_device *udev,
   rt_mutex_init(dev-i2c_bus_lock);
  
   /* register i2c bus 0 */
 - retval = em28xx_i2c_register(dev, 0);
 + if (dev-board.is_em2800)
 + retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
 + else
 + retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
   if (retval  0) {
   em28xx_errdev(%s: em28xx_i2c_register bus 0 - error [%d]!\n,
   __func__, retval);
   goto unregister_dev;
   }
  
 + /* register i2c bus 1 */
   if (dev-def_i2c_bus) {
 - retval = em28xx_i2c_register(dev, 1);
 + retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX);
   if (retval  0) {
   em28xx_errdev(%s: em28xx_i2c_register bus 1 - error 
 [%d]!\n,
   __func__, retval);
 diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
 b/drivers/media/usb/em28xx/em28xx-i2c.c
 index 9e2fa41..ab14ac3 100644
 --- a/drivers/media/usb/em28xx/em28xx-i2c.c
 +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
 @@ -5,6 +5,7 @@
 Markus Rechberger mrechber...@gmail.com
 Mauro Carvalho Chehab mche...@infradead.org
 Sascha Sommer saschasom...@freenet.de
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.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
 @@ -274,6 +275,176 @@ static int em28xx_i2c_check_for_device(struct em28xx 
 *dev, u16 addr)
  }
  
  /*
 + * em25xx_bus_B_send_bytes
 + * write bytes to the i2c device
 + */
 +static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 +u16 len)
 +{
 + int ret;
 +
 + if (len  1 || len  64)
 + return -EOPNOTSUPP;
 + /* NOTE: limited by the USB ctrl message constraints
 +  * Zero length reads always succeed, even if no device is connected */
 +
 + /* Set register and write value */
 + ret = dev-em28xx_write_regs_req(dev, 0x06, addr, buf, len);
 + /* NOTE:
 +  * 0 byte writes always succeed, even if no device is connected. */
 + if (ret != len) {
 + if (ret  0) {
 + em28xx_warn(writing to i2c device at 0x%x failed 
 + (error=%i)\n, addr, ret);
 + return ret;
 + } else {
 + em28xx_warn(%i bytes write to i2c device at 0x%x 
 + requested, but %i bytes written\n,
 + len, addr, ret);
 + return -EIO;
 + }
 + }
 + /* Check success */
 + ret = dev-em28xx_read_reg_req(dev, 0x08, 0x);
 + /* NOTE: the only error we've seen so far is
 +  * 0x01 when the slave device is not present */
 + if (ret == 0x00) {
 + return len;
 + } else if (ret  0) {
 + return -ENODEV;
 + }
 +
 + return ret;
 + /* NOTE: With chips which do not support this operation,
 +  * it seems to succeed ALWAYS ! (even if no device connected) */
 +}
 +
 +/*
 + * em25xx_bus_B_recv_bytes
 + * read bytes from the i2c device
 + */
 +static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 +u16 len)
 +{
 + int ret;
 +
 + if (len  1 || len  64)
 + return -EOPNOTSUPP;
 + /* NOTE: limited by the USB ctrl message constraints
 +  * Zero length reads always succeed, even if no device is connected */


Please stick with Kernel's coding 

[GIT PULL FOR v3.10] v4l2: add const to argument of write-only s_register ioctl

2013-03-24 Thread Hans Verkuil
It's identical to:

http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/62324

except it's rebased and the ivtv changes have been simplified.

Regards,

Hans

The following changes since commit 27d5a87cf4b44cbcbd0f4706a433e4a68d496236:

  [media] v4l2-ioctl: add precision when printing names (2013-03-24 07:13:54 
-0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git const2

for you to fetch changes up to 5481fb6abf48e71f544e917f7ba33e3902f147f6:

  v4l2-ioctl: simplify debug code. (2013-03-24 12:29:05 +0100)


Hans Verkuil (3):
  ivtv: prepare ivtv for adding const to s_register.
  v4l2: add const to argument of write-only s_register ioctl.
  v4l2-ioctl: simplify debug code.

 drivers/media/dvb-frontends/au8522_decoder.c|2 +-
 drivers/media/i2c/ad9389b.c |2 +-
 drivers/media/i2c/adv7183.c |2 +-
 drivers/media/i2c/adv7604.c |2 +-
 drivers/media/i2c/ak881x.c  |2 +-
 drivers/media/i2c/cs5345.c  |2 +-
 drivers/media/i2c/cx25840/cx25840-core.c|2 +-
 drivers/media/i2c/m52790.c  |2 +-
 drivers/media/i2c/mt9m032.c |2 +-
 drivers/media/i2c/mt9v011.c |2 +-
 drivers/media/i2c/ov7670.c  |2 +-
 drivers/media/i2c/saa7115.c |2 +-
 drivers/media/i2c/saa7127.c |2 +-
 drivers/media/i2c/saa717x.c |2 +-
 drivers/media/i2c/soc_camera/mt9m001.c  |2 +-
 drivers/media/i2c/soc_camera/mt9m111.c  |2 +-
 drivers/media/i2c/soc_camera/mt9t031.c  |2 +-
 drivers/media/i2c/soc_camera/mt9t112.c  |2 +-
 drivers/media/i2c/soc_camera/mt9v022.c  |2 +-
 drivers/media/i2c/soc_camera/ov2640.c   |2 +-
 drivers/media/i2c/soc_camera/ov5642.c   |2 +-
 drivers/media/i2c/soc_camera/ov6650.c   |2 +-
 drivers/media/i2c/soc_camera/ov772x.c   |2 +-
 drivers/media/i2c/soc_camera/ov9640.c   |2 +-
 drivers/media/i2c/soc_camera/ov9740.c   |2 +-
 drivers/media/i2c/soc_camera/rj54n1cb0c.c   |2 +-
 drivers/media/i2c/soc_camera/tw9910.c   |2 +-
 drivers/media/i2c/ths7303.c |2 +-
 drivers/media/i2c/tvp5150.c |2 +-
 drivers/media/i2c/tvp7002.c |2 +-
 drivers/media/i2c/upd64031a.c   |2 +-
 drivers/media/i2c/upd64083.c|2 +-
 drivers/media/i2c/vs6624.c  |2 +-
 drivers/media/pci/bt8xx/bttv-driver.c   |5 ++---
 drivers/media/pci/cx18/cx18-av-core.c   |2 +-
 drivers/media/pci/cx18/cx18-ioctl.c |   36 
++--
 drivers/media/pci/cx23885/cx23885-ioctl.c   |9 +++--
 drivers/media/pci/cx23885/cx23885-ioctl.h   |2 +-
 drivers/media/pci/cx23885/cx23888-ir.c  |2 +-
 drivers/media/pci/cx25821/cx25821-video.c   |2 +-
 drivers/media/pci/cx25821/cx25821-video.h   |2 +-
 drivers/media/pci/cx88/cx88-video.c |2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c |   33 
++---
 drivers/media/pci/saa7134/saa7134-video.c   |2 +-
 drivers/media/pci/saa7146/mxb.c |3 +--
 drivers/media/pci/saa7164/saa7164-encoder.c |2 +-
 drivers/media/platform/blackfin/bfin_capture.c  |2 +-
 drivers/media/platform/davinci/vpbe_display.c   |2 +-
 drivers/media/platform/davinci/vpif_capture.c   |3 ++-
 drivers/media/platform/davinci/vpif_display.c   |3 ++-
 drivers/media/platform/marvell-ccic/mcam-core.c |2 +-
 drivers/media/platform/sh_vou.c |2 +-
 drivers/media/platform/soc_camera/soc_camera.c  |2 +-
 drivers/media/usb/au0828/au0828-video.c |2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c   |2 +-
 drivers/media/usb/cx231xx/cx231xx.h |2 +-
 drivers/media/usb/em28xx/em28xx-video.c |2 +-
 drivers/media/usb/gspca/gspca.c |2 +-
 drivers/media/usb/gspca/gspca.h |8 +---
 drivers/media/usb/gspca/pac7302.c   |2 +-
 drivers/media/usb/gspca/sn9c20x.c   |2 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c |2 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.h |2 +-
 drivers/media/usb/pvrusb2/pvrusb2-v4l2.c|2 +-
 drivers/media/usb/stk1160/stk1160-v4l.c |2 +-
 drivers/media/usb/usbvision/usbvision-video.c   |2 +-
 drivers/media/v4l2-core/v4l2-ioctl.c|   17 +++--
 include/media/v4l2-ioctl.h  |2 +-
 include/media/v4l2-subdev.h |2 

Re: [PATCH v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Mauro Carvalho Chehab
Em Sat, 23 Mar 2013 18:27:08 +0100
Frank Schäfer fschaefer@googlemail.com escreveu:

 The webcam SpeedLink VAD Laplace (em2765 + ov2640) uses a special algorithm
 for i2c communication with the sensor, which is connected to a second i2c bus.
 
 We don't know yet how to find out which devices support/use it.
 It's very likely used by all em25xx and em276x+ bridges.
 Tests with other em28xx chips (em2820, em2882/em2883) show, that this
 algorithm always succeeds there although no slave device is connected.
 
 The algorithm likely also works for real i2c client devices (OV2640 uses 
 SCCB),
 because the Windows driver seems to use it for probing Samsung and Kodak
 sensors.
 
 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-cards.c |8 +-
  drivers/media/usb/em28xx/em28xx-i2c.c   |  229 
 +--
  drivers/media/usb/em28xx/em28xx.h   |   10 +-
  3 Dateien geändert, 205 Zeilen hinzugefügt(+), 42 Zeilen entfernt(-)
 
 diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
 b/drivers/media/usb/em28xx/em28xx-cards.c
 index cb7cdd3..033b6cb 100644
 --- a/drivers/media/usb/em28xx/em28xx-cards.c
 +++ b/drivers/media/usb/em28xx/em28xx-cards.c
 @@ -3139,15 +3139,19 @@ static int em28xx_init_dev(struct em28xx *dev, struct 
 usb_device *udev,
   rt_mutex_init(dev-i2c_bus_lock);
  
   /* register i2c bus 0 */
 - retval = em28xx_i2c_register(dev, 0);
 + if (dev-board.is_em2800)
 + retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
 + else
 + retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
   if (retval  0) {
   em28xx_errdev(%s: em28xx_i2c_register bus 0 - error [%d]!\n,
   __func__, retval);
   goto unregister_dev;
   }
  
 + /* register i2c bus 1 */
   if (dev-def_i2c_bus) {
 - retval = em28xx_i2c_register(dev, 1);
 + retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX);
   if (retval  0) {
   em28xx_errdev(%s: em28xx_i2c_register bus 1 - error 
 [%d]!\n,
   __func__, retval);
 diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
 b/drivers/media/usb/em28xx/em28xx-i2c.c
 index 9e2fa41..ab14ac3 100644
 --- a/drivers/media/usb/em28xx/em28xx-i2c.c
 +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
 @@ -5,6 +5,7 @@
 Markus Rechberger mrechber...@gmail.com
 Mauro Carvalho Chehab mche...@infradead.org
 Sascha Sommer saschasom...@freenet.de
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.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
 @@ -274,6 +275,176 @@ static int em28xx_i2c_check_for_device(struct em28xx 
 *dev, u16 addr)
  }
  
  /*
 + * em25xx_bus_B_send_bytes
 + * write bytes to the i2c device
 + */
 +static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 +u16 len)
 +{
 + int ret;
 +
 + if (len  1 || len  64)
 + return -EOPNOTSUPP;
 + /* NOTE: limited by the USB ctrl message constraints
 +  * Zero length reads always succeed, even if no device is connected */
 +
 + /* Set register and write value */
 + ret = dev-em28xx_write_regs_req(dev, 0x06, addr, buf, len);
 + /* NOTE:
 +  * 0 byte writes always succeed, even if no device is connected. */

You already noticed it on the previous note.

 + if (ret != len) {
 + if (ret  0) {
 + em28xx_warn(writing to i2c device at 0x%x failed 
 + (error=%i)\n, addr, ret);
 + return ret;
 + } else {
 + em28xx_warn(%i bytes write to i2c device at 0x%x 
 + requested, but %i bytes written\n,
 + len, addr, ret);
 + return -EIO;
 + }
 + }
 + /* Check success */
 + ret = dev-em28xx_read_reg_req(dev, 0x08, 0x);
 + /* NOTE: the only error we've seen so far is
 +  * 0x01 when the slave device is not present */
 + if (ret == 0x00) {

Please simplify. just use:
if (!ret)

 + return len;
 + } else if (ret  0) {
 + return -ENODEV;
 + }
 +
 + return ret;
 + /* NOTE: With chips which do not support this operation,
 +  * it seems to succeed ALWAYS ! (even if no device connected) */

Sorry, but I didn't get what you're trying to explain here. What are those
em25xx chips that don't support this operation?

 +}
 +
 +/*
 + * em25xx_bus_B_recv_bytes
 + * read bytes from the i2c device
 + */
 +static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 +u16 len)
 +{
 + int ret;
 +
 + 

Re: [PATCH v2 5/5] em28xx: write output frame resolution to regs 0x34+0x35 for em25xx family bridges

2013-03-24 Thread Mauro Carvalho Chehab
Em Sat, 23 Mar 2013 18:27:12 +0100
Frank Schäfer fschaefer@googlemail.com escreveu:

 The Windows driver writes the output resolution to registers 0x34 (width / 16)
 and 0x35 (height / 16) always.
 We don't know yet what these registers are used for.
 
 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-core.c |7 +++
  drivers/media/usb/em28xx/em28xx-reg.h  |6 ++
  2 Dateien geändert, 13 Zeilen hinzugefügt(+)
 
 diff --git a/drivers/media/usb/em28xx/em28xx-core.c 
 b/drivers/media/usb/em28xx/em28xx-core.c
 index 7b9f76b..0ce6b0f 100644
 --- a/drivers/media/usb/em28xx/em28xx-core.c
 +++ b/drivers/media/usb/em28xx/em28xx-core.c
 @@ -766,6 +766,13 @@ static void em28xx_capture_area_set(struct em28xx *dev, 
 u8 hstart, u8 vstart,
   em28xx_write_regs(dev, EM28XX_R1E_CWIDTH, cwidth, 1);
   em28xx_write_regs(dev, EM28XX_R1F_CHEIGHT, cheight, 1);
   em28xx_write_regs(dev, EM28XX_R1B_OFLOW, overflow, 1);
 +
 + if (dev-is_em25xx) {
 + em28xx_write_reg(dev, 0x34, width  4);
 + em28xx_write_reg(dev, 0x35, height  4);
 + }
 + /* FIXME: function/meaning of these registers ? */
 + /* FIXME: */

Please move those comments to be _before_ the code you're commenting.

E. g. something like:

if (dev-is_em25xx) {
/*
 * FIXME:
 *  - function/meaning of these registers are unknown;
 *  - align width+height to multiples of 4 ?! 
 */
em28xx_write_reg(dev, 0x34, width  4);
em28xx_write_reg(dev, 0x35, height  4);
}


  }
  
  static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v)
 diff --git a/drivers/media/usb/em28xx/em28xx-reg.h 
 b/drivers/media/usb/em28xx/em28xx-reg.h
 index 1b0ecd6..e08982a 100644
 --- a/drivers/media/usb/em28xx/em28xx-reg.h
 +++ b/drivers/media/usb/em28xx/em28xx-reg.h
 @@ -167,6 +167,12 @@
  
  #define EM28XX_R34_VBI_START_H   0x34
  #define EM28XX_R35_VBI_START_V   0x35
 +/* NOTE: the EM276x (and EM25xx, EM277x/8x ?) (camera bridges) use these
 + * registers for a different unknown purpose.
 + *   = register 0x34 is set to capture width / 16
 + *   = register 0x35 is set to capture height / 16
 + */
 +
  #define EM28XX_R36_VBI_WIDTH 0x36
  #define EM28XX_R37_VBI_HEIGHT0x37
  


-- 

Cheers,
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 v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Frank Schäfer
Am 24.03.2013 12:38, schrieb Mauro Carvalho Chehab:
 Em Sat, 23 Mar 2013 18:27:08 +0100
 Frank Schäfer fschaefer@googlemail.com escreveu:

 The webcam SpeedLink VAD Laplace (em2765 + ov2640) uses a special algorithm
 for i2c communication with the sensor, which is connected to a second i2c 
 bus.

 We don't know yet how to find out which devices support/use it.
 It's very likely used by all em25xx and em276x+ bridges.
 Tests with other em28xx chips (em2820, em2882/em2883) show, that this
 algorithm always succeeds there although no slave device is connected.

 The algorithm likely also works for real i2c client devices (OV2640 uses 
 SCCB),
 because the Windows driver seems to use it for probing Samsung and Kodak
 sensors.

 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-cards.c |8 +-
  drivers/media/usb/em28xx/em28xx-i2c.c   |  229 
 +--
  drivers/media/usb/em28xx/em28xx.h   |   10 +-
  3 Dateien geändert, 205 Zeilen hinzugefügt(+), 42 Zeilen entfernt(-)

 diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
 b/drivers/media/usb/em28xx/em28xx-cards.c
 index cb7cdd3..033b6cb 100644
 --- a/drivers/media/usb/em28xx/em28xx-cards.c
 +++ b/drivers/media/usb/em28xx/em28xx-cards.c
 @@ -3139,15 +3139,19 @@ static int em28xx_init_dev(struct em28xx *dev, 
 struct usb_device *udev,
  rt_mutex_init(dev-i2c_bus_lock);
  
  /* register i2c bus 0 */
 -retval = em28xx_i2c_register(dev, 0);
 +if (dev-board.is_em2800)
 +retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
 +else
 +retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
  if (retval  0) {
  em28xx_errdev(%s: em28xx_i2c_register bus 0 - error [%d]!\n,
  __func__, retval);
  goto unregister_dev;
  }
  
 +/* register i2c bus 1 */
  if (dev-def_i2c_bus) {
 -retval = em28xx_i2c_register(dev, 1);
 +retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX);
  if (retval  0) {
  em28xx_errdev(%s: em28xx_i2c_register bus 1 - error 
 [%d]!\n,
  __func__, retval);
 diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
 b/drivers/media/usb/em28xx/em28xx-i2c.c
 index 9e2fa41..ab14ac3 100644
 --- a/drivers/media/usb/em28xx/em28xx-i2c.c
 +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
 @@ -5,6 +5,7 @@
Markus Rechberger mrechber...@gmail.com
Mauro Carvalho Chehab mche...@infradead.org
Sascha Sommer saschasom...@freenet.de
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.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
 @@ -274,6 +275,176 @@ static int em28xx_i2c_check_for_device(struct em28xx 
 *dev, u16 addr)
  }
  
  /*
 + * em25xx_bus_B_send_bytes
 + * write bytes to the i2c device
 + */
 +static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 +   u16 len)
 +{
 +int ret;
 +
 +if (len  1 || len  64)
 +return -EOPNOTSUPP;
 +/* NOTE: limited by the USB ctrl message constraints
 + * Zero length reads always succeed, even if no device is connected */
 +
 +/* Set register and write value */
 +ret = dev-em28xx_write_regs_req(dev, 0x06, addr, buf, len);
 +/* NOTE:
 + * 0 byte writes always succeed, even if no device is connected. */
 You already noticed it on the previous note.

Yes. ;)


 +if (ret != len) {
 +if (ret  0) {
 +em28xx_warn(writing to i2c device at 0x%x failed 
 +(error=%i)\n, addr, ret);
 +return ret;
 +} else {
 +em28xx_warn(%i bytes write to i2c device at 0x%x 
 +requested, but %i bytes written\n,
 +len, addr, ret);
 +return -EIO;
 +}
 +}
 +/* Check success */
 +ret = dev-em28xx_read_reg_req(dev, 0x08, 0x);
 +/* NOTE: the only error we've seen so far is
 + * 0x01 when the slave device is not present */
 +if (ret == 0x00) {
   Please simplify. just use:
   if (!ret)

I would like to keep it as is because I think it better expresses the
purposes of this check. I also used 0x00 instead of 0 on purpose.
ret is a mixed value which is negative on errors and contains the data
bytes (0x00 to 0xff) on success.
Ok, in this specific case all other values are covered with a single
(ret  0) check, but take a look at the comment and the em28xx-algo
functions where we check for 0x10, too.


 +return len;
 +} else if (ret  0) {
 +return -ENODEV;
 +}
 +
 +return ret;
 +/* NOTE: With chips which do not support this operation,
 + 

Re: [PATCH v2 5/5] em28xx: write output frame resolution to regs 0x34+0x35 for em25xx family bridges

2013-03-24 Thread Frank Schäfer
Am 24.03.2013 12:44, schrieb Mauro Carvalho Chehab:
 Em Sat, 23 Mar 2013 18:27:12 +0100
 Frank Schäfer fschaefer@googlemail.com escreveu:

 The Windows driver writes the output resolution to registers 0x34 (width / 
 16)
 and 0x35 (height / 16) always.
 We don't know yet what these registers are used for.

 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-core.c |7 +++
  drivers/media/usb/em28xx/em28xx-reg.h  |6 ++
  2 Dateien geändert, 13 Zeilen hinzugefügt(+)

 diff --git a/drivers/media/usb/em28xx/em28xx-core.c 
 b/drivers/media/usb/em28xx/em28xx-core.c
 index 7b9f76b..0ce6b0f 100644
 --- a/drivers/media/usb/em28xx/em28xx-core.c
 +++ b/drivers/media/usb/em28xx/em28xx-core.c
 @@ -766,6 +766,13 @@ static void em28xx_capture_area_set(struct em28xx *dev, 
 u8 hstart, u8 vstart,
  em28xx_write_regs(dev, EM28XX_R1E_CWIDTH, cwidth, 1);
  em28xx_write_regs(dev, EM28XX_R1F_CHEIGHT, cheight, 1);
  em28xx_write_regs(dev, EM28XX_R1B_OFLOW, overflow, 1);
 +
 +if (dev-is_em25xx) {
 +em28xx_write_reg(dev, 0x34, width  4);
 +em28xx_write_reg(dev, 0x35, height  4);
 +}
 +/* FIXME: function/meaning of these registers ? */
 +/* FIXME: align width+height to multiples of 4 ?! */
 Please move those comments to be _before_ the code you're commenting.

 E. g. something like:

   if (dev-is_em25xx) {
   /*
* FIXME:
*  - function/meaning of these registers are unknown;
*  - align width+height to multiples of 4 ?! 
*/
   em28xx_write_reg(dev, 0x34, width  4);
   em28xx_write_reg(dev, 0x35, height  4);
   }

Ok, no problem.

Frank


  }
  
  static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v)
 diff --git a/drivers/media/usb/em28xx/em28xx-reg.h 
 b/drivers/media/usb/em28xx/em28xx-reg.h
 index 1b0ecd6..e08982a 100644
 --- a/drivers/media/usb/em28xx/em28xx-reg.h
 +++ b/drivers/media/usb/em28xx/em28xx-reg.h
 @@ -167,6 +167,12 @@
  
  #define EM28XX_R34_VBI_START_H  0x34
  #define EM28XX_R35_VBI_START_V  0x35
 +/* NOTE: the EM276x (and EM25xx, EM277x/8x ?) (camera bridges) use these
 + * registers for a different unknown purpose.
 + *   = register 0x34 is set to capture width / 16
 + *   = register 0x35 is set to capture height / 16
 + */
 +
  #define EM28XX_R36_VBI_WIDTH0x36
  #define EM28XX_R37_VBI_HEIGHT   0x37
  


--
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/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Frank Schäfer
...

Am 24.03.2013 12:22, schrieb Mauro Carvalho Chehab:
 Please stick with Kernel's coding style, as described on
 Documentation/CodingStyle and on the common practices.

 Multi-line comments are like:
   /*
* Foo
* bar
*/

 There are also a bunch of scripts/checkpatch.pl complains for this patch: 

 WARNING: please, no spaces at the start of a line
 #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com$

 WARNING: space prohibited between function name and open parenthesis '('
 #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com

 WARNING: Avoid CamelCase: Copyright
 #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com

 WARNING: Avoid CamelCase: Frank
 #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com

 WARNING: Avoid CamelCase: Sch
 #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com

The space prohibited between function name and open parenthesis and
CamelCase warnings are pure nonsense.
The spaces at start of a line thing applies to the whole and
licences/copyright headers of the em28xx driver.
If you think we should change that - fine - but it really doesn't make
sense to do this as part of this patch series.


 WARNING: quoted string split across lines
 #97: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:298:
 + em28xx_warn(writing to i2c device at 0x%x failed 
 + (error=%i)\n, addr, ret);

 WARNING: quoted string split across lines
 #101: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:302:
 + em28xx_warn(%i bytes write to i2c device at 0x%x 
 + requested, but %i bytes written\n,

Yes, these two are discussible.
AFAIK, strings should not be split across lines to avoid breaking
grepping for strings.
In this case I decided for the 80 characters per line rule instead,
because grepping for strings containing placeholders IMHO doesn't make
much sense.
We do exactly the same in the existing i2c functions.

 WARNING: braces {} are not necessary for any arm of this statement
 #110: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:311:
 + if (ret == 0x00) {
 [...]
 + } else if (ret  0) {
 [...]

 WARNING: braces {} are not necessary for any arm of this statement
 #156: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:357:
 + if (ret == 0x00) {
 [...]
 + } else if (ret  0) {
 [...]

 WARNING: braces {} are not necessary for any arm of this statement
 #190: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:391:
 + if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM28XX) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM2800) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) {
 [...]

The patch perfectly matches the kernel coding style rules here !?
What do you want me to change ?
Do you really think the code looks better without some of these braces ?

 WARNING: printk() should include KERN_ facility level
 #199: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:400:
 + printk( no device\n);

I only moved this piece of code around, but yes, that should really be
fixed !

 WARNING: braces {} are not necessary for any arm of this statement
 #211: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:412:
 + if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM28XX) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM2800) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) {
 [...]

See above.

 WARNING: printk() should include KERN_ facility level
 #220: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:421:
 + printk( %02x, msg.buf[byte]);

Same here, should indeed be fixed.

 WARNING: braces {} are not necessary for any arm of this statement
 #236: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:437:
 + if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM28XX) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM2800) {
 [...]
 + } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) {
 [...]

See above.

Except for the two printk warnings, please tell me which changes you
would like to see exactly.
I will send an updated version of this series then.

Regards,
Frank

 total: 0 errors, 14 warnings, 333 lines checked

 Your patch has style problems, please review.

 If any of these errors are false positives, please report
 them to the maintainer, see CHECKPATCH in MAINTAINERS.

 PS.: I'll write a separate email if I find any non-coding style issue on
 this patch series. Won't comment anymore about coding style, as I'm
 assuming that you'll be fixing it on the other patches of this series
 if needed.

 Regards,
 Mauro

--
To unsubscribe from this list: 

Re: Fwd: Delock 61959

2013-03-24 Thread Antti Palosaari
Maybe it is em28xx + DRX-K + tda18271 based. There is few such devices 
already supported by em28xx driver. First device to test is 1b80:e425 
MaxMedia UB425-TC. Just replace USB ID 0xe425 with 0xe1cc, compile and 
test. There is some other devices too, especially all those which are 
using drx-k.


regards
Antti


On 03/24/2013 03:51 AM, David wrote:

Hi there,

today i got a new DVB-T / DVB-C USB Stick but as far as i can see on
the web it is not (yet) supported.

Is this currently being worked on or is there something i can do to
get it working?

Here is the lsusb output:

Device Descriptor:
   bLength18
   bDescriptorType 1
   bcdUSB   2.00
   bDeviceClass0 (Defined at Interface level)
   bDeviceSubClass 0
   bDeviceProtocol 0
   bMaxPacketSize064
   idVendor   0x1b80 Afatech
   idProduct  0xe1cc
   bcdDevice1.00
   iManufacturer   0
   iProduct1 USB 2875 Device
   iSerial 0
   bNumConfigurations  1


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




--
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 v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Mauro Carvalho Chehab
Em Sun, 24 Mar 2013 14:04:47 +0100
Frank Schäfer fschaefer@googlemail.com escreveu:

 ...
 
 Am 24.03.2013 12:22, schrieb Mauro Carvalho Chehab:
  Please stick with Kernel's coding style, as described on
  Documentation/CodingStyle and on the common practices.
 
  Multi-line comments are like:
  /*
   * Foo
   * bar
   */
 
  There are also a bunch of scripts/checkpatch.pl complains for this patch: 
 
  WARNING: please, no spaces at the start of a line
  #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com$
 
  WARNING: space prohibited between function name and open parenthesis '('
  #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com
 
  WARNING: Avoid CamelCase: Copyright
  #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com
 
  WARNING: Avoid CamelCase: Frank
  #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com
 
  WARNING: Avoid CamelCase: Sch
  #69: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:8:
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.com
 
 The space prohibited between function name and open parenthesis and
 CamelCase warnings are pure nonsense.
 The spaces at start of a line thing applies to the whole and
 licences/copyright headers of the em28xx driver.
 If you think we should change that - fine - but it really doesn't make
 sense to do this as part of this patch series.

The above complaints are because checkpatch doesn't like comments like:

/*
 FOO
 */

As it should be, instead:

 /*
  * FOO
  */

You can safely ignore all the above. It is not worth to fix the comments
there.

 
 
  WARNING: quoted string split across lines
  #97: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:298:
  +   em28xx_warn(writing to i2c device at 0x%x failed 
  +   (error=%i)\n, addr, ret);
 
  WARNING: quoted string split across lines
  #101: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:302:
  +   em28xx_warn(%i bytes write to i2c device at 0x%x 
  +   requested, but %i bytes written\n,
 
 Yes, these two are discussible.
 AFAIK, strings should not be split across lines to avoid breaking
 grepping for strings.
 In this case I decided for the 80 characters per line rule instead,
 because grepping for strings containing placeholders IMHO doesn't make
 much sense.
 We do exactly the same in the existing i2c functions.

The not break strings rule is stronger. When the code was written, 
80 cols were a mandatory rule (and there was no checkpatch.pl). After
lots of discussions (with took years), we're all set about two points:

- the 80 cols is a soft limit;

- strings should not be broken. Linus explicitly pointed on that
time that he doesn't want to see strings broken, as it makes harder to 
grep for the printed messages when needed.

 
  WARNING: braces {} are not necessary for any arm of this statement
  #110: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:311:
  +   if (ret == 0x00) {
  [...]
  +   } else if (ret  0) {
  [...]
 
  WARNING: braces {} are not necessary for any arm of this statement
  #156: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:357:
  +   if (ret == 0x00) {
  [...]
  +   } else if (ret  0) {
  [...]
 
  WARNING: braces {} are not necessary for any arm of this statement
  #190: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:391:
  +   if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM28XX) {
  [...]
  +   } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM2800) {
  [...]
  +   } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) {
  [...]
 
 The patch perfectly matches the kernel coding style rules here !?
 What do you want me to change ?
 Do you really think the code looks better without some of these braces ?

For sure it looks better without the braces. Braces should be used only
if there are multiple lines at the if chain.

  WARNING: printk() should include KERN_ facility level
  #199: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:400:
  +   printk( no device\n);
 
 I only moved this piece of code around, but yes, that should really be
 fixed !

Where you're just moving the code, no.

 
  WARNING: braces {} are not necessary for any arm of this statement
  #211: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:412:
  +   if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM28XX) {
  [...]
  +   } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM2800) {
  [...]
  +   } else if (i2c_bus-algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) {
  [...]
 
 See above.
 
  WARNING: printk() should include KERN_ facility level
  #220: FILE: drivers/media/usb/em28xx/em28xx-i2c.c:421:
  +   printk( %02x, msg.buf[byte]);
 
 Same here, should indeed be fixed.
 
  WARNING: braces {} are not necessary 

Re: [PATCH v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Mauro Carvalho Chehab
Em Sun, 24 Mar 2013 13:53:40 +0100
Frank Schäfer fschaefer@googlemail.com escreveu:

 Am 24.03.2013 12:38, schrieb Mauro Carvalho Chehab:
  Em Sat, 23 Mar 2013 18:27:08 +0100
  Frank Schäfer fschaefer@googlemail.com escreveu:
 
  The webcam SpeedLink VAD Laplace (em2765 + ov2640) uses a special 
  algorithm
  for i2c communication with the sensor, which is connected to a second i2c 
  bus.
 
  We don't know yet how to find out which devices support/use it.
  It's very likely used by all em25xx and em276x+ bridges.
  Tests with other em28xx chips (em2820, em2882/em2883) show, that this
  algorithm always succeeds there although no slave device is connected.
 
  The algorithm likely also works for real i2c client devices (OV2640 uses 
  SCCB),
  because the Windows driver seems to use it for probing Samsung and Kodak
  sensors.
 
  Signed-off-by: Frank Schäfer fschaefer@googlemail.com
  ---
   drivers/media/usb/em28xx/em28xx-cards.c |8 +-
   drivers/media/usb/em28xx/em28xx-i2c.c   |  229 
  +--
   drivers/media/usb/em28xx/em28xx.h   |   10 +-
   3 Dateien geändert, 205 Zeilen hinzugefügt(+), 42 Zeilen entfernt(-)
 
  diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
  b/drivers/media/usb/em28xx/em28xx-cards.c
  index cb7cdd3..033b6cb 100644
  --- a/drivers/media/usb/em28xx/em28xx-cards.c
  +++ b/drivers/media/usb/em28xx/em28xx-cards.c
  @@ -3139,15 +3139,19 @@ static int em28xx_init_dev(struct em28xx *dev, 
  struct usb_device *udev,
 rt_mutex_init(dev-i2c_bus_lock);
   
 /* register i2c bus 0 */
  -  retval = em28xx_i2c_register(dev, 0);
  +  if (dev-board.is_em2800)
  +  retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
  +  else
  +  retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
 if (retval  0) {
 em28xx_errdev(%s: em28xx_i2c_register bus 0 - error [%d]!\n,
 __func__, retval);
 goto unregister_dev;
 }
   
  +  /* register i2c bus 1 */
 if (dev-def_i2c_bus) {
  -  retval = em28xx_i2c_register(dev, 1);
  +  retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX);
 if (retval  0) {
 em28xx_errdev(%s: em28xx_i2c_register bus 1 - error 
  [%d]!\n,
 __func__, retval);
  diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
  b/drivers/media/usb/em28xx/em28xx-i2c.c
  index 9e2fa41..ab14ac3 100644
  --- a/drivers/media/usb/em28xx/em28xx-i2c.c
  +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
  @@ -5,6 +5,7 @@
   Markus Rechberger mrechber...@gmail.com
   Mauro Carvalho Chehab mche...@infradead.org
   Sascha Sommer saschasom...@freenet.de
  +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.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
  @@ -274,6 +275,176 @@ static int em28xx_i2c_check_for_device(struct em28xx 
  *dev, u16 addr)
   }
   
   /*
  + * em25xx_bus_B_send_bytes
  + * write bytes to the i2c device
  + */
  +static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
  + u16 len)
  +{
  +  int ret;
  +
  +  if (len  1 || len  64)
  +  return -EOPNOTSUPP;
  +  /* NOTE: limited by the USB ctrl message constraints
  +   * Zero length reads always succeed, even if no device is connected */
  +
  +  /* Set register and write value */
  +  ret = dev-em28xx_write_regs_req(dev, 0x06, addr, buf, len);
  +  /* NOTE:
  +   * 0 byte writes always succeed, even if no device is connected. */
  You already noticed it on the previous note.
 
 Yes. ;)

Well, there's no need to repeat the same thing twice at the same function ;)

 
  +  if (ret != len) {
  +  if (ret  0) {
  +  em28xx_warn(writing to i2c device at 0x%x failed 
  +  (error=%i)\n, addr, ret);
  +  return ret;
  +  } else {
  +  em28xx_warn(%i bytes write to i2c device at 0x%x 
  +  requested, but %i bytes written\n,
  +  len, addr, ret);
  +  return -EIO;
  +  }
  +  }
  +  /* Check success */
  +  ret = dev-em28xx_read_reg_req(dev, 0x08, 0x);
  +  /* NOTE: the only error we've seen so far is
  +   * 0x01 when the slave device is not present */
  +  if (ret == 0x00) {
  Please simplify. just use:
  if (!ret)
 
 I would like to keep it as is because I think it better expresses the
 purposes of this check. I also used 0x00 instead of 0 on purpose.

Why do you think it better expresses it? It is just a more verbose way
of doing the same thing. 

If you want to better express, then add a comment:
/* 
 * Reg 08 value 0 means that the operation succeeded.
 * different values indicate that the I2C 

Re: [REVIEW PATCH 01/19] solo6x10: sync to latest code from Bluecherry's git repo.

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 18 Mar 2013 13:32:00 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 Synced to commit e9815ac5503ae60cfbf6ff8037035de8f62e2846 from
 branch next in git repository https://github.com/bluecherrydvr/solo6x10.git
 
 Only removed some code under #if LINUX_VERSION_CODE  some-kernel-version,
 renamed the driver back to solo6x10 from solo6x10-edge and removed the
 unnecessary compat.h header.
 
 Otherwise the code is identical.
 

...

 @@ -21,29 +26,78 @@
  #include linux/module.h
  #include linux/pci.h
  #include linux/interrupt.h
 -#include linux/slab.h

You can't remove slab.h if any k*alloc function is used, or it will
break compilation, depending on the Kconfig options selected.

The same type of removal are on other files inside this patch.

Please fix.

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: [REVIEW PATCH 09/42] sony-btf-mpx: the MPX driver for the sony BTF PAL/SECAM tuner

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 11 Mar 2013 12:45:47 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 The Sony BTF PG472Z has an internal MPX to deal with mono/stereo/bilingual
 audio. This is split off from the wis-sony-tuner driver that is part of
 the go7007 driver as it should be a separate i2c sub-device driver.
 
 The wis-sony-tuner is really three i2c devices: a standard tuner, a tda9887
 compatible demodulator and this mpx. After this patch the wis-sony-tuner
 can be replaced by this driver and the standard tuner driver.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/media/i2c/Kconfig|   11 +-
  drivers/media/i2c/Makefile   |1 +
  drivers/media/i2c/sony-btf-mpx.c |  399 
 ++

Not sure what happened, but sony-btf-mpx.c got missed on the version inside
the pull request.

So, I got it from this patch.

  3 files changed, 410 insertions(+), 1 deletion(-)
  create mode 100644 drivers/media/i2c/sony-btf-mpx.c
 
 diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
 index 7b771ba..70dbae2 100644
 --- a/drivers/media/i2c/Kconfig
 +++ b/drivers/media/i2c/Kconfig
 @@ -133,7 +133,7 @@ config VIDEO_WM8739
 module will be called wm8739.
  
  config VIDEO_VP27SMPX
 - tristate Panasonic VP27s internal MPX
 + tristate Panasonic VP27's internal MPX
   depends on VIDEO_V4L2  I2C
   ---help---
 Support for the internal MPX of the Panasonic VP27s tuner.
 @@ -141,6 +141,15 @@ config VIDEO_VP27SMPX
 To compile this driver as a module, choose M here: the
 module will be called vp27smpx.
  
 +config VIDEO_SONY_BTF_MPX
 + tristate Sony BTF's internal MPX
 + depends on VIDEO_V4L2  I2C
 + help
 +   Support for the internal MPX of the Sony BTF-PG472Z tuner.
 +
 +   To compile this driver as a module, choose M here: the
 +   module will be called sony-btf-mpx.
 +
  comment RDS decoders
  
  config VIDEO_SAA6588
 diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
 index cfefd30..4c57075 100644
 --- a/drivers/media/i2c/Makefile
 +++ b/drivers/media/i2c/Makefile
 @@ -44,6 +44,7 @@ obj-$(CONFIG_VIDEO_TLV320AIC23B) += tlv320aic23b.o
  obj-$(CONFIG_VIDEO_WM8775) += wm8775.o
  obj-$(CONFIG_VIDEO_WM8739) += wm8739.o
  obj-$(CONFIG_VIDEO_VP27SMPX) += vp27smpx.o
 +obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o
  obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
  obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
  obj-$(CONFIG_VIDEO_OV7670)   += ov7670.o
 diff --git a/drivers/media/i2c/sony-btf-mpx.c 
 b/drivers/media/i2c/sony-btf-mpx.c
 new file mode 100644
 index 000..bc73e8f
 --- /dev/null
 +++ b/drivers/media/i2c/sony-btf-mpx.c
 @@ -0,0 +1,399 @@
 +/*
 + * Copyright (C) 2005-2006 Micronas USA Inc.
 + *
 + * 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.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
 + */
 +
 +#include linux/module.h
 +#include linux/init.h
 +#include linux/i2c.h
 +#include linux/videodev2.h
 +#include media/tuner.h
 +#include media/v4l2-common.h
 +#include media/v4l2-ioctl.h
 +#include media/v4l2-device.h
 +#include linux/slab.h
 +
 +MODULE_DESCRIPTION(sony-btf-mpx driver);
 +MODULE_LICENSE(GPL v2);
 +
 +static int debug;
 +module_param(debug, int, 0644);
 +MODULE_PARM_DESC(debug, debug level 0=off(default) 1=on\n);
 +
 +/* #define MPX_DEBUG */
 +
 +/*
 + * Note:
 + *
 + * AS(IF/MPX) pin:  LOW  HIGH/OPEN
 + * IF/MPX address:   0x42/0x40   0x43/0x44
 + */
 +
 +
 +static int force_mpx_mode = -1;
 +module_param(force_mpx_mode, int, 0644);
 +
 +struct sony_btf_mpx {
 + struct v4l2_subdev sd;
 + int mpxmode;
 + u32 audmode;
 +};
 +
 +static inline struct sony_btf_mpx *to_state(struct v4l2_subdev *sd)
 +{
 + return container_of(sd, struct sony_btf_mpx, sd);
 +}
 +
 +static int mpx_write(struct i2c_client *client, int dev, int addr, int val)
 +{
 + u8 buffer[5];
 + struct i2c_msg msg;
 +
 + buffer[0] = dev;
 + buffer[1] = addr  8;
 + buffer[2] = addr  0xff;
 + buffer[3] = val  8;
 + buffer[4] = val  0xff;
 + msg.addr = client-addr;
 + msg.flags = 0;
 + msg.len = 5;
 + msg.buf = buffer;
 + i2c_transfer(client-adapter, msg, 1);
 + return 0;
 +}
 +
 +/*
 + * MPX register values for the BTF-PG472Z:
 + *
 + * FM_ NICAM_  SCART_
 + *  MODUS  SOURCE

Re: [REVIEW PATCH 12/42] tw9903: add new tw9903 video decoder.

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 11 Mar 2013 12:45:50 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 This based on the wis-tw9903.c driver that's part of the go7007 driver.
 It has been converted to a v4l subdev driver by Pete Eberlein, and I made
 additional cleanups.
 
 Based on work by: Pete Eberlein p...@sensoray.com
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: Pete Eberlein p...@sensoray.com
 ---
  drivers/media/i2c/Kconfig  |   10 ++
  drivers/media/i2c/Makefile |1 +
  drivers/media/i2c/tw9903.c |  274 
 
  3 files changed, 285 insertions(+)
  create mode 100644 drivers/media/i2c/tw9903.c
 
 diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
 index 8000642..eb9ef55 100644
 --- a/drivers/media/i2c/Kconfig
 +++ b/drivers/media/i2c/Kconfig
 @@ -301,6 +301,16 @@ config VIDEO_TVP7002
 To compile this driver as a module, choose M here: the
 module will be called tvp7002.
  
 +config VIDEO_TW9903
 + tristate Techwell TW9903 video decoder
 + depends on VIDEO_V4L2  I2C
 + ---help---
 +   Support for the Techwell 9903 multi-standard video decoder
 +   with high quality down scaler.
 +
 +   To compile this driver as a module, choose M here: the
 +   module will be called tw9903.
 +
  config VIDEO_VPX3220
   tristate vpx3220a, vpx3216b  vpx3214c video decoders
   depends on VIDEO_V4L2  I2C
 diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
 index b1775b3..af8fb29 100644
 --- a/drivers/media/i2c/Makefile
 +++ b/drivers/media/i2c/Makefile
 @@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_THS7303) += ths7303.o
  obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
  obj-$(CONFIG_VIDEO_TVP514X) += tvp514x.o
  obj-$(CONFIG_VIDEO_TVP7002) += tvp7002.o
 +obj-$(CONFIG_VIDEO_TW9903) += tw9903.o
  obj-$(CONFIG_VIDEO_CS5345) += cs5345.o
  obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
  obj-$(CONFIG_VIDEO_M52790) += m52790.o
 diff --git a/drivers/media/i2c/tw9903.c b/drivers/media/i2c/tw9903.c
 new file mode 100644
 index 000..82626ea
 --- /dev/null
 +++ b/drivers/media/i2c/tw9903.c
 @@ -0,0 +1,274 @@
 +/*
 + * Copyright (C) 2005-2006 Micronas USA Inc.
 + *
 + * 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.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
 + */
 +
 +#include linux/module.h
 +#include linux/init.h
 +#include linux/i2c.h
 +#include linux/videodev2.h
 +#include linux/ioctl.h
 +#include media/v4l2-device.h
 +#include media/v4l2-ctrls.h
 +#include linux/slab.h
 +
 +MODULE_DESCRIPTION(TW9903 I2C subdev driver);
 +MODULE_LICENSE(GPL v2);
 +
 +/*
 + * This driver is based on the wis-tw9903.c source that was in
 + * drivers/staging/media/go7007. That source had commented out code for
 + * saturation and scaling (neither seemed to work). If anyone ever gets
 + * hardware to test this driver, then that code might be useful to look at.
 + * You need to get the kernel sources of, say, kernel 3.8 where that
 + * wis-tw9903 driver is still present.
 + */
 +
 +struct tw9903 {
 + struct v4l2_subdev sd;
 + struct v4l2_ctrl_handler hdl;
 + v4l2_std_id norm;
 +};
 +
 +static inline struct tw9903 *to_state(struct v4l2_subdev *sd)
 +{
 + return container_of(sd, struct tw9903, sd);
 +}
 +
 +static const u8 initial_registers[] = {
 + 0x02, 0x44, /* input 1, composite */
 + 0x03, 0x92, /* correct digital format */
 + 0x04, 0x00,
 + 0x05, 0x80, /* or 0x00 for PAL */
 + 0x06, 0x40, /* second internal current reference */
 + 0x07, 0x02, /* window */
 + 0x08, 0x14, /* window */
 + 0x09, 0xf0, /* window */
 + 0x0a, 0x81, /* window */
 + 0x0b, 0xd0, /* window */
 + 0x0c, 0x8c,
 + 0x0d, 0x00, /* scaling */
 + 0x0e, 0x11, /* scaling */
 + 0x0f, 0x00, /* scaling */
 + 0x10, 0x00, /* brightness */
 + 0x11, 0x60, /* contrast */
 + 0x12, 0x01, /* sharpness */
 + 0x13, 0x7f, /* U gain */
 + 0x14, 0x5a, /* V gain */
 + 0x15, 0x00, /* hue */
 + 0x16, 0xc3, /* sharpness */
 + 0x18, 0x00,
 + 0x19, 0x58, /* vbi */
 + 0x1a, 0x80,
 + 0x1c, 0x0f, /* video norm */
 + 0x1d, 0x7f, /* video norm */
 + 0x20, 0xa0, /* clamping gain (working 0x50) */
 + 0x21, 0x22,
 + 0x22, 0xf0,
 + 0x23, 0xfe,
 + 0x24, 0x3c,
 + 0x25, 0x38,
 + 0x26, 0x44,
 + 0x27, 0x20,
 + 0x28, 0x00,
 + 0x29, 0x15,
 + 

Re: [REVIEW PATCH 16/42] go7007: switch to standard tuner/i2c subdevs.

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 11 Mar 2013 12:45:54 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 Instead of using the wis-* drivers we now use the standard 'proper' subdev
 drivers.
 
 The board configuration tables now also list the possible audio inputs,
 this will be used later to implement audio inputs.
 
 Special mention deserves a little change in set_capture_size() where the
 height passed to s_mbus_fmt is doubled: that is because the saa7115 driver
 expects to see the frame height, not the field height as the wis_saa7115
 driver did.
 
 Another change is that the tuner input is moved from last to the first
 input, which is consistent with the common practice in other video drivers.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/staging/media/go7007/Kconfig  |   77 ++---
  drivers/staging/media/go7007/Makefile |   12 ---
  drivers/staging/media/go7007/go7007-driver.c  |   29 +--
  drivers/staging/media/go7007/go7007-i2c.c |1 -
  drivers/staging/media/go7007/go7007-priv.h|   18 +++-
  drivers/staging/media/go7007/go7007-usb.c |  112 
 +
  drivers/staging/media/go7007/go7007-v4l2.c|   18 +++-
  drivers/staging/media/go7007/saa7134-go7007.c |2 +-
  8 files changed, 135 insertions(+), 134 deletions(-)

That produced the following warnings:

drivers/media/i2c/sony-btf-mpx.c:335:2: warning: initialization from 
incompatible pointer type [enabled by default]
drivers/media/i2c/sony-btf-mpx.c:335:2: warning: (near initialization for 
'sony_btf_mpx_tuner_ops.s_tuner') [enabled by default]

Cheers,
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: [REVIEW PATCH 19/42] s2250-loader: use usbv2_cypress_load_firmware

2013-03-24 Thread Mauro Carvalho Chehab
Em Mon, 11 Mar 2013 12:45:57 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 From: Hans Verkuil hans.verk...@cisco.com
 
 The v2 of this function doesn't do DMA to objects on the stack like
 its predecessor does.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/staging/media/go7007/Makefile   |4 ++--
  drivers/staging/media/go7007/s2250-loader.c |7 ---
  2 files changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/staging/media/go7007/Makefile 
 b/drivers/staging/media/go7007/Makefile
 index 5bed78b..f9c8e0f 100644
 --- a/drivers/staging/media/go7007/Makefile
 +++ b/drivers/staging/media/go7007/Makefile
 @@ -11,8 +11,8 @@ s2250-y := s2250-board.o
  #obj-$(CONFIG_VIDEO_SAA7134) += saa7134-go7007.o
  #ccflags-$(CONFIG_VIDEO_SAA7134:m=y) += -Idrivers/media/video/saa7134 
 -DSAA7134_MPEG_GO7007=3
  
 -# S2250 needs cypress ezusb loader from dvb-usb
 -ccflags-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD:m=y) += 
 -Idrivers/media/usb/dvb-usb
 +# S2250 needs cypress ezusb loader from dvb-usb-v2
 +ccflags-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD:m=y) += 
 -Idrivers/media/usb/dvb-usb-v2

Please don't do it like that. Ok, for now it is in staging,
but once you move it outside it, please move the cypress load firmware
code to drivers/media/common, and do the proper changes for it to be
shared between go7007 and dvb-usb-v2.

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: [REVIEW PATCH 19/42] s2250-loader: use usbv2_cypress_load_firmware

2013-03-24 Thread Antti Palosaari

On 03/24/2013 05:39 PM, Mauro Carvalho Chehab wrote:

Em Mon, 11 Mar 2013 12:45:57 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:


From: Hans Verkuil hans.verk...@cisco.com

The v2 of this function doesn't do DMA to objects on the stack like
its predecessor does.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
  drivers/staging/media/go7007/Makefile   |4 ++--
  drivers/staging/media/go7007/s2250-loader.c |7 ---
  2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/go7007/Makefile 
b/drivers/staging/media/go7007/Makefile
index 5bed78b..f9c8e0f 100644
--- a/drivers/staging/media/go7007/Makefile
+++ b/drivers/staging/media/go7007/Makefile
@@ -11,8 +11,8 @@ s2250-y := s2250-board.o
  #obj-$(CONFIG_VIDEO_SAA7134) += saa7134-go7007.o
  #ccflags-$(CONFIG_VIDEO_SAA7134:m=y) += -Idrivers/media/video/saa7134 
-DSAA7134_MPEG_GO7007=3

-# S2250 needs cypress ezusb loader from dvb-usb
-ccflags-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD:m=y) += 
-Idrivers/media/usb/dvb-usb
+# S2250 needs cypress ezusb loader from dvb-usb-v2
+ccflags-$(CONFIG_VIDEO_GO7007_USB_S2250_BOARD:m=y) += 
-Idrivers/media/usb/dvb-usb-v2


Please don't do it like that. Ok, for now it is in staging,
but once you move it outside it, please move the cypress load firmware
code to drivers/media/common, and do the proper changes for it to be
shared between go7007 and dvb-usb-v2.


I agree with Mauro, you could move it to the common as it is nothing DVB 
USB only related.


Acked-by: Antti Palosaari cr...@iki.fi

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: [REVIEW PATCH 12/42] tw9903: add new tw9903 video decoder.

2013-03-24 Thread Mauro Carvalho Chehab
Em Sun, 24 Mar 2013 12:29:32 -0300
Mauro Carvalho Chehab mche...@redhat.com escreveu:

 Em Mon, 11 Mar 2013 12:45:50 +0100
 Hans Verkuil hverk...@xs4all.nl escreveu:
 
  From: Hans Verkuil hans.verk...@cisco.com
  
  This based on the wis-tw9903.c driver that's part of the go7007 driver.
  It has been converted to a v4l subdev driver by Pete Eberlein, and I made
  additional cleanups.
  
  Based on work by: Pete Eberlein p...@sensoray.com
  
  Signed-off-by: Hans Verkuil hans.verk...@cisco.com
  Cc: Pete Eberlein p...@sensoray.com
  ---
   drivers/media/i2c/Kconfig  |   10 ++
   drivers/media/i2c/Makefile |1 +
   drivers/media/i2c/tw9903.c |  274 
  
   3 files changed, 285 insertions(+)
   create mode 100644 drivers/media/i2c/tw9903.c
  
  diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
  index 8000642..eb9ef55 100644
  --- a/drivers/media/i2c/Kconfig
  +++ b/drivers/media/i2c/Kconfig
  @@ -301,6 +301,16 @@ config VIDEO_TVP7002
To compile this driver as a module, choose M here: the
module will be called tvp7002.
   
  +config VIDEO_TW9903
  +   tristate Techwell TW9903 video decoder
  +   depends on VIDEO_V4L2  I2C
  +   ---help---
  + Support for the Techwell 9903 multi-standard video decoder
  + with high quality down scaler.
  +
  + To compile this driver as a module, choose M here: the
  + module will be called tw9903.
  +
   config VIDEO_VPX3220
  tristate vpx3220a, vpx3216b  vpx3214c video decoders
  depends on VIDEO_V4L2  I2C
  diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
  index b1775b3..af8fb29 100644
  --- a/drivers/media/i2c/Makefile
  +++ b/drivers/media/i2c/Makefile
  @@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_THS7303) += ths7303.o
   obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
   obj-$(CONFIG_VIDEO_TVP514X) += tvp514x.o
   obj-$(CONFIG_VIDEO_TVP7002) += tvp7002.o
  +obj-$(CONFIG_VIDEO_TW9903) += tw9903.o
   obj-$(CONFIG_VIDEO_CS5345) += cs5345.o
   obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
   obj-$(CONFIG_VIDEO_M52790) += m52790.o
  diff --git a/drivers/media/i2c/tw9903.c b/drivers/media/i2c/tw9903.c
  new file mode 100644
  index 000..82626ea
  --- /dev/null
  +++ b/drivers/media/i2c/tw9903.c
  @@ -0,0 +1,274 @@
  +/*
  + * Copyright (C) 2005-2006 Micronas USA Inc.
  + *
  + * 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.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software Foundation,
  + * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  + */
  +
  +#include linux/module.h
  +#include linux/init.h
  +#include linux/i2c.h
  +#include linux/videodev2.h
  +#include linux/ioctl.h
  +#include media/v4l2-device.h
  +#include media/v4l2-ctrls.h
  +#include linux/slab.h
  +
  +MODULE_DESCRIPTION(TW9903 I2C subdev driver);
  +MODULE_LICENSE(GPL v2);
  +
  +/*
  + * This driver is based on the wis-tw9903.c source that was in
  + * drivers/staging/media/go7007. That source had commented out code for
  + * saturation and scaling (neither seemed to work). If anyone ever gets
  + * hardware to test this driver, then that code might be useful to look at.
  + * You need to get the kernel sources of, say, kernel 3.8 where that
  + * wis-tw9903 driver is still present.
  + */
  +
  +struct tw9903 {
  +   struct v4l2_subdev sd;
  +   struct v4l2_ctrl_handler hdl;
  +   v4l2_std_id norm;
  +};
  +
  +static inline struct tw9903 *to_state(struct v4l2_subdev *sd)
  +{
  +   return container_of(sd, struct tw9903, sd);
  +}
  +
  +static const u8 initial_registers[] = {
  +   0x02, 0x44, /* input 1, composite */
  +   0x03, 0x92, /* correct digital format */
  +   0x04, 0x00,
  +   0x05, 0x80, /* or 0x00 for PAL */
  +   0x06, 0x40, /* second internal current reference */
  +   0x07, 0x02, /* window */
  +   0x08, 0x14, /* window */
  +   0x09, 0xf0, /* window */
  +   0x0a, 0x81, /* window */
  +   0x0b, 0xd0, /* window */
  +   0x0c, 0x8c,
  +   0x0d, 0x00, /* scaling */
  +   0x0e, 0x11, /* scaling */
  +   0x0f, 0x00, /* scaling */
  +   0x10, 0x00, /* brightness */
  +   0x11, 0x60, /* contrast */
  +   0x12, 0x01, /* sharpness */
  +   0x13, 0x7f, /* U gain */
  +   0x14, 0x5a, /* V gain */
  +   0x15, 0x00, /* hue */
  +   0x16, 0xc3, /* sharpness */
  +   0x18, 0x00,
  +   0x19, 0x58, /* vbi */
  +   0x1a, 0x80,
  +   0x1c, 0x0f, /* video norm */
  +   0x1d, 0x7f, /* video norm */
  +   0x20, 0xa0, /* clamping gain (working 0x50) */
  +   0x21, 0x22,
  +   0x22, 0xf0,
  +  

Re: [GIT PULL FOR v3.10] go7007 driver overhaul

2013-03-24 Thread Mauro Carvalho Chehab
Em Fri, 22 Mar 2013 15:36:35 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 Hi all,
 
 This pull request updates the staging go7007 driver to the latest
 V4L2 frameworks and actually makes it work reliably.
 
 This pull request assumes that pull request
 http://patchwork.linuxtv.org/patch/17568/ was merged first.
 
 Some highlights:
 
 - moved the custom i2c drivers to media/i2c.
 - replaced the s2250-loader by a common loader for all the supported
   devices.
 - replaced all MPEG-related custom ioctls by standard ioctls and FMT
   support.
 - added the saa7134-go7007 combination (similar to the saa7134-empress).
 - added support for ADS Tech DVD Xpress DX2.
 
 In addition I've made some V4L2 core and saa7115 changes (the first 7
 patches):
 
 - eliminate false lockdep warnings when dealing with nested control
   handlers. This patch is a slightly modified version from the one Andy
   posted a long time ago.
 - add support to easily test if any subdevices support a particular operation.
 - fix a few bugs in the code that tests if an ioctl is available: it didn't
   take 'disabling of ioctls' into account.
 - added additional configuration flags to saa7115, needed by the go7007.
 - improved querystd support in saa7115.
 
 This driver now passes all v4l2-compliance tests.
 
 It has been tested with:
 
 - Plextor PX-TV402U (PAL model)
 - Sensoray S2250S (generously provided by Sensoray, all audio inputs
   now work!)
 - Sensoray Model 614 (saa7134+go7007 PCI board, generously provided by
   Sensoray)
 - WIS X-Men II sensor board (generously provided by Sensoray)
 - Adlink PCI-MPG24 surveillance board
 - ADS Tech DVD Xpress DX2
 
 Everything seems to work OK, but for two things:
 
 - the WIS X-Men and tthe S2250 do not honor requested frameperiod changes
   using S_PARM. The others work fine, and I have no idea why these work
   differently.
 - the bttv part of the Adlink card doesn't work for me: I just get black
   with fuzzy lines. This doesn't work in 3.8 either, so I don't know
   what's going on here. It's not related to my patch series, that's for
   sure.
 
 What needs to be done to get this driver out of staging? The main thing
 is the motion detection support. Volokh has some additional code for that,
 and I want to experiment with motion detection for this card and the
 solo6x10 card and see if I can come up with a nice API for that.
 
 It would also be nice to get the s2250-board.c code make use of the already
 existing i2c devices, but it is hooked up somewhat strangely, so I need to
 look at that some day.
 
 Regarding the firmware: they are available here:
 
 http://git.linuxtv.org/hverkuil/linux-firmware.git/shortlog/refs/heads/go7007
 
 All firmwares relating to this driver have been collected in the go7007
 directory with correct licensing. Note that this means that the s2250 
 firmwares
 have been renamed. Should this be an issue I can change this back and leave
 those files where they are today, but since the go7007 firmware files were
 never included in linux-firmware (and therefor the driver never worked with
 just linux-firmware) and because it is still a staging driver I thought it
 cleaner to have all firmware files in one place.
 
 Mauro, when should I make a pull request for the linux-firmware changes?
 After you have merged this pull request?
 
 In the meantime, the firmware files are also available here:
 
 http://hverkuil.home.xs4all.nl/go7007-fw.tar.bz2
 
 Just unpack in /lib/firmware.
 
 Regards,
 
 Hans
 
 The following changes since commit 8bf1a5a826d06a9b6f65b3e8dffb9be59d8937c3:
 
   v4l2-ioctl: add precision when printing names. (2013-03-22 11:59:21 +0100)
 
 are available in the git repository at:
 
   git://linuxtv.org/hverkuil/media_tree.git go7007
 
 for you to fetch changes up to 651f19e2186eb92393296717afaa7fc0873d6c2f:
 
   go7007: add support for ADS Tech DVD Xpress DX2 (2013-03-22 15:20:46 +0100)
 
 
 Andy Walls (1):
   v4l2-ctrls: eliminate lockdep false alarms for struct 
 v4l2_ctrl_handler.lock
 
 Hans Verkuil (47):
   v4l2-core: add code to check for specific ops.
   v4l2-ioctl: check if an ioctl is valid.
   v4l2-ctrls: add V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER control
   saa7115: add config flag to change the IDQ polarity.
   saa7115: improve querystd handling for the saa7115.
   saa7115: add support for double-rate ASCLK
   go7007: fix i2c_xfer return codes.
   tuner: add Sony BTF tuners
   sony-btf-mpx: the MPX driver for the sony BTF PAL/SECAM tuner
   ov7640: add new ov7640 driver
   uda1342: add new uda1342 audio codec driver
   tw9903: add new tw9903 video decoder.
   tw2804: add support for the Techwell tw2804.
   go7007: switch to standard tuner/i2c subdevs.
   go7007: remove all wis* drivers.
   go7007: add audio input ioctls.
   s2250-loader: use usbv2_cypress_load_firmware
   go7007: go7007: add 

Re: [PATCH 4/4] [media] dvb-usb/dvb-usb-v2: use IS_ENABLED

2013-03-24 Thread Michael Krufky
Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Michael Krufky mkru...@linuxtv.org
 Cc: Andy Shevchenko andriy.shevche...@linux.intel.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h | 3 +--
  drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | 3 +--
  drivers/media/usb/dvb-usb/dibusb-common.c | 3 +--
  3 files changed, 3 insertions(+), 6 deletions(-)

 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 index 432706a..40dd409 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 @@ -31,8 +31,7 @@ struct mxl111sf_demod_config {
 struct mxl111sf_reg_ctrl_info *ctrl_reg_info);
  };

 -#if defined(CONFIG_DVB_USB_MXL111SF) || \
 -   (defined(CONFIG_DVB_USB_MXL111SF_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
  extern
  struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
struct mxl111sf_demod_config *cfg);
 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 index ff33396..634eee3 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 @@ -60,8 +60,7 @@ struct mxl111sf_tuner_config {

  /*  
 */

 -#if defined(CONFIG_DVB_USB_MXL111SF) || \
 -   (defined(CONFIG_DVB_USB_MXL111SF_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
  extern
  struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
struct mxl111sf_state *mxl_state,
 diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c 
 b/drivers/media/usb/dvb-usb/dibusb-common.c
 index af0d432..ecb9360 100644
 --- a/drivers/media/usb/dvb-usb/dibusb-common.c
 +++ b/drivers/media/usb/dvb-usb/dibusb-common.c
 @@ -232,8 +232,7 @@ static struct dibx000_agc_config 
 dib3000p_panasonic_agc_config = {
 .agc2_slope2 = 0x1e,
  };

 -#if defined(CONFIG_DVB_DIB3000MC) ||   \
 -   (defined(CONFIG_DVB_DIB3000MC_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_DIB3000MC)

  static struct dib3000mc_config mod3000p_dib3000p_config = {
 dib3000p_panasonic_agc_config,
 --
 1.8.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
--
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 1/4] [media] dvb-frontends: use IS_ENABLED

2013-03-24 Thread Michael Krufky
...a long awaited cleanup ;-)

Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Malcolm Priestley tvbox...@gmail.com
 Cc: Michael Krufky mkru...@linuxtv.org
 Cc: Konstantin Dimitrov kosio.dimit...@gmail.com
 Cc: Igor M. Liplianin liplia...@me.by
 Cc: Thomas Mair thomas.mai...@googlemail.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/dvb-frontends/a8293.h| 3 +--
  drivers/media/dvb-frontends/af9013.h   | 3 +--
  drivers/media/dvb-frontends/af9033.h   | 3 +--
  drivers/media/dvb-frontends/atbm8830.h | 3 +--
  drivers/media/dvb-frontends/au8522.h   | 3 +--
  drivers/media/dvb-frontends/cx22702.h  | 3 +--
  drivers/media/dvb-frontends/cx24113.h  | 3 +--
  drivers/media/dvb-frontends/cx24116.h  | 3 +--
  drivers/media/dvb-frontends/cx24123.h  | 3 +--
  drivers/media/dvb-frontends/cxd2820r.h | 3 +--
  drivers/media/dvb-frontends/dib3000mc.h| 3 +--
  drivers/media/dvb-frontends/dib7000m.h | 3 +--
  drivers/media/dvb-frontends/dib7000p.h | 3 +--
  drivers/media/dvb-frontends/drxd.h | 3 +--
  drivers/media/dvb-frontends/drxk.h | 3 +--
  drivers/media/dvb-frontends/ds3000.h   | 3 +--
  drivers/media/dvb-frontends/dvb_dummy_fe.h | 3 +--
  drivers/media/dvb-frontends/ec100.h| 3 +--
  drivers/media/dvb-frontends/hd29l2.h   | 3 +--
  drivers/media/dvb-frontends/it913x-fe.h| 3 +--
  drivers/media/dvb-frontends/ix2505v.h  | 3 +--
  drivers/media/dvb-frontends/lg2160.h   | 3 +--
  drivers/media/dvb-frontends/lgdt3305.h | 3 +--
  drivers/media/dvb-frontends/lgs8gl5.h  | 3 +--
  drivers/media/dvb-frontends/lgs8gxx.h  | 3 +--
  drivers/media/dvb-frontends/lnbh24.h   | 3 +--
  drivers/media/dvb-frontends/lnbp21.h   | 3 +--
  drivers/media/dvb-frontends/lnbp22.h   | 3 +--
  drivers/media/dvb-frontends/m88rs2000.h| 3 +--
  drivers/media/dvb-frontends/mb86a20s.h | 3 +--
  drivers/media/dvb-frontends/rtl2830.h  | 3 +--
  drivers/media/dvb-frontends/rtl2832.h  | 3 +--
  drivers/media/dvb-frontends/s5h1409.h  | 3 +--
  drivers/media/dvb-frontends/s5h1411.h  | 3 +--
  drivers/media/dvb-frontends/s5h1432.h  | 3 +--
  drivers/media/dvb-frontends/s921.h | 3 +--
  drivers/media/dvb-frontends/si21xx.h   | 3 +--
  drivers/media/dvb-frontends/stb6000.h  | 3 +--
  drivers/media/dvb-frontends/stv0288.h  | 3 +--
  drivers/media/dvb-frontends/stv0367.h  | 3 +--
  drivers/media/dvb-frontends/stv0900.h  | 3 +--
  drivers/media/dvb-frontends/stv6110.h  | 3 +--
  drivers/media/dvb-frontends/tda10048.h | 3 +--
  drivers/media/dvb-frontends/tda10071.h | 3 +--
  drivers/media/dvb-frontends/tda18271c2dd.h | 3 +--
  drivers/media/dvb-frontends/ts2020.h   | 3 +--
  drivers/media/dvb-frontends/zl10036.h  | 3 +--
  drivers/media/dvb-frontends/zl10039.h  | 3 +--
  48 files changed, 48 insertions(+), 96 deletions(-)

 diff --git a/drivers/media/dvb-frontends/a8293.h 
 b/drivers/media/dvb-frontends/a8293.h
 index ed29e55..e6d4a83 100644
 --- a/drivers/media/dvb-frontends/a8293.h
 +++ b/drivers/media/dvb-frontends/a8293.h
 @@ -25,8 +25,7 @@ struct a8293_config {
 u8 i2c_addr;
  };

 -#if defined(CONFIG_DVB_A8293) || \
 -   (defined(CONFIG_DVB_A8293_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_A8293)
  extern struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c, const struct a8293_config *cfg);
  #else
 diff --git a/drivers/media/dvb-frontends/af9013.h 
 b/drivers/media/dvb-frontends/af9013.h
 index 

Re: [PATCH 2/4] [media] tuners: use IS_ENABLED

2013-03-24 Thread Michael Krufky
Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Antti Palosaari cr...@iki.fi
 Cc: Michael Buesch m...@bues.ch
 Cc: Hans-Frieder Vogt hfv...@gmx.net
 Cc: Michael Krufky mkru...@kernellabs.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/tuners/e4000.h| 3 +--
  drivers/media/tuners/fc0011.h   | 3 +--
  drivers/media/tuners/fc0012.h   | 3 +--
  drivers/media/tuners/fc0013.h   | 3 +--
  drivers/media/tuners/fc2580.h   | 3 +--
  drivers/media/tuners/max2165.h  | 3 +--
  drivers/media/tuners/mc44s803.h | 3 +--
  drivers/media/tuners/mxl5005s.h | 3 +--
  drivers/media/tuners/tda18212.h | 3 +--
  drivers/media/tuners/tda18218.h | 3 +--
  drivers/media/tuners/tua9001.h  | 3 +--
  drivers/media/tuners/xc5000.h   | 3 +--
  12 files changed, 12 insertions(+), 24 deletions(-)

 diff --git a/drivers/media/tuners/e4000.h b/drivers/media/tuners/e4000.h
 index 71b1935..7801270 100644
 --- a/drivers/media/tuners/e4000.h
 +++ b/drivers/media/tuners/e4000.h
 @@ -36,8 +36,7 @@ struct e4000_config {
 u32 clock;
  };

 -#if defined(CONFIG_MEDIA_TUNER_E4000) || \
 -   (defined(CONFIG_MEDIA_TUNER_E4000_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_E4000)
  extern struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c, const struct e4000_config *cfg);
  #else
 diff --git a/drivers/media/tuners/fc0011.h b/drivers/media/tuners/fc0011.h
 index 0ee581f..33db6e4 100644
 --- a/drivers/media/tuners/fc0011.h
 +++ b/drivers/media/tuners/fc0011.h
 @@ -22,8 +22,7 @@ enum fc0011_fe_callback_commands {
 FC0011_FE_CALLBACK_RESET,
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC0011) ||\
 -defined(CONFIG_MEDIA_TUNER_FC0011_MODULE)
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0011)
  struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c,
const struct fc0011_config *config);
 diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
 index 54508fc..668d70d 100644
 --- a/drivers/media/tuners/fc0012.h
 +++ b/drivers/media/tuners/fc0012.h
 @@ -48,8 +48,7 @@ struct fc0012_config {
 bool clock_out;
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC0012) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC0012_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0012)
  extern struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c,
 const struct fc0012_config *cfg);
 diff --git a/drivers/media/tuners/fc0013.h b/drivers/media/tuners/fc0013.h
 index 594efd6..34aa1c3 100644
 --- a/drivers/media/tuners/fc0013.h
 +++ b/drivers/media/tuners/fc0013.h
 @@ -25,8 +25,7 @@
  #include dvb_frontend.h
  #include fc001x-common.h

 -#if defined(CONFIG_MEDIA_TUNER_FC0013) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC0013_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0013)
  extern struct dvb_frontend *fc0013_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c,
 u8 i2c_address, int dual_master,
 diff --git a/drivers/media/tuners/fc2580.h b/drivers/media/tuners/fc2580.h
 index 222601e..2dbf91f 100644
 --- a/drivers/media/tuners/fc2580.h
 +++ b/drivers/media/tuners/fc2580.h
 @@ -36,8 +36,7 @@ struct fc2580_config {
 u32 clock;
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC2580) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC2580_MODULE)  defined(MODULE))
 +#if 

Re: [GIT PULL FOR v3.10] au0828 driver overhaul

2013-03-24 Thread Mauro Carvalho Chehab
Em Fri, 22 Mar 2013 14:50:28 -0400
Devin Heitmueller dheitmuel...@kernellabs.com escreveu:

 On Fri, Mar 22, 2013 at 12:38 PM, Hans Verkuil hverk...@xs4all.nl wrote:
  It works fine with qv4l2, but there is still a bug causing tvtime to fail.
  That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied
  August last year, that broke g_tuner: after that 'signal' would always be 0
  and tvtime expects signal to be non-zero for a valid frequency. 

I don't think so: tvtime has a way to either honor signal or to ignore it
via GUI. As there are tuners that can't provide any signal level, I suspect
that this is the reason why it was coded this way.

  The signal
  field is set by the au8522, but g_tuner is only called for the tuner (well,
  also for au8522 but since the i2c gate is set for the tuner that won't do
  anything).

As far as I remember, there are a few drivers or boards whose signal
information is provided by the bridge and not by the tuner. I think
that this still works. For example:

drivers/media/pci/bt8xx/bttv-driver.c:static int bttv_g_tuner(struct file 
*file, void *priv,
drivers/media/pci/bt8xx/bttv-driver.c-struct 
v4l2_tuner *t)
drivers/media/pci/bt8xx/bttv-driver.c-{
drivers/media/pci/bt8xx/bttv-driver.c-struct bttv_fh *fh = priv;
drivers/media/pci/bt8xx/bttv-driver.c-struct bttv *btv = fh-btv;
drivers/media/pci/bt8xx/bttv-driver.c-
drivers/media/pci/bt8xx/bttv-driver.c-if (0 != t-index)
drivers/media/pci/bt8xx/bttv-driver.c-return -EINVAL;
drivers/media/pci/bt8xx/bttv-driver.c-
drivers/media/pci/bt8xx/bttv-driver.c-t-rxsubchans = V4L2_TUNER_SUB_MONO;
drivers/media/pci/bt8xx/bttv-driver.c-t-capability = V4L2_TUNER_CAP_NORM;
drivers/media/pci/bt8xx/bttv-driver.c-bttv_call_all(btv, tuner, g_tuner, t);
drivers/media/pci/bt8xx/bttv-driver.c-strcpy(t-name, Television);
drivers/media/pci/bt8xx/bttv-driver.c-t-type   = V4L2_TUNER_ANALOG_TV;
drivers/media/pci/bt8xx/bttv-driver.c-if 
(btread(BT848_DSTATUS)BT848_DSTATUS_HLOC)
drivers/media/pci/bt8xx/bttv-driver.c-t-signal = 0x;
drivers/media/pci/bt8xx/bttv-driver.c-
drivers/media/pci/bt8xx/bttv-driver.c-if (btv-audio_mode_gpio)
drivers/media/pci/bt8xx/bttv-driver.c-btv-audio_mode_gpio(btv, t, 
0);
drivers/media/pci/bt8xx/bttv-driver.c-
drivers/media/pci/bt8xx/bttv-driver.c-return 0;

changeset e58071f024aa337b7ce41682578b33895b024f8b doesn't affect it.

 Wait, are you saying that the G_TUNER call is no longer being routed
 to the au8522 driver?  The signal level has always been set to a
 nonzero value by au8522 if a signal is present, and thus the state of
 the i2c gate isn't relevant.

The logic there seems to need a proper I2C gate setting:

drivers/media/dvb-frontends/au8522_decoder.c:static int au8522_g_tuner(struct 
v4l2_subdev *sd, struct v4l2_tuner *vt)
drivers/media/dvb-frontends/au8522_decoder.c-{
drivers/media/dvb-frontends/au8522_decoder.c- int val = 0;
drivers/media/dvb-frontends/au8522_decoder.c- struct au8522_state *state = 
to_state(sd);
drivers/media/dvb-frontends/au8522_decoder.c- u8 lock_status;
drivers/media/dvb-frontends/au8522_decoder.c-
drivers/media/dvb-frontends/au8522_decoder.c- /* Interrogate the decoder to 
see if we are getting a real signal */
drivers/media/dvb-frontends/au8522_decoder.c- lock_status = 
au8522_readreg(state, 0x00);
drivers/media/dvb-frontends/au8522_decoder.c- if (lock_status == 0xa2)
drivers/media/dvb-frontends/au8522_decoder.c- vt-signal = 0x;
drivers/media/dvb-frontends/au8522_decoder.c- else
drivers/media/dvb-frontends/au8522_decoder.c- vt-signal = 0x00;
drivers/media/dvb-frontends/au8522_decoder.c-
drivers/media/dvb-frontends/au8522_decoder.c- vt-capability |=
drivers/media/dvb-frontends/au8522_decoder.c- V4L2_TUNER_CAP_STEREO 
| V4L2_TUNER_CAP_LANG1 |
drivers/media/dvb-frontends/au8522_decoder.c- V4L2_TUNER_CAP_LANG2 
| V4L2_TUNER_CAP_SAP;
drivers/media/dvb-frontends/au8522_decoder.c-
drivers/media/dvb-frontends/au8522_decoder.c- val = V4L2_TUNER_SUB_MONO;
drivers/media/dvb-frontends/au8522_decoder.c- vt-rxsubchans = val;
drivers/media/dvb-frontends/au8522_decoder.c- vt-audmode = 
V4L2_TUNER_MODE_STEREO;
drivers/media/dvb-frontends/au8522_decoder.c- return 0;

As if the i2c gate is on a wrong state, au8522_readreg() won't
work anymore.

 This is because the xc5000 driver didn't
 actually have implemented a call to return the signal level.
 
 If what you're saying is true, then the behavior of the framework
 itself changed, and who knows what else is broken.

I don't think that the framework behavior has changed with that
regards.

Anyway, until we have this issue fixed, I'll mark this patch
as changes requested.

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 

Re: [GIT PULL FOR v3.10] au0828 driver overhaul

2013-03-24 Thread Devin Heitmueller
On Sun, Mar 24, 2013 at 1:51 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 drivers/media/dvb-frontends/au8522_decoder.c:static int au8522_g_tuner(struct 
 v4l2_subdev *sd, struct v4l2_tuner *vt)
 drivers/media/dvb-frontends/au8522_decoder.c-{
 drivers/media/dvb-frontends/au8522_decoder.c- int val = 0;
 drivers/media/dvb-frontends/au8522_decoder.c- struct au8522_state *state 
 = to_state(sd);
 drivers/media/dvb-frontends/au8522_decoder.c- u8 lock_status;
 drivers/media/dvb-frontends/au8522_decoder.c-
 drivers/media/dvb-frontends/au8522_decoder.c- /* Interrogate the decoder 
 to see if we are getting a real signal */
 drivers/media/dvb-frontends/au8522_decoder.c- lock_status = 
 au8522_readreg(state, 0x00);
 drivers/media/dvb-frontends/au8522_decoder.c- if (lock_status == 0xa2)
 drivers/media/dvb-frontends/au8522_decoder.c- vt-signal = 0x;
 drivers/media/dvb-frontends/au8522_decoder.c- else
 drivers/media/dvb-frontends/au8522_decoder.c- vt-signal = 0x00;
 drivers/media/dvb-frontends/au8522_decoder.c-
 drivers/media/dvb-frontends/au8522_decoder.c- vt-capability |=
 drivers/media/dvb-frontends/au8522_decoder.c- 
 V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 |
 drivers/media/dvb-frontends/au8522_decoder.c- 
 V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
 drivers/media/dvb-frontends/au8522_decoder.c-
 drivers/media/dvb-frontends/au8522_decoder.c- val = V4L2_TUNER_SUB_MONO;
 drivers/media/dvb-frontends/au8522_decoder.c- vt-rxsubchans = val;
 drivers/media/dvb-frontends/au8522_decoder.c- vt-audmode = 
 V4L2_TUNER_MODE_STEREO;
 drivers/media/dvb-frontends/au8522_decoder.c- return 0;

 As if the i2c gate is on a wrong state, au8522_readreg() won't
 work anymore.

Note that au8522_g_tuner function never actually talks to the tuner.
It's handled entirely within the au8522 driver, which is not behind
the gate.  The I2C gate is only required if talking to the xc5000, not
the au8522.

There's something else broken here.  I suspect it's probably some
artifact of the conversion to the new control framework (if I had to
guess).

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.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


Status of the patches under review at LMML (32 patches)

2013-03-24 Thread Mauro Carvalho Chehab
This is the summary of the patches that are currently under review at
Linux Media Mailing List linux-media@vger.kernel.org.
Each patch is represented by its submission date, the subject (up to 70
chars) and the patchwork link (if submitted via email).

P.S.: This email is c/c to the developers where some action is expected.
  If you were copied, please review the patches, acking/nacking or
  submitting an update.

It took me a lot of time to handle patches this time. The good news is that
there's just one patch without an owner.

This patch is there on the pile for a long time. I was actually expecting
that either Jarod or David could review it, as it can affect existing
NEC devices:

Jul,26 2012: media: rc: Add support to decode Remotes using NECx IR protocol
http://patchwork.linuxtv.org/patch/13480  Ravi Kumar V 
kumar...@codeaurora.org

Not sure what to do here, as all devices I have with NEC protocol
(either normal or extended) works fine. I suspect that Ravi has a
different variant of remote. Not sure through. I won't apply it without
proper testing with both existing supported remotes and this new one.

== Prabhakar Lad prabhakar@ti.com == 

Oct,24 2012: [media] vpif_display: fix return value check in vpif_reqbufs() 
http://patchwork.linuxtv.org/patch/15167  Wei Yongjun 
yongjun_...@trendmicro.com.cn

== Laurent Pinchart Laurent Pinchart 
laurent.pinch...@ideasonboard.com == 

Dec,12 2012: [v2] ad5820: Voice coil motor controller driver
http://patchwork.linuxtv.org/patch/15881  Florian Neuhaus 
florian.neuh...@reberinformatik.ch
Jan, 4 2013: omap3isp: Add support for interlaced input data
http://patchwork.linuxtv.org/patch/16133  William Swanson 
william.swan...@fuel7.com

== Sylwester Nawrocki s.nawro...@samsung.com == 

Jan, 6 2013: s5p-tv: mixer: fix handling of VIDIOC_S_FMT
http://patchwork.linuxtv.org/patch/16143  Tomasz Stanislawski 
t.stanisl...@samsung.com

== Marek Szyprowski m.szyprow...@samsung.com == 

Nov,12 2012: [media] videobuf2-core: print current state of buffer in 
vb2_buffer_do http://patchwork.linuxtv.org/patch/15420  Tushar Behera 
tushar.beh...@linaro.org
Mar, 5 2013: [media] dma-mapping: enable no mmu support in dma_common_mmap  
http://patchwork.linuxtv.org/patch/17112  Scott Jiang 
scott.jiang.li...@gmail.com

== Laurent Pinchart laurent.pinch...@ideasonboard.com == 

Jan,14 2013: omap3isp: Add support for interlaced input data
http://patchwork.linuxtv.org/patch/16255  William Swanson 
william.swan...@fuel7.com

== Michael Krufky mkru...@linuxtv.org == 

Michael promised to review and apply them on his tree, sending me a pull
request, but this never happened. Mike, did you see any issues on those
patches?

Jan,27 2013: [4/4,v2] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM
http://patchwork.linuxtv.org/patch/16501  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [4/4] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM   
http://patchwork.linuxtv.org/patch/16615  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [1/8] saa7134: v4l2-compliance: implement V4L2_CAP_DEVICE_CAPS 
http://patchwork.linuxtv.org/patch/16617  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [2/8] saa7134: v4l2-compliance: don't report invalid audio modes 
for r http://patchwork.linuxtv.org/patch/16618  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [3/8] saa7134: v4l2-compliance: use v4l2_fh to fix priority 
handling   http://patchwork.linuxtv.org/patch/16619  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [4/8] saa7134: v4l2-compliance: return real frequency  
http://patchwork.linuxtv.org/patch/16620  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [5/8] saa7134: v4l2-compliance: fix g_tuner/s_tuner
http://patchwork.linuxtv.org/patch/16621  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [6/8] saa7134: v4l2-compliance: remove bogus audio input support   
http://patchwork.linuxtv.org/patch/16622  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [7/8] saa7134: v4l2-compliance: remove bogus g_parm
http://patchwork.linuxtv.org/patch/16623  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [8/8] saa7134: v4l2-compliance: clear reserved part of VBI 
structure   http://patchwork.linuxtv.org/patch/16624  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [1/4] tda8290: Allow disabling I2C gate
http://patchwork.linuxtv.org/patch/16612  Ondrej Zary 
li...@rainbow-software.org
Feb, 1 2013: [2/4] tda8290: Allow custom std_map for tda18271   
http://patchwork.linuxtv.org/patch/16613  Ondrej Zary 
li...@rainbow-software.org
Feb, 3 2013: [PATH,1/2] mxl5007 move reset to attach 

Re: [PATCH] cxd2820r_t2: Multistream support (MultiPLP)

2013-03-24 Thread Antti Palosaari

Is there anyone who could test that patch?

I have no multi PLP signal here.

Also there is minor issue on that patch. As stream ID validy is already 
checked there is no reason for bit AND 0xff.



Antti

On 03/07/2013 02:16 AM, CrazyCat wrote:

MultiPLP filtering support for CXD2820r, not tested.
Somebody from Russia please test (exclude Moscow, because used singlePLP). 
Usual used PLP 0 (4TV + 3 radio) and 1 (4TV). PLP 2,3 reserved (regional 
channels).

P.S. You can use my scan-s2 with multistream support - 
https://bitbucket.org/CrazyCat/scan-s2. Generated channel list compatible with 
current VDR 1.7.3x

Signed-off-by: Evgeny Plehov evgenyple...@ukr.net
diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c 
b/drivers/media/dvb-frontends/cxd2820r_core.c
index 9b658c1..7ca5c69 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -660,7 +660,8 @@ static const struct dvb_frontend_ops cxd2820r_ops = {
FE_CAN_GUARD_INTERVAL_AUTO  |
FE_CAN_HIERARCHY_AUTO   |
FE_CAN_MUTE_TS  |
-   FE_CAN_2G_MODULATION
+   FE_CAN_2G_MODULATION|
+   FE_CAN_MULTISTREAM
},

.release= cxd2820r_release,
diff --git a/drivers/media/dvb-frontends/cxd2820r_t2.c 
b/drivers/media/dvb-frontends/cxd2820r_t2.c
index e82d82a..c2bfea7 100644
--- a/drivers/media/dvb-frontends/cxd2820r_t2.c
+++ b/drivers/media/dvb-frontends/cxd2820r_t2.c
@@ -124,6 +124,23 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
buf[1] = ((if_ctl   8)  0xff);
buf[2] = ((if_ctl   0)  0xff);

+   /* PLP filtering */
+   if (c-stream_id  0 || c-stream_id  255) {
+   dev_dbg(priv-i2c-dev, %s: Disable PLP filtering\n, 
__func__);
+   ret = cxd2820r_wr_reg(priv, 0x023ad , 0);
+   if (ret)
+   goto error;
+   } else {
+   dev_dbg(priv-i2c-dev, %s: Enable PLP filtering = %d\n, 
__func__,
+   c-stream_id);
+   ret = cxd2820r_wr_reg(priv, 0x023af , c-stream_id  0xFF);
+   if (ret)
+   goto error;
+   ret = cxd2820r_wr_reg(priv, 0x023ad , 1);
+   if (ret)
+   goto error;
+   }
+
ret = cxd2820r_wr_regs(priv, 0x020b6, buf, 3);
if (ret)
goto error;
--
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




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


cron job: media_tree daily build: ERRORS

2013-03-24 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:   Sun Mar 24 19:00:24 CET 2013
git branch: test
git hash:   b781e6be79a394cd6980e9cd8fd5c25822d152b6
gcc version:i686-linux-gcc (GCC) 4.7.2
host hardware:  x86_64
host os:3.8-3.slh.2-amd64

linux-git-arm-davinci: OK
linux-git-arm-exynos: ERRORS
linux-git-arm-omap: WARNINGS
linux-git-blackfin: WARNINGS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: ERRORS
linux-git-powerpc64: OK
linux-git-sh: OK
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: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: ERRORS
linux-3.7.4-i686: ERRORS
linux-3.8-i686: ERRORS
linux-3.9-rc1-i686: WARNINGS
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: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-x86_64: ERRORS
linux-3.8-x86_64: ERRORS
linux-3.9-rc1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.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


[PATCH] em28xx-i2c: do not break strings across lines

2013-03-24 Thread Frank Schäfer
Signed-off-by: Frank Schäfer fschaefer@googlemail.com
---
 drivers/media/usb/em28xx/em28xx-i2c.c |   45 +++--
 1 Datei geändert, 20 Zeilen hinzugefügt(+), 25 Zeilen entfernt(-)

diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
b/drivers/media/usb/em28xx/em28xx-i2c.c
index 9e2fa41..db40835 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -68,8 +68,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, 
u8 *buf, u16 len)
/* trigger write */
ret = dev-em28xx_write_regs(dev, 4 - len, b2[4 - len], 2 + len);
if (ret != 2 + len) {
-   em28xx_warn(failed to trigger write to i2c address 0x%x 
-   (error=%i)\n, addr, ret);
+   em28xx_warn(failed to trigger write to i2c address 0x%x 
(error=%i)\n,
+   addr, ret);
return (ret  0) ? ret : -EIO;
}
/* wait for completion */
@@ -81,8 +81,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, 
u8 *buf, u16 len)
} else if (ret == 0x94 + len - 1) {
return -ENODEV;
} else if (ret  0) {
-   em28xx_warn(failed to get i2c transfer status from 
-   bridge register (error=%i)\n, ret);
+   em28xx_warn(failed to get i2c transfer status from 
bridge register (error=%i)\n,
+   ret);
return ret;
}
msleep(5);
@@ -110,8 +110,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 
addr, u8 *buf, u16 len)
buf2[0] = addr;
ret = dev-em28xx_write_regs(dev, 0x04, buf2, 2);
if (ret != 2) {
-   em28xx_warn(failed to trigger read from i2c address 0x%x 
-   (error=%i)\n, addr, ret);
+   em28xx_warn(failed to trigger read from i2c address 0x%x 
(error=%i)\n,
+   addr, ret);
return (ret  0) ? ret : -EIO;
}
 
@@ -124,8 +124,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 
addr, u8 *buf, u16 len)
} else if (ret == 0x94 + len - 1) {
return -ENODEV;
} else if (ret  0) {
-   em28xx_warn(failed to get i2c transfer status from 
-   bridge register (error=%i)\n, ret);
+   em28xx_warn(failed to get i2c transfer status from 
bridge register (error=%i)\n,
+   ret);
return ret;
}
msleep(5);
@@ -136,9 +136,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 
addr, u8 *buf, u16 len)
/* get the received message */
ret = dev-em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len);
if (ret != len) {
-   em28xx_warn(reading from i2c device at 0x%x failed: 
-   couldn't get the received message from the bridge 
-   (error=%i)\n, addr, ret);
+   em28xx_warn(reading from i2c device at 0x%x failed: couldn't 
get the received message from the bridge (error=%i)\n,
+   addr, ret);
return (ret  0) ? ret : -EIO;
}
for (i = 0; i  len; i++)
@@ -179,12 +178,11 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 
addr, u8 *buf,
ret = dev-em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len);
if (ret != len) {
if (ret  0) {
-   em28xx_warn(writing to i2c device at 0x%x failed 
-   (error=%i)\n, addr, ret);
+   em28xx_warn(writing to i2c device at 0x%x failed 
(error=%i)\n,
+   addr, ret);
return ret;
} else {
-   em28xx_warn(%i bytes write to i2c device at 0x%x 
-   requested, but %i bytes written\n,
+   em28xx_warn(%i bytes write to i2c device at 0x%x 
requested, but %i bytes written\n,
len, addr, ret);
return -EIO;
}
@@ -199,8 +197,8 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 
addr, u8 *buf,
} else if (ret == 0x10) {
return -ENODEV;
} else if (ret  0) {
-   em28xx_warn(failed to read i2c transfer status from 
-   bridge (error=%i)\n, ret);
+   em28xx_warn(failed to read i2c transfer status from 
bridge (error=%i)\n,
+   ret);
return ret;
}
msleep(5);
@@ -243,8 +241,8 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, 

Re: [PATCH] block i2c tuner reads for Avermedia Twinstar in the af9035 driver

2013-03-24 Thread Jose Alberto Reguero
On Domingo, 17 de marzo de 2013 23:46:06 Antti Palosaari escribió:
 On 03/17/2013 08:49 PM, Jose Alberto Reguero wrote:
  On Martes, 12 de marzo de 2013 00:11:38 Antti Palosaari escribió:
  On 03/11/2013 10:02 PM, Jose Alberto Reguero wrote:
  On Lunes, 11 de marzo de 2013 14:57:37 Antti Palosaari escribió:
  On 03/11/2013 01:51 PM, Jose Alberto Reguero wrote:
  On Lunes, 11 de febrero de 2013 14:48:18 Jose Alberto Reguero 
escribió:
  On Domingo, 10 de febrero de 2013 22:11:53 Antti Palosaari escribió:
  On 02/10/2013 09:43 PM, Jose Alberto Reguero wrote:
  This patch block the i2c tuner reads for Avermedia Twinstar. If
  it's
  needed other pids can be added.
  
  Signed-off-by: Jose Alberto Reguero jaregu...@telefonica.net
  
  diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c
  linux.new/drivers/media/usb/dvb-usb-v2/af9035.c ---
  linux/drivers/media/usb/dvb-usb-v2/af9035.c  2013-01-07
  05:45:57.0 +0100 +++
  linux.new/drivers/media/usb/dvb-usb-v2/af9035.c  2013-02-08
  22:55:08.304089054 +0100 @@ -232,7 +232,11 @@ static int
  af9035_i2c_master_xfer(struct
  
   buf[3] = 0x00; /* reg addr MSB */
   buf[4] = 0x00; /* reg addr LSB */
   memcpy(buf[5], msg[0].buf, msg[0].len);
  
  -ret = af9035_ctrl_msg(d, req);
  +if (state-block_read) {
  +msg[1].buf[0] = 0x3f;
  +ret = 0;
  +} else
  +ret = af9035_ctrl_msg(d, req);
  
   }
   
   } else if (num == 1  !(msg[0].flags  I2C_M_RD)) {
   
   if (msg[0].len  40) {
  
  @@ -638,6 +642,17 @@ static int af9035_read_config(struct dvb
  
   for (i = 0; i  ARRAY_SIZE(state-af9033_config); i++)
   
   state-af9033_config[i].clock = clock_lut[tmp];
  
  +state-block_read = false;
  +
  +if (le16_to_cpu(d-udev-descriptor.idVendor) ==
  USB_VID_AVERMEDIA
  
  +le16_to_cpu(d-udev-descriptor.idProduct) ==
  +USB_PID_AVERMEDIA_TWINSTAR) {
  +dev_dbg(d-udev-dev,
  +%s: AverMedia Twinstar: block i2c read 
  from tuner\n,
  +__func__);
  +state-block_read = true;
  +}
  +
  
   return 0;
   
   err:
  diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.h
  linux.new/drivers/media/usb/dvb-usb-v2/af9035.h ---
  linux/drivers/media/usb/dvb-usb-v2/af9035.h  2013-01-07
  05:45:57.0 +0100 +++
  linux.new/drivers/media/usb/dvb-usb-v2/af9035.h  2013-02-08
  22:52:42.293842710 +0100 @@ -54,6 +54,7 @@ struct usb_req {
  
   struct state {
   
   u8 seq; /* packet sequence number */
   bool dual_mode;
  
  +bool block_read;
  
   struct af9033_config af9033_config[2];
   
   };
  
  Could you test if faking tuner ID during attach() is enough?
  
  Also, I would like to know what is returned error code from firmware
  when it fails. Enable debugs to see it. It should print something
  like
  that: af9035_ctrl_msg: command=03 failed fw error=2
  
  
  diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c
  b/drivers/media/usb/dvb-usb-v2/af9035.c
  index a1e953a..5a4f28d 100644
  --- a/drivers/media/usb/dvb-usb-v2/af9035.c
  +++ b/drivers/media/usb/dvb-usb-v2/af9035.c
  @@ -1082,9 +1082,22 @@ static int af9035_tuner_attach(struct
  dvb_usb_adapter *adap)
  
  tuner_addr = 0x60 | 0x80; /* I2C bus
  hack
  */
  
  }
  
  +   // fake used tuner for demod firmware / i2c adapter
  +   if (adap-id == 0)
  +   ret = af9035_wr_reg(d, 0x00f641,
  AF9033_TUNER_FC0011);
  +   else
  +   ret = af9035_wr_reg(d, 0x10f641,
  AF9033_TUNER_FC0011);
  +
  
  /* attach tuner */
  fe = dvb_attach(mxl5007t_attach, adap-fe[0],
  d-i2c_adap,
  
  tuner_addr,
  
  af9035_mxl5007t_config[adap-id]);
  +
  +   // return correct tuner
  +   if (adap-id == 0)
  +   ret = af9035_wr_reg(d, 0x00f641,
  AF9033_TUNER_MXL5007T);
  +   else
  +   ret = af9035_wr_reg(d, 0x10f641,
  AF9033_TUNER_MXL5007T);
  +
  
  break;
  
  case AF9033_TUNER_TDA18218:
  /* attach tuner */
  
  regards
  Antti
  
  I will try with fake tuner, but I can't test unil next weekend.
  If I remember, the read operation is performed, and return good
  value,
  but after that, all the i2c transfers fail. Seee:
  
  

[PATCH] em28xx-i2c: fix coding style of multi line comments

2013-03-24 Thread Frank Schäfer
Signed-off-by: Frank Schäfer fschaefer@googlemail.com
---
 drivers/media/usb/em28xx/em28xx-i2c.c |   52 +
 1 Datei geändert, 34 Zeilen hinzugefügt(+), 18 Zeilen entfernt(-)

diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
b/drivers/media/usb/em28xx/em28xx-i2c.c
index db40835..79ed1da 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -171,8 +171,10 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 
addr, u8 *buf,
 
if (len  1 || len  64)
return -EOPNOTSUPP;
-   /* NOTE: limited by the USB ctrl message constraints
-* Zero length reads always succeed, even if no device is connected */
+   /*
+* NOTE: limited by the USB ctrl message constraints
+* Zero length reads always succeed, even if no device is connected
+*/
 
/* Write to i2c device */
ret = dev-em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len);
@@ -202,9 +204,11 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 
addr, u8 *buf,
return ret;
}
msleep(5);
-   /* NOTE: do we really have to wait for success ?
-  Never seen anything else than 0x00 or 0x10
-  (even with high payload) ... */
+   /*
+* NOTE: do we really have to wait for success ?
+* Never seen anything else than 0x00 or 0x10
+* (even with high payload) ...
+*/
}
em28xx_warn(write to i2c device at 0x%x timed out\n, addr);
return -EIO;
@@ -220,8 +224,10 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 
addr, u8 *buf, u16 len)
 
if (len  1 || len  64)
return -EOPNOTSUPP;
-   /* NOTE: limited by the USB ctrl message constraints
-* Zero length reads always succeed, even if no device is connected */
+   /*
+* NOTE: limited by the USB ctrl message constraints
+* Zero length reads always succeed, even if no device is connected
+*/
 
/* Read data from i2c device */
ret = dev-em28xx_read_reg_req_len(dev, 2, addr, buf, len);
@@ -230,7 +236,8 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 
addr, u8 *buf, u16 len)
addr, ret);
return ret;
}
-   /* NOTE: some devices with two i2c busses have the bad habit to return 0
+   /*
+* NOTE: some devices with two i2c busses have the bad habit to return 0
 * bytes if we are on bus B AND there was no write attempt to the
 * specified slave address before AND no device is present at the
 * requested slave address.
@@ -366,9 +373,10 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
return num;
 }
 
-/* based on linux/sunrpc/svcauth.h and linux/hash.h
+/*
+ * based on linux/sunrpc/svcauth.h and linux/hash.h
  * The original hash function returns a different value, if arch is x86_64
- *  or i386.
+ * or i386.
  */
 static inline unsigned long em28xx_hash_mem(char *buf, int length, int bits)
 {
@@ -391,8 +399,10 @@ static inline unsigned long em28xx_hash_mem(char *buf, int 
length, int bits)
return (hash  (32 - bits))  0xUL;
 }
 
-/* Helper function to read data blocks from i2c clients with 8 or 16 bit
- * address width, 8 bit register width and auto incrementation been activated 
*/
+/*
+ * Helper function to read data blocks from i2c clients with 8 or 16 bit
+ * address width, 8 bit register width and auto incrementation been activated
+ */
 static int em28xx_i2c_read_block(struct em28xx *dev, unsigned bus, u16 addr,
 bool addr_w16, u16 len, u8 *data)
 {
@@ -434,9 +444,11 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned 
bus,
 u8 **eedata, u16 *eedata_len)
 {
const u16 len = 256;
-   /* FIXME common length/size for bytes to read, to display, hash
+   /*
+* FIXME common length/size for bytes to read, to display, hash
 * calculation and returned device dataset. Simplifies the code a lot,
-* but we might have to deal with multiple sizes in the future !  */
+* but we might have to deal with multiple sizes in the future !
+*/
int i, err;
struct em28xx_eeprom *dev_config;
u8 buf, *data;
@@ -497,7 +509,8 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned 
bus,
em28xx_info(EEPROM info:\n);
em28xx_info(\tmicrocode start address = 0x%04x, boot 
configuration = 0x%02x\n,
mc_start, data[2]);
-   /* boot configuration (address 0x0002):
+   /*
+* boot configuration (address 0x0002):
 * [0]   microcode download speed: 1 = 400 kHz; 0 = 100 kHz
 * [1]   always selects 

Re: [PATCH v2 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations

2013-03-24 Thread Frank Schäfer
Am 24.03.2013 15:02, schrieb Mauro Carvalho Chehab:
 Em Sun, 24 Mar 2013 13:53:40 +0100
 Frank Schäfer fschaefer@googlemail.com escreveu:

 Am 24.03.2013 12:38, schrieb Mauro Carvalho Chehab:
 Em Sat, 23 Mar 2013 18:27:08 +0100
 Frank Schäfer fschaefer@googlemail.com escreveu:

 The webcam SpeedLink VAD Laplace (em2765 + ov2640) uses a special 
 algorithm
 for i2c communication with the sensor, which is connected to a second i2c 
 bus.

 We don't know yet how to find out which devices support/use it.
 It's very likely used by all em25xx and em276x+ bridges.
 Tests with other em28xx chips (em2820, em2882/em2883) show, that this
 algorithm always succeeds there although no slave device is connected.

 The algorithm likely also works for real i2c client devices (OV2640 uses 
 SCCB),
 because the Windows driver seems to use it for probing Samsung and Kodak
 sensors.

 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/usb/em28xx/em28xx-cards.c |8 +-
  drivers/media/usb/em28xx/em28xx-i2c.c   |  229 
 +--
  drivers/media/usb/em28xx/em28xx.h   |   10 +-
  3 Dateien geändert, 205 Zeilen hinzugefügt(+), 42 Zeilen entfernt(-)

 diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
 b/drivers/media/usb/em28xx/em28xx-cards.c
 index cb7cdd3..033b6cb 100644
 --- a/drivers/media/usb/em28xx/em28xx-cards.c
 +++ b/drivers/media/usb/em28xx/em28xx-cards.c
 @@ -3139,15 +3139,19 @@ static int em28xx_init_dev(struct em28xx *dev, 
 struct usb_device *udev,
rt_mutex_init(dev-i2c_bus_lock);
  
/* register i2c bus 0 */
 -  retval = em28xx_i2c_register(dev, 0);
 +  if (dev-board.is_em2800)
 +  retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
 +  else
 +  retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
if (retval  0) {
em28xx_errdev(%s: em28xx_i2c_register bus 0 - error [%d]!\n,
__func__, retval);
goto unregister_dev;
}
  
 +  /* register i2c bus 1 */
if (dev-def_i2c_bus) {
 -  retval = em28xx_i2c_register(dev, 1);
 +  retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX);
if (retval  0) {
em28xx_errdev(%s: em28xx_i2c_register bus 1 - error 
 [%d]!\n,
__func__, retval);
 diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
 b/drivers/media/usb/em28xx/em28xx-i2c.c
 index 9e2fa41..ab14ac3 100644
 --- a/drivers/media/usb/em28xx/em28xx-i2c.c
 +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
 @@ -5,6 +5,7 @@
  Markus Rechberger mrechber...@gmail.com
  Mauro Carvalho Chehab mche...@infradead.org
  Sascha Sommer saschasom...@freenet.de
 +   Copyright (C) 2013 Frank Schäfer fschaefer@googlemail.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
 @@ -274,6 +275,176 @@ static int em28xx_i2c_check_for_device(struct em28xx 
 *dev, u16 addr)
  }
  
  /*
 + * em25xx_bus_B_send_bytes
 + * write bytes to the i2c device
 + */
 +static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
 + u16 len)
 +{
 +  int ret;
 +
 +  if (len  1 || len  64)
 +  return -EOPNOTSUPP;
 +  /* NOTE: limited by the USB ctrl message constraints
 +   * Zero length reads always succeed, even if no device is connected */
 +
 +  /* Set register and write value */
 +  ret = dev-em28xx_write_regs_req(dev, 0x06, addr, buf, len);
 +  /* NOTE:
 +   * 0 byte writes always succeed, even if no device is connected. */
 You already noticed it on the previous note.
 Yes. ;)
 Well, there's no need to repeat the same thing twice at the same function ;)

Uhm yes... WTF... !??
This stuff has definitely been rebased too often... ;)


 +  if (ret != len) {
 +  if (ret  0) {
 +  em28xx_warn(writing to i2c device at 0x%x failed 
 +  (error=%i)\n, addr, ret);
 +  return ret;
 +  } else {
 +  em28xx_warn(%i bytes write to i2c device at 0x%x 
 +  requested, but %i bytes written\n,
 +  len, addr, ret);
 +  return -EIO;
 +  }
 +  }
 +  /* Check success */
 +  ret = dev-em28xx_read_reg_req(dev, 0x08, 0x);
 +  /* NOTE: the only error we've seen so far is
 +   * 0x01 when the slave device is not present */
 +  if (ret == 0x00) {
 Please simplify. just use:
 if (!ret)
 I would like to keep it as is because I think it better expresses the
 purposes of this check. I also used 0x00 instead of 0 on purpose.
 Why do you think it better expresses it? It is just a more verbose way
 of doing the same thing. 

 If you want to better express, then add a comment:
   /* 
* Reg 08 value 0 means that the operation succeeded.
* different values indicate 

[PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy

2013-03-24 Thread Chen Gang

  for NUL terminated string, need always set '\0' in the end.

Signed-off-by: Chen Gang gang.c...@asianux.com
---
 drivers/staging/media/go7007/saa7134-go7007.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/media/go7007/saa7134-go7007.c 
b/drivers/staging/media/go7007/saa7134-go7007.c
index cf7c34a..2d1c6c2 100644
--- a/drivers/staging/media/go7007/saa7134-go7007.c
+++ b/drivers/staging/media/go7007/saa7134-go7007.c
@@ -456,7 +456,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
if (go == NULL)
goto allocfail;
go-board_id = GO7007_BOARDID_PCI_VOYAGER;
-   strncpy(go-name, saa7134_boards[dev-board].name, sizeof(go-name));
+   strlcpy(go-name, saa7134_boards[dev-board].name, sizeof(go-name));
go-hpi_ops = saa7134_go7007_hpi_ops;
go-hpi_context = saa;
saa-dev = dev;
-- 
1.7.7.6
--
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: Status of the patches under review at LMML (32 patches)

2013-03-24 Thread Prabhakar Lad
Hi Mauro,

On Sun, Mar 24, 2013 at 11:41 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 This is the summary of the patches that are currently under review at
 Linux Media Mailing List linux-media@vger.kernel.org.
 Each patch is represented by its submission date, the subject (up to 70
 chars) and the patchwork link (if submitted via email).

 P.S.: This email is c/c to the developers where some action is expected.
   If you were copied, please review the patches, acking/nacking or
   submitting an update.

 It took me a lot of time to handle patches this time. The good news is that
 there's just one patch without an owner.


[Snip]


 == Prabhakar Lad prabhakar@ti.com ==

 Oct,24 2012: [media] vpif_display: fix return value check in vpif_reqbufs()   
   http://patchwork.linuxtv.org/patch/15167  Wei Yongjun 
 yongjun_...@trendmicro.com.cn

This patch can be marked as 'Superseded'.

Regards,
--Prabhakar
--
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 1/2] media: davinci: vpss: enable vpss clocks

2013-03-24 Thread Sekhar Nori
On 3/22/2013 1:23 PM, Prabhakar lad wrote:
 From: Lad, Prabhakar prabhakar.cse...@gmail.com
 
 By default the VPSS clocks are only enabled in capture driver
 for davinci family which creates duplicates. This
 patch adds support to enable the VPSS clocks in VPSS driver.
 This avoids duplication of code and also adding clock aliases.
 This patch cleanups the VPSS clock enabling in the capture driver,
 and also removes the clock alias in machine file. Along side adds
 a vpss slave clock for DM365 as mentioned by Sekhar
 (https://patchwork.kernel.org/patch/1221261/).
 
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  arch/arm/mach-davinci/dm355.c|3 -
  arch/arm/mach-davinci/dm365.c|9 +++-
  arch/arm/mach-davinci/dm644x.c   |5 --
  drivers/media/platform/davinci/dm355_ccdc.c  |   39 +
  drivers/media/platform/davinci/dm644x_ccdc.c |   44 ---
  drivers/media/platform/davinci/isif.c|   28 ++--
  drivers/media/platform/davinci/vpss.c|   60 
 ++
  7 files changed, 72 insertions(+), 116 deletions(-)
 
  static struct clk arm_clk = {
   .name   = arm_clk,
   .parent = pll2_sysclk2,
 @@ -450,6 +456,7 @@ static struct clk_lookup dm365_clks[] = {
   CLK(NULL, pll2_sysclk9, pll2_sysclk9),
   CLK(NULL, vpss_dac, vpss_dac_clk),
   CLK(NULL, vpss_master, vpss_master_clk),
 + CLK(NULL, vpss_slave, vpss_slave_clk),

These should use device name for look-up instead of relying just on
con_id. So the entry should look like:

CLK(vpss, slave, vpss_slave_clk),

   CLK(NULL, arm, arm_clk),
   CLK(NULL, uart0, uart0_clk),
   CLK(NULL, uart1, uart1_clk),
 @@ -1239,8 +1246,6 @@ static int __init dm365_init_devices(void)
   clk_add_alias(NULL, dev_name(dm365_mdio_device.dev),
 NULL, dm365_emac_device.dev);
  
 - /* Add isif clock alias */
 - clk_add_alias(master, dm365_isif_dev.name, vpss_master, NULL);
   platform_device_register(dm365_vpss_device);
   platform_device_register(dm365_isif_dev);
   platform_device_register(vpfe_capture_dev);
 diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
 index ee0e994..026e7e3 100644
 --- a/arch/arm/mach-davinci/dm644x.c
 +++ b/arch/arm/mach-davinci/dm644x.c
 @@ -901,11 +901,6 @@ int __init dm644x_init_video(struct vpfe_config 
 *vpfe_cfg,
   dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
   platform_device_register(dm644x_ccdc_dev);
   platform_device_register(dm644x_vpfe_dev);
 - /* Add ccdc clock aliases */
 - clk_add_alias(master, dm644x_ccdc_dev.name,
 -   vpss_master, NULL);
 - clk_add_alias(slave, dm644x_ccdc_dev.name,
 -   vpss_slave, NULL);
   }
  
   if (vpbe_cfg) {
 diff --git a/drivers/media/platform/davinci/dm355_ccdc.c 
 b/drivers/media/platform/davinci/dm355_ccdc.c
 index 2364dba..05f8fb7 100644
 --- a/drivers/media/platform/davinci/dm355_ccdc.c
 +++ b/drivers/media/platform/davinci/dm355_ccdc.c
 @@ -37,7 +37,6 @@
  #include linux/platform_device.h
  #include linux/uaccess.h
  #include linux/videodev2.h
 -#include linux/clk.h
  #include linux/err.h
  #include linux/module.h
  
 @@ -59,10 +58,6 @@ static struct ccdc_oper_config {
   struct ccdc_params_raw bayer;
   /* YCbCr configuration */
   struct ccdc_params_ycbcr ycbcr;
 - /* Master clock */
 - struct clk *mclk;
 - /* slave clock */
 - struct clk *sclk;
   /* ccdc base address */
   void __iomem *base_addr;
  } ccdc_cfg = {
 @@ -997,32 +992,10 @@ static int dm355_ccdc_probe(struct platform_device 
 *pdev)
   goto fail_nomem;
   }
  
 - /* Get and enable Master clock */
 - ccdc_cfg.mclk = clk_get(pdev-dev, master);
 - if (IS_ERR(ccdc_cfg.mclk)) {
 - status = PTR_ERR(ccdc_cfg.mclk);
 - goto fail_nomap;
 - }
 - if (clk_prepare_enable(ccdc_cfg.mclk)) {
 - status = -ENODEV;
 - goto fail_mclk;
 - }
 -
 - /* Get and enable Slave clock */
 - ccdc_cfg.sclk = clk_get(pdev-dev, slave);
 - if (IS_ERR(ccdc_cfg.sclk)) {
 - status = PTR_ERR(ccdc_cfg.sclk);
 - goto fail_mclk;
 - }
 - if (clk_prepare_enable(ccdc_cfg.sclk)) {
 - status = -ENODEV;
 - goto fail_sclk;
 - }
 -
   /* Platform data holds setup_pinmux function ptr */
   if (NULL == pdev-dev.platform_data) {
   status = -ENODEV;
 - goto fail_sclk;
 + goto fail_nomap;
   }
   setup_pinmux = pdev-dev.platform_data;
   /*
 @@ -1033,12 +1006,6 @@ static int dm355_ccdc_probe(struct platform_device 
 *pdev)
   ccdc_cfg.dev = pdev-dev;
   printk(KERN_NOTICE %s is registered with vpfe.\n, ccdc_hw_dev.name);
   return 0;
 -fail_sclk:
 - 

[PATCH 1/2] [media] tw9906: Remove unneeded version.h header include

2013-03-24 Thread Sachin Kamat
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/tw9906.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/i2c/tw9906.c b/drivers/media/i2c/tw9906.c
index 2263a91..d94325b 100644
--- a/drivers/media/i2c/tw9906.c
+++ b/drivers/media/i2c/tw9906.c
@@ -17,7 +17,6 @@
 
 #include linux/module.h
 #include linux/init.h
-#include linux/version.h
 #include linux/i2c.h
 #include linux/videodev2.h
 #include linux/ioctl.h
-- 
1.7.4.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 2/2] [media] go7007: Remove unneeded version.h header include

2013-03-24 Thread Sachin Kamat
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/staging/media/go7007/go7007-v4l2.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c 
b/drivers/staging/media/go7007/go7007-v4l2.c
index 24ba50e..50eb69a 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -17,7 +17,6 @@
 
 #include linux/module.h
 #include linux/init.h
-#include linux/version.h
 #include linux/delay.h
 #include linux/sched.h
 #include linux/spinlock.h
-- 
1.7.4.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


Re: [RFC 11/12] media: m5mols: Adding dt support to m5mols driver

2013-03-24 Thread Shaik Ameer Basha
Hi Sylwester,

Thanks for the review.
Actually I agree with all of your review comments.

This was just a temporary test patch, used to test exynos5-mdev.
I thought for some one to test exynos5-mdev series patches, i need to
provide one working m5mols dt driver.

Good to hear you already have one patch for this driver.
If you can able to post the dt patch for this driver, I will use that.

Regards,
Shaik Ameer Basha


On Sat, Mar 23, 2013 at 5:26 PM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 Hi Shaik,


 On 03/06/2013 12:53 PM, Shaik Ameer Basha wrote:

 This patch adds the dt support to m5mols driver.

 Signed-off-by: Shaik Ameer Bashashaik.am...@samsung.com
 ---
   drivers/media/i2c/m5mols/m5mols_core.c |   54
 +++-
   1 file changed, 53 insertions(+), 1 deletion(-)

 diff --git a/drivers/media/i2c/m5mols/m5mols_core.c
 b/drivers/media/i2c/m5mols/m5mols_core.c
 index d4e7567..21c66ef 100644
 --- a/drivers/media/i2c/m5mols/m5mols_core.c
 +++ b/drivers/media/i2c/m5mols/m5mols_core.c
 @@ -19,6 +19,8 @@
   #includelinux/interrupt.h
   #includelinux/delay.h
   #includelinux/gpio.h
 +#includelinux/of_gpio.h
 +#includelinux/pinctrl/consumer.h


 What would you need pinctrl for ? In most cases this driver just needs one
 GPIO
 (sensor RESET), which is normally passed in gpios property.


   #includelinux/regulator/consumer.h
   #includelinux/videodev2.h
   #includelinux/module.h
 @@ -926,13 +928,38 @@ static irqreturn_t m5mols_irq_handler(int irq, void
 *data)
 return IRQ_HANDLED;
   }

 +static const struct of_device_id m5mols_match[];
 +
   static int m5mols_probe(struct i2c_client *client,
 const struct i2c_device_id *id)
   {
 -   const struct m5mols_platform_data *pdata =
 client-dev.platform_data;
 +   struct m5mols_platform_data *pdata;
 struct m5mols_info *info;
 +   const struct of_device_id *of_id;
 struct v4l2_subdev *sd;
 int ret;
 +   struct pinctrl *pctrl;
 +   int eint_gpio = 0;
 +
 +   if (client-dev.of_node) {
 +   of_id = of_match_node(m5mols_match, client-dev.of_node);
 +   if (of_id)
 +   pdata = (struct m5mols_platform_data
 *)of_id-data;
 +   client-dev.platform_data = pdata;


 Oh, no. Probably best thing to do would be to get rid of struct
 m5mols_platform_data pointer from struct m5mols_info and just add gpio_reset
 field there. That's what we have currently in the driver's platform data
 structure.

 struct m5mols_platform_data {
 int gpio_reset;
 u8 reset_polarity;
 int (*set_power)(struct device *dev, int on);
 };

 gpio_reset and reset_polarity are already handled in the driver, and for
 this we just need a single entry in 'gpios' property.

 set_power callback can't be supported. Luckily there seems to be no board
 that needs it any more. So we just drop it. One solution for more complex
 power sequence could be the Runtime Interpreted Power Sequences. Once it
 is available we might be able to describe what was previously in a board
 file in set_power callback in the device tree.


 +   } else {
 +   pdata = client-dev.platform_data;
 +   }
 +
 +   if (!pdata)
 +   return -EINVAL;
 +
 +   pctrl = devm_pinctrl_get_select_default(client-dev);


 Two issues here:

 1. m5mols DT node doesn't include pinctrl property, does it ?
 2. default pinctrl state is now being handled in the driver core.

 Hence this pinctrl set up could well be removed.


 +   if (client-dev.of_node) {
 +   eint_gpio = of_get_named_gpio(client-dev.of_node,
 gpios, 0);
 +   client-irq = gpio_to_irq(eint_gpio);
 +   pdata-gpio_reset = of_get_named_gpio(client-dev.of_node,
 +   gpios,
 1);


 Err, now when pinctrl and generic GPIO DT bindings are supported on Exynos5
 this should not be needed at all. request_irq() should work when you add
 relevant properties in this device DT node. Please see exynos4210-trats.dts,
 mms114-touchscreen node for an example.

 mms114-touchscreen@48 {
 ...
 interrupt-parent = gpx0;
 interrupts = 4 2;
 ...
 };

 You specify GPIO bank in the 'interrupt-parent' property, and the GPIO
 index within the bank in first cell of 'interrupts' property. The second
 cell are interrupt flags as defined in /Documentation/devicetree/bindings/
 interrupt-controller/interrupts.txt. I'm not sure how this interacts with
 the interrupt flags passed to request_irq ATM.

 It's the pinctrl driver's task to configure the GPIO pinmux into EINT
 function, when the above properties are present in device DT node.


 +   }

 if (pdata == NULL) {
 dev_err(client-dev, No platform data\n);
 @@ -1040,9 +1067,34 @@ static const struct i2c_device_id m5mols_id[] = {
   };
   

Re: [PATCH 2/2] media: davinci: vpbe: venc: move the enabling of vpss clocks to driver

2013-03-24 Thread Sekhar Nori
On 3/22/2013 1:23 PM, Prabhakar lad wrote:
 From: Lad, Prabhakar prabhakar.cse...@gmail.com
 
 The vpss clocks were enabled by calling a exported function from a driver
 in a machine code. calling driver code from platform code is incorrect way.
 
 This patch fixes this issue and calls the function from driver code itself.
 
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  Note: This patch is based on the comment from Sekhar
   (https://patchwork-mail1.kernel.org/patch/2278441/).
   Shekar I haven't completely removed the callback, I just added
   the function calls after the callback. As you mentioned just to
   pass the VPSS_CLK_CTRL as a resource to venc but the VPSS_CLK_CTRL
   is already being used by VPSS driver. I'll take this cleanup task later
   point of time.

Fine by me.

Thanks,
Sekhar
--
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