Re: [PATCH v4 2/5] media: ov2640: add async probe function

2015-01-01 Thread Laurent Pinchart
Hi Josh,

On Tuesday 30 December 2014 18:02:23 Josh Wu wrote:
 On 12/30/2014 8:15 AM, Laurent Pinchart wrote:
  On Monday 29 December 2014 16:28:02 Josh Wu wrote:
  On 12/26/2014 6:06 PM, Laurent Pinchart wrote:
  On Friday 26 December 2014 10:14:26 Guennadi Liakhovetski wrote:
  On Fri, 26 Dec 2014, Laurent Pinchart wrote:

[snip]

  Talking about mclk and xvclk is quite confusing. There's no mclk from
  an ov2640 point of view. The ov2640 driver should call
  v4l2_clk_get(xvclk).
  
  Yes, I also was thinking about this, and yes, requesting a xvclk
  clock would be more logical. But then, as you write below, if we let
  the v4l2_clk wrapper first check for a CCF xvclk clock, say, none is
  found. How do we then find the exported mclk V4L2 clock? Maybe
  v4l2_clk_get() should use two names?..
  
  Given that v4l2_clk_get() is only used by soc-camera drivers and that
  they all call it with the clock name set to mclk, I wonder whether we
  couldn't just get rid of struct v4l2_clk.id and ignore the id argument
  to v4l2_clk_get() when CCF isn't available. Maybe we've overdesigned
  v4l2_clk :-)
  
  Sorry, I'm not clear about how to implement what you discussed here.
  
  Do you mean, In the ov2640 driver:
  1. need to remove the patch 4/5, add a master clock for sensor
  
  No, the sensor has a clock input named xvclk, the ov2640 driver should
  thus manage that clock. Patch 4/5 does the right thing.
  
  However, I've just realized that it will cause regressions on the i.MX27,
  i.MX31 and i.MX37 3DS development boards that use the sensor without
  registering a clock named xvclk. You should fix that as part of the patch
  series.
 
 Thanks for the information.
 So I think to be compatible with i.MX series board, I have two ways:
   1. Make the xvclk clock be optional in ov2640 driver. After the i.MX
 series board switch to CCF, and we can change it to mandatory.
   2. switch the i.MX host driver to DT, and add the xvclk to their dts.
 
 As I am not similar with i.MX board and cannot test for them. I prefer
 to the #1, which is simple and work well. We can change the property
 when CCF  DT is introduced to i.MX boards.

I'd be fine with this if DT bindings were not required to be stable. The 
driver can always be fixed later, but biding should be correct from the start. 
As the ov2640 chip requires a clock, the bindings must require the clock, and 
the driver must enforce the requirement, at least when the device is 
instantiated from DT.

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v4 2/5] media: ov2640: add async probe function

2015-01-01 Thread Laurent Pinchart
Hi Guennadi,

On Tuesday 30 December 2014 13:12:27 Guennadi Liakhovetski wrote:
 On Tue, 30 Dec 2014, Josh Wu wrote:
 
 [snip]
 
   And until omap1 is in the mainline we cannot drop v4l2_clk.
 
 s/until/as lonh as/
 
  So I think the better way right now for ov2640 driver is still request
  both the v4l2_clock: mclk, and the clock: xvclk in probe().
  In that way,  we can take our time to introduce other patches to merged
  these two clocks. Does it make sense?
 
 How about this sequence, that we cat still try to get in on time for the
 next merge window:
 
 1. stop using the clock name in v4l2_clk
 2. add support for CCF to v4l2_clk, falling back to current behaviour if
 no clock is found
 3. switch ov2640 to using xvclk

It looks good at first sight.

 Otherwise I would propose to add asynchronous probing support to ov2640
 _without_ changing the clock name. Whether or not we changee clock's name
 isn't related directly to async support, since the driver already is using
 v4l2_clk with the standarf wrong name. So, I would consider these two
 changes separately - one is a new feature, another is a fix. The only
 question is in which order to apply them. In general fix-first is
 preferred, but since in this case the fix requires framework changes, we
 could go with feature-first. This also makes sense since features need to
 catch a merge window, whereas a fix can go in later too. So, if we don't
 manage the above 3-step plan, I would priposw the most primitive patch ro
 ov2640 just adding async support in line wuth other drivers and without
 changing the clock name at first.

Async support can go in without the clock rename, but DT support can't.

-- 
Regards,

Laurent Pinchart

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


[REVIEW PATCH 1/1] smiapp: Use of_property_read_u64_array() to read a 64-bit number array

2015-01-01 Thread Sakari Ailus
of_property_read_u64_array() wasn't yet part of the kernel tree when the
functionality was needed. Do use it now.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
 drivers/media/i2c/smiapp/smiapp-core.c |   24 +---
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index b3c8125..b1f566b 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2977,10 +2977,7 @@ static struct smiapp_platform_data 
*smiapp_get_pdata(struct device *dev)
struct smiapp_platform_data *pdata;
struct v4l2_of_endpoint bus_cfg;
struct device_node *ep;
-   struct property *prop;
-   __be32 *val;
uint32_t asize;
-   unsigned int i;
int rval;
 
if (!dev-of_node)
@@ -3042,23 +3039,12 @@ static struct smiapp_platform_data 
*smiapp_get_pdata(struct device *dev)
}
 
