[PATCH] V4L/DVB: tea6415c: return -EIO if i2c_check_functionality fails

2010-11-01 Thread Axel Lin
If the adapter does not support I2C_FUNC_SMBUS_WRITE_BYTE,
return -EIO instead of 0.

Signed-off-by: Axel Lin axel@gmail.com
---
 drivers/media/video/tea6415c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 3e99cea..19621ed 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -148,7 +148,7 @@ static int tea6415c_probe(struct i2c_client *client,
 
/* let's see whether this adapter can support what we need */
if (!i2c_check_functionality(client-adapter, 
I2C_FUNC_SMBUS_WRITE_BYTE))
-   return 0;
+   return -EIO;
 
v4l_info(client, chip found @ 0x%x (%s)\n,
client-addr  1, client-adapter-name);
-- 
1.7.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


[PATCH RESEND] [media] convert drivers/media/* to use module_platform_driver()

2012-01-09 Thread Axel Lin
This patch converts the drivers in drivers/media/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Mauro Carvalho Chehab mche...@infradead.org
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Hans Verkuil hans.verk...@cisco.com
Cc: Richard Röjfors richard.rojf...@pelagicore.com
Cc: Matti J. Aaltonen matti.j.aalto...@nokia.com
Cc: Lucas De Marchi lucas.demar...@profusion.mobi
Cc: Manjunath Hadli manjunath.ha...@ti.com
Cc: Muralidharan Karicheri m-kariche...@ti.com
Cc: Anatolij Gustschin ag...@denx.de
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
Cc: Marek Szyprowski m.szyprow...@samsung.com
Cc: Robert Jarzmik robert.jarz...@free.fr
Cc: Jonathan Corbet cor...@lwn.net
Cc: Daniel Drake d...@laptop.org
Signed-off-by: Axel Lin axel@gmail.com
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
Acked-by: Marek Szyprowski m.szyprow...@samsung.com
Acked-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 drivers/media/radio/radio-si4713.c |   15 +--
 drivers/media/radio/radio-timb.c   |   15 +--
 drivers/media/radio/radio-wl1273.c |   17 +---
 drivers/media/video/davinci/dm355_ccdc.c   |   13 +-
 drivers/media/video/davinci/dm644x_ccdc.c  |   13 +-
 drivers/media/video/davinci/isif.c |   13 +-
 drivers/media/video/davinci/vpbe.c |   24 +-
 drivers/media/video/davinci/vpbe_display.c |   38 +---
 drivers/media/video/davinci/vpbe_osd.c |   18 +
 drivers/media/video/davinci/vpbe_venc.c|   18 +
 drivers/media/video/davinci/vpfe_capture.c |   18 +
 drivers/media/video/fsl-viu.c  |   13 +-
 drivers/media/video/mx3_camera.c   |   14 +-
 drivers/media/video/omap1_camera.c |   12 +
 drivers/media/video/omap24xxcam.c  |   19 +-
 drivers/media/video/omap3isp/isp.c |   19 +-
 drivers/media/video/pxa_camera.c   |   14 +-
 drivers/media/video/s5p-g2d/g2d.c  |   16 +---
 drivers/media/video/s5p-mfc/s5p_mfc.c  |   22 +---
 drivers/media/video/s5p-tv/hdmi_drv.c  |   26 +--
 drivers/media/video/s5p-tv/sdo_drv.c   |   22 +---
 drivers/media/video/sh_mobile_csi2.c   |   13 +-
 drivers/media/video/soc_camera_platform.c  |   13 +-
 drivers/media/video/timblogiw.c|   15 +--
 drivers/media/video/via-camera.c   |   12 +
 25 files changed, 26 insertions(+), 406 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index d1fab58..c54210c 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -355,17 +355,4 @@ static struct platform_driver radio_si4713_pdriver = {
.remove = __exit_p(radio_si4713_pdriver_remove),
 };
 
-/* Module Interface */
-static int __init radio_si4713_module_init(void)
-{
-   return platform_driver_register(radio_si4713_pdriver);
-}
-
-static void __exit radio_si4713_module_exit(void)
-{
-   platform_driver_unregister(radio_si4713_pdriver);
-}
-
-module_init(radio_si4713_module_init);
-module_exit(radio_si4713_module_exit);
-
+module_platform_driver(radio_si4713_pdriver);
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index 3e9209f..5d9a90a 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -226,20 +226,7 @@ static struct platform_driver timbradio_platform_driver = {
.remove = timbradio_remove,
 };
 
-/*--*/
-
-static int __init timbradio_init(void)
-{
-   return platform_driver_register(timbradio_platform_driver);
-}
-
-static void __exit timbradio_exit(void)
-{
-   platform_driver_unregister(timbradio_platform_driver);
-}
-
-module_init(timbradio_init);
-module_exit(timbradio_exit);
+module_platform_driver(timbradio_platform_driver);
 
 MODULE_DESCRIPTION(Timberdale Radio driver);
 MODULE_AUTHOR(Mocean Laboratories i...@mocean-labs.com);
diff --git a/drivers/media/radio/radio-wl1273.c 
b/drivers/media/radio/radio-wl1273.c
index 8aa4968..f1b6070 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -2148,8 +2148,6 @@ pdata_err:
return r;
 }
 
