Re: [PATCH] Fix spelling of Qt in .desktop file (typo)

2013-05-26 Thread Diego Viola
This patch is for v4l-utils.git. Please apply it.

Thanks,

Diego

On Sun, May 26, 2013 at 4:15 AM, Diego Viola  wrote:
> Proper spelling of Qt is Qt, not QT.  "QT" is often confused with
> QuickTime, here is a minor patch to fix this issue in the .desktop file.
>
> Signed-off-by: Diego Viola 
> ---
>  utils/qv4l2/qv4l2.desktop | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utils/qv4l2/qv4l2.desktop b/utils/qv4l2/qv4l2.desktop
> index 00f3e33..69413e1 100644
> --- a/utils/qv4l2/qv4l2.desktop
> +++ b/utils/qv4l2/qv4l2.desktop
> @@ -1,5 +1,5 @@
>  [Desktop Entry]
> -Name=QT V4L2 test Utility
> +Name=Qt V4L2 test Utility
>  Name[pt]=Utilitário de teste V4L2
>  Comment=Allow testing Video4Linux devices
>  Comment[pt]=Permite testar dispositivos Video4Linux
> --
> 1.8.2.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 16/24] drivers/media/pci/mantis/mantis_cards: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean

Signed-off-by: Libo Chen 
---
 drivers/media/pci/mantis/mantis_cards.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/mantis/mantis_cards.c 
b/drivers/media/pci/mantis/mantis_cards.c
index 932a0d7..801fc55 100644
--- a/drivers/media/pci/mantis/mantis_cards.c
+++ b/drivers/media/pci/mantis/mantis_cards.c
@@ -290,18 +290,7 @@ static struct pci_driver mantis_pci_driver = {
.remove = mantis_pci_remove,
 };
 
-static int mantis_init(void)
-{
-   return pci_register_driver(&mantis_pci_driver);
-}
-
-static void mantis_exit(void)
-{
-   return pci_unregister_driver(&mantis_pci_driver);
-}
-
-module_init(mantis_init);
-module_exit(mantis_exit);
+module_pci_driver(mantis_pci_driver);
 
 MODULE_DESCRIPTION("MANTIS driver");
 MODULE_AUTHOR("Manu Abraham");
-- 
1.7.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 18/24] drivers/media/pci/mantis/hopper_cards: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen 
---
 drivers/media/pci/mantis/hopper_cards.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/mantis/hopper_cards.c 
b/drivers/media/pci/mantis/hopper_cards.c
index 6fe9fe5..104914a 100644
--- a/drivers/media/pci/mantis/hopper_cards.c
+++ b/drivers/media/pci/mantis/hopper_cards.c
@@ -260,18 +260,7 @@ static struct pci_driver hopper_pci_driver = {
.remove = hopper_pci_remove,
 };
 
-static int hopper_init(void)
-{
-   return pci_register_driver(&hopper_pci_driver);
-}
-
-static void hopper_exit(void)
-{
-   return pci_unregister_driver(&hopper_pci_driver);
-}
-
-module_init(hopper_init);
-module_exit(hopper_exit);
+module_pci_driver(hopper_pci_driver);
 
 MODULE_DESCRIPTION("HOPPER driver");
 MODULE_AUTHOR("Manu Abraham");
-- 
1.7.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 19/24] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen 
---
 drivers/media/pci/dm1105/dm1105.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/dm1105/dm1105.c 
b/drivers/media/pci/dm1105/dm1105.c
index 026767b..ab797fe 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -1241,18 +1241,7 @@ static struct pci_driver dm1105_driver = {
.remove = dm1105_remove,
 };
 
-static int __init dm1105_init(void)
-{
-   return pci_register_driver(&dm1105_driver);
-}
-
-static void __exit dm1105_exit(void)
-{
-   pci_unregister_driver(&dm1105_driver);
-}
-
-module_init(dm1105_init);
-module_exit(dm1105_exit);
+module_pci_driver(dm1105_driver);
 
 MODULE_AUTHOR("Igor M. Liplianin ");
 MODULE_DESCRIPTION("SDMC DM1105 DVB driver");
-- 
1.7.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 22/24] drivers/media/radio/radio-maxiradio: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean

Signed-off-by: Libo Chen 
---
 drivers/media/radio/radio-maxiradio.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/radio/radio-maxiradio.c 
b/drivers/media/radio/radio-maxiradio.c
index bd4d3a7..1d1c9e1 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -200,15 +200,4 @@ static struct pci_driver maxiradio_driver = {
.remove = maxiradio_remove,
 };
 
-static int __init maxiradio_init(void)
-{
-   return pci_register_driver(&maxiradio_driver);
-}
-
-static void __exit maxiradio_exit(void)
-{
-   pci_unregister_driver(&maxiradio_driver);
-}
-
-module_init(maxiradio_init);
-module_exit(maxiradio_exit);
+module_pci_driver(maxiradio_driver);
-- 
1.7.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 20/24] drivers/media/pci/pluto2/pluto2: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen 
---
 drivers/media/pci/pluto2/pluto2.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/pluto2/pluto2.c 
b/drivers/media/pci/pluto2/pluto2.c
index 2290fae..4938285 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -796,18 +796,7 @@ static struct pci_driver pluto2_driver = {
.remove = pluto2_remove,
 };
 
-static int __init pluto2_init(void)
-{
-   return pci_register_driver(&pluto2_driver);
-}
-
-static void __exit pluto2_exit(void)
-{
-   pci_unregister_driver(&pluto2_driver);
-}
-
-module_init(pluto2_init);
-module_exit(pluto2_exit);
+module_pci_driver(pluto2_driver);
 
 MODULE_AUTHOR("Andreas Oberritter ");
 MODULE_DESCRIPTION("Pluto2 driver");
-- 
1.7.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 17/24] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen 
---
 drivers/media/pci/b2c2/flexcop-pci.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/b2c2/flexcop-pci.c 
b/drivers/media/pci/b2c2/flexcop-pci.c
index 44f8fb5..447afbd 100644
--- a/drivers/media/pci/b2c2/flexcop-pci.c
+++ b/drivers/media/pci/b2c2/flexcop-pci.c
@@ -432,18 +432,7 @@ static struct pci_driver flexcop_pci_driver = {
.remove   = flexcop_pci_remove,
 };
 
-static int __init flexcop_pci_module_init(void)
-{
-   return pci_register_driver(&flexcop_pci_driver);
-}
-
-static void __exit flexcop_pci_module_exit(void)
-{
-   pci_unregister_driver(&flexcop_pci_driver);
-}
-
-module_init(flexcop_pci_module_init);
-module_exit(flexcop_pci_module_exit);
+module_pci_driver(flexcop_pci_driver);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_NAME);
-- 
1.7.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 21/24] drivers/media/pci/pt1/pt1: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen 
---
 drivers/media/pci/pt1/pt1.c |   15 +--
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index e921108..75ce142 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1225,20 +1225,7 @@ static struct pci_driver pt1_driver = {
.id_table   = pt1_id_table,
 };
 
-
-static int __init pt1_init(void)
-{
-   return pci_register_driver(&pt1_driver);
-}
-
-
-static void __exit pt1_cleanup(void)
-{
-   pci_unregister_driver(&pt1_driver);
-}
-
-module_init(pt1_init);
-module_exit(pt1_cleanup);
+module_pci_driver(pt1_driver);
 
 MODULE_AUTHOR("Takahito HIRANO ");
 MODULE_DESCRIPTION("Earthsoft PT1/PT2 Driver");
-- 
1.7.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: [PATCH RFC] media: Rename media_entity_remote_source to media_entity_remote_pad

2013-05-26 Thread Sylwester Nawrocki

On 01/22/2013 09:24 AM, Andrzej Hajda wrote:

Function media_entity_remote_source actually returns the remote pad to
the given one, regardless if this is the source or the sink pad.
Name media_entity_remote_pad is more adequate for this function.


It seems this patch had slipped through the cracks.

Laurent, would you have any comments on this patch ?

I might have rebased it on top of this series [1], once it is reviewed
and merged.

[1] http://www.spinics.net/lists/linux-media/msg63423.html

Regards,
Sylwester


Signed-off-by: Andrzej Hajda
Signed-off-by: Kyungmin Park
---
  Documentation/media-framework.txt|2 +-
  drivers/media/media-entity.c |   13 ++---
  drivers/media/platform/omap3isp/isp.c|6 +++---
  drivers/media/platform/omap3isp/ispccdc.c|2 +-
  drivers/media/platform/omap3isp/ispccp2.c|2 +-
  drivers/media/platform/omap3isp/ispcsi2.c|2 +-
  drivers/media/platform/omap3isp/ispvideo.c   |6 +++---
  drivers/media/platform/s3c-camif/camif-capture.c |2 +-
  drivers/media/platform/s5p-fimc/fimc-capture.c   |8 
  drivers/media/platform/s5p-fimc/fimc-lite.c  |4 ++--
  drivers/media/platform/s5p-fimc/fimc-mdevice.c   |2 +-
  drivers/staging/media/davinci_vpfe/vpfe_video.c  |   12 ++--
  include/media/media-entity.h |2 +-
  13 files changed, 31 insertions(+), 32 deletions(-)

diff --git a/Documentation/media-framework.txt 
b/Documentation/media-framework.txt
index 8028754..e68744a 100644
--- a/Documentation/media-framework.txt
+++ b/Documentation/media-framework.txt
@@ -265,7 +265,7 @@ connected to another pad through an enabled link
media_entity_find_link(struct media_pad *source,
   struct media_pad *sink);

-   media_entity_remote_source(struct media_pad *pad);
+   media_entity_remote_pad(struct media_pad *pad);

  Refer to the kerneldoc documentation for more information.

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index e1cd132..0438209 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -560,17 +560,16 @@ media_entity_find_link(struct media_pad *source, struct 
media_pad *sink)
  EXPORT_SYMBOL_GPL(media_entity_find_link);

  /**
- * media_entity_remote_source - Find the source pad at the remote end of a link
- * @pad: Sink pad at the local end of the link
+ * media_entity_remote_pad - Find the pad at the remote end of a link
+ * @pad: Pad at the local end of the link
   *
- * Search for a remote source pad connected to the given sink pad by iterating
- * over all links originating or terminating at that pad until an enabled link
- * is found.
+ * Search for a remote pad connected to the given pad by iterating over all
+ * links originating or terminating at that pad until an enabled link is found.
   *
   * Return a pointer to the pad at the remote end of the first found enabled
   * link, or NULL if no enabled link has been found.
   */
-struct media_pad *media_entity_remote_source(struct media_pad *pad)
+struct media_pad *media_entity_remote_pad(struct media_pad *pad)
  {
unsigned int i;

@@ -590,4 +589,4 @@ struct media_pad *media_entity_remote_source(struct 
media_pad *pad)
return NULL;

  }
-EXPORT_SYMBOL_GPL(media_entity_remote_source);
+EXPORT_SYMBOL_GPL(media_entity_remote_pad);
diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index a9f6de5..5bb1698 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -757,7 +757,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
if (!(pad->flags&  MEDIA_PAD_FL_SINK))
break;

-   pad = media_entity_remote_source(pad);
+   pad = media_entity_remote_pad(pad);
if (pad == NULL ||
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break;
@@ -847,7 +847,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
if (!(pad->flags&  MEDIA_PAD_FL_SINK))
break;

-   pad = media_entity_remote_source(pad);
+   pad = media_entity_remote_pad(pad);
if (pad == NULL ||
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break;
@@ -963,7 +963,7 @@ static int isp_pipeline_is_last(struct media_entity *me)
pipe = to_isp_pipeline(me);
if (pipe->stream_state == ISP_PIPELINE_STREAM_STOPPED)
return 0;
-   pad = media_entity_remote_source(&pipe->output->pad);
+   pad = media_entity_remote_pad(&pipe->output->pad);
return pad->entity == me;
  }

diff --git a/drivers/media/platform/omap3isp/ispccdc.c 
b/drivers/media/platform/omap3isp/ispccdc.c
index 60e60aa..907a205 100644
--- a/drivers/media/pl

Re: [RFC PATCH 00/24] Remove VIDIOC_DBG_G_CHIP_IDENT

2013-05-26 Thread Hans Verkuil
On Sun May 26 2013 20:42:10 Jon Arne Jørgensen wrote:
> On Sun, May 26, 2013 at 03:26:55PM +0200, Hans Verkuil wrote:
> > With the introduction in 3.10 of the new superior VIDIOC_DBG_G_CHIP_INFO
> > ioctl there is no longer any need for the DBG_G_CHIP_IDENT ioctl or the
> > v4l2-chip-ident.h header.
> > 
> > This patch series removes all code related to this ioctl and the
> > v4l2-chip-ident.h header.
> > 
> > This patch series simplifies drivers substantially and deletes over 2800
> > lines in total.
> >
> Maybe a stupid question, but what tree should I apply this patch set to?
> I can't get it to apply to any of my kernel-trees.

Not a stupid question at all. I should have mentioned that this patch series
sits on top of my for-v3.11 tree:

http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/for-v3.11

Regards,

Hans

> I tried your hverkuil/media_tree.git, but could not get it to apply
> there either.
> 
> Best regards,
> Jon Arne
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 00/24] Remove VIDIOC_DBG_G_CHIP_IDENT

2013-05-26 Thread Jon Arne Jørgensen
On Sun, May 26, 2013 at 03:26:55PM +0200, Hans Verkuil wrote:
> With the introduction in 3.10 of the new superior VIDIOC_DBG_G_CHIP_INFO
> ioctl there is no longer any need for the DBG_G_CHIP_IDENT ioctl or the
> v4l2-chip-ident.h header.
> 
> This patch series removes all code related to this ioctl and the
> v4l2-chip-ident.h header.
> 
> This patch series simplifies drivers substantially and deletes over 2800
> lines in total.
>
Maybe a stupid question, but what tree should I apply this patch set to?
I can't get it to apply to any of my kernel-trees.

I tried your hverkuil/media_tree.git, but could not get it to apply
there either.

Best regards,
Jon Arne

> Regards,
> 
>   Hans
> 
>  Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml  |  271 ---
>  b/Documentation/DocBook/media/v4l/compat.xml |   14 
>  b/Documentation/DocBook/media/v4l/v4l2.xml   |   11 
>  b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml |   17 
>  b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml  |   40 -
>  b/Documentation/video4linux/v4l2-framework.txt   |   13 
>  b/Documentation/zh_CN/video4linux/v4l2-framework.txt |   13 
>  b/drivers/media/common/saa7146/saa7146_video.c   |   23 
>  b/drivers/media/common/tveeprom.c|  142 +--
>  b/drivers/media/dvb-frontends/au8522_decoder.c   |   17 
>  b/drivers/media/i2c/ad9389b.c|   21 
>  b/drivers/media/i2c/adv7170.c|   13 
>  b/drivers/media/i2c/adv7175.c|9 
>  b/drivers/media/i2c/adv7180.c|   10 
>  b/drivers/media/i2c/adv7183.c|   22 
>  b/drivers/media/i2c/adv7343.c|   10 
>  b/drivers/media/i2c/adv7393.c|   10 
>  b/drivers/media/i2c/adv7604.c|   18 
>  b/drivers/media/i2c/ak881x.c |   34 
>  b/drivers/media/i2c/bt819.c  |   14 
>  b/drivers/media/i2c/bt856.c  |9 
>  b/drivers/media/i2c/bt866.c  |   13 
>  b/drivers/media/i2c/cs5345.c |   17 
>  b/drivers/media/i2c/cs53l32a.c   |   10 
>  b/drivers/media/i2c/cx25840/cx25840-core.c   |   64 -
>  b/drivers/media/i2c/cx25840/cx25840-core.h   |   34 
>  b/drivers/media/i2c/ks0127.c |   16 
>  b/drivers/media/i2c/m52790.c |   15 
>  b/drivers/media/i2c/msp3400-driver.c |   10 
>  b/drivers/media/i2c/mt9m032.c|9 
>  b/drivers/media/i2c/mt9p031.c|1 
>  b/drivers/media/i2c/mt9v011.c|   24 
>  b/drivers/media/i2c/noon010pc30.c|1 
>  b/drivers/media/i2c/ov7640.c |1 
>  b/drivers/media/i2c/ov7670.c |   17 
>  b/drivers/media/i2c/saa6588.c|9 
>  b/drivers/media/i2c/saa7110.c|9 
>  b/drivers/media/i2c/saa7115.c|  107 +-
>  b/drivers/media/i2c/saa7127.c|   47 -
>
>  b/drivers/media/i2c/saa717x.c|7  
>
>  b/drivers/media/i2c/saa7185.c|9  
>
>  b/drivers/media/i2c/saa7191.c|   10  
>
>  b/drivers/media/i2c/soc_camera/imx074.c  |   19  
>
>  b/drivers/media/i2c/soc_camera/mt9m001.c |   33  
>
>  b/drivers/media/i2c/soc_camera/mt9m111.c |   33  
>
>  b/drivers/media/i2c/soc_camera/mt9t031.c |   32  
>
>  b/drivers/media/i2c/soc_camera/mt9t112.c |   16  
>
>  b/drivers/media/i2c/soc_camera/mt9v022.c |   47 -
>
> 

cron job: media_tree daily build: WARNINGS

2013-05-26 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 May 26 19:00:17 CEST 2013
git branch: test
git hash:   6a084d6b3dc200b855ae8a3c6771abe285a3835d
gcc version:i686-linux-gcc (GCC) 4.8.0
host hardware:  x86_64
host os:3.8-3.slh.2-amd64

linux-git-arm-davinci: OK
linux-git-arm-exynos: WARNINGS
linux-git-arm-omap: WARNINGS
linux-git-blackfin: WARNINGS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: WARNINGS
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.10-rc1-i686: WARNINGS
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: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-2.6.31.14-x86_64: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.10-rc1-x86_64: WARNINGS
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: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
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


Re: EM28xx - new device ID - Ion

2013-05-26 Thread alxgomz
Thanks a lot. I just bought the same device from my local maplin as well as
I felt lucky today! :)
Will try it soon and let you know how thing went.

regards, Alex.

--
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 v3, part2 16/20] PCI, via-camera: use hotplug-safe iterators to walk PCI buses

2013-05-26 Thread Jiang Liu
Enhance via-camera drviers to use hotplug-safe iterators to walk
PCI buses.