asize /= sizeof(*pdata-op_sys_clock);
-   /*
-* Read a 64-bit array --- this will be replaced with a
-* of_property_read_u64_array() once it's merged.
-*/
-   prop = of_find_property(dev-of_node, link-frequencies, NULL);
-   if (!prop)
-   goto out_err;
-   if (!prop-value)
-   goto out_err;
-   if (asize * sizeof(*pdata-op_sys_clock)  prop-length)
-   goto out_err;
-   val = prop-value;
-   if (IS_ERR(val))
+   rval = of_property_read_u64_array(
+   dev-of_node, link-frequencies, pdata-op_sys_clock, asize);
+   if (rval) {
+   dev_warn(dev, can't get link-frequencies\n);
goto out_err;
-
-   for (i = 0; i  asize; i++)
-   pdata-op_sys_clock[i] = of_read_number(val + i * 2, 2);
+   }
 
for (; asize  0; asize--)
dev_dbg(dev, freq %d: %lld\n, asize - 1,
-- 
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


[PATCH] media: i2c: adv7604.c: Remove some unused functions

2015-01-01 Thread Rickard Strandqvist
Removes some functions that are not used anywhere:
vblanking() hblanking()

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
 drivers/media/i2c/adv7604.c |   10 --
 drivers/media/i2c/adv7842.c |   10 --
 drivers/media/i2c/ths8200.c |   10 --
 3 files changed, 30 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 47795ff..0ecca94 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -333,21 +333,11 @@ static inline struct adv7604_state *to_state(struct 
v4l2_subdev *sd)
return container_of(sd, struct adv7604_state, sd);
 }
 
-static inline unsigned hblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_WIDTH(t);
-}
-
 static inline unsigned htotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_WIDTH(t);
 }
 
-static inline unsigned vblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_HEIGHT(t);
-}
-
 static inline unsigned vtotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_HEIGHT(t);
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 48b628b..d89898c 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -220,21 +220,11 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl 
*ctrl)
return container_of(ctrl-handler, struct adv7842_state, hdl)-sd;
 }
 
-static inline unsigned hblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_WIDTH(t);
-}
-
 static inline unsigned htotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_WIDTH(t);
 }
 
-static inline unsigned vblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_HEIGHT(t);
-}
-
 static inline unsigned vtotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_HEIGHT(t);
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 656d889..4ebd329 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -58,21 +58,11 @@ static inline struct ths8200_state *to_state(struct 
v4l2_subdev *sd)
return container_of(sd, struct ths8200_state, sd);
 }
 
-static inline unsigned hblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_WIDTH(t);
-}
-
 static inline unsigned htotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_WIDTH(t);
 }
 
-static inline unsigned vblanking(const struct v4l2_bt_timings *t)
-{
-   return V4L2_DV_BT_BLANKING_HEIGHT(t);
-}
-
 static inline unsigned vtotal(const struct v4l2_bt_timings *t)
 {
return V4L2_DV_BT_FRAME_HEIGHT(t);
-- 
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


Re: How to access DVB-onboard RC? (Technisat)

2015-01-01 Thread Jannis
Am 30.12.2014 um 13:59 schrieb JPT:
 I currently try to make my Technisat IR-RC work.
 But nothing happens when I press a key.
 What's wrong?

It depends on what you expect to happen when you press a key on the
remote control. The kernel's and driver's job is primarily to deliver
the events to the userspace where they can be handled by a tool or a daemon.

 triggerhappy config:

Never heared of a software with such a name.

 Registered IR keymap rc-technisat-usb2
 input: IR-receiver inside an USB DVB receiver as
 /devices/soc/soc:pcie-controller/pci:00/:00:01.0/:01:00.0/usb1/1-1/rc/rc0/input1
 evbug: Connected device: input1 (IR-receiver inside an USB DVB receiver
 at usb-:01:00.0-1/ir0)
 rc0: IR-receiver inside an USB DVB receiver as
 /devices/soc/soc:pcie-controller/pci:00/:00:01.0/:01:00.0/usb1/1-1/rc/rc0

As you can see, the input event devices are created and you should find
the device nodes somewhere at /dev/input/... You can try to use cat on
them and see if something happens when you press a button on the remote
control.

 do I need lirc?

Again, depends on what you want to happen on a key-press.

Jannis

--
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: pci: mantis: mantis_core.c: Remove unused function

2015-01-01 Thread Rickard Strandqvist
Remove the function write_eeprom_byte() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
 drivers/media/pci/mantis/mantis_core.c |   23 ---
 1 file changed, 23 deletions(-)

diff --git a/drivers/media/pci/mantis/mantis_core.c 
b/drivers/media/pci/mantis/mantis_core.c
index 684d906..82220ea 100644
--- a/drivers/media/pci/mantis/mantis_core.c
+++ b/drivers/media/pci/mantis/mantis_core.c
@@ -56,29 +56,6 @@ static int read_eeprom_byte(struct mantis_pci *mantis, u8 
*data, u8 length)
return 0;
 }
 