-MODULE_ALIAS(platform:wl1273_fm_radio);
-
 static struct platform_driver wl1273_fm_radio_driver = {
.probe  = wl1273_fm_radio_probe,
.remove = __devexit_p(wl1273_fm_radio_remove),
@@ -2159,20 +2157,9 @@ static struct platform_driver wl1273_fm_radio_driver = {
},
 };
 
-static int __init wl1273_fm_module_init(void)
-{
-   pr_info(%s\n, __func__);
-   return

[PATCH] [media] convert drivers/media/* to use module_i2c_driver()

2012-01-21 Thread Axel Lin
This patch converts the drivers in drivers/media/* to use the
module_i2_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin axel@gmail.com
Cc: Mauro Carvalho Chehab mche...@infradead.org
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Heungjun Kim riverful@samsung.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Tomasz Stanislawski t.stanisl...@samsung.com
Cc: Hans Verkuil hans.verk...@cisco.com
Cc: Joonyoung Shim jy0922.s...@samsung.com
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
Cc: Andrew Chew ac...@nvidia.com
Cc: Paul Mundt let...@linux-sh.org
Cc: Michael Grzeschik m.grzesc...@pengutronix.de
Cc: Johannes Obermaier johannes.oberma...@gmail.com
Cc: Sylwester Nawrocki s.nawro...@samsung.com
Cc: Steven Toth st...@kernellabs.com
---
 drivers/media/dvb/frontends/au8522_decoder.c  |   13 +--
 drivers/media/radio/radio-tea5764.c   |   19 +
 drivers/media/radio/saa7706h.c|   13 +--
 drivers/media/radio/si470x/radio-si470x-i2c.c |   28 +
 drivers/media/radio/si4713-i2c.c  |   15 +
 drivers/media/radio/tef6862.c |   14 +---
 drivers/media/video/adp1653.c |   19 +
 drivers/media/video/adv7170.c |   13 +--
 drivers/media/video/adv7175.c |   13 +--
 drivers/media/video/adv7180.c |   14 +---
 drivers/media/video/adv7343.c |   13 +--
 drivers/media/video/ak881x.c  |   13 +--
 drivers/media/video/as3645a.c |   19 +
 drivers/media/video/bt819.c   |   13 +--
 drivers/media/video/bt856.c   |   13 +--
 drivers/media/video/bt866.c   |   13 +--
 drivers/media/video/cs5345.c  |   13 +--
 drivers/media/video/cs53l32a.c|   13 +--
 drivers/media/video/cx25840/cx25840-core.c|   13 +--
 drivers/media/video/imx074.c  |   13 +--
 drivers/media/video/indycam.c |   13 +--
 drivers/media/video/ir-kbd-i2c.c  |   17 ++
 drivers/media/video/ks0127.c  |   13 +--
 drivers/media/video/m52790.c  |   13 +--
 drivers/media/video/m5mols/m5mols_core.c  |   13 +--
 drivers/media/video/msp3400-driver.c  |   13 +--
 drivers/media/video/mt9m001.c |   13 +--
 drivers/media/video/mt9m111.c |   13 +--
 drivers/media/video/mt9p031.c |   13 +--
 drivers/media/video/mt9t001.c |   13 +--
 drivers/media/video/mt9t031.c |   13 +--
 drivers/media/video/mt9t112.c |   16 +-
 drivers/media/video/mt9v011.c |   13 +--
 drivers/media/video/mt9v022.c |   13 +--
 drivers/media/video/mt9v032.c |   13 +--
 drivers/media/video/noon010pc30.c |   13 +--
 drivers/media/video/ov2640.c  |   16 +-
 drivers/media/video/ov5642.c  |   13 +--
 drivers/media/video/ov6650.c  |   13 +--
 drivers/media/video/ov7670.c  |   13 +--
 drivers/media/video/ov772x.c  |   17 +--
 drivers/media/video/ov9640.c  |   13 +--
 drivers/media/video/ov9740.c  |   13 +--
 drivers/media/video/rj54n1cb0c.c  |   13 +--
 drivers/media/video/s5k6aa.c  |   13 +--
 drivers/media/video/s5p-tv/hdmiphy_drv.c  |   12 +-
 drivers/media/video/saa6588.c |   13 +--
 drivers/media/video/saa7110.c |   13 +--
 drivers/media/video/saa7115.c |   13 +--
 drivers/media/video/saa7127.c |   13 +--
 drivers/media/video/saa7134/saa6752hs.c   |   13 +--
 drivers/media/video/saa717x.c |   13 +--
 drivers/media/video/saa7185.c |   13 +--
 drivers/media/video/saa7191.c |   13 +--
 drivers/media/video/sr030pc30.c   |   13 +--
 drivers/media/video/tda7432.c |   13 +--
 drivers/media/video/tda9840.c |   13 +--
 drivers/media/video/tea6415c.c|   13 +--
 drivers/media/video/tea6420.c |   13 +--
 drivers/media/video/ths7303.c |   14 +---
 drivers/media/video/tlv320aic23b.c|   13 +--
 drivers/media/video/tuner-core.c  |   13 +--
 drivers/media

[PATCH RESEND] [media] convert drivers/media/* to use module_i2c_driver()

2012-02-12 Thread Axel Lin
This patch converts the drivers in drivers/media/* to use the
module_i2_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin axel@gmail.com
Cc: Mauro Carvalho Chehab mche...@infradead.org
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Heungjun Kim riverful@samsung.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Tomasz Stanislawski t.stanisl...@samsung.com
Cc: Hans Verkuil hans.verk...@cisco.com
Cc: Joonyoung Shim jy0922.s...@samsung.com
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
Cc: Andrew Chew ac...@nvidia.com
Cc: Paul Mundt let...@linux-sh.org
Cc: Michael Grzeschik m.grzesc...@pengutronix.de
Cc: Johannes Obermaier johannes.oberma...@gmail.com
Cc: Sylwester Nawrocki s.nawro...@samsung.com
Cc: Steven Toth st...@kernellabs.com
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Acked-by: Sylwester Nawrocki s.nawro...@samsung.com
Acked-by: Tomasz Stanislawski t.stanisl...@samsung.com
Acked-by: Hans Verkuil hans.verk...@cisco.com
Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
Acked-by: Mauro Carvalho Chehab mche...@redhat.com
Acked-by: Jonathan Corbet cor...@lwn.net
---
 drivers/media/dvb/frontends/au8522_decoder.c  |   13 +--
 drivers/media/radio/radio-tea5764.c   |   19 +
 drivers/media/radio/saa7706h.c|   13 +--
 drivers/media/radio/si470x/radio-si470x-i2c.c |   28 +
 drivers/media/radio/si4713-i2c.c  |   15 +
 drivers/media/radio/tef6862.c |   14 +---
 drivers/media/video/adp1653.c |   19 +
 drivers/media/video/adv7170.c |   13 +--
 drivers/media/video/adv7175.c |   13 +--
 drivers/media/video/adv7180.c |   14 +---
 drivers/media/video/adv7343.c |   13 +--
 drivers/media/video/ak881x.c  |   13 +--
 drivers/media/video/as3645a.c |   19 +
 drivers/media/video/bt819.c   |   13 +--
 drivers/media/video/bt856.c   |   13 +--
 drivers/media/video/bt866.c   |   13 +--
 drivers/media/video/cs5345.c  |   13 +--
 drivers/media/video/cs53l32a.c|   13 +--
 drivers/media/video/cx25840/cx25840-core.c|   13 +--
 drivers/media/video/imx074.c  |   13 +--
 drivers/media/video/indycam.c |   13 +--
 drivers/media/video/ir-kbd-i2c.c  |   17 ++
 drivers/media/video/ks0127.c  |   13 +--
 drivers/media/video/m52790.c  |   13 +--
 drivers/media/video/m5mols/m5mols_core.c  |   13 +--
 drivers/media/video/msp3400-driver.c  |   13 +--
 drivers/media/video/mt9m001.c |   13 +--
 drivers/media/video/mt9m111.c |   13 +--
 drivers/media/video/mt9p031.c |   13 +--
 drivers/media/video/mt9t001.c |   13 +--
 drivers/media/video/mt9t031.c |   13 +--
 drivers/media/video/mt9t112.c |   16 +-
 drivers/media/video/mt9v011.c |   13 +--
 drivers/media/video/mt9v022.c |   13 +--
 drivers/media/video/mt9v032.c |   13 +--
 drivers/media/video/noon010pc30.c |   13 +--
 drivers/media/video/ov2640.c  |   16 +-
 drivers/media/video/ov5642.c  |   13 +--
 drivers/media/video/ov6650.c  |   13 +--
 drivers/media/video/ov7670.c  |   13 +--
 drivers/media/video/ov772x.c  |   17 +--
 drivers/media/video/ov9640.c  |   13 +--
 drivers/media/video/ov9740.c  |   13 +--
 drivers/media/video/rj54n1cb0c.c  |   13 +--
 drivers/media/video/s5k6aa.c  |   13 +--
 drivers/media/video/s5p-tv/hdmiphy_drv.c  |   12 +-
 drivers/media/video/saa6588.c |   13 +--
 drivers/media/video/saa7110.c |   13 +--
 drivers/media/video/saa7115.c |   13 +--
 drivers/media/video/saa7127.c |   13 +--
 drivers/media/video/saa7134/saa6752hs.c   |   13 +--
 drivers/media/video/saa717x.c |   13 +--
 drivers/media/video/saa7185.c |   13 +--
 drivers/media/video/saa7191.c |   13 +--
 drivers/media/video/sr030pc30.c   |   13 +--
 drivers/media/video/tda7432.c |   13 +--
 drivers/media/video/tda9840.c |   13

[PATCH] [media] s5c73m3: Fix off-by-one valid range checking for fie-index

2013-04-29 Thread Axel Lin
Current code uses fie-index as array subscript, thus the valid value range
is 0 ... ARRAY_SIZE(s5c73m3_intervals) - 1.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c 
b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index b353c50..cd365bb 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -956,7 +956,7 @@ static int s5c73m3_oif_enum_frame_interval(struct 
v4l2_subdev *sd,
 
if (fie-pad != OIF_SOURCE_PAD)
return -EINVAL;
-   if (fie-index  ARRAY_SIZE(s5c73m3_intervals))
+   if (fie-index = ARRAY_SIZE(s5c73m3_intervals))
return -EINVAL;
 
mutex_lock(state-lock);
-- 
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


[PATCH] [media] exynos4-is: Fix off-by-one valid range checking for is-config_index

2013-04-30 Thread Axel Lin
Current code uses is-config_index as array subscript, thus the valid value
range is 0 ... ARRAY_SIZE(cmd) - 1.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/platform/exynos4-is/fimc-is-regs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c 
b/drivers/media/platform/exynos4-is/fimc-is-regs.c
index b0ff67b..d05eaa2 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-regs.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c
@@ -174,7 +174,7 @@ int fimc_is_hw_change_mode(struct fimc_is *is)
HIC_CAPTURE_STILL, HIC_CAPTURE_VIDEO,
};
 
-   if (WARN_ON(is-config_index  ARRAY_SIZE(cmd)))
+   if (WARN_ON(is-config_index = ARRAY_SIZE(cmd)))
return -EINVAL;
 
mcuctl_write(cmd[is-config_index], is, MCUCTL_REG_ISSR(0));
-- 
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


[PATCH] [media] media/radio/tef6862: fix checking return value of i2c_master_send

2011-11-16 Thread Axel Lin
i2c_master_send returns negative errno, or else the number of bytes written.

Signed-off-by: Axel Lin axel@gmail.com
---
 drivers/media/radio/tef6862.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index 0991e19..3408685 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -118,9 +118,11 @@ static int tef6862_s_frequency(struct v4l2_subdev *sd, 
struct v4l2_frequency *f)
i2cmsg[2] = pll  0xff;
 
err = i2c_master_send(client, i2cmsg, sizeof(i2cmsg));
-   if (!err)
-   state-freq = f-frequency;
-   return err;
+   if (err != sizeof(i2cmsg))
+   return err  0 ? err : -EIO;
+
+   state-freq = f-frequency;
+   return 0;
 }
 
 static int tef6862_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency 
*f)
-- 
1.7.5.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] [media] tda7432: Fix setting TDA7432_MUTE bit for TDA7432_RF register

2014-08-08 Thread Axel Lin
Fix a copy-paste bug when converting to the control framework.

Fixes: commit 5d478e0de871 ([media] tda7432: convert to the control framework)
Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/tda7432.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tda7432.c b/drivers/media/i2c/tda7432.c
index 72af644..cf93021 100644
--- a/drivers/media/i2c/tda7432.c
+++ b/drivers/media/i2c/tda7432.c
@@ -293,7 +293,7 @@ static int tda7432_s_ctrl(struct v4l2_ctrl *ctrl)
if (t-mute-val) {
lf |= TDA7432_MUTE;
lr |= TDA7432_MUTE;
-   lf |= TDA7432_MUTE;
+   rf |= TDA7432_MUTE;
rr |= TDA7432_MUTE;
}
/* Mute  update balance*/
-- 
1.9.1



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


[PATCH 1/4] [media] ov7670: Include media/v4l2-image-sizes.h

2014-08-08 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/ov7670.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index cdd7c1b..dd3db24 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -19,6 +19,7 @@
 #include media/v4l2-device.h
 #include media/v4l2-ctrls.h
 #include media/v4l2-mediabus.h
+#include media/v4l2-image-sizes.h
 #include media/ov7670.h
 
 MODULE_AUTHOR(Jonathan Corbet cor...@lwn.net);
@@ -30,19 +31,6 @@ module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, Debug level (0-1));
 
 /*
- * Basic window sizes.  These probably belong somewhere more globally
- * useful.
- */
-#define VGA_WIDTH  640
-#define VGA_HEIGHT 480
-#define QVGA_WIDTH 320
-#define QVGA_HEIGHT240
-#define CIF_WIDTH  352
-#define CIF_HEIGHT 288
-#define QCIF_WIDTH 176
-#defineQCIF_HEIGHT 144
-
-/*
  * The 7670 sits on i2c with ID 0x42
  */
 #define OV7670_I2C_ADDR 0x42