Signed-off-by: Jiang Liu 
Cc: Mauro Carvalho Chehab 
Cc: Daniel Drake 
Cc: Jonathan Corbet 
Cc: Javier Martin 
Cc: linux-media@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/media/platform/via-camera.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/via-camera.c 
b/drivers/media/platform/via-camera.c
index a794cd6..3ea3fac 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -1284,7 +1284,8 @@ static struct video_device viacam_v4l_template = {
 
 static bool viacam_serial_is_enabled(void)
 {
-   struct pci_bus *pbus = pci_find_bus(0, 0);
+   struct pci_bus *pbus = pci_get_bus(0, 0);
+   bool ret = false;
u8 cbyte;
 
if (!pbus)
@@ -1292,18 +1293,21 @@ static bool viacam_serial_is_enabled(void)
pci_bus_read_config_byte(pbus, VIACAM_SERIAL_DEVFN,
VIACAM_SERIAL_CREG, &cbyte);
if ((cbyte & VIACAM_SERIAL_BIT) == 0)
-   return false; /* Not enabled */
+   goto out; /* Not enabled */
if (override_serial == 0) {
printk(KERN_NOTICE "Via camera: serial port is enabled, " \
"refusing to load.\n");
printk(KERN_NOTICE "Specify override_serial=1 to force " \
"module loading.\n");
-   return true;
+   ret = true;
+   goto out;
}
printk(KERN_NOTICE "Via camera: overriding serial port\n");
pci_bus_write_config_byte(pbus, VIACAM_SERIAL_DEVFN,
VIACAM_SERIAL_CREG, cbyte & ~VIACAM_SERIAL_BIT);
-   return false;
+out:
+   pci_bus_put(pbus);
+   return ret;
 }
 
 static struct ov7670_config sensor_cfg = {
-- 
1.8.1.2

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


Re: [PATCH v3 4/9] media: davinci: vpif_capture: move the freeing of irq and global variables to remove()

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 16:00, Prabhakar Lad wrote:


From: Lad, Prabhakar 



Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.



Signed-off-by: Lad, Prabhakar 
---
  drivers/media/platform/davinci/vpif_capture.c |   31 ++--
  1 files changed, 13 insertions(+), 18 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index caaf4fe..f8b7304 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2225,17 +2225,29 @@ vpif_int_err:
   */
  static int vpif_remove(struct platform_device *device)
  {
-   int i;
+   struct platform_device *pdev;
struct channel_obj *ch;
+   struct resource *res;
+   int irq_num, i = 0;
+
+   pdev = container_of(vpif_dev, struct platform_device, dev);


   Why you need this if you should be already called with the correct 
platform device?


WBR, Sergei

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


Re: [PATCH v3 2/9] media: davinci: vpif: Convert to devm_* api

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 16:00, Prabhakar Lad wrote:


From: Lad, Prabhakar 



Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.



Signed-off-by: Lad, Prabhakar 
Acked-by: Laurent Pinchart 
---
  drivers/media/platform/davinci/vpif.c |   27 ---
  1 files changed, 4 insertions(+), 23 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index 761c825..f857d8f 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c

[...]

@@ -421,23 +419,12 @@ EXPORT_SYMBOL(vpif_channel_getfid);

  static int vpif_probe(struct platform_device *pdev)
  {
-   int status = 0;
+   static struct resource  *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

[...]

+   vpif_base = devm_request_and_ioremap(&pdev->dev, res);


   No, don't use this deprecated funtion please. Undo to 
devm_ioremap_resource().



+   if (IS_ERR(vpif_base))


NAK, devm_request_and_ioremap() doesn't rethrn error cpdes, only 
NULL. BTW, it's implemented via a call to devm_ioremap_resource() now.

Is it so hard to look at the code that you've calling?


+   return PTR_ERR(vpif_base);


WBR, Sergei

--
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 2/5] media: davinci: vpif: Convert to devm_* api

2013-05-26 Thread Sergei Shtylyov

Hello.

On 26-05-2013 4:49, Laurent Pinchart wrote:


From: Lad, Prabhakar 



Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.



Signed-off-by: Lad, Prabhakar 
---
  drivers/media/platform/davinci/vpif.c |   27 ---
  1 files changed, 4 insertions(+), 23 deletions(-)



diff --git a/drivers/media/platform/davinci/vpif.c
b/drivers/media/platform/davinci/vpif.c index 761c825..164c1b7 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c

[...]

@@ -421,23 +419,12 @@ EXPORT_SYMBOL(vpif_channel_getfid);

  static int vpif_probe(struct platform_device *pdev)
  {
-   int status = 0;
+   static struct resource  *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENOENT;
-
-   res_len = resource_size(res);
-
-   res = request_mem_region(res->start, res_len, res->name);
-   if (!res)
-   return -EBUSY;
-
-   vpif_base = ioremap(res->start, res_len);
-   if (!vpif_base) {
-   status = -EBUSY;
-   goto fail;
-   }
+   vpif_base = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(vpif_base))
+   return PTR_ERR(vpif_base);



You're loosing the request_mem_region().


   He's not losing anything, first look at how devm_ioremp_resource() 
is defined.



You should use devm_request_and_ioremap()


Already deprecated by now.


function instead of devm_ioremap_resource(). With
that change,



Acked-by: Laurent Pinchart 


WBR, Sergei

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


[PATCH] media: i2c: ths7303: add OF support

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

add OF support for the ths7303 driver.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
---
 .../devicetree/bindings/media/i2c/ths73x3.txt  |   50 
 drivers/media/i2c/ths7303.c|   40 +++-
 2 files changed, 89 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ths73x3.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ths73x3.txt 
b/Documentation/devicetree/bindings/media/i2c/ths73x3.txt
new file mode 100644
index 000..62f63e8
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ths73x3.txt
@@ -0,0 +1,50 @@
+* Texas Instruments THS7303/THS7353 video amplifier
+
+The THS7303/THS7353 device is a low power 3-channel integrated video buffer
+which can be configured individually via i2c for all the functions which makes
+it flexible for any application. It incorporates a selectable fifth-order
+Butterworth filter to eliminate data converter images.
+
+Required Properties :
+- compatible : value should be either one among the following
+   (a) "ti,ths7303" for ths7303 video amplifier.
+   (b) "ti,ths7353" for ths7353 video amplifier.
+
+- ti,ths73x3-ch1-bias: Bias value for channel 1.
+
+- ti,ths73x3-ch2-bias: Bias value for channel 2.
+
+- ti,ths73x3-ch3-bias: Bias value for channel 3.
+
+Bias values for channel-1/2/3 can be following (values default to zero):-
+ - 0: Disable Channel - Conserves Power
+ - 1: Channel On - Mute Function - No Output
+ - 2: Channel On - DC Bias Select
+ - 3: Channel On - DC Bias + 250 mV Offset Select
+ - 4: Channel On - AC Bias Select
+ - 5: Channel On - Sync Tip Clam with low bias
+ - 6: Channel On - Sync Tip Clam with mid bias
+ - 7: Channel On - Sync Tip Clam with high bias
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   ths7303@2c {
+   compatible = "ti,ths7303";
+   reg = <0x2c>;
+
+   port {
+   ths7303_1: endpoint {
+   ti,ths73x3-ch1-bias = <3>;
+   ti,ths73x3-ch2-bias = <3>;
+   ti,ths73x3-ch3-bias = <3>;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c
index b954195..b218b0f 100644
--- a/drivers/media/i2c/ths7303.c
+++ b/drivers/media/i2c/ths7303.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define THS7303_CHANNEL_1  1
 #define THS7303_CHANNEL_2  2
@@ -349,10 +350,37 @@ static const struct v4l2_subdev_ops ths7303_ops = {
.video  = &ths7303_video_ops,
 };
 
+static struct ths7303_platform_data *
+ths7303_get_pdata(struct i2c_client *client)
+{
+   struct ths7303_platform_data *pdata;
+   struct device_node *endpoint;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!endpoint)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   of_property_read_u8(endpoint, "ti,ths73x3-ch1-bias", &pdata->ch_1);
+   of_property_read_u8(endpoint, "ti,ths73x3-ch2-bias", &pdata->ch_2);
+   of_property_read_u8(endpoint, "ti,ths73x3-ch3-bias", &pdata->ch_3);
+
+done:
+   of_node_put(endpoint);
+
+   return pdata;
+}
+
 static int ths7303_probe(struct i2c_client *client,
const struct i2c_device_id *id)
 {
-   struct ths7303_platform_data *pdata = client->dev.platform_data;
+   struct ths7303_platform_data *pdata = ths7303_get_pdata(client);
struct ths7303_state *state;
struct v4l2_subdev *sd;
 
@@ -405,8 +433,18 @@ static const struct i2c_device_id ths7303_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ths7303_id);
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id ths73x3_of_match[] = {
+   { .compatible = "ti,ths7303", },
+   { .compatible = "ti,ths7353", },
+   { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, ths73x3_of_match);
+#endif
+
 static struct i2c_driver ths7303_driver = {
.driver = {
+   .of_match_table = of_match_ptr(ths73x3_of_match),
.owner  = THIS_MODULE,
.name   = "ths73x3",
},
-- 
1.7.0.4

--
To un

[RFC PATCH 24/24] v4l2-framework: replace g_chip_ident by g_std in the examples.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

The framework documentation used the g_chip_ident op as an example. This
op has been removed, so replace its use in the examples by the g_std op.

Signed-off-by: Hans Verkuil 
---
 Documentation/video4linux/v4l2-framework.txt   |   13 ++---
 Documentation/zh_CN/video4linux/v4l2-framework.txt |   13 ++---
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/Documentation/video4linux/v4l2-framework.txt 
b/Documentation/video4linux/v4l2-framework.txt
index a300b28..24353ec 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -246,7 +246,6 @@ may be NULL if the subdev driver does not support anything 
from that category.
 It looks like this:
 
 struct v4l2_subdev_core_ops {
-   int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident 
*chip);
int (*log_status)(struct v4l2_subdev *sd);
int (*init)(struct v4l2_subdev *sd, u32 val);
...
@@ -346,24 +345,24 @@ Afterwards the subdev module can be unloaded and sd->dev 
== NULL.
 
 You can call an ops function either directly:
 
-   err = sd->ops->core->g_chip_ident(sd, &chip);
+   err = sd->ops->core->g_std(sd, &norm);
 
 but it is better and easier to use this macro:
 
-   err = v4l2_subdev_call(sd, core, g_chip_ident, &chip);
+   err = v4l2_subdev_call(sd, core, g_std, &norm);
 
 The macro will to the right NULL pointer checks and returns -ENODEV if subdev
-is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is
-NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
+is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_std is
+NULL, or the actual result of the subdev->ops->core->g_std ops.
 
 It is also possible to call all or a subset of the sub-devices:
 
-   v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip);
+   v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
 
 Any subdev that does not support this ops is skipped and error results are
 ignored. If you want to check for errors use this:
 
-   err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, 
&chip);
+   err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
 
 Any error except -ENOIOCTLCMD will exit the loop with that error. If no
 errors (except -ENOIOCTLCMD) occurred, then 0 is returned.
diff --git a/Documentation/zh_CN/video4linux/v4l2-framework.txt 
b/Documentation/zh_CN/video4linux/v4l2-framework.txt
index 44c1d93..0da95db 100644
--- a/Documentation/zh_CN/video4linux/v4l2-framework.txt
+++ b/Documentation/zh_CN/video4linux/v4l2-framework.txt
@@ -247,7 +247,6 @@ i2c_client 结构体,i2c_set_clientdata() 函数可用于保存一个 v4l2_sub
 这些结构体定义如下:
 
 struct v4l2_subdev_core_ops {
-   int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident 
*chip);
int (*log_status)(struct v4l2_subdev *sd);
int (*init)(struct v4l2_subdev *sd, u32 val);
...
@@ -337,24 +336,24 @@ subdev->dev 域就指向了 v4l2_device。
 
 注册之设备后,可通过以下方式直接调用其操作函数:
 
-   err = sd->ops->core->g_chip_ident(sd, &chip);
+   err = sd->ops->core->g_std(sd, &norm);
 
 但使用如下宏会比较容易且合适:
 
-   err = v4l2_subdev_call(sd, core, g_chip_ident, &chip);
+   err = v4l2_subdev_call(sd, core, g_std, &norm);
 
 这个宏将会做 NULL 指针检查,如果 subdev 为 NULL,则返回-ENODEV;如果
-subdev->core 或 subdev->core->g_chip_ident 为 NULL,则返回 -ENOIOCTLCMD;
-否则将返回 subdev->ops->core->g_chip_ident ops 调用的实际结果。
+subdev->core 或 subdev->core->g_std 为 NULL,则返回 -ENOIOCTLCMD;
+否则将返回 subdev->ops->core->g_std ops 调用的实际结果。
 
 有时也可能同时调用所有或一系列子设备的某个操作函数:
 
-   v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip);
+   v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
 
 任何不支持此操作的子设备都会被跳过,并忽略错误返回值。但如果你需要
 检查出错码,则可使用如下函数:
 
-   err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, 
&chip);
+   err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
 
 除 -ENOIOCTLCMD 外的任何错误都会跳出循环并返回错误值。如果(除 -ENOIOCTLCMD
 外)没有错误发生,则返回 0。
-- 
1.7.10.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


[RFC PATCH 17/24] soc_camera sensors: remove g_chip_ident op.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This is no longer needed since the core now handles this through 
DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/soc_camera/imx074.c |   19 
 drivers/media/i2c/soc_camera/mt9m001.c|   33 ++--
 drivers/media/i2c/soc_camera/mt9m111.c|   33 ++--
 drivers/media/i2c/soc_camera/mt9t031.c|   32 ++--
 drivers/media/i2c/soc_camera/mt9t112.c|   16 --
 drivers/media/i2c/soc_camera/mt9v022.c|   47 -
 drivers/media/i2c/soc_camera/ov2640.c |   16 --
 drivers/media/i2c/soc_camera/ov5642.c |   19 
 drivers/media/i2c/soc_camera/ov6650.c |   12 
 drivers/media/i2c/soc_camera/ov772x.c |   16 --
 drivers/media/i2c/soc_camera/ov9640.c |   16 --
 drivers/media/i2c/soc_camera/ov9740.c |   17 ---
 drivers/media/i2c/soc_camera/rj54n1cb0c.c |   31 ++-
 drivers/media/i2c/soc_camera/tw9910.c |   14 -
 14 files changed, 21 insertions(+), 300 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/imx074.c 
b/drivers/media/i2c/soc_camera/imx074.c
index a2a5cbb..a315d43 100644
--- a/drivers/media/i2c/soc_camera/imx074.c
+++ b/drivers/media/i2c/soc_camera/imx074.c
@@ -19,7 +19,6 @@
 
 #include 
 #include 
-#include 
 
 /* IMX074 registers */
 
@@ -251,23 +250,6 @@ static int imx074_s_stream(struct v4l2_subdev *sd, int 
enable)
return reg_write(client, MODE_SELECT, !!enable);
 }
 
-static int imx074_g_chip_ident(struct v4l2_subdev *sd,
-  struct v4l2_dbg_chip_ident *id)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-   if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-   return -EINVAL;
-
-   if (id->match.addr != client->addr)
-   return -ENODEV;
-
-   id->ident   = V4L2_IDENT_IMX074;
-   id->revision= 0;
-
-   return 0;
-}
-
 static int imx074_s_power(struct v4l2_subdev *sd, int on)
 {
struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -299,7 +281,6 @@ static struct v4l2_subdev_video_ops imx074_subdev_video_ops 
= {
 };
 
 static struct v4l2_subdev_core_ops imx074_subdev_core_ops = {
-   .g_chip_ident   = imx074_g_chip_ident,
.s_power= imx074_s_power,
 };
 
diff --git a/drivers/media/i2c/soc_camera/mt9m001.c 
b/drivers/media/i2c/soc_camera/mt9m001.c
index dd90898..3f1f437 100644
--- a/drivers/media/i2c/soc_camera/mt9m001.c
+++ b/drivers/media/i2c/soc_camera/mt9m001.c
@@ -17,7 +17,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 /*
@@ -97,7 +96,6 @@ struct mt9m001 {
const struct mt9m001_datafmt *fmt;
const struct mt9m001_datafmt *fmts;
int num_fmts;
-   int model;  /* V4L2_IDENT_MT9M001* codes from v4l2-chip-ident.h */
unsigned int total_h;
unsigned short y_skip_top;  /* Lines to skip at the top */
 };
@@ -320,36 +318,15 @@ static int mt9m001_try_fmt(struct v4l2_subdev *sd,
return 0;
 }
 
-static int mt9m001_g_chip_ident(struct v4l2_subdev *sd,
-   struct v4l2_dbg_chip_ident *id)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-   struct mt9m001 *mt9m001 = to_mt9m001(client);
-
-   if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-   return -EINVAL;
-
-   if (id->match.addr != client->addr)
-   return -ENODEV;
-
-   id->ident   = mt9m001->model;
-   id->revision= 0;
-
-   return 0;
-}
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9m001_g_register(struct v4l2_subdev *sd,
  struct v4l2_dbg_register *reg)
 {
struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-   if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+   if (reg->reg > 0xff)
return -EINVAL;
 
-   if (reg->match.addr != client->addr)
-   return -ENODEV;
-
reg->size = 2;
reg->val = reg_read(client, reg->reg);
 
@@ -364,12 +341,9 @@ static int mt9m001_s_register(struct v4l2_subdev *sd,
 {
struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-   if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+   if (reg->reg > 0xff)
return -EINVAL;
 
-   if (reg->match.addr != client->addr)
-   return -ENODEV;
-
if (reg_write(client, reg->reg, reg->val) < 0)
return -EIO;
 
@@ -505,11 +479,9 @@ static int mt9m001_video_probe(struct 
soc_camera_subdev_desc *ssdd,
switch (data) {
case 0x8411:
case 0x8421:
-   mt9m001->model = V4L2_IDENT_MT9M001C12ST;
mt9m001->fmts = mt9m001_colour_fmts;
break;
case 0x8431:
-   mt9m001->model = V4L2_IDENT_MT9M001C12STM;
mt9m001->fmts = mt9m001_monochrome_fmts;
break;
de

[RFC PATCH 20/24] v4l2-common: remove unused v4l2_chip_match/ident_i2c_client functions

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-common.c |   47 +
 include/media/v4l2-common.h   |9 ---
 2 files changed, 1 insertion(+), 55 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-common.c 
b/drivers/media/v4l2-core/v4l2-common.c
index 5fd7660..3b2a760 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -61,7 +61,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -227,51 +226,9 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 
id)
 }
 EXPORT_SYMBOL(v4l2_ctrl_next);
 
-#if IS_ENABLED(CONFIG_I2C)
-int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct 
v4l2_dbg_match *match)
-{
-   int len;
-
-   if (c == NULL || match == NULL)
-   return 0;
-
-   switch (match->type) {
-   case V4L2_CHIP_MATCH_I2C_DRIVER:
-   if (c->driver == NULL || c->driver->driver.name == NULL)
-   return 0;
-   len = strlen(c->driver->driver.name);
-   return len && !strncmp(c->driver->driver.name, match->name, 
len);
-   case V4L2_CHIP_MATCH_I2C_ADDR:
-   return c->addr == match->addr;
-   case V4L2_CHIP_MATCH_SUBDEV:
-   return 1;
-   default:
-   return 0;
-   }
-}
-EXPORT_SYMBOL(v4l2_chip_match_i2c_client);
-
-int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct 
v4l2_dbg_chip_ident *chip,
-   u32 ident, u32 revision)
-{
-   if (!v4l2_chip_match_i2c_client(c, &chip->match))
-   return 0;
-   if (chip->ident == V4L2_IDENT_NONE) {
-   chip->ident = ident;
-   chip->revision = revision;
-   }
-   else {
-   chip->ident = V4L2_IDENT_AMBIGUOUS;
-   chip->revision = 0;
-   }
-   return 0;
-}
-EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
-
-/* - */
-
 /* I2C Helper functions */
 
+#if IS_ENABLED(CONFIG_I2C)
 
 void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
const struct v4l2_subdev_ops *ops)
@@ -290,8 +247,6 @@ void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct 
i2c_client *client,
 }
 EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
 
-
-
 /* Load an i2c sub-device. */
 struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter, struct i2c_board_info *info,
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index e7821fb..015ff82 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -100,15 +100,6 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 
id);
 
 /* - */
 
-/* Register/chip ident helper function */
-
-struct i2c_client; /* forward reference */
-int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct 
v4l2_dbg_match *match);
-int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct 
v4l2_dbg_chip_ident *chip,
-   u32 ident, u32 revision);
-
-/* - */
-
 /* I2C Helper functions */
 
 struct i2c_driver;
-- 
1.7.10.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


[RFC PATCH 19/24] cx25840: remove the v4l2-chip-ident.h include

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Replace the V4L2_IDENT_ macros from v4l2-chip-ident.h with driver specific
defines.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/cx25840/cx25840-core.c |   50 +++---
 drivers/media/i2c/cx25840/cx25840-core.h |   34 +---
 2 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/drivers/media/i2c/cx25840/cx25840-core.c 
b/drivers/media/i2c/cx25840/cx25840-core.c
index 6fbdad4..2e3771d 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -497,7 +497,7 @@ static void cx23885_initialize(struct i2c_client *client)
 