-static int write_eeprom_byte(struct mantis_pci *mantis, u8 *data, u8 length)
-{
-   int err;
-
-   struct i2c_msg msg = {
-   .addr = 0x50,
-   .flags = 0,
-   .buf = data,
-   .len = length
-   };
-
-   err = i2c_transfer(mantis-adapter, msg, 1);
-   if (err  0) {
-   dprintk(verbose, MANTIS_ERROR, 1,
-   ERROR: i2c write:  err=%i length=0x%02x d0=0x%02x, 
d1=0x%02x ,
-   err, length, data[0], data[1]);
-
-   return err;
-   }
-
-   return 0;
-}
-
 static int get_mac_address(struct mantis_pci *mantis)
 {
int err;
-- 
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


[REVIEW PATCH 1/1] omap3isp: Correctly set QUERYCAP capabilities

2015-01-01 Thread Sakari Ailus
device_caps in struct v4l2_capability were inadequately set in
VIDIOC_QUERYCAP. Fix this.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
 drivers/media/platform/omap3isp/ispvideo.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispvideo.c 
b/drivers/media/platform/omap3isp/ispvideo.c
index cdfec27..d644164 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -602,10 +602,13 @@ isp_video_querycap(struct file *file, void *fh, struct 
v4l2_capability *cap)
strlcpy(cap-card, video-video.name, sizeof(cap-card));
strlcpy(cap-bus_info, media, sizeof(cap-bus_info));
 
+   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
+   | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
+
if (video-type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
else
-   cap-capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
 
return 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


[PATCH] media: platform: vsp1: vsp1_hsit: Remove unused function

2015-01-01 Thread Rickard Strandqvist
Remove the function vsp1_hsit_read() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
 drivers/media/platform/vsp1/vsp1_hsit.c |5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_hsit.c 
b/drivers/media/platform/vsp1/vsp1_hsit.c
index db2950a..9fb003b 100644
--- a/drivers/media/platform/vsp1/vsp1_hsit.c
+++ b/drivers/media/platform/vsp1/vsp1_hsit.c
@@ -26,11 +26,6 @@
  * Device Access
  */
 
-static inline u32 vsp1_hsit_read(struct vsp1_hsit *hsit, u32 reg)
-{
-   return vsp1_read(hsit-entity.vsp1, reg);
-}
-
 static inline void vsp1_hsit_write(struct vsp1_hsit *hsit, u32 reg, u32 data)
 {
vsp1_write(hsit-entity.vsp1, reg, data);
-- 
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


[PATCH] media: pci: saa7134: saa7134-video.c: Remove unused function

2015-01-01 Thread Rickard Strandqvist
Remove the function saa7134_queue() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
 drivers/media/pci/saa7134/saa7134-video.c |5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/media/pci/saa7134/saa7134-video.c 
b/drivers/media/pci/saa7134/saa7134-video.c
index fc4a427..cf40573 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1098,11 +1098,6 @@ static int saa7134_s_ctrl(struct v4l2_ctrl *ctrl)
 
 /* -- */
 
-static inline struct vb2_queue *saa7134_queue(struct file *file)
-{
-   return video_devdata(file)-queue;
-}
-
 static int video_open(struct file *file)
 {
struct video_device *vdev = video_devdata(file);
-- 
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


[PATCH 1/5] mb86a20s: remove unused debug modprobe parameter

2015-01-01 Thread Mauro Carvalho Chehab
The debug parameter is not used anymore, as this module was
converted already to use dev_dbg().

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
b/drivers/media/dvb-frontends/mb86a20s.c
index e6f165a5b90d..8f54c39ca63f 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -22,10 +22,6 @@
 
 #define NUM_LAYERS 3
 
-static int debug = 1;
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, Activates frontend debugging (default:0));
-
 enum mb86a20s_bandwidth {
MB86A20S_13SEG = 0,
MB86A20S_13SEG_PARTIAL = 1,
-- 
2.1.0

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


[PATCH 5/5] cx231xx: add media controller support for mb86a20s boards

2015-01-01 Thread Mauro Carvalho Chehab
Add experimental support for the media controlers, on boards
that have mb86a20s (and use the new dvb core I2C binding).

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index e6b6da44b1e5..d772d386849f 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -65,6 +65,10 @@ struct cx231xx_dvb {
struct dmx_frontend fe_mem;
struct dvb_net net;
struct i2c_client *i2c_client_tuner;
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   struct media_device *media_dev;
+#endif
 };
 
 static struct s5h1432_config dvico_s5h1432_config = {
@@ -562,6 +566,7 @@ fail_adapter:
 static void unregister_dvb(struct cx231xx_dvb *dvb)
 {
struct i2c_client *client;
+
dvb_net_release(dvb-net);
dvb-demux.dmx.remove_frontend(dvb-demux.dmx, dvb-fe_mem);
dvb-demux.dmx.remove_frontend(dvb-demux.dmx, dvb-fe_hw);
@@ -573,6 +578,13 @@ static void unregister_dvb(struct cx231xx_dvb *dvb)
module_put(client-dev.driver-owner);
i2c_unregister_device(client);
}
+#ifdef CONFIG_MEDIA_CONTROLLER
+   if (dvb-media_dev) {
+   media_device_unregister(dvb-media_dev);
+   kfree(dvb-media_dev);
+   dvb-media_dev = NULL;
+   }
+#endif
dvb_unregister_frontend(dvb-frontend);
dvb_frontend_detach(dvb-frontend);
dvb_unregister_adapter(dvb-adapter);
@@ -813,16 +825,45 @@ static int dvb_init(struct cx231xx *dev)
}
 
case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID:
-   case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID:
+   case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID: {
+#ifdef CONFIG_MEDIA_CONTROLLER
+   struct media_device *mdev;
+#endif
 
dev_info(dev-dev,
 %s: looking for demod on i2c bus: %d\n,
 __func__, i2c_adapter_id(tuner_i2c));
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+   mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+   if (mdev) {
+   mdev-dev = dev-dev;
+   strlcpy(mdev-model, dev-board.name,
+   sizeof(mdev-model));
+   if (dev-udev-serial)
+   strlcpy(mdev-serial, dev-udev-serial,
+   sizeof(mdev-serial));
+   strcpy(mdev-bus_info, dev-udev-devpath);
+   mdev-hw_revision = 
le16_to_cpu(dev-udev-descriptor.bcdDevice);
+   mdev-driver_version = LINUX_VERSION_CODE;
+
+   result = media_device_register(mdev);
+   if (result) {
+   dev_err(dev-dev,
+   Couln't create a media device. Error: 
%d\n,
+   result);
+   kfree(mdev);
+   mdev = NULL;
+   } else {
+   dvb-media_dev = mdev;
+   }
+   }
+#endif
+
dev-dvb-frontend = dvb_i2c_attach_fe(demod_i2c,
   mb86a20s_board_info,
   pv_mb86a20s_config,
-  NULL, NULL);
+  NULL, mdev);
if (dev-dvb-frontend == NULL) {
dev_err(dev-dev,
Failed to attach mb86a20s demod\n);
@@ -837,7 +878,7 @@ static int dvb_init(struct cx231xx *dev)
   0x60, tuner_i2c,
   pv_tda18271_config);
break;
-
+   }
default:
dev_err(dev-dev,
%s/2: The frontend of your DVB/ATSC card isn't 
supported yet\n,
@@ -866,6 +907,13 @@ ret:
return result;
 
 out_free:
+#ifdef CONFIG_MEDIA_CONTROLLER
+   if (dvb-media_dev) {
+   media_device_unregister(dvb-media_dev);
+   kfree(dvb-media_dev);
+   dvb-media_dev = NULL;
+   }
+#endif
kfree(dvb);
dev-dvb = NULL;
goto ret;
-- 
2.1.0

--
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/5] dvb core: add media controller support for the demod

2015-01-01 Thread Mauro Carvalho Chehab
Now that we have an I2C function to attach DVB sub-devices, add
support for media controller on it.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/dvb-core/dvb_frontend.h 
b/drivers/media/dvb-core/dvb_frontend.h
index 41aae1bf0103..65d002f19cc3 100644
--- a/drivers/media/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb-core/dvb_frontend.h
@@ -40,6 +40,8 @@
 
 #include linux/dvb/frontend.h
 
+#include media/media-device.h
+
 #include dvbdev.h
 
 /*
@@ -416,6 +418,11 @@ struct dvb_frontend {
struct dvb_frontend_ops ops;
struct dvb_adapter *dvb;
struct i2c_client *fe_cl;
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   struct media_device *mdev;
+   struct media_entity demod_entity;
+#endif
+
void *demodulator_priv;
void *tuner_priv;
void *frontend_priv;
diff --git a/drivers/media/dvb-core/dvb_i2c.c b/drivers/media/dvb-core/dvb_i2c.c
index 4ea4e5e59f14..df8b7718ca8a 100644
--- a/drivers/media/dvb-core/dvb_i2c.c
+++ b/drivers/media/dvb-core/dvb_i2c.c
@@ -39,11 +39,12 @@ dvb_i2c_new_device(struct i2c_adapter *adap, struct 
i2c_board_info *info,
 
 struct dvb_frontend *
 dvb_i2c_attach_fe(struct i2c_adapter *adap, const struct i2c_board_info *info,
- const void *cfg, void **out)
+ const void *cfg, void **out, struct media_device *mdev)
 {
struct i2c_client *cl;
struct i2c_board_info bi;
struct dvb_i2c_dev_config dcfg;
+   struct dvb_frontend *fe;
 
dcfg.priv_cfg = cfg;
dcfg.out = out;
@@ -53,7 +54,28 @@ dvb_i2c_attach_fe(struct i2c_adapter *adap, const struct 
i2c_board_info *info,
cl = dvb_i2c_new_device(adap, bi, NULL);
if (!cl)
return NULL;
-   return i2c_get_clientdata(cl);
+   fe = i2c_get_clientdata(cl);
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   /* Register the media controller entity. */
+   if (mdev) {
+   int ret;
+
+   if (!fe-mdev)
+   fe-mdev = mdev;
+
+   fe-demod_entity.type = MEDIA_ENT_T_DEVNODE_DVB;
+   fe-demod_entity.name = info-type;
+   fe-demod_entity.info.dvb = fe-id;
+   fe-demod_entity.flags = MEDIA_ENT_T_DVB_DEMOD;
+   ret = media_device_register_entity(fe-mdev, fe-demod_entity);
+   if (ret  0)
+   printk(KERN_WARNING
+   %s: media_device_register_entity failed\n,
+   __func__);
+   }
+#endif
+   return fe;
 }
 EXPORT_SYMBOL(dvb_i2c_attach_fe);
 
@@ -193,6 +215,10 @@ static int remove_fe(struct i2c_client *client,
if (param-priv_remove)
param-priv_remove(client);
fe = i2c_get_clientdata(client);
+
+   if (fe-mdev)
+   media_device_unregister_entity(fe-demod_entity);
+
kfree(fe-demodulator_priv);
kfree(fe);
module_put(this_module);
diff --git a/drivers/media/dvb-core/dvb_i2c.h b/drivers/media/dvb-core/dvb_i2c.h
index 2bf409d4bcaf..c2efed9c997e 100644
--- a/drivers/media/dvb-core/dvb_i2c.h
+++ b/drivers/media/dvb-core/dvb_i2c.h
@@ -33,7 +33,8 @@
 
 struct dvb_frontend *dvb_i2c_attach_fe(struct i2c_adapter *adap,
   const struct i2c_board_info *info,
-  const void *cfg, void **out);
+  const void *cfg, void **out,
+  struct media_device *mdev);
 
 struct i2c_client *dvb_i2c_attach_tuner(struct i2c_adapter *adap,
const struct i2c_board_info *info,
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index fc23b7ad194f..084526a29414 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -1510,7 +1510,7 @@ static int dvb_register(struct cx23885_tsport *port)
fe0-dvb.frontend = dvb_i2c_attach_fe(i2c_bus-i2c_adap,
   mb86a20s_board_info,
   
mygica_x8507_mb86a20s_config,
-  NULL);
+  NULL, NULL);
if (fe0-dvb.frontend == NULL)
break;
 
diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c 
b/drivers/media/pci/saa7134/saa7134-dvb.c
index 74b5ce0de488..a47630be4583 100644
--- a/drivers/media/pci/saa7134/saa7134-dvb.c
+++ b/drivers/media/pci/saa7134/saa7134-dvb.c
@@ -1814,7 +1814,7 @@ static int dvb_init(struct saa7134_dev *dev)
fe0-dvb.frontend = dvb_i2c_attach_fe(dev-i2c_adap,
   mb86a20s_board_info,
   kworld_mb86a20s_config,
- 

[PATCH 3/5] mb86a20s: remove two uneeded macros

2015-01-01 Thread Mauro Carvalho Chehab
There are two macros that are there just to simplify the parameter
passage. Remove them, as the i2c address is already inside the
i2c client structure.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
b/drivers/media/dvb-frontends/mb86a20s.c
index 8dd608be1edd..7d6a688f6f12 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -224,12 +224,12 @@ static struct regdata mb86a20s_per_ber_reset[] = {
  * I2C read/write functions and macros
  */
 
-static int mb86a20s_i2c_writereg(struct mb86a20s_state *state,
-u8 i2c_addr, u8 reg, u8 data)
+static int mb86a20s_writereg(struct mb86a20s_state *state,
+u8 reg, u8 data)
 {
u8 buf[] = { reg, data };
struct i2c_msg msg = {
-   .addr = i2c_addr, .flags = 0, .buf = buf, .len = 2
+   .addr = state-i2c-addr, .flags = 0, .buf = buf, .len = 2
};
int rc;
 
@@ -245,27 +245,25 @@ static int mb86a20s_i2c_writereg(struct mb86a20s_state 
*state,
 }
 
 static int mb86a20s_i2c_writeregdata(struct mb86a20s_state *state,
-u8 i2c_addr, struct regdata *rd, int size)
+struct regdata *rd, int size)
 {
int i, rc;
 
for (i = 0; i  size; i++) {
-   rc = mb86a20s_i2c_writereg(state, i2c_addr, rd[i].reg,
-  rd[i].data);
+   rc = mb86a20s_writereg(state, rd[i].reg, rd[i].data);
if (rc  0)
return rc;
}
return 0;
 }
 
-static int mb86a20s_i2c_readreg(struct mb86a20s_state *state,
-   u8 i2c_addr, u8 reg)
+static int mb86a20s_readreg(struct mb86a20s_state *state, u8 reg)
 {
u8 val;
int rc;
struct i2c_msg msg[] = {
-   { .addr = i2c_addr, .flags = 0, .buf = reg, .len = 1 },
-   { .addr = i2c_addr, .flags = I2C_M_RD, .buf = val, .len = 1 }
+   { .addr = state-i2c-addr, .flags = 0, .buf = reg, .len = 1 },
+   { .addr = state-i2c-addr, .flags = I2C_M_RD, .buf = val, 
.len = 1 }
};
 
rc = i2c_transfer(state-i2c-adapter, msg, 2);
@@ -279,12 +277,8 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state 
*state,
return val;
 }
 
-#define mb86a20s_readreg(state, reg) \
-   mb86a20s_i2c_readreg(state, state-i2c-addr, reg)
-#define mb86a20s_writereg(state, reg, val) \
-   mb86a20s_i2c_writereg(state, state-i2c-addr, reg, val)
 #define mb86a20s_writeregdata(state, regdata) \
-   mb86a20s_i2c_writeregdata(state, state-i2c-addr, \
+   mb86a20s_i2c_writeregdata(state, \
regdata, ARRAY_SIZE(regdata))
 
 /*
-- 
2.1.0

--
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/5] mb86a20s: convert it to I2C binding model

2015-01-01 Thread Mauro Carvalho Chehab
Instead of using I2C raw API, use the standard I2C binding API,
with the DVB core support for it.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
b/drivers/media/dvb-frontends/mb86a20s.c
index 8f54c39ca63f..8dd608be1edd 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -18,6 +18,7 @@
 #include asm/div64.h
 
 #include dvb_frontend.h
+#include dvb_i2c.h
 #include mb86a20s.h
 
 #define NUM_LAYERS 3
@@ -35,12 +36,10 @@ static u8 mb86a20s_subchannel[] = {
 };
 
 struct mb86a20s_state {
-   struct i2c_adapter *i2c;
+   struct i2c_client *i2c;
const struct mb86a20s_config *config;
u32 last_frequency;
 
-   struct dvb_frontend frontend;
-
u32 if_freq;
enum mb86a20s_bandwidth bw;
bool inversion;
@@ -234,7 +233,7 @@ static int mb86a20s_i2c_writereg(struct mb86a20s_state 
*state,
};
int rc;
 
-   rc = i2c_transfer(state-i2c, msg, 1);
+   rc = i2c_transfer(state-i2c-adapter, msg, 1);
if (rc != 1) {
dev_err(state-i2c-dev,
%s: writereg error (rc == %i, reg == 0x%02x, data == 
0x%02x)\n,
@@ -269,7 +268,7 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state 
*state,
{ .addr = i2c_addr, .flags = I2C_M_RD, .buf = val, .len = 1 }
};
 
-   rc = i2c_transfer(state-i2c, msg, 2);
+   rc = i2c_transfer(state-i2c-adapter, msg, 2);
 
if (rc != 2) {
dev_err(state-i2c-dev, %s: reg=0x%x (error=%d)\n,
@@ -281,11 +280,11 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state 
*state,
 }
 
 #define mb86a20s_readreg(state, reg) \
-   mb86a20s_i2c_readreg(state, state-config-demod_address, reg)
+   mb86a20s_i2c_readreg(state, state-i2c-addr, reg)
 #define mb86a20s_writereg(state, reg, val) \
-   mb86a20s_i2c_writereg(state, state-config-demod_address, reg, val)
+   mb86a20s_i2c_writereg(state, state-i2c-addr, reg, val)
 #define mb86a20s_writeregdata(state, regdata) \
-   mb86a20s_i2c_writeregdata(state, state-config-demod_address, \
+   mb86a20s_i2c_writeregdata(state, state-i2c-addr, \
regdata, ARRAY_SIZE(regdata))
 
 /*
@@ -2058,41 +2057,34 @@ static int mb86a20s_tune(struct dvb_frontend *fe,
return rc;
 }
 
-static void mb86a20s_release(struct dvb_frontend *fe)
+static int mb86a20s_remove(struct i2c_client *i2c)
 {
-   struct mb86a20s_state *state = fe-demodulator_priv;
+   dev_dbg(i2c-dev, %s called.\n, __func__);
 
-   dev_dbg(state-i2c-dev, %s called.\n, __func__);
-
-   kfree(state);
+   return 0;
 }
 
 static struct dvb_frontend_ops mb86a20s_ops;
 
-struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
-   struct i2c_adapter *i2c)
+static int mb86a20s_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
 {
+   struct dvb_frontend *fe;
struct mb86a20s_state *state;
u8  rev;
 
dev_dbg(i2c-dev, %s called.\n, __func__);
 
-   /* allocate memory for the internal state */
-   state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL);
-   if (state == NULL) {
-   dev_err(i2c-dev,
-   %s: unable to allocate memory for state\n, __func__);
-   goto error;
-   }
+   fe = i2c_get_clientdata(i2c);
+   state = fe-demodulator_priv;
 
/* setup the state */
-   state-config = config;
+   memcpy(state-config, i2c-dev.platform_data, sizeof(state-config));
state-i2c = i2c;
 
/* create dvb_frontend */
-   memcpy(state-frontend.ops, mb86a20s_ops,
+   memcpy(fe-ops, mb86a20s_ops,
sizeof(struct dvb_frontend_ops));
-   state-frontend.demodulator_priv = state;
 
/* Check if it is a mb86a20s frontend */
rev = mb86a20s_readreg(state, 0);
@@ -2104,16 +2096,11 @@ struct dvb_frontend *mb86a20s_attach(const struct 
mb86a20s_config *config,
dev_dbg(i2c-dev,
Frontend revision %d is unknown - aborting.\n,
   rev);
-   goto error;
+   return -ENODEV;
}
 
-   return state-frontend;
-
-error:
-   kfree(state);
-   return NULL;
+   return 0;
 }
-EXPORT_SYMBOL(mb86a20s_attach);
 
 static struct dvb_frontend_ops mb86a20s_ops = {
.delsys = { SYS_ISDBT },
@@ -2132,8 +2119,6 @@ static struct dvb_frontend_ops mb86a20s_ops = {
.frequency_stepsize = 62500,
},
 
-   .release = mb86a20s_release,
-
.init = mb86a20s_initfe,
.set_frontend = mb86a20s_set_frontend,
.get_frontend = mb86a20s_get_frontend_dummy,
@@ -2142,6 +2127,21 @@ static struct dvb_frontend_ops mb86a20s_ops = {
.tune = mb86a20s_tune,
 };
 
+static const struct i2c_device_id mb86a20s_id[] = {
+   { mb86a20s, 0 },
+   {}

[RFC PATCH 0/5] mb96a20s:use DVB core I2C binding and add media controller support

2015-01-01 Thread Mauro Carvalho Chehab
Those patches are currently experimental and they depend on
this patch:
https://patchwork.linuxtv.org/patch/27329/

There are 2 cleanup patches here for mb86a20s, and one patch that
converts it to use the new I2C binding helper routines added at the
DVB core.

The next patch extends the DVB core I2C binding routines to add media
controller support for the DVB demod.

The final patch makes cx231xx to register to the media controller,
if the device has a mb86a20s.

Please notice that the current media controller support is actually
too poor and not complete, as it doesn't create and pads to the demod
entity. More work is needed, in order to add the demod pads to it.

That would require some changes at the dvb core, for it to be media
controller aware, and to create the nodes for the DVR and for the other
elements of the DVB graph.

For now, all it shows is:

Media controller API version 0.1.1

Media device information

driver  cx231xx
model   Pixelview PlayTV USB Hybrid
serial  CIR0001
bus info1.2
hw revision 0x4001
driver version  3.19.0

Device topology
- entity 1: mb86a20s (0 pad, 0 link)
type Node subtype DVB flags 20005

Mauro Carvalho Chehab (5):
  mb86a20s: remove unused debug modprobe parameter
  mb86a20s: convert it to I2C binding model
  mb86a20s: remove two uneeded macros
  dvb core: add media controller support for the demod
  cx231xx: add media controller support for mb86a20s boards

 drivers/media/dvb-core/dvb_frontend.h   |  7 +++
 drivers/media/dvb-core/dvb_i2c.c| 30 ++-
 drivers/media/dvb-core/dvb_i2c.h|  3 +-
 drivers/media/dvb-frontends/mb86a20s.c  | 90 +++--
 drivers/media/dvb-frontends/mb86a20s.h  | 19 ---
 drivers/media/pci/cx23885/cx23885-dvb.c | 13 +++--
 drivers/media/pci/saa7134/saa7134-dvb.c | 13 +++--
 drivers/media/usb/cx231xx/cx231xx-dvb.c | 64 ---
 drivers/media/usb/em28xx/em28xx-dvb.c   | 13 +++--
 include/uapi/linux/media.h  |  4 +-
 10 files changed, 165 insertions(+), 91 deletions(-)

-- 
2.1.0

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


[BUG] Dual tuner TV card, works using one tuner only, doesn't work if both tuners are used

2015-01-01 Thread dCrypt
Hi,

I just subscribed to the mailing list to submit information on the bug which
is driving me crazy since one month ago.

I have a VDR based PVR at home, installed over an Ubuntu 14.04 LTS.
Everything was working perfectly, until beginning of December. It seems to
me that something changed that broke my PVR pretty bad. 

The problem is the following: tuning (zap) both tuners (it's not needed that
both are tuned simultaneously, only one after the other, in no particular
order) makes the tuners to enter an state where they can't lock the signal
anymore. 

Facts:

- My TV card is a Cinergy T PCIe Dual from Terratec
(http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_T_PCIe_dual).
- The problem arose in the form of frontend x/0 timed out while tuning to
channel ... in /var/log/syslog. It happened when both tuners are active,
during EPG scan. The problem does not happen if VDR is run with -D parameter
to limit the number of frontends enabled. Disabling the EPG scan with both
frontends enabled minimizes the problem, but doesn't solve it because tuning
both frontends without any EPG scan makes the error happen again.
- I initially thought about a problem in the DVB-T signal, because it all
started the 1st of December, during the transition to a new set of
frequencies in Spain.
- Everything was working perfectly before the 1st, and the problems started
suddenly.
- I setup testing board for debugging, different board and processor, less
memory, lots of Linux distros tested, Windows tested as well.
- Both tuners works in windows without problems. Confirmed.
- I have completely discarded problems/errors in hardware (because in
Windows I can enable both tuners without problems) and VDR (because I can
reproduce the problems at OS level, without even having VDR installed).
- I have almost narrowed the problem at the cx23885 driver, because when it
happens, I can restart the TV card to working conditions by executing rmmod
cx23885 and modprobe cx23885; however, as with rmmod several
dependencies are unloaded as well, I am stuck and I am unable to go on with
debugging to find out where the problem really is.
- Tools used to test and confirm the problem are: VDR, MythTV, TVHeadend,
dvbscan, dvbv5-scan, dvbv5-zap and others
- Linux distros tested: Ubuntu, Fedora, Suse, yaVDR (not sure if the card
worked at all), MythBuntu (dvb-fe-tool -a 1 -c DVBT was required to force
DVB-T mode for the second tuner), and probably others
- I have a Sony PlayTV also with dual tuners, which works without any
problem. http://www.linuxtv.org/wiki/index.php/Sony_PlayTV_dual_tuner_DVB-T

So, that's why I ask for your help. How can I further debug the problem? Is
there something I can do?

BR, and happy new year!


INFO  TEST:



pvr@prueba:~$ sudo lspci -vvv -s 03:00.0 03:00.0 Multimedia video
controller: Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (rev
04)
Subsystem: TERRATEC Electronic GmbH Cinergy T PCIe Dual
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort-
TAbort- MAbort- SERR- PERR- INTx-
Latency: 0, Cache Line Size: 4 bytes
Interrupt: pin A routed to IRQ 16
Region 0: Memory at fba0 (64-bit, non-prefetchable) [size=2M]
Capabilities: [40] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
64ns, L1 1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr+ FatalErr- UnsuppReq+ AuxPwr-
TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s 2us, L1 4us
ClockPM- Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [90] Vital Product Data
Product Name: 
End
Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
Address:   Data: 
Capabilities: [100 v1] Advanced Error Reporting
UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-

Re: [PATCH 2/5] mb86a20s: convert it to I2C binding model

2015-01-01 Thread Antti Palosaari
I am on holiday trip now. But generally speaking I would like to separate all 
drivers from the interfaces. That means for example I2C tuner driver is just a 
I2C driver and nothing more - no relations to DVB nor V4L API. That is 
something I said many times earlier too, but for my taste drivers should be 
agnostics to APIs.
Antti
On 1 Jan 2015 15:51, Mauro Carvalho Chehab mche...@osg.samsung.com wrote:

 Instead of using I2C raw API, use the standard I2C binding API, 
 with the DVB core support for it. 

 Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com 

 diff --git a/drivers/media/dvb-frontends/mb86a20s.c 
 b/drivers/media/dvb-frontends/mb86a20s.c 
 index 8f54c39ca63f..8dd608be1edd 100644 
 --- a/drivers/media/dvb-frontends/mb86a20s.c 
 +++ b/drivers/media/dvb-frontends/mb86a20s.c 
 @@ -18,6 +18,7 @@ 
 #include asm/div64.h 

 #include dvb_frontend.h 
 +#include dvb_i2c.h 
 #include mb86a20s.h 

 #define NUM_LAYERS 3 
 @@ -35,12 +36,10 @@ static u8 mb86a20s_subchannel[] = { 
 }; 

 struct mb86a20s_state { 
 - struct i2c_adapter *i2c; 
 + struct i2c_client *i2c; 
 const struct mb86a20s_config *config; 
 u32 last_frequency; 

 - struct dvb_frontend frontend; 
 - 
 u32 if_freq; 
 enum mb86a20s_bandwidth bw; 
 bool inversion; 
 @@ -234,7 +233,7 @@ static int mb86a20s_i2c_writereg(struct mb86a20s_state 
 *state, 
 }; 
 int rc; 

 - rc = i2c_transfer(state-i2c, msg, 1); 
 + rc = i2c_transfer(state-i2c-adapter, msg, 1); 
 if (rc != 1) { 
 dev_err(state-i2c-dev, 
 %s: writereg error (rc == %i, reg == 0x%02x, data == 0x%02x)\n, 
 @@ -269,7 +268,7 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state 
 *state, 
 { .addr = i2c_addr, .flags = I2C_M_RD, .buf = val, .len = 1 } 
 }; 

 - rc = i2c_transfer(state-i2c, msg, 2); 
 + rc = i2c_transfer(state-i2c-adapter, msg, 2); 

 if (rc != 2) { 
 dev_err(state-i2c-dev, %s: reg=0x%x (error=%d)\n, 
 @@ -281,11 +280,11 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state 
 *state, 
 } 

 #define mb86a20s_readreg(state, reg) \ 
 - mb86a20s_i2c_readreg(state, state-config-demod_address, reg) 
 + mb86a20s_i2c_readreg(state, state-i2c-addr, reg) 
 #define mb86a20s_writereg(state, reg, val) \ 
 - mb86a20s_i2c_writereg(state, state-config-demod_address, reg, val) 
 + mb86a20s_i2c_writereg(state, state-i2c-addr, reg, val) 
 #define mb86a20s_writeregdata(state, regdata) \ 
 - mb86a20s_i2c_writeregdata(state, state-config-demod_address, \ 
 + mb86a20s_i2c_writeregdata(state, state-i2c-addr, \ 
 regdata, ARRAY_SIZE(regdata)) 

 /* 
 @@ -2058,41 +2057,34 @@ static int mb86a20s_tune(struct dvb_frontend *fe, 
 return rc; 
 } 

 -static void mb86a20s_release(struct dvb_frontend *fe) 
 +static int mb86a20s_remove(struct i2c_client *i2c) 
 { 
 - struct mb86a20s_state *state = fe-demodulator_priv; 
 + dev_dbg(i2c-dev, %s called.\n, __func__); 

 - dev_dbg(state-i2c-dev, %s called.\n, __func__); 
 - 
 - kfree(state); 
 + return 0; 
 } 

 static struct dvb_frontend_ops mb86a20s_ops; 

 -struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, 
 -     struct i2c_adapter *i2c) 
 +static int mb86a20s_probe(struct i2c_client *i2c, 
 +   const struct i2c_device_id *id) 
 { 
 + struct dvb_frontend *fe; 
 struct mb86a20s_state *state; 
 u8 rev; 

 dev_dbg(i2c-dev, %s called.\n, __func__); 

 - /* allocate memory for the internal state */ 
 - state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); 
 - if (state == NULL) { 
 - dev_err(i2c-dev, 
 - %s: unable to allocate memory for state\n, __func__); 
 - goto error; 
 - } 
 + fe = i2c_get_clientdata(i2c); 
 + state = fe-demodulator_priv; 

 /* setup the state */ 
 - state-config = config; 
 + memcpy(state-config, i2c-dev.platform_data, sizeof(state-config)); 
 state-i2c = i2c; 

 /* create dvb_frontend */ 
 - memcpy(state-frontend.ops, mb86a20s_ops, 
 + memcpy(fe-ops, mb86a20s_ops, 
 sizeof(struct dvb_frontend_ops)); 
 - state-frontend.demodulator_priv = state; 

 /* Check if it is a mb86a20s frontend */ 
 rev = mb86a20s_readreg(state, 0); 
 @@ -2104,16 +2096,11 @@ struct dvb_frontend *mb86a20s_attach(const struct 
 mb86a20s_config *config, 
 dev_dbg(i2c-dev, 
 Frontend revision %d is unknown - aborting.\n, 
    rev); 
 - goto error; 
 + return -ENODEV; 
 } 

 - return state-frontend; 
 - 
 -error: 
 - kfree(state); 
 - return NULL; 
 + return 0; 
 } 
 -EXPORT_SYMBOL(mb86a20s_attach); 

 static struct dvb_frontend_ops mb86a20s_ops = { 
 .delsys = { SYS_ISDBT }, 
 @@ -2132,8 +2119,6 @@ static struct dvb_frontend_ops mb86a20s_ops = { 
 .frequency_stepsize = 62500, 
 }, 

 - .release = mb86a20s_release, 
 - 
 .init = mb86a20s_initfe, 
 .set_frontend = mb86a20s_set_frontend, 
 .get_frontend = mb86a20s_get_frontend_dummy, 
 @@ -2142,6 +2127,21 @@ static struct dvb_frontend_ops mb86a20s_ops = { 
 .tune = mb86a20s_tune, 
 }; 

 +static const struct i2c_device_id mb86a20s_id[] = { 
 + { mb86a20s, 0 }, 
 + {} 
 +}; 
 + 
 +static const struct dvb_i2c_module_param mb86a20s_param = { 
 + .ops.fe_ops = NULL, 
 + 

cron job: media_tree daily build: ERRORS

2015-01-01 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:   Fri Jan  2 04:00:08 CET 2015
git branch: test
git hash:   99f3cd52aee21091ce62442285a68873e3be833f
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-41-g6c2d743
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:3.17-3.slh.2-amd64

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

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.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: [REVIEW PATCH 1/1] omap3isp: Correctly set QUERYCAP capabilities

2015-01-01 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 01 January 2015 23:13:54 Sakari Ailus wrote:
 device_caps in struct v4l2_capability were inadequately set in
 VIDIOC_QUERYCAP. Fix this.
 
 Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
 ---
  drivers/media/platform/omap3isp/ispvideo.c |7 +--
  1 file changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/media/platform/omap3isp/ispvideo.c
 b/drivers/media/platform/omap3isp/ispvideo.c index cdfec27..d644164 100644
 --- a/drivers/media/platform/omap3isp/ispvideo.c
 +++ b/drivers/media/platform/omap3isp/ispvideo.c
 @@ -602,10 +602,13 @@ isp_video_querycap(struct file *file, void *fh, struct
 v4l2_capability *cap) strlcpy(cap-card, video-video.name,
 sizeof(cap-card));
   strlcpy(cap-bus_info, media, sizeof(cap-bus_info));
 
 + cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
 + | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;

I would align the | under the =. Apart from that,

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

 +
   if (video-type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
 - cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
 + cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
   else
 - cap-capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
 + cap-device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
 
   return 0;
  }

-- 
Regards,

Laurent Pinchart

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