-- 
1.9.1



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


[PATCH 2/4] [media] vs6624: Include media/v4l2-image-sizes.h

2014-08-09 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/vs6624.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c
index 23f4f65..373f2df 100644
--- a/drivers/media/i2c/vs6624.c
+++ b/drivers/media/i2c/vs6624.c
@@ -30,22 +30,10 @@
 #include media/v4l2-ctrls.h
 #include media/v4l2-device.h
 #include media/v4l2-mediabus.h
+#include media/v4l2-image-sizes.h
 
 #include vs6624_regs.h
 
-#define VGA_WIDTH   640
-#define VGA_HEIGHT  480
-#define QVGA_WIDTH  320
-#define QVGA_HEIGHT 240
-#define QQVGA_WIDTH 160
-#define QQVGA_HEIGHT120
-#define CIF_WIDTH   352
-#define CIF_HEIGHT  288
-#define QCIF_WIDTH  176
-#define QCIF_HEIGHT 144
-#define QQCIF_WIDTH 88
-#define QQCIF_HEIGHT72
-
 #define MAX_FRAME_RATE  30
 
 struct vs6624 {
-- 
1.9.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 3/4] [media] soc_camera: mt9t112: Include media/v4l2-image-sizes.h

2014-08-09 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/soc_camera/mt9t112.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/mt9t112.c 
b/drivers/media/i2c/soc_camera/mt9t112.c
index 46f431a..996d7b4 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -29,6 +29,7 @@
 #include media/soc_camera.h
 #include media/v4l2-clk.h
 #include media/v4l2-common.h