/* Sys PLL */
switch (state->id) {
-   case V4L2_IDENT_CX23888_AV:
+   case CX23888_AV:
/*
 * 50.0 MHz * (0xb + 0xe8ba26/0x200)/4 = 5 * 28.636363 MHz
 * 572.73 MHz before post divide
@@ -510,7 +510,7 @@ static void cx23885_initialize(struct i2c_client *client)
cx25840_write4(client, 0x42c, 0x4260);
cx25840_write4(client, 0x44c, 0x161f1000);
break;
-   case V4L2_IDENT_CX23887_AV:
+   case CX23887_AV:
/*
 * 25.0 MHz * (0x16 + 0x1d1744c/0x200)/4 = 5 * 28.636363 MHz
 * 572.73 MHz before post divide
@@ -518,7 +518,7 @@ static void cx23885_initialize(struct i2c_client *client)
cx25840_write4(client, 0x11c, 0x01d1744c);
cx25840_write4(client, 0x118, 0x0416);
break;
-   case V4L2_IDENT_CX23885_AV:
+   case CX23885_AV:
default:
/*
 * 28.636363 MHz * (0x14 + 0x0/0x200)/4 = 5 * 28.636363 MHz
@@ -545,7 +545,7 @@ static void cx23885_initialize(struct i2c_client *client)
 
/* HVR1850 */
switch (state->id) {
-   case V4L2_IDENT_CX23888_AV:
+   case CX23888_AV:
/* 888/HVR1250 specific */
cx25840_write4(client, 0x10c, 0x1333);
cx25840_write4(client, 0x108, 0x0515);
@@ -569,7 +569,7 @@ static void cx23885_initialize(struct i2c_client *client)
 * 48 ksps, 16 bits/sample, x16 multiplier = 12.288 MHz
 */
switch (state->id) {
-   case V4L2_IDENT_CX23888_AV:
+   case CX23888_AV:
/*
 * 50.0 MHz * (0x7 + 0x0bedfa4/0x200)/3 = 122.88 MHz
 * 368.64 MHz before post divide
@@ -579,7 +579,7 @@ static void cx23885_initialize(struct i2c_client *client)
cx25840_write4(client, 0x114, 0x017dbf48);
cx25840_write4(client, 0x110, 0x000a030e);
break;
-   case V4L2_IDENT_CX23887_AV:
+   case CX23887_AV:
/*
 * 25.0 MHz * (0xe + 0x17dbf48/0x200)/3 = 122.88 MHz
 * 368.64 MHz before post divide
@@ -588,7 +588,7 @@ static void cx23885_initialize(struct i2c_client *client)
cx25840_write4(client, 0x114, 0x017dbf48);
cx25840_write4(client, 0x110, 0x000a030e);
break;
-   case V4L2_IDENT_CX23885_AV:
+   case CX23885_AV:
default:
/*
 * 28.636363 MHz * (0xc + 0x1bf0c9e/0x200)/3 = 122.88 MHz
@@ -5110,18 +5110,18 @@ static u32 get_cx2388x_ident(struct i2c_client *client)
ret = cx25840_read4(client, 0x300);
if (((ret & 0x) >> 16) == (ret & 0x)) {
/* No DIF */
-   ret = V4L2_IDENT_CX23885_AV;
+   ret = CX23885_AV;
} else {
/* CX23887 has a broken DIF, but the registers
 * appear valid (but unused), good enough to detect. */
-   ret = V4L2_IDENT_CX23887_AV;
+   ret = CX23887_AV;
}
} else if (cx25840_read4(client, 0x300) & 0x0fff) {
/* DIF PLL Freq Word reg exists; chip must be a CX23888 */
-   ret = V4L2_IDENT_CX23888_AV;
+   ret = CX23888_AV;
} else {
v4l_err(client, "Unable to detect h/w, assuming cx23887\n");
-   ret = V4L2_IDENT_CX23887_AV;
+   ret = CX23887_AV;
}
 
/* Back into digital power down */
@@ -5135,7 +5135,7 @@ static int cx25840_probe(struct i2c_client *client,
struct cx25840_state *state;
struct v4l2_subdev *sd;
int default_volume;
-   u32 id = V4L2_IDENT_NONE;
+   u32 id;
u16 device_id;
 
/* Check if the adapter supports the needed features */
@@ -5151,14 +5151,14 @@ static int cx25840_probe(struct i2c_client *client,
/* The high byte of the device ID should be
 * 0x83 for the cx2583x and 0x84 for the cx2584x */
if ((device_id & 0xff00) == 0x8300) {
-   id = V4L2_IDENT_CX25836 + ((device_id >> 4) & 0xf) - 6;
+   id = CX25836 + ((de

[RFC PATCH 21/24] v4l2-int-device: remove unused chip_ident reference.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Signed-off-by: Hans Verkuil 
---
 include/media/v4l2-int-device.h |3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index e6aa231..0286c95 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -220,8 +220,6 @@ enum v4l2_int_ioctl_num {
vidioc_int_reset_num,
/* VIDIOC_INT_INIT */
vidioc_int_init_num,
-   /* VIDIOC_DBG_G_CHIP_IDENT */
-   vidioc_int_g_chip_ident_num,
 
/*
 *
@@ -303,6 +301,5 @@ V4L2_INT_WRAPPER_1(enum_frameintervals, struct 
v4l2_frmivalenum, *);
 
 V4L2_INT_WRAPPER_0(reset);
 V4L2_INT_WRAPPER_0(init);
-V4L2_INT_WRAPPER_1(g_chip_ident, int, *);
 
 #endif
-- 
1.7.10.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


[RFC PATCH 22/24] v4l2-core: remove support for obsolete VIDIOC_DBG_G_CHIP_IDENT.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This has been replaced by the new and much better VIDIOC_DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c |1 -
 drivers/media/v4l2-core/v4l2-dev.c|1 -
 drivers/media/v4l2-core/v4l2-ioctl.c  |   28 --
 include/media/v4l2-chip-ident.h   |  354 -
 include/media/v4l2-ioctl.h|2 -
 include/media/v4l2-subdev.h   |4 +-
 include/uapi/linux/videodev2.h|   17 +-
 7 files changed, 4 insertions(+), 403 deletions(-)
 delete mode 100644 include/media/v4l2-chip-ident.h

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c 
b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index f129551..8f7a6a4 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -1074,7 +1074,6 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int 
cmd, unsigned long arg)
case VIDIOC_TRY_DECODER_CMD:
case VIDIOC_DBG_S_REGISTER:
case VIDIOC_DBG_G_REGISTER:
-   case VIDIOC_DBG_G_CHIP_IDENT:
case VIDIOC_S_HW_FREQ_SEEK:
case VIDIOC_S_DV_TIMINGS:
case VIDIOC_G_DV_TIMINGS:
diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
b/drivers/media/v4l2-core/v4l2-dev.c
index 5923c5d..fb3fcde 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -596,7 +596,6 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
set_bit(_IOC_NR(VIDIOC_DBG_G_REGISTER), valid_ioctls);
set_bit(_IOC_NR(VIDIOC_DBG_S_REGISTER), valid_ioctls);
 #endif
-   SET_VALID_IOCTL(ops, VIDIOC_DBG_G_CHIP_IDENT, vidioc_g_chip_ident);
/* yes, really vidioc_subscribe_event */
SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event);
SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event);
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 60b8c25..7a7f5f0 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 /* Zero out the end of the struct pointed to by p.  Everything after, but
@@ -624,20 +623,6 @@ static void v4l_print_decoder_cmd(const void *arg, bool 
write_only)
pr_info("pts=%llu\n", p->stop.pts);
 }
 
-static void v4l_print_dbg_chip_ident(const void *arg, bool write_only)
-{
-   const struct v4l2_dbg_chip_ident *p = arg;
-
-   pr_cont("type=%u, ", p->match.type);
-   if (p->match.type == V4L2_CHIP_MATCH_I2C_DRIVER)
-   pr_cont("name=%.*s, ",
-   (int)sizeof(p->match.name), p->match.name);
-   else
-   pr_cont("addr=%u, ", p->match.addr);
-   pr_cont("chip_ident=%u, revision=0x%x\n",
-   p->ident, p->revision);
-}
-
 static void v4l_print_dbg_chip_info(const void *arg, bool write_only)
 {
const struct v4l2_dbg_chip_info *p = arg;
@@ -1844,18 +1829,6 @@ static int v4l_dbg_s_register(const struct 
v4l2_ioctl_ops *ops,
 #endif
 }
 
-static int v4l_dbg_g_chip_ident(const struct v4l2_ioctl_ops *ops,
-   struct file *file, void *fh, void *arg)
-{
-   struct v4l2_dbg_chip_ident *p = arg;
-
-   p->ident = V4L2_IDENT_NONE;
-   p->revision = 0;
-   if (p->match.type == V4L2_CHIP_MATCH_SUBDEV)
-   return -EINVAL;
-   return ops->vidioc_g_chip_ident(file, fh, p);
-}
-
 static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
 {
@@ -2105,7 +2078,6 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
IOCTL_INFO_STD(VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd, 
v4l_print_decoder_cmd, 0),
IOCTL_INFO_FNC(VIDIOC_DBG_S_REGISTER, v4l_dbg_s_register, 
v4l_print_dbg_register, 0),
IOCTL_INFO_FNC(VIDIOC_DBG_G_REGISTER, v4l_dbg_g_register, 
v4l_print_dbg_register, 0),
-   IOCTL_INFO_FNC(VIDIOC_DBG_G_CHIP_IDENT, v4l_dbg_g_chip_ident, 
v4l_print_dbg_chip_ident, 0),
IOCTL_INFO_FNC(VIDIOC_S_HW_FREQ_SEEK, v4l_s_hw_freq_seek, 
v4l_print_hw_freq_seek, INFO_FL_PRIO),
IOCTL_INFO_STD(VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings, 
v4l_print_dv_timings, INFO_FL_PRIO),
IOCTL_INFO_STD(VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings, 
v4l_print_dv_timings, 0),
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
deleted file mode 100644
index 543f89c..000
--- a/include/media/v4l2-chip-ident.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
-v4l2 chip identifiers header
-
-This header provides a list of chip identifiers that can be returned
-through the VIDIOC_DBG_G_CHIP_IDENT ioctl.
-
-Copyright (C) 2007 Hans Verkuil 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Publi

[RFC PATCH 23/24] DocBook: remove references to the dropped VIDIOC_DBG_G_CHIP_IDENT ioctl.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Signed-off-by: Hans Verkuil 
---
 Documentation/DocBook/media/v4l/compat.xml |   14 +-
 Documentation/DocBook/media/v4l/v4l2.xml   |   11 +-
 .../DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml  |  271 
 .../DocBook/media/v4l/vidioc-dbg-g-chip-info.xml   |   17 +-
 .../DocBook/media/v4l/vidioc-dbg-g-register.xml|   40 +--
 5 files changed, 24 insertions(+), 329 deletions(-)
 delete mode 100644 Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml

diff --git a/Documentation/DocBook/media/v4l/compat.xml 
b/Documentation/DocBook/media/v4l/compat.xml
index f43542a..0c7195e 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2254,7 +2254,7 @@ video encoding.
   

  The VIDIOC_G_CHIP_IDENT ioctl was renamed
-to VIDIOC_G_CHIP_IDENT_OLD and &VIDIOC-DBG-G-CHIP-IDENT;
+to VIDIOC_G_CHIP_IDENT_OLD and 
VIDIOC_DBG_G_CHIP_IDENT
 was introduced in its place. The old struct 
v4l2_chip_ident
 was renamed to v4l2_chip_ident_old.

@@ -2513,6 +2513,16 @@ that used it. It was originally scheduled for removal in 
2.6.35.
   
 
 
+
+  V4L2 in Linux 3.11
+  
+
+ Remove obsolete VIDIOC_DBG_G_CHIP_IDENT 
ioctl.
+ 
+
+  
+
+
 
   Relation of V4L2 to other Linux multimedia APIs
 
@@ -2596,7 +2606,7 @@ and may change in the future.
 ioctls.
 
 
- &VIDIOC-DBG-G-CHIP-IDENT; ioctl.
+ &VIDIOC-DBG-G-CHIP-INFO; ioctl.
 
 
  &VIDIOC-ENUM-DV-TIMINGS;, &VIDIOC-QUERY-DV-TIMINGS; and
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml 
b/Documentation/DocBook/media/v4l/v4l2.xml
index bfc93cd..8469fe1 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -141,6 +141,14 @@ structs, ioctls) must be noted in more detail in the 
history chapter
 applications. -->
 
   
+   3.11
+   2013-05-26
+   hv
+   Remove obsolete VIDIOC_DBG_G_CHIP_IDENT ioctl.
+   
+  
+
+  
3.10
2013-03-25
hv
@@ -493,7 +501,7 @@ and discussions on the V4L mailing list.
 
 
 Video for Linux Two API Specification
- Revision 3.9
+ Revision 3.11
 
   
 &sub-common;
@@ -547,7 +555,6 @@ and discussions on the V4L mailing list.
 
 &sub-create-bufs;
 &sub-cropcap;
-&sub-dbg-g-chip-ident;
 &sub-dbg-g-chip-info;
 &sub-dbg-g-register;
 &sub-decoder-cmd;
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml 
b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
deleted file mode 100644
index 921e185..000
--- a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml
+++ /dev/null
@@ -1,271 +0,0 @@
-
-  
-ioctl VIDIOC_DBG_G_CHIP_IDENT
-&manvol;
-  
-
-  
-VIDIOC_DBG_G_CHIP_IDENT
-Identify the chips on a TV card
-  
-
-  
-
-  
-   int ioctl
-   int fd
-   int request
-   struct v4l2_dbg_chip_ident
-*argp
-  
-
-  
-
-  
-Arguments
-
-
-  
-   fd
-   
- &fd;
-   
-  
-  
-   request
-   
- VIDIOC_DBG_G_CHIP_IDENT
-   
-  
-  
-   argp
-   
- 
-   
-  
-
-  
-
-  
-Description
-
-
-  Experimental
-
-  This is an experimental interface and may change in
-the future.
-
-
-For driver debugging purposes this ioctl allows test
-applications to query the driver about the chips present on the TV
-card. Regular applications must not use it. When you found a chip
-specific bug, please contact the linux-media mailing list (&v4l-ml;)
-so it can be fixed.
-
-To query the driver applications must initialize the
-match.type and
-match.addr or match.name
-fields of a &v4l2-dbg-chip-ident;
-and call VIDIOC_DBG_G_CHIP_IDENT with a pointer to
-this structure. On success the driver stores information about the
-selected chip in the ident and
-revision fields. On failure the structure
-remains unchanged.
-
-When match.type is
-V4L2_CHIP_MATCH_HOST,
-match.addr selects the nth non-&i2c; chip
-on the TV card. You can enumerate all chips by starting at zero and
-incrementing match.addr by one until
-VIDIOC_DBG_G_CHIP_IDENT fails with an &EINVAL;.
-The number zero always selects the host chip, ⪚ the chip connected
-to the PCI or USB bus.
-
-When match.type is
-V4L2_CHIP_MATCH_I2C_DRIVER,
-match.name contains the I2C driver name.
-For instance
-"saa7127" will match any chip
-supported by the saa7127 driver, regardless of its &i2c; bus address.
-When multiple chips supported by the same driver are present, the
-ioctl will return V4L2_IDENT_AMBIGUOUS in the
-ident field.
-
-When match.type is
-V4L2_CHIP_MATCH_I2C_ADDR,
-match.addr selects a chip by its 7 bit
-&i2c; bus address.
-
-When match.type is
-V4L2_CHIP_MATCH_AC97,
-match.addr selects the nth AC97 chip
-on the TV card. You can enumerate

[RFC PATCH 10/24] cx231xx: remove g_chip_ident.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Remove g_chip_ident and replace it with g_chip_info.

Signed-off-by: Hans Verkuil 
---
 drivers/media/usb/cx231xx/cx231xx-417.c|1 -
 drivers/media/usb/cx231xx/cx231xx-avcore.c |1 -
 drivers/media/usb/cx231xx/cx231xx-cards.c  |1 -
 drivers/media/usb/cx231xx/cx231xx-vbi.c|1 -
 drivers/media/usb/cx231xx/cx231xx-video.c  |  417 +++-
 drivers/media/usb/cx231xx/cx231xx.h|2 +-
 6 files changed, 103 insertions(+), 320 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c 
b/drivers/media/usb/cx231xx/cx231xx-417.c
index f548db8..2f63029 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1840,7 +1840,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff= vidioc_streamoff,
.vidioc_log_status   = vidioc_log_status,
-   .vidioc_g_chip_ident = cx231xx_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register   = cx231xx_g_register,
.vidioc_s_register   = cx231xx_s_register,
diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c 
b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index 235ba65..89de00b 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -35,7 +35,6 @@
 
 #include 
 #include 
-#include 
 
 #include "cx231xx.h"
 #include "cx231xx-dif.h"
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 13249e5..27948e1 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include "dvb-usb-ids.h"
diff --git a/drivers/media/usb/cx231xx/cx231xx-vbi.c 
b/drivers/media/usb/cx231xx/cx231xx-vbi.c
index 1340ff2..c027942 100644
--- a/drivers/media/usb/cx231xx/cx231xx-vbi.c
+++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c
@@ -32,7 +32,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c 
b/drivers/media/usb/cx231xx/cx231xx-video.c
index cd22147..54cdd4d 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -36,7 +36,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -1228,179 +1227,86 @@ int cx231xx_s_frequency(struct file *file, void *priv,
return rc;
 }
 
-int cx231xx_g_chip_ident(struct file *file, void *fh,
-   struct v4l2_dbg_chip_ident *chip)
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+
+int cx231xx_g_chip_info(struct file *file, void *fh,
+   struct v4l2_dbg_chip_info *chip)
 {
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
-   if (v4l2_chip_match_host(&chip->match))
-   chip->ident = V4L2_IDENT_CX23100;
+   switch (chip->match.addr) {
+   case 0: /* Cx231xx - internal registers */
+   return 0;
+   case 1: /* AFE - read byte */
+   strlcpy(chip->name, "AFE (byte)", sizeof(chip->name));
+   return 0;
+   case 2: /* Video Block - read byte */
+   strlcpy(chip->name, "Video (byte)", sizeof(chip->name));
+   return 0;
+   case 3: /* I2S block - read byte */
+   strlcpy(chip->name, "I2S (byte)", sizeof(chip->name));
+   return 0;
+   case 4: /* AFE - read dword */
+   strlcpy(chip->name, "AFE (dword)", sizeof(chip->name));
+   return 0;
+   case 5: /* Video Block - read dword */
+   strlcpy(chip->name, "Video (dword)", sizeof(chip->name));
+   return 0;
+   case 6: /* I2S Block - read dword */
+   strlcpy(chip->name, "I2S (dword)", sizeof(chip->name));
return 0;
}
return -EINVAL;
 }
 
-#ifdef CONFIG_VIDEO_ADV_DEBUG
-
-/*
-  -R, --list-registers=type=,
-   chip=[,min=,max=]
-dump registers from  to  [VIDIOC_DBG_G_REGISTER]
-  -r, --set-register=type=,
-   chip=,reg=,val=
-set the register [VIDIOC_DBG_S_REGISTER]
-
-  if type == host, then  is the hosts chip ID (default 0)
-  if type == i2cdrv (default), then  is the I2C driver name or ID
-  if type == i2caddr, then  is the 7-bit I2C address
-*/
-
 int cx231xx_g_register(struct file *file, void *priv,
 struct v4l2_dbg_register *reg)
 {
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
-   int ret = 0;
+   int ret;
u8 value[4] = { 0, 0, 0, 0 };
u32 data = 0;
 
-   switch (reg->match.type) {
-   case V4L2_CHIP_MATCH_HOST:
-   switch (reg->match.addr) {
-   case 0: /* Cx231xx - internal re

[RFC PATCH 03/24] cx18: remove g_chip_ident support.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

The av-core is really a subdev, so there is no need anymore to act as if it
is a 'second' bridge chip.

As a result of this the g_chip_ident implementation can be completely dropped.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/cx18/cx18-av-core.c |   32 --
 drivers/media/pci/cx18/cx18-av-core.h |1 -
 drivers/media/pci/cx18/cx18-ioctl.c   |   78 +++--
 3 files changed, 7 insertions(+), 104 deletions(-)

diff --git a/drivers/media/pci/cx18/cx18-av-core.c 
b/drivers/media/pci/cx18/cx18-av-core.c
index ba8caf0..c4890a4 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -22,7 +22,6 @@
  *  02110-1301, USA.
  */
 
-#include 
 #include "cx18-driver.h"
 #include "cx18-io.h"
 #include "cx18-cards.h"
@@ -1231,31 +1230,12 @@ static int cx18_av_log_status(struct v4l2_subdev *sd)
return 0;
 }
 
-static inline int cx18_av_dbg_match(const struct v4l2_dbg_match *match)
-{
-   return match->type == V4L2_CHIP_MATCH_HOST && match->addr == 1;
-}
-
-static int cx18_av_g_chip_ident(struct v4l2_subdev *sd,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct cx18_av_state *state = to_cx18_av_state(sd);
-
-   if (cx18_av_dbg_match(&chip->match)) {
-   chip->ident = state->id;
-   chip->revision = state->rev;
-   }
-   return 0;
-}
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int cx18_av_g_register(struct v4l2_subdev *sd,
  struct v4l2_dbg_register *reg)
 {
struct cx18 *cx = v4l2_get_subdevdata(sd);
 
-   if (!cx18_av_dbg_match(®->match))
-   return -EINVAL;
if ((reg->reg & 0x3) != 0)
return -EINVAL;
reg->size = 4;
@@ -1268,8 +1248,6 @@ static int cx18_av_s_register(struct v4l2_subdev *sd,
 {
struct cx18 *cx = v4l2_get_subdevdata(sd);
 
-   if (!cx18_av_dbg_match(®->match))
-   return -EINVAL;
if ((reg->reg & 0x3) != 0)
return -EINVAL;
cx18_av_write4(cx, reg->reg & 0x0ffc, reg->val);
@@ -1282,17 +1260,9 @@ static const struct v4l2_ctrl_ops cx18_av_ctrl_ops = {
 };
 
 static const struct v4l2_subdev_core_ops cx18_av_general_ops = {
-   .g_chip_ident = cx18_av_g_chip_ident,
.log_status = cx18_av_log_status,
.load_fw = cx18_av_load_fw,
.reset = cx18_av_reset,
-   .g_ctrl = v4l2_subdev_g_ctrl,
-   .s_ctrl = v4l2_subdev_s_ctrl,
-   .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
-   .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
-   .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
-   .queryctrl = v4l2_subdev_queryctrl,
-   .querymenu = v4l2_subdev_querymenu,
.s_std = cx18_av_s_std,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = cx18_av_g_register,
@@ -1340,8 +1310,6 @@ int cx18_av_probe(struct cx18 *cx)
int err;
 
state->rev = cx18_av_read4(cx, CXADEC_CHIP_CTRL) & 0x;
-   state->id = ((state->rev >> 4) == CXADEC_CHIP_TYPE_MAKO)
-   ? V4L2_IDENT_CX23418_843 : V4L2_IDENT_UNKNOWN;
 
state->vid_input = CX18_AV_COMPOSITE7;
state->aud_input = CX18_AV_AUDIO8;
diff --git a/drivers/media/pci/cx18/cx18-av-core.h 
b/drivers/media/pci/cx18/cx18-av-core.h
index e9c69d9..4c559e8 100644
--- a/drivers/media/pci/cx18/cx18-av-core.h
+++ b/drivers/media/pci/cx18/cx18-av-core.h
@@ -104,7 +104,6 @@ struct cx18_av_state {
enum cx18_av_audio_input aud_input;
u32 audclk_freq;
int audmode;
-   u32 id;
u32 rev;
int is_initialized;
 
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c 
b/drivers/media/pci/cx18/cx18-ioctl.c
index aee7b6d..414b0ec 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -39,7 +39,6 @@
 #include "cx18-cards.h"
 #include "cx18-av-core.h"
 #include 
-#include 
 
 u16 cx18_service2vbi(int type)
 {
@@ -362,73 +361,16 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, 
void *fh,
return 0;
 }
 
-static int cx18_g_chip_ident(struct file *file, void *fh,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct cx18 *cx = fh2id(fh)->cx;
-   int err = 0;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   switch (chip->match.type) {
-   case V4L2_CHIP_MATCH_HOST:
-   switch (chip->match.addr) {
-   case 0:
-   chip->ident = V4L2_IDENT_CX23418;
-   chip->revision = cx18_read_reg(cx, 0xC72028);
-   break;
-   case 1:
-   /*
-* The A/V decoder is always present, but in the rare
-* case that the card doesn't have analog, we don't
-* use it.  We find it w/o using the cx->sd_av pointer
-*/
-   cx18_call_hw(cx, CX18_HW_418_AV,
-   

[RFC PATCH 15/24] radio: remove g_chip_ident op.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This is no longer needed since the core now handles this through 
DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil 
---
 drivers/media/radio/saa7706h.c |   10 --
 drivers/media/radio/tef6862.c  |   14 --
 2 files changed, 24 deletions(-)

diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c
index 06c06cc..d1f30d6 100644
--- a/drivers/media/radio/saa7706h.c
+++ b/drivers/media/radio/saa7706h.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define DRIVER_NAME "saa7706h"
 
@@ -349,16 +348,7 @@ static int saa7706h_s_ctrl(struct v4l2_subdev *sd, struct 
v4l2_control *ctrl)
return -EINVAL;
 }
 
-static int saa7706h_g_chip_ident(struct v4l2_subdev *sd,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-   return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7706H, 0);
-}
-
 static const struct v4l2_subdev_core_ops saa7706h_core_ops = {
-   .g_chip_ident = saa7706h_g_chip_ident,
.queryctrl = saa7706h_queryctrl,
.g_ctrl = saa7706h_g_ctrl,
.s_ctrl = saa7706h_s_ctrl,
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index 82c6c94..d78afbb 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define DRIVER_NAME "tef6862"
 
@@ -136,14 +135,6 @@ static int tef6862_g_frequency(struct v4l2_subdev *sd, 
struct v4l2_frequency *f)
return 0;
 }
 
-static int tef6862_g_chip_ident(struct v4l2_subdev *sd,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-   return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TEF6862, 0);
-}
-
 static const struct v4l2_subdev_tuner_ops tef6862_tuner_ops = {
.g_tuner = tef6862_g_tuner,
.s_tuner = tef6862_s_tuner,
@@ -151,12 +142,7 @@ static const struct v4l2_subdev_tuner_ops 
tef6862_tuner_ops = {
.g_frequency = tef6862_g_frequency,
 };
 
-static const struct v4l2_subdev_core_ops tef6862_core_ops = {
-   .g_chip_ident = tef6862_g_chip_ident,
-};
-
 static const struct v4l2_subdev_ops tef6862_ops = {
-   .core = &tef6862_core_ops,
.tuner = &tef6862_tuner_ops,
 };
 
-- 
1.7.10.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


[RFC PATCH 07/24] cx88: remove g_chip_ident.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Remove g_chip_ident from cx88. Also remove the v4l2-chip-ident.h include.
The board code used defines from v4l2-chip-ident.h to tell the driver which
audio chip is used. Replace this with a cx88-specific enum.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/cx88/cx88-alsa.c  |6 +++---
 drivers/media/pci/cx88/cx88-cards.c |   12 ++--
 drivers/media/pci/cx88/cx88-video.c |   27 +--
 drivers/media/pci/cx88/cx88.h   |8 ++--
 4 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 27d6262..ce02105 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -615,7 +615,7 @@ static int snd_cx88_volume_put(struct snd_kcontrol 
*kcontrol,
int changed = 0;
u32 old;
 
-   if (core->board.audio_chip == V4L2_IDENT_WM8775)
+   if (core->board.audio_chip == CX88_AUDIO_WM8775)
snd_cx88_wm8775_volume_put(kcontrol, value);
 
left = value->value.integer.value[0] & 0x3f;
@@ -682,7 +682,7 @@ static int snd_cx88_switch_put(struct snd_kcontrol 
*kcontrol,
vol ^= bit;
cx_swrite(SHADOW_AUD_VOL_CTL, AUD_VOL_CTL, vol);
/* Pass mute onto any WM8775 */
-   if ((core->board.audio_chip == V4L2_IDENT_WM8775) &&
+   if ((core->board.audio_chip == CX88_AUDIO_WM8775) &&
((1<<6) == bit))
wm8775_s_ctrl(core, V4L2_CID_AUDIO_MUTE, 0 != (vol & 
bit));
ret = 1;
@@ -903,7 +903,7 @@ static int cx88_audio_initdev(struct pci_dev *pci,
goto error;
 
/* If there's a wm8775 then add a Line-In ALC switch */
-   if (core->board.audio_chip == V4L2_IDENT_WM8775)
+   if (core->board.audio_chip == CX88_AUDIO_WM8775)
snd_ctl_add(card, snd_ctl_new1(&snd_cx88_alc_switch, chip));
 
strcpy (card->driver, "CX88x");
diff --git a/drivers/media/pci/cx88/cx88-cards.c 
b/drivers/media/pci/cx88/cx88-cards.c
index a87a0e1..e18a7ac 100644
--- a/drivers/media/pci/cx88/cx88-cards.c
+++ b/drivers/media/pci/cx88/cx88-cards.c
@@ -744,7 +744,7 @@ static const struct cx88_board cx88_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
/* Some variants use a tda9874 and so need the tvaudio module. 
*/
-   .audio_chip = V4L2_IDENT_TVAUDIO,
+   .audio_chip = CX88_AUDIO_TVAUDIO,
.input  = {{
.type   = CX88_VMUX_TELEVISION,
.vmux   = 0,
@@ -976,7 +976,7 @@ static const struct cx88_board cx88_boards[] = {
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
-   .audio_chip = V4L2_IDENT_WM8775,
+   .audio_chip = CX88_AUDIO_WM8775,
.i2sinputcntl   = 2,
.input  = {{
.type   = CX88_VMUX_DVB,
@@ -1014,7 +1014,7 @@ static const struct cx88_board cx88_boards[] = {
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
-   .audio_chip = V4L2_IDENT_WM8775,
+   .audio_chip = CX88_AUDIO_WM8775,
.input  = {{
.type   = CX88_VMUX_DVB,
.vmux   = 0,
@@ -1376,7 +1376,7 @@ static const struct cx88_board cx88_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.tda9887_conf   = TDA9887_PRESENT,
-   .audio_chip = V4L2_IDENT_WM8775,
+   .audio_chip = CX88_AUDIO_WM8775,
.input  = {{
.type   = CX88_VMUX_TELEVISION,
.vmux   = 0,
@@ -1461,7 +1461,7 @@ static const struct cx88_board cx88_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.tda9887_conf   = TDA9887_PRESENT,
-   .audio_chip = V4L2_IDENT_WM8775,
+   .audio_chip = CX88_AUDIO_WM8775,
/*
 * gpio0 as reported by Mike Crash 
 */
@@ -1929,7 +1929,7 @@ static const struct cx88_board cx88_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.tda9887_conf   = TDA9887_PRESENT,
-   .audio_chip = V4L2_IDENT_WM8775,
+   .audio_chip = CX88_AUDIO_WM8775,
/*
 * GPIO0 (WINTV2000)
 *
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 1b00615..6b3a9ae 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/c

[RFC PATCH 02/24] v4l2: remove g_chip_ident from bridge drivers where it is easy to do so.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

VIDIOC_DBG_G_CHIP_IDENT has been replaced by VIDIOC_DBG_G_CHIP_INFO. Remove
g_chip_ident support from bridge drivers since it is no longer needed.

This patch takes care of all the trivial cases.

Signed-off-by: Hans Verkuil 
---
 drivers/media/common/saa7146/saa7146_video.c   |   23 -
 drivers/media/pci/bt8xx/bttv-driver.c  |   38 --
 drivers/media/pci/saa7134/saa7134-empress.c|   17 --
 drivers/media/pci/saa7134/saa7134-video.c  |4 --
 drivers/media/pci/saa7146/mxb.c|   15 ++
 drivers/media/pci/saa7164/saa7164-encoder.c|   37 -
 drivers/media/pci/saa7164/saa7164-vbi.c|9 
 drivers/media/pci/saa7164/saa7164.h|1 -
 drivers/media/platform/blackfin/bfin_capture.c |   41 ---
 drivers/media/platform/davinci/vpif_capture.c  |   66 
 drivers/media/platform/davinci/vpif_display.c  |   66 
 drivers/media/platform/sh_vou.c|   31 ---
 drivers/media/platform/soc_camera/soc_camera.c |   34 
 drivers/media/platform/via-camera.c|   16 --
 drivers/media/radio/radio-si476x.c |   11 
 drivers/media/usb/au0828/au0828-video.c|   39 --
 drivers/media/usb/em28xx/em28xx-video.c|   66 +++-
 drivers/media/usb/stk1160/stk1160-v4l.c|   41 ---
 18 files changed, 10 insertions(+), 545 deletions(-)

diff --git a/drivers/media/common/saa7146/saa7146_video.c 
b/drivers/media/common/saa7146/saa7146_video.c
index fe907f2..3077949 100644
--- a/drivers/media/common/saa7146/saa7146_video.c
+++ b/drivers/media/common/saa7146/saa7146_video.c
@@ -1,7 +1,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -988,26 +987,6 @@ static int vidioc_streamoff(struct file *file, void *__fh, 
enum v4l2_buf_type ty
return err;
 }
 
-static int vidioc_g_chip_ident(struct file *file, void *__fh,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct saa7146_fh *fh = __fh;
-   struct saa7146_dev *dev = fh->dev;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
-   if (v4l2_chip_match_host(&chip->match))
-   chip->ident = V4L2_IDENT_SAA7146;
-   return 0;
-   }
-   if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
-   chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-   return -EINVAL;
-   return v4l2_device_call_until_err(&dev->v4l2_dev, 0,
-   core, g_chip_ident, chip);
-}
-
 const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
@@ -1018,7 +997,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
.vidioc_g_fmt_vid_overlay= vidioc_g_fmt_vid_overlay,
.vidioc_try_fmt_vid_overlay  = vidioc_try_fmt_vid_overlay,
.vidioc_s_fmt_vid_overlay= vidioc_s_fmt_vid_overlay,
-   .vidioc_g_chip_ident = vidioc_g_chip_ident,
 
.vidioc_overlay  = vidioc_overlay,
.vidioc_g_fbuf   = vidioc_g_fbuf,
@@ -1039,7 +1017,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
 const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops = {
.vidioc_querycap = vidioc_querycap,
.vidioc_g_fmt_vbi_cap= vidioc_g_fmt_vbi_cap,
-   .vidioc_g_chip_ident = vidioc_g_chip_ident,
 
.vidioc_reqbufs  = vidioc_reqbufs,
.vidioc_querybuf = vidioc_querybuf,
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c 
b/drivers/media/pci/bt8xx/bttv-driver.c
index a334c94..bfcfa3e 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -50,7 +50,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -1907,28 +1906,6 @@ static int bttv_log_status(struct file *file, void *f)
return 0;
 }
 
-static int bttv_g_chip_ident(struct file *file, void *f, struct 
v4l2_dbg_chip_ident *chip)
-{
-   struct bttv_fh *fh  = f;
-   struct bttv *btv = fh->btv;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
-   if (v4l2_chip_match_host(&chip->match)) {
-   chip->ident = btv->id;
-   if (chip->ident == PCI_DEVICE_ID_FUSION879)
-   chip->ident = V4L2_IDENT_BT879;
-   }
-   return 0;
-   }
-   if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
-   chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-   return -EINVAL;
-   /* TODO: is this correct? */
-   return bttv_call_all_err(btv, core, 

[RFC PATCH 09/24] gspca: remove g_chip_ident

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Remove g_chip_ident and replace it with g_chip_info.

Signed-off-by: Hans Verkuil 
---
 drivers/media/usb/gspca/gspca.c   |   32 +-
 drivers/media/usb/gspca/gspca.h   |6 ++--
 drivers/media/usb/gspca/pac7302.c |   19 +--
 drivers/media/usb/gspca/sn9c20x.c |   67 +
 4 files changed, 34 insertions(+), 90 deletions(-)

diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 5995ec4..b7ae872 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -1029,33 +1029,35 @@ static int gspca_get_mode(struct gspca_dev *gspca_dev,
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int vidioc_g_register(struct file *file, void *priv,
-   struct v4l2_dbg_register *reg)
+static int vidioc_g_chip_info(struct file *file, void *priv,
+   struct v4l2_dbg_chip_info *chip)
 {
struct gspca_dev *gspca_dev = video_drvdata(file);
 
gspca_dev->usb_err = 0;
-   return gspca_dev->sd_desc->get_register(gspca_dev, reg);
+   if (gspca_dev->sd_desc->get_chip_info)
+   return gspca_dev->sd_desc->get_chip_info(gspca_dev, chip);
+   return chip->match.addr ? -EINVAL : 0;
 }
 
-static int vidioc_s_register(struct file *file, void *priv,
-   const struct v4l2_dbg_register *reg)
+static int vidioc_g_register(struct file *file, void *priv,
+   struct v4l2_dbg_register *reg)
 {
struct gspca_dev *gspca_dev = video_drvdata(file);
 
gspca_dev->usb_err = 0;
-   return gspca_dev->sd_desc->set_register(gspca_dev, reg);
+   return gspca_dev->sd_desc->get_register(gspca_dev, reg);
 }
-#endif
 
-static int vidioc_g_chip_ident(struct file *file, void *priv,
-   struct v4l2_dbg_chip_ident *chip)
+static int vidioc_s_register(struct file *file, void *priv,
+   const struct v4l2_dbg_register *reg)
 {
struct gspca_dev *gspca_dev = video_drvdata(file);
 
gspca_dev->usb_err = 0;
-   return gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
+   return gspca_dev->sd_desc->set_register(gspca_dev, reg);
 }
+#endif
 
 static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
struct v4l2_fmtdesc *fmtdesc)
@@ -1974,10 +1976,10 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
.vidioc_enum_framesizes = vidioc_enum_framesizes,
.vidioc_enum_frameintervals = vidioc_enum_frameintervals,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_chip_info = vidioc_g_chip_info,
.vidioc_g_register  = vidioc_g_register,
.vidioc_s_register  = vidioc_s_register,
 #endif
-   .vidioc_g_chip_ident= vidioc_g_chip_ident,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
 };
@@ -2086,14 +2088,10 @@ int gspca_dev_probe2(struct usb_interface *intf,
v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_DQBUF);
v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_QBUF);
v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_QUERYBUF);
-   if (!gspca_dev->sd_desc->get_chip_ident)
-   v4l2_disable_ioctl(&gspca_dev->vdev, VIDIOC_DBG_G_CHIP_IDENT);
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-   if (!gspca_dev->sd_desc->get_chip_ident ||
-   !gspca_dev->sd_desc->get_register)
+   if (!gspca_dev->sd_desc->get_register)
v4l2_disable_ioctl(&gspca_dev->vdev, VIDIOC_DBG_G_REGISTER);
-   if (!gspca_dev->sd_desc->get_chip_ident ||
-   !gspca_dev->sd_desc->set_register)
+   if (!gspca_dev->sd_desc->set_register)
v4l2_disable_ioctl(&gspca_dev->vdev, VIDIOC_DBG_S_REGISTER);
 #endif
if (!gspca_dev->sd_desc->get_jcomp)
diff --git a/drivers/media/usb/gspca/gspca.h b/drivers/media/usb/gspca/gspca.h
index ef8efeb..ac0b11f 100644
--- a/drivers/media/usb/gspca/gspca.h
+++ b/drivers/media/usb/gspca/gspca.h
@@ -78,8 +78,8 @@ typedef int (*cam_get_reg_op) (struct gspca_dev *,
struct v4l2_dbg_register *);
 typedef int (*cam_set_reg_op) (struct gspca_dev *,
const struct v4l2_dbg_register *);
-typedef int (*cam_ident_op) (struct gspca_dev *,
-   struct v4l2_dbg_chip_ident *);
+typedef int (*cam_chip_info_op) (struct gspca_dev *,
+   struct v4l2_dbg_chip_info *);
 typedef void (*cam_streamparm_op) (struct gspca_dev *,
  struct v4l2_streamparm *);
 typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
@@ -112,8 +112,8 @@ struct sd_desc {
 #ifdef CONFIG_VIDEO_ADV_DEBUG
cam_set_reg_op set_register;
cam_get_reg_op get_register;
+   cam_chip_info_op get_chip_info;
 #endif
-   cam_ident_op get_chip_ident;
 #if IS_ENABLED(CONFIG_INPUT)
cam_int_pkt_op int_pkt_sc

[RFC PATCH 12/24] tveeprom: remove v4l2-chip-ident.h include.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Replace the V4L2_IDENT_* usage with tveeprom-specific defines. This header
is deprecated, so those defines shouldn't be used anymore.

The em28xx driver is the only one that uses the tveeprom audio_processor
field, so that has been updated to use the new tveeprom AUDPROC define.

Signed-off-by: Hans Verkuil 
---
 drivers/media/common/tveeprom.c |  142 ++-
 drivers/media/usb/em28xx/em28xx-cards.c |3 +-
 include/media/tveeprom.h|   11 +++
 3 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/drivers/media/common/tveeprom.c b/drivers/media/common/tveeprom.c
index cc1e172..c7dace6 100644
--- a/drivers/media/common/tveeprom.c
+++ b/drivers/media/common/tveeprom.c
@@ -40,7 +40,6 @@
 #include 
 #include 
 #include 
-#include 
 
 MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver");
 MODULE_AUTHOR("John Klar");
@@ -67,13 +66,10 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
  * The Hauppauge eeprom uses an 8bit field to determine which
  * tuner formats the tuner supports.
  */
-static struct HAUPPAUGE_TUNER_FMT
-{
+static const struct {
int id;
-   char *name;
-}
-hauppauge_tuner_fmt[] =
-{
+   const char * const name;
+} hauppauge_tuner_fmt[] = {
{ V4L2_STD_UNKNOWN,   " UNKNOWN" },
{ V4L2_STD_UNKNOWN,   " FM" },
{ V4L2_STD_B|V4L2_STD_GH, " PAL(B/G)" },
@@ -88,13 +84,10 @@ hauppauge_tuner_fmt[] =
supplying this information. Note that many tuners where only used for
testing and never made it to the outside world. So you will only see
a subset in actual produced cards. */
-static struct HAUPPAUGE_TUNER
-{
+static const struct {
int  id;
-   char *name;
-}
-hauppauge_tuner[] =
-{
+   const char * const name;
+} hauppauge_tuner[] = {
/* 0-9 */
{ TUNER_ABSENT, "None" },
{ TUNER_ABSENT, "External" },
@@ -298,69 +291,66 @@ hauppauge_tuner[] =
{ TUNER_ABSENT, "NXP 18272S"},
 };
 
-/* Use V4L2_IDENT_AMBIGUOUS for those audio 'chips' that are
+/* Use TVEEPROM_AUDPROC_INTERNAL for those audio 'chips' that are
  * internal to a video chip, i.e. not a separate audio chip. */
-static struct HAUPPAUGE_AUDIOIC
-{
+static const struct {
u32   id;
-   char *name;
-}
-audioIC[] =
-{
+   const char * const name;
+} audio_ic[] = {
/* 0-4 */
-   { V4L2_IDENT_NONE,  "None"  },
-   { V4L2_IDENT_UNKNOWN,   "TEA6300"   },
-   { V4L2_IDENT_UNKNOWN,   "TEA6320"   },
-   { V4L2_IDENT_UNKNOWN,   "TDA9850"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3400C"  },
+   { TVEEPROM_AUDPROC_NONE,  "None"  },
+   { TVEEPROM_AUDPROC_OTHER, "TEA6300"   },
+   { TVEEPROM_AUDPROC_OTHER, "TEA6320"   },
+   { TVEEPROM_AUDPROC_OTHER, "TDA9850"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3400C"  },
/* 5-9 */
-   { V4L2_IDENT_MSPX4XX,   "MSP3410D"  },
-   { V4L2_IDENT_MSPX4XX,   "MSP3415"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3430"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3438"   },
-   { V4L2_IDENT_UNKNOWN,   "CS5331"},
+   { TVEEPROM_AUDPROC_MSP,   "MSP3410D"  },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3415"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3430"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3438"   },
+   { TVEEPROM_AUDPROC_OTHER, "CS5331"},
/* 10-14 */
-   { V4L2_IDENT_MSPX4XX,   "MSP3435"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3440"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3445"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3411"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3416"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3435"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3440"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3445"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3411"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3416"   },
/* 15-19 */
-   { V4L2_IDENT_MSPX4XX,   "MSP3425"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3451"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP3418"   },
-   { V4L2_IDENT_UNKNOWN,   "Type 0x12" },
-   { V4L2_IDENT_UNKNOWN,   "OKI7716"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3425"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3451"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP3418"   },
+   { TVEEPROM_AUDPROC_OTHER, "Type 0x12" },
+   { TVEEPROM_AUDPROC_OTHER, "OKI7716"   },
/* 20-24 */
-   { V4L2_IDENT_MSPX4XX,   "MSP4410"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP4420"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP4440"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP4450"   },
-   { V4L2_IDENT_MSPX4XX,   "MSP4408"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP4410"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP4420"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP4440"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP4450"   },
+   { TVEEPROM_AUDPROC_MSP,   "MSP4408"   },
/* 25-29 */
-   { V4L2_IDENT_MSPX4XX,   "M

[RFC PATCH 14/24] au8522_decoder: remove g_chip_ident op.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This is no longer needed since the core now handles this through 
DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil 
---
 drivers/media/dvb-frontends/au8522_decoder.c |   17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/media/dvb-frontends/au8522_decoder.c 
b/drivers/media/dvb-frontends/au8522_decoder.c
index 9d159b4..23a0d05 100644
--- a/drivers/media/dvb-frontends/au8522_decoder.c
+++ b/drivers/media/dvb-frontends/au8522_decoder.c
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "au8522.h"
 #include "au8522_priv.h"
@@ -524,11 +523,8 @@ static int au8522_s_ctrl(struct v4l2_ctrl *ctrl)
 static int au8522_g_register(struct v4l2_subdev *sd,
 struct v4l2_dbg_register *reg)
 {
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct au8522_state *state = to_state(sd);
 
-   if (!v4l2_chip_match_i2c_client(client, ®->match))
-   return -EINVAL;
reg->val = au8522_readreg(state, reg->reg & 0x);
return 0;
 }
@@ -536,11 +532,8 @@ static int au8522_g_register(struct v4l2_subdev *sd,
 static int au8522_s_register(struct v4l2_subdev *sd,
 const struct v4l2_dbg_register *reg)
 {
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct au8522_state *state = to_state(sd);
 
-   if (!v4l2_chip_match_i2c_client(client, ®->match))
-   return -EINVAL;
au8522_writereg(state, reg->reg, reg->val & 0xff);
return 0;
 }
@@ -632,20 +625,10 @@ static int au8522_g_tuner(struct v4l2_subdev *sd, struct 
v4l2_tuner *vt)
return 0;
 }
 
-static int au8522_g_chip_ident(struct v4l2_subdev *sd,
-  struct v4l2_dbg_chip_ident *chip)
-{
-   struct au8522_state *state = to_state(sd);
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-   return v4l2_chip_ident_i2c_client(client, chip, state->id, state->rev);
-}
-
 /* --- */
 
 static const struct v4l2_subdev_core_ops au8522_core_ops = {
.log_status = v4l2_ctrl_subdev_log_status,
-   .g_chip_ident = au8522_g_chip_ident,
.reset = au8522_reset,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = au8522_g_register,
-- 
1.7.10.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


[RFC PATCH 04/24] saa7115: add back the dropped 'found' message.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

The saa7115 driver used to show a 'chip found' message during probe. This
was accidentally dropped during recent commits. Add it back as it is quite
useful.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/saa7115.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c
index 18cf0bf..4daa81c 100644
--- a/drivers/media/i2c/saa7115.c
+++ b/drivers/media/i2c/saa7115.c
@@ -1735,6 +1735,8 @@ static int saa711x_probe(struct i2c_client *client,
sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &saa711x_ops);
 
+   v4l_info(client, "%s found @ 0x%x (%s)\n", name,
+client->addr << 1, client->adapter->name);
hdl = &state->hdl;
v4l2_ctrl_handler_init(hdl, 6);
/* add in ascending ID order */
-- 
1.7.10.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


[RFC PATCH 13/24] v4l2: remove obsolete v4l2_chip_match_host().

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This function is no longer needed since it is now the responsibility of the
v4l2 core to check if the DBG_G/S_REGISTER and DBG_G_CHIP_INFO ioctls are
called for the bridge driver or not.

Signed-off-by: Hans Verkuil 
---
 drivers/media/usb/usbvision/usbvision-video.c |4 
 drivers/media/v4l2-core/v4l2-common.c |   11 ---
 include/media/v4l2-common.h   |1 -
 3 files changed, 16 deletions(-)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c 
b/drivers/media/usb/usbvision/usbvision-video.c
index d34c2af..f959197 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -467,8 +467,6 @@ static int vidioc_g_register(struct file *file, void *priv,
struct usb_usbvision *usbvision = video_drvdata(file);
int err_code;
 
-   if (!v4l2_chip_match_host(®->match))
-   return -EINVAL;
/* NT100x has a 8-bit register space */
err_code = usbvision_read_reg(usbvision, reg->reg&0xff);
if (err_code < 0) {
@@ -488,8 +486,6 @@ static int vidioc_s_register(struct file *file, void *priv,
struct usb_usbvision *usbvision = video_drvdata(file);
int err_code;
 
-   if (!v4l2_chip_match_host(®->match))
-   return -EINVAL;
/* NT100x has a 8-bit register space */
err_code = usbvision_write_reg(usbvision, reg->reg & 0xff, reg->val);
if (err_code < 0) {
diff --git a/drivers/media/v4l2-core/v4l2-common.c 
b/drivers/media/v4l2-core/v4l2-common.c
index 3fed63f..5fd7660 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -227,17 +227,6 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 
id)
 }
 EXPORT_SYMBOL(v4l2_ctrl_next);
 
-int v4l2_chip_match_host(const struct v4l2_dbg_match *match)
-{
-   switch (match->type) {
-   case V4L2_CHIP_MATCH_BRIDGE:
-   return match->addr == 0;
-   default:
-   return 0;
-   }
-}
-EXPORT_SYMBOL(v4l2_chip_match_host);
-
 #if IS_ENABLED(CONFIG_I2C)
 int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct 
v4l2_dbg_match *match)
 {
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 1d93c48..e7821fb 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -106,7 +106,6 @@ struct i2c_client; /* forward reference */
 int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct 
v4l2_dbg_match *match);
 int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct 
v4l2_dbg_chip_ident *chip,
u32 ident, u32 revision);
-int v4l2_chip_match_host(const struct v4l2_dbg_match *match);
 
 /* - */
 
-- 
1.7.10.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


[RFC PATCH 16/24] indycam: remove g_chip_ident op.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This is no longer needed since the core now handles this through 
DBG_G_CHIP_INFO.

Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/indycam.c |   12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/media/platform/indycam.c b/drivers/media/platform/indycam.c
index 5482363..f1d192b 100644
--- a/drivers/media/platform/indycam.c
+++ b/drivers/media/platform/indycam.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "indycam.h"
 
@@ -283,20 +282,9 @@ static int indycam_s_ctrl(struct v4l2_subdev *sd, struct 
v4l2_control *ctrl)
 
 /* I2C-interface */
 
-static int indycam_g_chip_ident(struct v4l2_subdev *sd,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-   struct indycam *camera = to_indycam(sd);
-
-   return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_INDYCAM,
-  camera->version);
-}
-
 /* --- */
 
 static const struct v4l2_subdev_core_ops indycam_core_ops = {
-   .g_chip_ident = indycam_g_chip_ident,
.g_ctrl = indycam_g_ctrl,
.s_ctrl = indycam_s_ctrl,
 };
-- 
1.7.10.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


[RFC PATCH 11/24] marvell-ccic: remove g_chip_ident.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Remove g_chip_ident. This driver used some of the V4L2_IDENT defines, replace
those with a driver-specific enum. This makes it possible to drop the
v4l2-chip-ident.h define as well.

Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/marvell-ccic/cafe-driver.c |3 +-
 drivers/media/platform/marvell-ccic/mcam-core.c   |   55 +++--
 drivers/media/platform/marvell-ccic/mcam-core.h   |8 ++-
 drivers/media/platform/marvell-ccic/mmp-driver.c  |3 +-
 4 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/drivers/media/platform/marvell-ccic/cafe-driver.c 
b/drivers/media/platform/marvell-ccic/cafe-driver.c
index d030f9b..7b07fc5 100644
--- a/drivers/media/platform/marvell-ccic/cafe-driver.c
+++ b/drivers/media/platform/marvell-ccic/cafe-driver.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -469,7 +468,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
goto out;
cam->pdev = pdev;
mcam = &cam->mcam;
-   mcam->chip_id = V4L2_IDENT_CAFE;
+   mcam->chip_id = MCAM_CAFE;
spin_lock_init(&mcam->dev_lock);
init_waitqueue_head(&cam->smbus_wait);
mcam->plat_power_up = cafe_ctlr_power_up;
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c 
b/drivers/media/platform/marvell-ccic/mcam-core.c
index 64ab91e..a187161 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -336,7 +335,7 @@ static void mcam_ctlr_dma_vmalloc(struct mcam_camera *cam)
mcam_reg_clear_bit(cam, REG_CTRL1, C1_TWOBUFS);
} else
mcam_reg_set_bit(cam, REG_CTRL1, C1_TWOBUFS);
-   if (cam->chip_id == V4L2_IDENT_CAFE)
+   if (cam->chip_id == MCAM_CAFE)
mcam_reg_write(cam, REG_UBAR, 0); /* 32 bits only */
 }
 
@@ -796,7 +795,6 @@ static int __mcam_cam_reset(struct mcam_camera *cam)
  */
 static int mcam_cam_init(struct mcam_camera *cam)
 {
-   struct v4l2_dbg_chip_ident chip;
int ret;
 
mutex_lock(&cam->s_mutex);
@@ -804,24 +802,8 @@ static int mcam_cam_init(struct mcam_camera *cam)
cam_warn(cam, "Cam init with device in funky state %d",
cam->state);
ret = __mcam_cam_reset(cam);
-   if (ret)
-   goto out;
-   chip.ident = V4L2_IDENT_NONE;
-   chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR;
-   chip.match.addr = cam->sensor_addr;
-   ret = sensor_call(cam, core, g_chip_ident, &chip);
-   if (ret)
-   goto out;
-   cam->sensor_type = chip.ident;
-   if (cam->sensor_type != V4L2_IDENT_OV7670) {
-   cam_err(cam, "Unsupported sensor type 0x%x", cam->sensor_type);
-   ret = -EINVAL;
-   goto out;
-   }
-/* Get/set parameters? */
-   ret = 0;
+   /* Get/set parameters? */
cam->state = S_IDLE;
-out:
mcam_ctlr_power_down(cam);
mutex_unlock(&cam->s_mutex);
return ret;
@@ -1392,20 +1374,6 @@ static int mcam_vidioc_s_parm(struct file *filp, void 
*priv,
return ret;
 }
 
-static int mcam_vidioc_g_chip_ident(struct file *file, void *priv,
-   struct v4l2_dbg_chip_ident *chip)
-{
-   struct mcam_camera *cam = priv;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   if (v4l2_chip_match_host(&chip->match)) {
-   chip->ident = cam->chip_id;
-   return 0;
-   }
-   return sensor_call(cam, core, g_chip_ident, chip);
-}
-
 static int mcam_vidioc_enum_framesizes(struct file *filp, void *priv,
struct v4l2_frmsizeenum *sizes)
 {
@@ -1436,12 +1404,9 @@ static int mcam_vidioc_g_register(struct file *file, 
void *priv,
 {
struct mcam_camera *cam = priv;
 
-   if (v4l2_chip_match_host(®->match)) {
-   reg->val = mcam_reg_read(cam, reg->reg);
-   reg->size = 4;
-   return 0;
-   }
-   return sensor_call(cam, core, g_register, reg);
+   reg->val = mcam_reg_read(cam, reg->reg);
+   reg->size = 4;
+   return 0;
 }
 
 static int mcam_vidioc_s_register(struct file *file, void *priv,
@@ -1449,11 +1414,8 @@ static int mcam_vidioc_s_register(struct file *file, 
void *priv,
 {
struct mcam_camera *cam = priv;
 
-   if (v4l2_chip_match_host(®->match)) {
-   mcam_reg_write(cam, reg->reg, reg->val);
-   return 0;
-   }
-   return sensor_call(cam, core, s_register, reg);
+   mcam_reg_write(cam, reg->reg, reg->val);
+   return 0;
 }
 #endif
 
@@ -1477,7 +1439,6 @@ static const struct v4l2_ioctl_ops mcam_v4l_ioctl_ops = {
.vidioc_s_parm  = mcam_vidioc_s_parm,
.vidioc_enum_framesizes = mcam_vidioc_enum_framesizes,
.vidioc_enum_frameintervals = mcam_vidioc_

[RFC PATCH 05/24] ivtv: remove g_chip_ident

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

g_chip_ident was used to determine if a saa7114 or saa7115 was used. Instead
just check the subdev name.

After that the g_chip_ident function can be removed.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/ivtv/ivtv-driver.c |8 +--
 drivers/media/pci/ivtv/ivtv-ioctl.c  |   41 --
 2 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/drivers/media/pci/ivtv/ivtv-driver.c 
b/drivers/media/pci/ivtv/ivtv-driver.c
index 07b8460..db61452 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -58,7 +58,6 @@
 #include 
 #include 
 #include 
-#include 
 #include "tuner-xc2028.h"
 
 /* If you have already X v4l cards, then set this to X. This way
@@ -968,15 +967,10 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
}
 
if (hw & IVTV_HW_SAA711X) {
-   struct v4l2_dbg_chip_ident v;
-
/* determine the exact saa711x model */
itv->hw_flags &= ~IVTV_HW_SAA711X;
 
-   v.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
-   strlcpy(v.match.name, "saa7115", sizeof(v.match.name));
-   ivtv_call_hw(itv, IVTV_HW_SAA711X, core, g_chip_ident, &v);
-   if (v.ident == V4L2_IDENT_SAA7114) {
+   if (strstr(itv->sd_video->name, "saa7114")) {
itv->hw_flags |= IVTV_HW_SAA7114;
/* VBI is not yet supported by the saa7114 driver. */
itv->v4l2_cap &= 
~(V4L2_CAP_SLICED_VBI_CAPTURE|V4L2_CAP_VBI_CAPTURE);
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c 
b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 3e281ec..944300f 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -34,7 +34,6 @@
 #include "ivtv-cards.h"
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -692,24 +691,6 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, 
void *fh, struct v4l2_f
return ret;
 }
 
-static int ivtv_g_chip_ident(struct file *file, void *fh, struct 
v4l2_dbg_chip_ident *chip)
-{
-   struct ivtv *itv = fh2id(fh)->itv;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
-   if (v4l2_chip_match_host(&chip->match))
-   chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : 
V4L2_IDENT_CX23416;
-   return 0;
-   }
-   if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
-   chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-   return -EINVAL;
-   /* TODO: is this correct? */
-   return ivtv_call_all_err(itv, core, g_chip_ident, chip);
-}
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val)
 {
@@ -736,29 +717,16 @@ static int ivtv_g_register(struct file *file, void *fh, 
struct v4l2_dbg_register
 {
struct ivtv *itv = fh2id(fh)->itv;
 
-   if (v4l2_chip_match_host(®->match)) {
-   reg->size = 4;
-   return ivtv_itvc(itv, true, reg->reg, ®->val);
-   }
-   /* TODO: subdev errors should not be ignored, this should become a
-  subdev helper function. */
-   ivtv_call_all(itv, core, g_register, reg);
-   return 0;
+   reg->size = 4;
+   return ivtv_itvc(itv, true, reg->reg, ®->val);
 }
 
 static int ivtv_s_register(struct file *file, void *fh, const struct 
v4l2_dbg_register *reg)
 {
struct ivtv *itv = fh2id(fh)->itv;
+   u64 val = reg->val;
 
-   if (v4l2_chip_match_host(®->match)) {
-   u64 val = reg->val;
-
-   return ivtv_itvc(itv, false, reg->reg, &val);
-   }
-   /* TODO: subdev errors should not be ignored, this should become a
-  subdev helper function. */
-   ivtv_call_all(itv, core, s_register, reg);
-   return 0;
+   return ivtv_itvc(itv, false, reg->reg, &val);
 }
 #endif
 
@@ -1912,7 +1880,6 @@ static const struct v4l2_ioctl_ops ivtv_ioctl_ops = {
.vidioc_try_fmt_vid_out_overlay = ivtv_try_fmt_vid_out_overlay,
.vidioc_try_fmt_sliced_vbi_out  = ivtv_try_fmt_sliced_vbi_out,
.vidioc_g_sliced_vbi_cap= ivtv_g_sliced_vbi_cap,
-   .vidioc_g_chip_ident= ivtv_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register  = ivtv_g_register,
.vidioc_s_register  = ivtv_s_register,
-- 
1.7.10.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


[RFC PATCH 08/24] saa6752hs: drop obsolete g_chip_ident.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

This op and the v4l2-chip-ident.h header are no longer needed.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/saa7134/saa6752hs.c |   14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/media/pci/saa7134/saa6752hs.c 
b/drivers/media/pci/saa7134/saa6752hs.c
index f147b05..244b286 100644
--- a/drivers/media/pci/saa7134/saa6752hs.c
+++ b/drivers/media/pci/saa7134/saa6752hs.c
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -92,7 +91,6 @@ static const struct v4l2_format v4l2_format_table[] =
 
 struct saa6752hs_state {
struct v4l2_subdevsd;
-   int   chip;
u32   revision;
int   has_ac3;
struct saa6752hs_mpeg_params  params;
@@ -914,19 +912,9 @@ static int saa6752hs_s_std(struct v4l2_subdev *sd, 
v4l2_std_id std)
return 0;
 }
 
-static int saa6752hs_g_chip_ident(struct v4l2_subdev *sd, struct 
v4l2_dbg_chip_ident *chip)
-{
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-   struct saa6752hs_state *h = to_state(sd);
-
-   return v4l2_chip_ident_i2c_client(client,
-   chip, h->chip, h->revision);
-}
-
 /* --- */
 
 static const struct v4l2_subdev_core_ops saa6752hs_core_ops = {
-   .g_chip_ident = saa6752hs_g_chip_ident,
.init = saa6752hs_init,
.queryctrl = saa6752hs_queryctrl,
.querymenu = saa6752hs_querymenu,
@@ -963,11 +951,9 @@ static int saa6752hs_probe(struct i2c_client *client,
 
i2c_master_send(client, &addr, 1);
i2c_master_recv(client, data, sizeof(data));
-   h->chip = V4L2_IDENT_SAA6752HS;
h->revision = (data[8] << 8) | data[9];
h->has_ac3 = 0;
if (h->revision == 0x0206) {
-   h->chip = V4L2_IDENT_SAA6752HS_AC3;
h->has_ac3 = 1;
v4l_info(client, "support AC-3\n");
}
-- 
1.7.10.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


[RFC PATCH 06/24] cx23885: remove g_chip_ident.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Replace g_chip_ident by g_chip_info. Note that the IR support is implemented
as a subdev, so this part no longer needs to be handled as a 'bridge' chip.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/cx23885/cx23885-417.c   |2 +-
 drivers/media/pci/cx23885/cx23885-ioctl.c |  139 ++---
 drivers/media/pci/cx23885/cx23885-ioctl.h |4 +-
 drivers/media/pci/cx23885/cx23885-video.c |2 +-
 drivers/media/pci/cx23885/cx23888-ir.c|   27 --
 5 files changed, 29 insertions(+), 145 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-417.c 
b/drivers/media/pci/cx23885/cx23885-417.c
index 6dea11a..68568d3 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1690,8 +1690,8 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
.vidioc_log_status   = vidioc_log_status,
.vidioc_querymenu= vidioc_querymenu,
.vidioc_queryctrl= vidioc_queryctrl,
-   .vidioc_g_chip_ident = cx23885_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_chip_info  = cx23885_g_chip_info,
.vidioc_g_register   = cx23885_g_register,
.vidioc_s_register   = cx23885_s_register,
 #endif
diff --git a/drivers/media/pci/cx23885/cx23885-ioctl.c 
b/drivers/media/pci/cx23885/cx23885-ioctl.c
index 00f5125..271d69d 100644
--- a/drivers/media/pci/cx23885/cx23885-ioctl.c
+++ b/drivers/media/pci/cx23885/cx23885-ioctl.c
@@ -24,93 +24,21 @@
 #include "cx23885.h"
 #include "cx23885-ioctl.h"
 
-#include 
-
-int cx23885_g_chip_ident(struct file *file, void *fh,
-struct v4l2_dbg_chip_ident *chip)
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+int cx23885_g_chip_info(struct file *file, void *fh,
+struct v4l2_dbg_chip_info *chip)
 {
struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
-   int err = 0;
-   u8 rev;
-
-   chip->ident = V4L2_IDENT_NONE;
-   chip->revision = 0;
-   switch (chip->match.type) {
-   case V4L2_CHIP_MATCH_HOST:
-   switch (chip->match.addr) {
-   case 0:
-   rev = cx_read(RDR_CFG2) & 0xff;
-   switch (dev->pci->device) {
-   case 0x8852:
-   /* rev 0x04 could be '885 or '888. Pick '888. */
-   if (rev == 0x04)
-   chip->ident = V4L2_IDENT_CX23888;
-   else
-   chip->ident = V4L2_IDENT_CX23885;
-   break;
-   case 0x8880:
-   if (rev == 0x0e || rev == 0x0f)
-   chip->ident = V4L2_IDENT_CX23887;
-   else
-   chip->ident = V4L2_IDENT_CX23888;
-   break;
-   default:
-   chip->ident = V4L2_IDENT_UNKNOWN;
-   break;
-   }
-   chip->revision = (dev->pci->device << 16) | (rev << 8) |
-(dev->hwrevision & 0xff);
-   break;
-   case 1:
-   if (dev->v4l_device != NULL) {
-   chip->ident = V4L2_IDENT_CX23417;
-   chip->revision = 0;
-   }
-   break;
-   case 2:
-   /*
-* The integrated IR controller on the CX23888 is
-* host chip 2.  It may not be used/initialized or sd_ir
-* may be pointing at the cx25840 subdevice for the
-* IR controller on the CX23885.  Thus we find it
-* without using the dev->sd_ir pointer.
-*/
-   call_hw(dev, CX23885_HW_888_IR, core, g_chip_ident,
-   chip);
-   break;
-   default:
-   err = -EINVAL; /* per V4L2 spec */
-   break;
-   }
-   break;
-   case V4L2_CHIP_MATCH_I2C_DRIVER:
-   /* If needed, returns V4L2_IDENT_AMBIGUOUS without extra work */
-   call_all(dev, core, g_chip_ident, chip);
-   break;
-   case V4L2_CHIP_MATCH_I2C_ADDR:
-   /*
-* We could return V4L2_IDENT_UNKNOWN, but we don't do the work
-* to look if a chip is at the address with no driver.  That's a
-* dangerous thing to do with EEPROMs anyway.
-*/
-   call_all(dev, core, g_chip_ident, chip);
-   break;
-   default:
-   err = -EINVAL;
-   break;
-   }
-  

[RFC PATCH 01/24] v4l2-ioctl: dbg_g/s_register: only match BRIDGE and SUBDEV types.

2013-05-26 Thread Hans Verkuil
From: Hans Verkuil 

Drop support for V4L2_CHIP_MATCH_I2C_DRIVER/ADDR and V4L2_CHIP_MATCH_AC97
types. The following patches will remove support for those in the drivers
as well.

This means that bridge drivers no longer have to check for the match.type
field in their g/s_register implementations. Only if they also implement
g_chip_info do they still have to check the match.addr field, otherwise the
core will check for that as well.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ioctl.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index f81bda1..60b8c25 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1807,7 +1807,8 @@ static int v4l_dbg_g_register(const struct v4l2_ioctl_ops 
*ops,
return v4l2_subdev_call(sd, core, g_register, 
p);
return -EINVAL;
}
-   if (ops->vidioc_g_register)
+   if (ops->vidioc_g_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE &&
+   (ops->vidioc_g_chip_info || p->match.addr == 0))
return ops->vidioc_g_register(file, fh, p);
return -EINVAL;
 #else
@@ -1834,7 +1835,8 @@ static int v4l_dbg_s_register(const struct v4l2_ioctl_ops 
*ops,
return v4l2_subdev_call(sd, core, s_register, 
p);
return -EINVAL;
}
-   if (ops->vidioc_s_register)
+   if (ops->vidioc_s_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE &&
+   (ops->vidioc_g_chip_info || p->match.addr == 0))
return ops->vidioc_s_register(file, fh, p);
return -EINVAL;
 #else
-- 
1.7.10.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


[RFC PATCH 00/24] Remove VIDIOC_DBG_G_CHIP_IDENT

2013-05-26 Thread Hans Verkuil
With the introduction in 3.10 of the new superior VIDIOC_DBG_G_CHIP_INFO
ioctl there is no longer any need for the DBG_G_CHIP_IDENT ioctl or the
v4l2-chip-ident.h header.

This patch series removes all code related to this ioctl and the
v4l2-chip-ident.h header.

This patch series simplifies drivers substantially and deletes over 2800
lines in total.

Regards,

Hans

 Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml  |  271 ---
 b/Documentation/DocBook/media/v4l/compat.xml |   14 
 b/Documentation/DocBook/media/v4l/v4l2.xml   |   11 
 b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml |   17 
 b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml  |   40 -
 b/Documentation/video4linux/v4l2-framework.txt   |   13 
 b/Documentation/zh_CN/video4linux/v4l2-framework.txt |   13 
 b/drivers/media/common/saa7146/saa7146_video.c   |   23 
 b/drivers/media/common/tveeprom.c|  142 +--
 b/drivers/media/dvb-frontends/au8522_decoder.c   |   17 
 b/drivers/media/i2c/ad9389b.c|   21 
 b/drivers/media/i2c/adv7170.c|   13 
 b/drivers/media/i2c/adv7175.c|9 
 b/drivers/media/i2c/adv7180.c|   10 
 b/drivers/media/i2c/adv7183.c|   22 
 b/drivers/media/i2c/adv7343.c|   10 
 b/drivers/media/i2c/adv7393.c|   10 
 b/drivers/media/i2c/adv7604.c|   18 
 b/drivers/media/i2c/ak881x.c |   34 
 b/drivers/media/i2c/bt819.c  |   14 
 b/drivers/media/i2c/bt856.c  |9 
 b/drivers/media/i2c/bt866.c  |   13 
 b/drivers/media/i2c/cs5345.c |   17 
 b/drivers/media/i2c/cs53l32a.c   |   10 
 b/drivers/media/i2c/cx25840/cx25840-core.c   |   64 -
 b/drivers/media/i2c/cx25840/cx25840-core.h   |   34 
 b/drivers/media/i2c/ks0127.c |   16 
 b/drivers/media/i2c/m52790.c |   15 
 b/drivers/media/i2c/msp3400-driver.c |   10 
 b/drivers/media/i2c/mt9m032.c|9 
 b/drivers/media/i2c/mt9p031.c|1 
 b/drivers/media/i2c/mt9v011.c|   24 
 b/drivers/media/i2c/noon010pc30.c|1 
 b/drivers/media/i2c/ov7640.c |1 
 b/drivers/media/i2c/ov7670.c |   17 
 b/drivers/media/i2c/saa6588.c|9 
 b/drivers/media/i2c/saa7110.c|9 
 b/drivers/media/i2c/saa7115.c|  107 +-
 b/drivers/media/i2c/saa7127.c|   47 -  
 
 b/drivers/media/i2c/saa717x.c|7
 
 b/drivers/media/i2c/saa7185.c|9
 
 b/drivers/media/i2c/saa7191.c|   10
 
 b/drivers/media/i2c/soc_camera/imx074.c  |   19
 
 b/drivers/media/i2c/soc_camera/mt9m001.c |   33
 
 b/drivers/media/i2c/soc_camera/mt9m111.c |   33
 
 b/drivers/media/i2c/soc_camera/mt9t031.c |   32
 
 b/drivers/media/i2c/soc_camera/mt9t112.c |   16
 
 b/drivers/media/i2c/soc_camera/mt9v022.c |   47 -  
 
 b/drivers/media/i2c/soc_camera/ov2640.c  |   16
 
 b/drivers/media/i2c/soc_camera/ov5642.c  |   19
 
 b/drivers/media/i2c/soc_camera/ov6650.c  |   12
  

[PATCH v5] media: i2c: tvp514x: add OF support

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

add OF support for the tvp514x driver.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
---
Tested on da850-evm.

 RFC v1: https://patchwork.kernel.org/patch/2030061/
 RFC v2: https://patchwork.kernel.org/patch/2061811/

 Changes for current version from RFC v2:
 1: Fixed review comments pointed by Sylwester.

 Changes for v2:
 1: Listed all the compatible property values in the documentation text file.
 2: Removed "-decoder" from compatible property values.
 3: Added a reference to the V4L2 DT bindings documentation to explain
what the port and endpoint nodes are for.
 4: Fixed some Nits pointed by Laurent.
 5: Removed unnecessary header file includes and sort them alphabetically.

 Changes for v3:
 1: Rebased on patch https://patchwork.kernel.org/patch/2539411/

 Changes for v4:
 1: added missing call for of_node_put().
 2: Rebased the patch on v3.11.
 
 Changes for v5:
 1: Fixed calling to a wrong label.
 
 .../devicetree/bindings/media/i2c/tvp514x.txt  |   45 ++
 drivers/media/i2c/tvp514x.c|   62 ++--
 2 files changed, 101 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp514x.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/tvp514x.txt 
b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
new file mode 100644
index 000..cc09424
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
@@ -0,0 +1,45 @@
+* Texas Instruments TVP514x video decoder
+
+The TVP5146/TVP5146m2/TVP5147/TVP5147m1 device is high quality, single-chip
+digital video decoder that digitizes and decodes all popular baseband analog
+video formats into digital video component. The tvp514x decoder supports 
analog-
+to-digital (A/D) conversion of component RGB and YPbPr signals as well as A/D
+conversion and decoding of NTSC, PAL and SECAM composite and S-video into
+component YCbCr.
+
+Required Properties :
+- compatible : value should be either one among the following
+   (a) "ti,tvp5146" for tvp5146 decoder.
+   (b) "ti,tvp5146m2" for tvp5146m2 decoder.
+   (c) "ti,tvp5147" for tvp5147 decoder.
+   (d) "ti,tvp5147m1" for tvp5147m1 decoder.
+
+- hsync-active: HSYNC Polarity configuration for endpoint.
+
+- vsync-active: VSYNC Polarity configuration for endpoint.
+
+- pclk-sample: Clock polarity of the endpoint.
+
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   tvp514x@5c {
+   compatible = "ti,tvp5146";
+   reg = <0x5c>;
+
+   port {
+   tvp514x_1: endpoint {
+   hsync-active = <1>;
+   vsync-active = <1>;
+   pclk-sample = <0>;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 7438e01..7ed999b 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1055,6 +1056,42 @@ static struct tvp514x_decoder tvp514x_dev = {
 
 };
 
+static struct tvp514x_platform_data *
+tvp514x_get_pdata(struct i2c_client *client)
+{
+   struct tvp514x_platform_data *pdata = NULL;
+   struct v4l2_of_endpoint bus_cfg;
+   struct device_node *endpoint;
+   unsigned int flags;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!endpoint)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   v4l2_of_parse_endpoint(endpoint, &bus_cfg);
+   flags = bus_cfg.bus.parallel.flags;
+
+   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
+   pdata->hs_polarity = 1;
+
+   if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
+   pdata->vs_polarity = 1;
+
+   if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
+   pdata->clk_polarity = 1;
+
+done:
+   of_node_put(endpoint);
+   return pdata;
+}
+
 /**
  * tvp514x_probe() - decoder driver i2c probe handler
  * @client: i2c driver client device structure
@@ -1066,19 +1103,20 @@ static struct tvp514x_decoder tvp514x_dev = {
 static int
 tvp514x

[PATCH] media: i2c: mt9p031: add OF support

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

add OF support for the mt9p031 sensor driver.
Alongside this patch sorts the header inclusion alphabetically.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Sascha Hauer 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: Arnd Bergmann 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 Changes for NON RFC v1:
 1: added missing call for of_node_put().
 
 Changes for RFC v4 (https://patchwork.kernel.org/patch/2556251/):
 1: Renamed "gpio-reset" property to "reset-gpios".
 2: Dropped assigning the driver data from the of node.

 Changes for RFC v3(https://patchwork.kernel.org/patch/2515921/):
 1: Dropped check if gpio-reset is valid.
 2: Fixed some code nits.
 3: Included a reference to the V4L2 DT bindings documentation.

 Changes for RFC v2 (https://patchwork.kernel.org/patch/2510201/):
 1: Used '-' instead of '_' for device properties.
 2: Specified gpio reset pin as phandle in device node.
 3: Handle platform data properly even if kernel is compiled with
devicetree support.
 4: Used dev_* for messages in drivers instead of pr_*.
 5: Changed compatible property to "aptina,mt9p031" and "aptina,mt9p031m".
 6: Sorted the header inclusion alphabetically and fixed some minor code nits.
 
 RFC v1: https://patchwork.kernel.org/patch/2498791/
 
 .../devicetree/bindings/media/i2c/mt9p031.txt  |   40 ++
 drivers/media/i2c/mt9p031.c|   43 +++-
 2 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/mt9p031.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/mt9p031.txt 
b/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
new file mode 100644
index 000..59d613c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
@@ -0,0 +1,40 @@
+* Aptina 1/2.5-Inch 5Mp CMOS Digital Image Sensor
+
+The Aptina MT9P031 is a 1/2.5-inch CMOS active pixel digital image sensor with
+an active array size of 2592H x 1944V. It is programmable through a simple
+two-wire serial interface.
+
+Required Properties :
+- compatible : value should be either one among the following
+   (a) "aptina,mt9p031" for mt9p031 sensor
+   (b) "aptina,mt9p031m" for mt9p031m sensor
+
+- input-clock-frequency : Input clock frequency.
+
+- pixel-clock-frequency : Pixel clock frequency.
+
+Optional Properties :
+- reset-gpios: Chip reset GPIO
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   mt9p031@5d {
+   compatible = "aptina,mt9p031";
+   reg = <0x5d>;
+   reset-gpios = <&gpio3 30 0>;
+
+   port {
+   mt9p031_1: endpoint {
+   input-clock-frequency = <600>;
+   pixel-clock-frequency = <9600>;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index bf49899..bb1f993 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -16,9 +16,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -28,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "aptina-pll.h"
@@ -928,10 +930,37 @@ static const struct v4l2_subdev_internal_ops 
mt9p031_subdev_internal_ops = {
  * Driver initialization and probing
  */
 
+static struct mt9p031_platform_data *
+mt9p031_get_pdata(struct i2c_client *client)
+{
+   struct mt9p031_platform_data *pdata = NULL;
+   struct device_node *np;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   np = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!np)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(struct mt9p031_platform_data),
+GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   pdata->reset = of_get_named_gpio(client->dev.of_node, "reset-gpios", 0);
+   of_property_read_u32(np, "input-clock-frequency", &pdata->ext_freq);
+   of_property_read_u32(np, "pixel-clock-frequency", &pdata->target_freq);
+
+done:
+   of_node_put(np);
+   return pdata;
+}
+
 static int mt9p031_probe(struct i2c_client *client,
 const struct i2c_device_id *did)
 {
-   struct mt9p031_platform_data *pdata = client->dev.platform_data;
+   struct mt9p0

Re: [PATCH v4] media: i2c: tvp514x: add OF support

2013-05-26 Thread Prabhakar Lad
Hi All,

On Sun, May 26, 2013 at 6:10 PM, Prabhakar Lad
 wrote:
> From: Lad, Prabhakar 
>
> add OF support for the tvp514x driver.
>
> Signed-off-by: Lad, Prabhakar 
> Cc: Hans Verkuil 
> Cc: Laurent Pinchart 
> Cc: Mauro Carvalho Chehab 
> Cc: Guennadi Liakhovetski 
> Cc: Sylwester Nawrocki 
> Cc: Sakari Ailus 
> Cc: Grant Likely 
> Cc: Rob Herring 
> Cc: Rob Landley 
> Cc: devicetree-disc...@lists.ozlabs.org
> Cc: linux-...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org
> Cc: davinci-linux-open-sou...@linux.davincidsp.com
> ---
>  Tested on da850-evm.
>
>  RFC v1: https://patchwork.kernel.org/patch/2030061/
>  RFC v2: https://patchwork.kernel.org/patch/2061811/
>
>  Changes for current version from RFC v2:
>  1: Fixed review comments pointed by Sylwester.
>
>  Changes for v2:
>  1: Listed all the compatible property values in the documentation text file.
>  2: Removed "-decoder" from compatible property values.
>  3: Added a reference to the V4L2 DT bindings documentation to explain
> what the port and endpoint nodes are for.
>  4: Fixed some Nits pointed by Laurent.
>  5: Removed unnecessary header file includes and sort them alphabetically.
>
>  Changes for v3:
>  1: Rebased on patch https://patchwork.kernel.org/patch/2539411/
>
>  Changes for v4:
>  1: added missing call for of_node_put().
>  2: Rebased the patch on v3.11.
>
>  .../devicetree/bindings/media/i2c/tvp514x.txt  |   45 ++
>  drivers/media/i2c/tvp514x.c|   62 
> ++--
>  2 files changed, 101 insertions(+), 6 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp514x.txt
>
> diff --git a/Documentation/devicetree/bindings/media/i2c/tvp514x.txt 
> b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
> new file mode 100644
> index 000..cc09424
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
> @@ -0,0 +1,45 @@
> +* Texas Instruments TVP514x video decoder
> +
> +The TVP5146/TVP5146m2/TVP5147/TVP5147m1 device is high quality, single-chip
> +digital video decoder that digitizes and decodes all popular baseband analog
> +video formats into digital video component. The tvp514x decoder supports 
> analog-
> +to-digital (A/D) conversion of component RGB and YPbPr signals as well as A/D
> +conversion and decoding of NTSC, PAL and SECAM composite and S-video into
> +component YCbCr.
> +
> +Required Properties :
> +- compatible : value should be either one among the following
> +   (a) "ti,tvp5146" for tvp5146 decoder.
> +   (b) "ti,tvp5146m2" for tvp5146m2 decoder.
> +   (c) "ti,tvp5147" for tvp5147 decoder.
> +   (d) "ti,tvp5147m1" for tvp5147m1 decoder.
> +
> +- hsync-active: HSYNC Polarity configuration for endpoint.
> +
> +- vsync-active: VSYNC Polarity configuration for endpoint.
> +
> +- pclk-sample: Clock polarity of the endpoint.
> +
> +
> +For further reading of port node refer 
> Documentation/devicetree/bindings/media/
> +video-interfaces.txt.
> +
> +Example:
> +
> +   i2c0@1c22000 {
> +   ...
> +   ...
> +   tvp514x@5c {
> +   compatible = "ti,tvp5146";
> +   reg = <0x5c>;
> +
> +   port {
> +   tvp514x_1: endpoint {
> +   hsync-active = <1>;
> +   vsync-active = <1>;
> +   pclk-sample = <0>;
> +   };
> +   };
> +   };
> +   ...
> +   };
> diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
> index 7438e01..803f3b8 100644
> --- a/drivers/media/i2c/tvp514x.c
> +++ b/drivers/media/i2c/tvp514x.c
> @@ -38,6 +38,7 @@
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -1055,6 +1056,42 @@ static struct tvp514x_decoder tvp514x_dev = {
>
>  };
>
> +static struct tvp514x_platform_data *
> +tvp514x_get_pdata(struct i2c_client *client)
> +{
> +   struct tvp514x_platform_data *pdata = NULL;
> +   struct v4l2_of_endpoint bus_cfg;
> +   struct device_node *endpoint;
> +   unsigned int flags;
> +
> +   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
> +   return client->dev.platform_data;
> +
> +   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
> +   if (!endpoint)
> +   goto done;
> +
Ahh this had to be return NULL I'll respin a new version fixing it.

Regards,
--Prabhakar Lad
--
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 v4] media: i2c: tvp514x: add OF support

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

add OF support for the tvp514x driver.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
---
 Tested on da850-evm.

 RFC v1: https://patchwork.kernel.org/patch/2030061/
 RFC v2: https://patchwork.kernel.org/patch/2061811/

 Changes for current version from RFC v2:
 1: Fixed review comments pointed by Sylwester.

 Changes for v2:
 1: Listed all the compatible property values in the documentation text file.
 2: Removed "-decoder" from compatible property values.
 3: Added a reference to the V4L2 DT bindings documentation to explain
what the port and endpoint nodes are for.
 4: Fixed some Nits pointed by Laurent.
 5: Removed unnecessary header file includes and sort them alphabetically.

 Changes for v3:
 1: Rebased on patch https://patchwork.kernel.org/patch/2539411/
 
 Changes for v4:
 1: added missing call for of_node_put().
 2: Rebased the patch on v3.11.
 
 .../devicetree/bindings/media/i2c/tvp514x.txt  |   45 ++
 drivers/media/i2c/tvp514x.c|   62 ++--
 2 files changed, 101 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp514x.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/tvp514x.txt 
b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
new file mode 100644
index 000..cc09424
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/tvp514x.txt
@@ -0,0 +1,45 @@
+* Texas Instruments TVP514x video decoder
+
+The TVP5146/TVP5146m2/TVP5147/TVP5147m1 device is high quality, single-chip
+digital video decoder that digitizes and decodes all popular baseband analog
+video formats into digital video component. The tvp514x decoder supports 
analog-
+to-digital (A/D) conversion of component RGB and YPbPr signals as well as A/D
+conversion and decoding of NTSC, PAL and SECAM composite and S-video into
+component YCbCr.
+
+Required Properties :
+- compatible : value should be either one among the following
+   (a) "ti,tvp5146" for tvp5146 decoder.
+   (b) "ti,tvp5146m2" for tvp5146m2 decoder.
+   (c) "ti,tvp5147" for tvp5147 decoder.
+   (d) "ti,tvp5147m1" for tvp5147m1 decoder.
+
+- hsync-active: HSYNC Polarity configuration for endpoint.
+
+- vsync-active: VSYNC Polarity configuration for endpoint.
+
+- pclk-sample: Clock polarity of the endpoint.
+
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   tvp514x@5c {
+   compatible = "ti,tvp5146";
+   reg = <0x5c>;
+
+   port {
+   tvp514x_1: endpoint {
+   hsync-active = <1>;
+   vsync-active = <1>;
+   pclk-sample = <0>;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 7438e01..803f3b8 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -38,6 +38,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1055,6 +1056,42 @@ static struct tvp514x_decoder tvp514x_dev = {
 
 };
 
+static struct tvp514x_platform_data *
+tvp514x_get_pdata(struct i2c_client *client)
+{
+   struct tvp514x_platform_data *pdata = NULL;
+   struct v4l2_of_endpoint bus_cfg;
+   struct device_node *endpoint;
+   unsigned int flags;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!endpoint)
+   goto done;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   v4l2_of_parse_endpoint(endpoint, &bus_cfg);
+   flags = bus_cfg.bus.parallel.flags;
+
+   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
+   pdata->hs_polarity = 1;
+
+   if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
+   pdata->vs_polarity = 1;
+
+   if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
+   pdata->clk_polarity = 1;
+
+done:
+   of_node_put(endpoint);
+   return pdata;
+}
+
 /**
  * tvp514x_probe() - decoder driver i2c probe handler
  * @client: i2c driver client device structure
@@ -1066,19 +1103,20 @@ static struct tvp514x_decoder tvp514x_dev = {
 static int
 tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id

[PATCH v3 7/9] media: davinci: vpif_display: move the freeing of irq and global variables to remove()

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_display.c |   32 +++--
 1 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index 5b6f906..9c308e7 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1894,11 +1894,23 @@ vpif_int_err:
  */
 static int vpif_remove(struct platform_device *device)
 {
+   struct platform_device *pdev;
struct channel_obj *ch;
-   int i;
+   struct resource *res;
+   int irq_num;
+   int i = 0;
+
+   pdev = container_of(vpif_dev, struct platform_device, dev);
+   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
+   for (irq_num = res->start; irq_num <= res->end; irq_num++)
+   free_irq(irq_num,
+(void *)(&vpif_obj.dev[i]->channel_id));
+   i++;
+   }
 
v4l2_device_unregister(&vpif_obj.v4l2_dev);
 
+   kfree(vpif_obj.sd);
/* un-register device */
for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {
/* Get the pointer to the channel object */
@@ -1907,6 +1919,7 @@ static int vpif_remove(struct platform_device *device)
video_unregister_device(ch->video_dev);
 
ch->video_dev = NULL;
+   kfree(vpif_obj.dev[i]);
}
 
return 0;
@@ -2004,24 +2017,7 @@ static __init int vpif_init(void)
  */
 static void vpif_cleanup(void)
 {
-   struct platform_device *pdev;
-   struct resource *res;
-   int irq_num;
-   int i = 0;
-
-   pdev = container_of(vpif_dev, struct platform_device, dev);
-
-   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
-   for (irq_num = res->start; irq_num <= res->end; irq_num++)
-   free_irq(irq_num,
-(void *)(&vpif_obj.dev[i]->channel_id));
-   i++;
-   }
-
platform_driver_unregister(&vpif_driver);
-   kfree(vpif_obj.sd);
-   for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++)
-   kfree(vpif_obj.dev[i]);
 }
 
 module_init(vpif_init);
-- 
1.7.0.4

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


[PATCH v3 6/9] media: davinci: vpif_capture: Convert to devm_* api

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

use devm_request_irq() instead of request_irq(). This ensures
more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_capture.c |   38 -
 1 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index 38c1fba..5e1e5f6 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2082,14 +2082,14 @@ static __init int vpif_probe(struct platform_device 
*pdev)
 
while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) {
for (i = res->start; i <= res->end; i++) {
-   if (request_irq(i, vpif_channel_isr, IRQF_SHARED,
-   "VPIF_Capture", (void *)
-   (&vpif_obj.dev[res_idx]->channel_id))) {
-   err = -EBUSY;
-   for (j = 0; j < i; j++)
-   free_irq(j, (void *)
-   (&vpif_obj.dev[res_idx]->channel_id));
-   goto vpif_int_err;
+   err = devm_request_irq(&pdev->dev, i, vpif_channel_isr,
+IRQF_SHARED, "VPIF_Capture",
+(void *)(&vpif_obj.dev[res_idx]->
+channel_id));
+   if (err) {
+   err = -EINVAL;
+   goto vpif_unregister;
+
}
}
res_idx++;
@@ -2106,7 +2106,7 @@ static __init int vpif_probe(struct platform_device *pdev)
video_device_release(ch->video_dev);
}
err = -ENOMEM;
-   goto vpif_int_err;
+   goto vpif_unregister;
}
 
/* Initialize field of video device */
@@ -2207,13 +2207,9 @@ vpif_sd_error:
/* Note: does nothing if ch->video_dev == NULL */
video_device_release(ch->video_dev);
}
-vpif_int_err:
+vpif_unregister:
v4l2_device_unregister(&vpif_obj.v4l2_dev);
-   for (i = 0; i < res_idx; i++) {
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
-   for (j = res->start; j <= res->end; j++)
-   free_irq(j, (void *)(&vpif_obj.dev[i]->channel_id));
-   }
+
return err;
 }
 
@@ -2225,18 +2221,8 @@ vpif_int_err:
  */
 static int vpif_remove(struct platform_device *device)
 {
-   struct platform_device *pdev;
struct channel_obj *ch;
-   struct resource *res;
-   int irq_num, i = 0;
-
-   pdev = container_of(vpif_dev, struct platform_device, dev);
-   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
-   for (irq_num = res->start; irq_num <= res->end; irq_num++)
-   free_irq(irq_num,
-(void *)(&vpif_obj.dev[i]->channel_id));
-   i++;
-   }
+   int i;
 
v4l2_device_unregister(&vpif_obj.v4l2_dev);
 
-- 
1.7.0.4

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


[PATCH v3 3/9] media: davinci: vpif: remove unnecessary braces around defines

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch removes unnecessary braces around defines.

Signed-off-by: Lad, Prabhakar 
Acked-by: Laurent Pinchart 
---
 drivers/media/platform/davinci/vpif.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index f857d8f..77763f1 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -32,10 +32,10 @@
 MODULE_DESCRIPTION("TI DaVinci Video Port Interface driver");
 MODULE_LICENSE("GPL");
 
-#define VPIF_CH0_MAX_MODES (22)
-#define VPIF_CH1_MAX_MODES (02)
-#define VPIF_CH2_MAX_MODES (15)
-#define VPIF_CH3_MAX_MODES (02)
+#define VPIF_CH0_MAX_MODES 22
+#define VPIF_CH1_MAX_MODES 2
+#define VPIF_CH2_MAX_MODES 15
+#define VPIF_CH3_MAX_MODES 2
 
 spinlock_t vpif_lock;
 
-- 
1.7.0.4

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


[PATCH v3 4/9] media: davinci: vpif_capture: move the freeing of irq and global variables to remove()

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_capture.c |   31 ++--
 1 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index caaf4fe..f8b7304 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2225,17 +2225,29 @@ vpif_int_err:
  */
 static int vpif_remove(struct platform_device *device)
 {
-   int i;
+   struct platform_device *pdev;
struct channel_obj *ch;
+   struct resource *res;
+   int irq_num, i = 0;
+
+   pdev = container_of(vpif_dev, struct platform_device, dev);
+   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
+   for (irq_num = res->start; irq_num <= res->end; irq_num++)
+   free_irq(irq_num,
+(void *)(&vpif_obj.dev[i]->channel_id));
+   i++;
+   }
 
v4l2_device_unregister(&vpif_obj.v4l2_dev);
 
+   kfree(vpif_obj.sd);
/* un-register device */
for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
/* Get the pointer to the channel object */
ch = vpif_obj.dev[i];
/* Unregister video device */
video_unregister_device(ch->video_dev);
+   kfree(vpif_obj.dev[i]);
}
return 0;
 }
@@ -2347,24 +2359,7 @@ static __init int vpif_init(void)
  */
 static void vpif_cleanup(void)
 {
-   struct platform_device *pdev;
-   struct resource *res;
-   int irq_num;
-   int i = 0;
-
-   pdev = container_of(vpif_dev, struct platform_device, dev);
-   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
-   for (irq_num = res->start; irq_num <= res->end; irq_num++)
-   free_irq(irq_num,
-(void *)(&vpif_obj.dev[i]->channel_id));
-   i++;
-   }
-
platform_driver_unregister(&vpif_driver);
-
-   kfree(vpif_obj.sd);
-   for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++)
-   kfree(vpif_obj.dev[i]);
 }
 
 /* Function for module initialization and cleanup */
-- 
1.7.0.4

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


[PATCH v3 9/9] media: davinci: vpif_display: Convert to devm_* api

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

use devm_request_irq() instead of request_irq(). This ensures
more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_display.c |   35 ++--
 1 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index 7bcfe7d..e2f080b 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1718,15 +1718,14 @@ static __init int vpif_probe(struct platform_device 
*pdev)
 
while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) {
for (i = res->start; i <= res->end; i++) {
-   if (request_irq(i, vpif_channel_isr, IRQF_SHARED,
-   "VPIF_Display", (void *)
-   (&vpif_obj.dev[res_idx]->channel_id))) {
-   err = -EBUSY;
-   for (j = 0; j < i; j++)
-   free_irq(j, (void *)
-   (&vpif_obj.dev[res_idx]->channel_id));
+   err = devm_request_irq(&pdev->dev, i, vpif_channel_isr,
+IRQF_SHARED, "VPIF_Display",
+(void *)(&vpif_obj.dev[res_idx]->
+channel_id));
+   if (err) {
+   err = -EINVAL;
vpif_err("VPIF IRQ request failed\n");
-   goto vpif_int_err;
+   goto vpif_unregister;
}
}
res_idx++;
@@ -1744,7 +1743,7 @@ static __init int vpif_probe(struct platform_device *pdev)
video_device_release(ch->video_dev);
}
err = -ENOMEM;
-   goto vpif_int_err;
+   goto vpif_unregister;
}
 
/* Initialize field of video device */
@@ -1878,13 +1877,8 @@ vpif_sd_error:
/* Note: does nothing if ch->video_dev == NULL */
video_device_release(ch->video_dev);
}
-vpif_int_err:
+vpif_unregister:
v4l2_device_unregister(&vpif_obj.v4l2_dev);
-   for (i = 0; i < res_idx; i++) {
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
-   for (j = res->start; j <= res->end; j++)
-   free_irq(j, (void *)(&vpif_obj.dev[i]->channel_id));
-   }
 
return err;
 }
@@ -1894,20 +1888,9 @@ vpif_int_err:
  */
 static int vpif_remove(struct platform_device *device)
 {
-   struct platform_device *pdev;
struct channel_obj *ch;
-   struct resource *res;
-   int irq_num;
int i = 0;
 
-   pdev = container_of(vpif_dev, struct platform_device, dev);
-   while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, i))) {
-   for (irq_num = res->start; irq_num <= res->end; irq_num++)
-   free_irq(irq_num,
-(void *)(&vpif_obj.dev[i]->channel_id));
-   i++;
-   }
-
v4l2_device_unregister(&vpif_obj.v4l2_dev);
 
kfree(vpif_obj.sd);
-- 
1.7.0.4

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


[PATCH v3 8/9] media: davinci: vpif_display: use module_platform_driver()

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch uses module_platform_driver() to simplify the code.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_display.c |   18 +-
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index 9c308e7..7bcfe7d 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -2005,20 +2005,4 @@ static __refdata struct platform_driver vpif_driver = {
.remove = vpif_remove,
 };
 
-static __init int vpif_init(void)
-{
-   return platform_driver_register(&vpif_driver);
-}
-
-/*
- * vpif_cleanup: This function un-registers device and driver to the kernel,
- * frees requested irq handler and de-allocates memory allocated for channel
- * objects.
- */
-static void vpif_cleanup(void)
-{
-   platform_driver_unregister(&vpif_driver);
-}
-
-module_init(vpif_init);
-module_exit(vpif_cleanup);
+module_platform_driver(vpif_driver);
-- 
1.7.0.4

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


[PATCH v3 5/9] media: davinci: vpif_capture: use module_platform_driver()

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch uses module_platform_driver() to simplify the code.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpif_capture.c |   28 +
 1 files changed, 1 insertions(+), 27 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index f8b7304..38c1fba 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2338,30 +2338,4 @@ static __refdata struct platform_driver vpif_driver = {
.remove = vpif_remove,
 };
 
-/**
- * vpif_init: initialize the vpif driver
- *
- * This function registers device and driver to the kernel, requests irq
- * handler and allocates memory
- * for channel objects
- */
-static __init int vpif_init(void)
-{
-   return platform_driver_register(&vpif_driver);
-}
-
-/**
- * vpif_cleanup : This function clean up the vpif capture resources
- *
- * This will un-registers device and driver to the kernel, frees
- * requested irq handler and de-allocates memory allocated for channel
- * objects.
- */
-static void vpif_cleanup(void)
-{
-   platform_driver_unregister(&vpif_driver);
-}
-
-/* Function for module initialization and cleanup */
-module_init(vpif_init);
-module_exit(vpif_cleanup);
+module_platform_driver(vpif_driver);
-- 
1.7.0.4

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


[PATCH v3 2/9] media: davinci: vpif: Convert to devm_* api

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar 
Acked-by: Laurent Pinchart 
---
 drivers/media/platform/davinci/vpif.c |   27 ---
 1 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index 761c825..f857d8f 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -37,8 +37,6 @@ MODULE_LICENSE("GPL");
 #define VPIF_CH2_MAX_MODES (15)
 #define VPIF_CH3_MAX_MODES (02)
 
-static resource_size_t res_len;
-static struct resource *res;
 spinlock_t vpif_lock;
 
 void __iomem *vpif_base;
@@ -421,23 +419,12 @@ EXPORT_SYMBOL(vpif_channel_getfid);
 
 static int vpif_probe(struct platform_device *pdev)
 {
-   int status = 0;
+   static struct resource  *res;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENOENT;
-
-   res_len = resource_size(res);
-
-   res = request_mem_region(res->start, res_len, res->name);
-   if (!res)
-   return -EBUSY;
-
-   vpif_base = ioremap(res->start, res_len);
-   if (!vpif_base) {
-   status = -EBUSY;
-   goto fail;
-   }
+   vpif_base = devm_request_and_ioremap(&pdev->dev, res);
+   if (IS_ERR(vpif_base))
+   return PTR_ERR(vpif_base);
 
pm_runtime_enable(&pdev->dev);
pm_runtime_get(&pdev->dev);
@@ -445,17 +432,11 @@ static int vpif_probe(struct platform_device *pdev)
spin_lock_init(&vpif_lock);
dev_info(&pdev->dev, "vpif probe success\n");
return 0;
-
-fail:
-   release_mem_region(res->start, res_len);
-   return status;
 }
 
 static int vpif_remove(struct platform_device *pdev)
 {
pm_runtime_disable(&pdev->dev);
-   iounmap(vpif_base);
-   release_mem_region(res->start, res_len);
return 0;
 }
 
-- 
1.7.0.4

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


[PATCH v3 1/9] media: davinci: vpif: remove unwanted header mach/hardware.h and sort the includes alphabetically

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch removes unwanted header include of mach/hardware.h
and along side sorts the header inclusion alphabetically.

Signed-off-by: Lad, Prabhakar 
Acked-by: Laurent Pinchart 
---
 drivers/media/platform/davinci/vpif.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index ea82a8b..761c825 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -17,18 +17,16 @@
  * GNU General Public License for more details.
  */
 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
+#include 
 #include 
 
-#include 
-
 #include "vpif.h"
 
 MODULE_DESCRIPTION("TI DaVinci Video Port Interface driver");
-- 
1.7.0.4

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


[PATCH v3 0/9] media: davinci: vpif trivial cleanup

2013-05-26 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch series cleans the VPIF driver, uses devm_* api wherever
required and uses module_platform_driver() to simplify the code.

This patch series applies on http://git.linuxtv.org/hverkuil/media_tree.git/
shortlog/refs/heads/for-v3.11 and is tested on OMAP-L138.

Changes for v2:
1: Rebased on v3.11 branch of Hans.
2: Dropped the patches which removed headers as mentioned by Laurent.

Changes for v3:
1: Splitted the patches logically as mentioned by Laurent.
2: Fixed review comments pointed by Laurent.
3: Included Ack's.


Lad, Prabhakar (9):
  media: davinci: vpif: remove unwanted header mach/hardware.h and sort
the includes alphabetically
  media: davinci: vpif: Convert to devm_* api
  media: davinci: vpif: remove unnecessary braces around defines
  media: davinci: vpif_capture: move the freeing of irq and global
variables to remove()
  media: davinci: vpif_capture: use module_platform_driver()
  media: davinci: vpif_capture: Convert to devm_* api
  media: davinci: vpif_display: move the freeing of irq and global
variables to remove()
  media: davinci: vpif_display: use module_platform_driver()
  media: davinci: vpif_display: Convert to devm_* api

 drivers/media/platform/davinci/vpif.c |   45 ---
 drivers/media/platform/davinci/vpif_capture.c |   75 +
 drivers/media/platform/davinci/vpif_display.c |   63 
 3 files changed, 40 insertions(+), 143 deletions(-)

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


Re: InstantFM

2013-05-26 Thread Hans de Goede

Hi,

On 05/25/2013 07:18 PM, Patrice Levesque wrote:



This, as well as the "Invalid freq '12715'" and the "get_baseline:
min=65535.00 max=65535.00" messages seem to indicate that only
 is being read from all the registers of the tuner chip, so
somehow the communication between the usb micro-controller and the
si470x tuner chip is not working.


A disconnect-connect of the USB device reset its internal state and now
I can confirm the device properly works with the 3.9.3-gentoo kernel,
using the 3.103 version of xawtv.

Under the same kernel, the 3.95-r2 xawtv version shipped with gentoo
fails to detect signal: “radio -i -d” outputs no channel and shows
“get_baseline: min=0.00 max=0.00”.


Thanks for your good work on this, you know who you are,


Good to hear, your device has "software version 0, hardware version 7",
right? If you can confirm then I'll lower the version requirement in
the kernel too match (so that you'll no longer get the warning message).

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: saa7115/gm7113c - device specific initialization

2013-05-26 Thread Jon Arne Jørgensen
On Mon, May 20, 2013 at 12:42:58PM -0400, Andy Walls wrote:
> "Jon Arne Jørgensen"  wrote:
> 
> >On Mon, May 20, 2013 at 06:33:20AM -0400, Andy Walls wrote:
> >> "Jon Arne Jørgensen"  wrote:
> >> 
> >> >Hi,
> >> >I've recently discovered that the smi2021 device have some pretty
> >> >specific
> >> >needs for the setup of the gm7113c chip.
> >> >
> >> >Both the smi2021 driver and the stk1160 driver needs registers
> >> >0x14 -> 0x17 to be zeroed, this is what forced me to add the gm7113c
> >> >chip to the saa7115 driver in the first place.
> >> >
> >> >Then Timo reported that the Terratec Grabby hwrev2 needs some of the
> >> >initial register settings to be changed for the device to work.
> >> >He posted a small list of required changes.
> >> >One of these changes is a change to register 0x12 which sets
> >> >up what to output on the RTS0 pin on the chip.
> >> >
> >> >Then I discovered that the smi2021 needs the V-Flag in the SAV/EAV
> >> >to be generated by VREF - whatever that means :).
> >> >That is, I need bit 7 to be clear and bit 6 to be set in register
> >0x10.
> >> >To have the device behave correctly.
> >> >
> >> >Both the change for the smi2021 driver and the changes for the
> >Terratec
> >> >device are pretty hardware specific.
> >> >They should probably not be part of the generic gm7113c setup.
> >> >
> >> >I would also guess that if other devices with the gm7113c chip
> >should
> >> >surface, these devices might also have different needs for the setup
> >of
> >> >the chip.
> >> >
> >> >I'm not sure what would be the correct way to handle these
> >> >differences.
> >> >The only sollution I'we tried is to bypass the saa7115
> >> >driver, and push the needed changes directly over usb to the device,
> >> >after the initial setup is sent by the saa7115 driver.
> >> >This is a major hack, and the changes should probably go through
> >> >the saa7115 driver.
> >> >
> >> >Should the saa7115 driver be extended with an interface to change
> >> >random
> >> >register settings, or does the i2c subsystem already have a way to
> >> >handle this?
> >> >
> >> >Any idea about what might could be a better sollution?
> >> >
> >> >Best regards
> >> >Jon Arne Jørgensen
> >> >
> >> >--
> >> >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
> >> 
> >> For v4l2_subdev's there is a way to pass in platform/bridge device
> >specific data so initialization can be different than the default,
> >based on the needs of the bridge driver.
> >
> >Ok, can you give any pointers to any documentation/source files I can
> >look at for this?
> >
> >> 
> >> As for the meaning of the V (Vertical) flag in Start Active Video
> >(SAV) / End Active Video (EAV) markers, the VESA VIP 1.x standard
> >explains that.  Basically they are codes embedded in digitized video
> >rasters horizontal blanking interval that describe the current video
> >line and delimit their start and end.
> >> 
> >> The V flag probably means a line in the vertical blanking interval
> >(VBI), but I can't recall.
> >> 
> >
> >I'm sorry, I was a bit quick with that comment.
> >I know what the SAV/EAV and V-flag is. I just don't know what it means
> >that the V-flag is
> >generated by VREF.
> >
> >> Regards,
> >> Andy
> >> --
> >> 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
> 
> http://lxr.free-electrons.com/source/drivers/media/i2c/wm8775.c#L232
> 
> The bttv driver, IIRC, has the wm8775 driver initialize differently for the 
> Nova S card.  FWIW, the defaults for the wm8775 driver are generally those 
> needed by the ivtv driver.

Cool,
that looks like the sollution I'm looking for.

Thanks.

Best regards
Jon Arne

> 
> Regards,
> Andy
> --
> 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: saa7115/gm7113c - device specific initialization

2013-05-26 Thread Jon Arne Jørgensen
On Mon, May 20, 2013 at 06:00:29PM -0300, Mauro Carvalho Chehab wrote:
> Em Mon, 20 May 2013 18:20:44 +0200
> Jon Arne Jørgensen  escreveu:
> 
> > On Mon, May 20, 2013 at 06:33:20AM -0400, Andy Walls wrote:
> > > "Jon Arne Jørgensen"  wrote:
> > > 
> > > >Hi,
> > > >I've recently discovered that the smi2021 device have some pretty
> > > >specific
> > > >needs for the setup of the gm7113c chip.
> > > >
> > > >Both the smi2021 driver and the stk1160 driver needs registers
> > > >0x14 -> 0x17 to be zeroed, this is what forced me to add the gm7113c
> > > >chip to the saa7115 driver in the first place.
> > > >
> > > >Then Timo reported that the Terratec Grabby hwrev2 needs some of the
> > > >initial register settings to be changed for the device to work.
> > > >He posted a small list of required changes.
> > > >One of these changes is a change to register 0x12 which sets
> > > >up what to output on the RTS0 pin on the chip.
> > > >
> > > >Then I discovered that the smi2021 needs the V-Flag in the SAV/EAV
> > > >to be generated by VREF - whatever that means :).
> > > >That is, I need bit 7 to be clear and bit 6 to be set in register 0x10.
> > > >To have the device behave correctly.
> > > >
> > > >Both the change for the smi2021 driver and the changes for the Terratec
> > > >device are pretty hardware specific.
> > > >They should probably not be part of the generic gm7113c setup.
> > > >
> > > >I would also guess that if other devices with the gm7113c chip should
> > > >surface, these devices might also have different needs for the setup of
> > > >the chip.
> > > >
> > > >I'm not sure what would be the correct way to handle these
> > > >differences.
> > > >The only sollution I'we tried is to bypass the saa7115
> > > >driver, and push the needed changes directly over usb to the device,
> > > >after the initial setup is sent by the saa7115 driver.
> > > >This is a major hack, and the changes should probably go through
> > > >the saa7115 driver.
> > > >
> > > >Should the saa7115 driver be extended with an interface to change
> > > >random
> > > >register settings, or does the i2c subsystem already have a way to
> > > >handle this?
> > > >
> > > >Any idea about what might could be a better sollution?
> > > >
> > > >Best regards
> > > >Jon Arne Jørgensen
> > > >
> > > >--
> > > >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
> > > 
> > > For v4l2_subdev's there is a way to pass in platform/bridge device 
> > > specific data so initialization can be different than the default, based 
> > > on the needs of the bridge driver.
> > 
> > Ok, can you give any pointers to any documentation/source files I can
> > look at for this?
> 
> Look, for example, at drivers/media/i2c/mt9v011.c. At mt9v011_probe, it
> checks if c->dev.platform_data exists. If so, it changes the xtal frequency
> to the one specified by the driver.
> 

Thanks.
Exactly what I need.

Best regards,
Jon Arne

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


EM28xx - new device ID - Ion "Video Forever" USB capture dongle

2013-05-26 Thread Philip Pemberton
Hi folks,

This is my first post here (I think?) and I'm going to make it an
informative one :)


TL/DR:
  Can someone please add this to the device ID list for the em28xx module?
Ion "Video Forever" - USB ID EB1A:5124, Card Type 9.
  Confirmed as working with Xawtv and VLC, video source PAL composite
from a FLIR camera; S-video and audio untested as I have no suitable
source to hand.
  Test platform: Ubuntu 13.04 "Raring", kernel 3.8.0-21-generic
#32-Ubuntu SMP x86_64


The longer version:

I found this thing in a local Maplins under stock code A27KJ for the
princely sum of £29.99 on special offer. According to the box, it's a
"Video Forever VHS-to-Digital Video Converter" by ION (www.ionaudio.com).
Strangely they don't list it on their website, so perhaps it's a special
for Maplin?


lsusb says:

Bus 001 Device 084: ID eb1a:5124 eMPIA Technology, Inc.


The CD-ROM in the packet is apparently a driver set for an "ezcap"
device ("Ezcap Video Grabber"), the INF file suggests it's an EM2860
series chip. For a laugh, I did this:

sudo modprobe em28xx card=9
echo eb1a 5124 | sudo tee /sys/bus/usb/drivers/em28xx/new_id

Which has the effect of loading the EM28xx driver with cardtype forced
to 9 (which seems to be a generic EM2860-based device ID), then adding
the new device ID (temporarily) to the module.


Dmesg after doing this:

> [377328.118295] usb 1-1.4.3.5: new high-speed USB device number 94 using 
> ehci-pci
> [377328.217158] usb 1-1.4.3.5: New USB device found, idVendor=eb1a, 
> idProduct=5124
> [377328.217160] usb 1-1.4.3.5: New USB device strings: Mfr=0, Product=1, 
> SerialNumber=2
> [377328.217162] usb 1-1.4.3.5: Product: USB VIDBOX FW Audio
> [377328.217163] usb 1-1.4.3.5: SerialNumber: USB2.0 VIDBOX FW
> [377328.217448] em28xx: New device  USB VIDBOX FW Audio @ 480 Mbps 
> (eb1a:5124, interface 0, class 0)
> [377328.217450] em28xx: Video interface 0 found
> [377328.217451] em28xx: DVB interface 0 found
> [377328.217506] em28xx #0: chip ID is em2860
> [377328.344000] em28xx #0: i2c eeprom 00: 1a eb 67 95 1a eb 24 51 50 00 20 03 
> 8c 28 6a 22
> [377328.344007] em28xx #0: i2c eeprom 10: 00 00 24 57 06 02 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344012] em28xx #0: i2c eeprom 20: 02 00 01 00 f0 10 01 00 00 00 00 00 
> 5b 00 00 00
> [377328.344016] em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 01 01 00 00 
> 00 00 00 00
> [377328.344020] em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 
> 00 c4 00 00
> [377328.344025] em28xx #0: i2c eeprom 50: 00 a2 00 87 81 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344029] em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 22 03 
> 55 00 53 00
> [377328.344033] em28xx #0: i2c eeprom 70: 42 00 32 00 2e 00 30 00 20 00 56 00 
> 49 00 44 00
> [377328.344038] em28xx #0: i2c eeprom 80: 42 00 4f 00 58 00 20 00 46 00 57 00 
> 28 03 55 00
> [377328.344042] em28xx #0: i2c eeprom 90: 53 00 42 00 20 00 56 00 49 00 44 00 
> 42 00 4f 00
> [377328.344047] em28xx #0: i2c eeprom a0: 58 00 20 00 46 00 57 00 20 00 41 00 
> 75 00 64 00
> [377328.344051] em28xx #0: i2c eeprom b0: 69 00 6f 00 00 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344055] em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344060] em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344064] em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344068] em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 00 00 00 00 
> 00 00 00 00
> [377328.344074] em28xx #0: EEPROM ID= 0x9567eb1a, EEPROM hash = 0x806f2156
> [377328.344075] em28xx #0: EEPROM info:
> [377328.344076] em28xx #0:AC97 audio (5 sample rates)
> [377328.344076] em28xx #0:500mA max power
> [377328.344078] em28xx #0:Table at 0x24, strings=0x288c, 0x226a, 0x
> [377328.344080] em28xx #0: Identified as Pinnacle Dazzle DVC 90/100/101/107 / 
> Kaiser Baas Video to DVD maker / Kworld DVD Maker 2 / Plextor ConvertX 
> PX-AV100U (card=9)
> [377328.706041] saa7115 4-0025: saa7113 found (1f7113d0e10) @ 0x4a 
> (em28xx #0)
> [377329.472675] em28xx #0: Config register raw data: 0x50
> [377329.496532] em28xx #0: AC97 vendor ID = 0x83847652
> [377329.508515] em28xx #0: AC97 features = 0x6a90
> [377329.508517] em28xx #0: Sigmatel audio processor detected(stac 9752)
> [377329.967933] em28xx #0: v4l2 driver version 0.1.3
> [377330.990725] em28xx #0: V4L2 video device registered as video0
> [377330.990727] em28xx #0: V4L2 VBI device registered as vbi0


Fire up Xawtv or VLC, select the device, enjoy.

Thanks,
-- 
Phil.
phil...@philpem.me.uk
http://www.philpem.me.uk/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Fix spelling of Qt in .desktop file (typo)

2013-05-26 Thread Diego Viola
Proper spelling of Qt is Qt, not QT.  "QT" is often confused with
QuickTime, here is a minor patch to fix this issue in the .desktop file.

Signed-off-by: Diego Viola 
---
 utils/qv4l2/qv4l2.desktop | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/qv4l2/qv4l2.desktop b/utils/qv4l2/qv4l2.desktop
index 00f3e33..69413e1 100644
--- a/utils/qv4l2/qv4l2.desktop
+++ b/utils/qv4l2/qv4l2.desktop
@@ -1,5 +1,5 @@
 [Desktop Entry]
-Name=QT V4L2 test Utility
+Name=Qt V4L2 test Utility
 Name[pt]=Utilitário de teste V4L2
 Comment=Allow testing Video4Linux devices
 Comment[pt]=Permite testar dispositivos Video4Linux
-- 
1.8.2.3

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