+#include media/v4l2-image-sizes.h
 
 /* you can check PLL/clock info */
 /* #define EXT_CLOCK 2400 */
@@ -42,9 +43,6 @@
 #define MAX_WIDTH   2048
 #define MAX_HEIGHT  1536
 
-#define VGA_WIDTH   640
-#define VGA_HEIGHT  480
-
 /*
  * macro of read/write
  */
-- 
1.9.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 4/4] [media] soc_camera: ov772x: Include media/v4l2-image-sizes.h

2014-08-09 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/soc_camera/ov772x.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/ov772x.c 
b/drivers/media/i2c/soc_camera/ov772x.c
index 7f2b3c8..970a04e 100644
--- a/drivers/media/i2c/soc_camera/ov772x.c
+++ b/drivers/media/i2c/soc_camera/ov772x.c
@@ -29,6 +29,7 @@
 #include media/v4l2-clk.h
 #include media/v4l2-ctrls.h
 #include media/v4l2-subdev.h
+#include media/v4l2-image-sizes.h
 
 /*
  * register offset
@@ -360,10 +361,6 @@
 #define SCAL0_ACTRL 0x08 /* Auto scaling factor control */
 #define SCAL1_2_ACTRL   0x04 /* Auto scaling factor control */
 
-#define VGA_WIDTH  640
-#define VGA_HEIGHT 480
-#define QVGA_WIDTH 320
-#define QVGA_HEIGHT240
 #define OV772X_MAX_WIDTH   VGA_WIDTH
 #define OV772X_MAX_HEIGHT  VGA_HEIGHT
 
-- 
1.9.1



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


[PATCH 1/2] [media] sh_veu: Include media/v4l2-image-sizes.h

2014-08-09 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/platform/sh_veu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 8dc279d..be3b3bc 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -26,6 +26,7 @@
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-mem2mem.h
+#include media/v4l2-image-sizes.h
 #include media/videobuf2-dma-contig.h
 
 #define VEU_STR 0x00 /* start register */
@@ -135,9 +136,6 @@ enum sh_veu_fmt_idx {
SH_VEU_FMT_RGB24,
 };
 
-#define VGA_WIDTH  640
-#define VGA_HEIGHT 480
-
 #define DEFAULT_IN_WIDTH   VGA_WIDTH
 #define DEFAULT_IN_HEIGHT  VGA_HEIGHT
 #define DEFAULT_IN_FMTIDX  SH_VEU_FMT_NV12
-- 
1.9.1



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


[PATCH 2/2] [media] via-camera: Include media/v4l2-image-sizes.h

2014-08-09 Thread Axel Lin
So we can remove the same defines in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/platform/via-camera.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/media/platform/via-camera.c 
b/drivers/media/platform/via-camera.c
index b4f9d03..2ac8704 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -18,6 +18,7 @@
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-ctrls.h
+#include media/v4l2-image-sizes.h
 #include media/ov7670.h
 #include media/videobuf-dma-sg.h
 #include linux/delay.h
@@ -49,14 +50,6 @@ MODULE_PARM_DESC(override_serial,
to force-enable the camera.);
 
 /*
- * Basic window sizes.
- */
-#define VGA_WIDTH  640
-#define VGA_HEIGHT 480
-#define QCIF_WIDTH 176
-#defineQCIF_HEIGHT 144
-
-/*
  * The structure describing our camera.
  */
 enum viacam_opstate { S_IDLE = 0, S_RUNNING = 1 };
-- 
1.9.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] [media] saa6752hs: Convert to devm_kzalloc()

2014-08-10 Thread Axel Lin
Using the managed function the kfree() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/saa6752hs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/saa6752hs.c b/drivers/media/i2c/saa6752hs.c
index 04e9e55..4024ea6 100644
--- a/drivers/media/i2c/saa6752hs.c
+++ b/drivers/media/i2c/saa6752hs.c
@@ -660,7 +660,7 @@ static const struct v4l2_subdev_ops saa6752hs_ops = {
 static int saa6752hs_probe(struct i2c_client *client,
const struct i2c_device_id *id)
 {
-   struct saa6752hs_state *h = kzalloc(sizeof(*h), GFP_KERNEL);
+   struct saa6752hs_state *h;
struct v4l2_subdev *sd;
struct v4l2_ctrl_handler *hdl;
u8 addr = 0x13;
@@ -668,6 +668,8 @@ static int saa6752hs_probe(struct i2c_client *client,
 
v4l_info(client, chip found @ 0x%x (%s)\n,
client-addr  1, client-adapter-name);
+
+   h = devm_kzalloc(client-dev, sizeof(*h), GFP_KERNEL);
if (h == NULL)
return -ENOMEM;
sd = h-sd;
@@ -752,7 +754,6 @@ static int saa6752hs_probe(struct i2c_client *client,
int err = hdl-error;
 
v4l2_ctrl_handler_free(hdl);
-   kfree(h);
return err;
}
v4l2_ctrl_cluster(3, h-video_bitrate_mode);
@@ -767,7 +768,6 @@ static int saa6752hs_remove(struct i2c_client *client)
 
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(to_state(sd)-hdl);
-   kfree(to_state(sd));
return 0;
 }
 
-- 
1.9.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] [media] mt9v032: Remove duplicate test for I2C_FUNC_SMBUS_WORD_DATA functionality

2014-08-10 Thread Axel Lin
Since commit b42261078a91 (regmap: i2c: fallback to SMBus if the adapter
does not support standard I2C), regmap-i2c will check the
I2C_FUNC_SMBUS_[BYTE|WORD]_DATA functionality based on the regmap_config
setting if the adapter does not support standard I2C.

So remove the I2C_FUNC_SMBUS_WORD_DATA functionality check in the driver code.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/mt9v032.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index d044bce..f9e4bf7 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -879,13 +879,6 @@ static int mt9v032_probe(struct i2c_client *client,
unsigned int i;
int ret;
 
-   if (!i2c_check_functionality(client-adapter,
-I2C_FUNC_SMBUS_WORD_DATA)) {
-   dev_warn(client-adapter-dev,
-I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n);
-   return -EIO;
-   }
-
mt9v032 = devm_kzalloc(client-dev, sizeof(*mt9v032), GFP_KERNEL);
if (!mt9v032)
return -ENOMEM;
-- 
1.9.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] [media] tvp7002: Don't update device-streaming if write to register fails

2014-08-16 Thread Axel Lin
This ensures device-streaming has correct status.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/media/i2c/tvp7002.c | 21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 11f2387..51bac76 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -775,25 +775,20 @@ static int tvp7002_enum_mbus_fmt(struct v4l2_subdev *sd, 
unsigned index,
 static int tvp7002_s_stream(struct v4l2_subdev *sd, int enable)
 {
struct tvp7002 *device = to_tvp7002(sd);
-   int error = 0;
+   int error;
 
if (device-streaming == enable)
return 0;
 
-   if (enable) {
-   /* Set output state on (low impedance means stream on) */
-   error = tvp7002_write(sd, TVP7002_MISC_CTL_2, 0x00);
-   device-streaming = enable;
-   } else {
-   /* Set output state off (high impedance means stream off) */
-   error = tvp7002_write(sd, TVP7002_MISC_CTL_2, 0x03);
-   if (error)
-   v4l2_dbg(1, debug, sd, Unable to stop streaming\n);
-
-   device-streaming = enable;
+   /* low impedance: on, high impedance: off */
+   error = tvp7002_write(sd, TVP7002_MISC_CTL_2, enable ? 0x00 : 0x03);
+   if (error) {
+   v4l2_dbg(1, debug, sd, Fail to set streaming\n);
+   return error;
}
 
-   return error;
+   device-streaming = enable;
+   return 0;
 }
 
 /*
-- 
1.9.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