Re: [PATCH 2/2] v4l-utils: fixed dvbv5 vdr format

2016-09-08 Thread Markus Heiser

Am 07.09.2016 um 19:59 schrieb VDR User :

>> It is broken (see below). Have you ever used dvbv5 tools with vdr format
>> output or did you know a "VDR user" who is using dvbv5-scan and not wscan?
> 
> In my experience the v4l scanner, wscan, and VDR's internal scanner
> has never worked well (for NA). I use nscan, which has easily been the
> most successful of the scanners. An additional benefit to nscan is you
> only supply a single transponder on the command line and it will
> populate a channel list for the entire sat. You don't need to supply
> an entire list of transponders to scan.
> 
> As far as other VDR users, of which I know many being a long time
> user, they tend to use whatever works best for them.
> 
>>> Well, the libdvbv5 VDR output support was written aiming VDR version 2.1.6.
>>> I've no idea if it works with VDR 1.6.0.
> 
> It's not uncommon to find VDR users who run versions as old as 1.6.0*.
> Some are completely satisfied leaving their perfectly stable system be
> with no concern about updating it.
> 
>> Since these bugs are from the beginning and no one has rejected,
>> I suppose, that these VDR 1.6.0 users are using wscan and not the
>> dvbv5 tools. IMHO the VDR format has never been worked,
>> so we can't break backwards compatible ;) and since there is wscan
>> widely used by old vdr hats, we do not need to care pre-DVB-[T|S]-2
>> formats.
> 
> Instead of making that kind of assumption, why not ask VDR users
> directly on the VDR mailing list?
> 
>> As I said, it might be more helpful to place vdr in a public
>> repository and to document channel's format well. It is always a
>> hell for me to dig into the vdr sources without a version
>> context and an ambiguous documentation ...
> 
> There is already a publicly available VDR repository offering the
> current stable & developer versions, along with all previous versions:
> http://www.tvdr.de/download.htm

?? these are tarballs, where is the version control system?

> 
>> Different formats (compare):
>> * http://www.vdr-wiki.de/wiki/index.php/Channels.conf#Unterschiede
>> * 
>> https://www.linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf#Differences
> 
> It's best to refer to VDRs packaged documention. You can get the
> channels.conf format definition with `man 5 vdr`.

Good point, but I have only 2.2 installed, so where get I the backward 
informations .. should I extract all theses tarballs and read through
them .. you see my point?


>> VDR wiki recommends wscan
>> * http://www.vdr-wiki.de/wiki/index.php/W_scan
> 
> That wiki shouldn't be viewed as a main reference point in general but
> especially for scanning.

And the main ref is https://www.linuxtv.org ... which is not updated?

> As mentioned earlier, people tend to use what
> works for them. In NA/SA nscan tends to be the top choice. Europe/Asia
> tends to be other scanners.

What I said, nobody use the vdr format of dvbv5-tools, since it 
is broken and now, Chris and I want to fix it.

> 
>> I think, there is much room left to support developers and users
>> outside the vdr community ;)
>> 
>> Would you like to test these patches from Chris and mine / Thanks
>> that will be very helpful.
> 
> I'd recommend posting to the VDR mailing list where you'll find more
> people who use and would be affected by these changes. Additionally,
> you could inquire at vdr-portal.de, which is one of the most supported
> VDR forums for both users and developers.

Chris and I want to patch something in v4l-utils which is broken 
and YOU make the assumption that our patches are not OK ... and now, #
I have to ask someone other on a different projects ML and their portal?

If you have a doubt about the patches from Chris and mine, make a test and
if you see any regression it would be great to post your experience here ...

thanks.

-- Markus --


--
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 00/10] v4l: platform: Add Renesas R-Car FDP1 Driver

2016-09-08 Thread Kieran Bingham
On 07/09/16 23:25, Laurent Pinchart wrote:
> Hello,

Thanks for all of your efforts here!

> Here's the third version of the Renesas R-Car FDP1 driver.
> 
> The FDP1 (Fine Display Processor) is a hardware memory-to-memory de-interlacer
> device, with capability to convert from various YCbCr/YUV formats to both
> YCbCr/YUV and RGB formats at the same time as converting interlaced content to
> progressive.
> 
> Patch 01/10 fixes an issue in the V4L2 ioctl handling core code. It has been
> posted before and hasn't been changed.
> 
> Patch 02/10 adds a new standard V4L2 menu control for the deinterlacing mode.
> The menu items are driver specific.
> 
> Patch 03/10 extends the FCP driver to support the FDP1. It has been posted
> before and hasn't been changed.
> 
> Patch 04/10 adds the FDP1 driver unchanged compared to the v2 posted by
> Kieran. Patches 05/10 to 09/10 then fix issues in the driver and incorporate
> review comments. They will eventually be squashed into patch 04/10, but are
> currently separate to allow easier review of the changes.
> 
> Patch 10/10 reworks buffer handling in the FDP1 driver. This is experimental
> and doesn't fix any known bug. I've included the patch in the series to get
> feedback on whether this is a good idea.
> 
> Kieran, I noticed that your patches are authored by
> 
>   Kieran Bingham 
> 
> Is that correct or should it be changed to
> 
>   Kieran Bingham 

Yes, @bingham.xyz is preferred.

Google is rewriting my outgoing mail address.
I fear I may have to set up my own mail server :(

I've had a quick look through the extra patches. I will try to reply to
each of them when I get chance. (I've just done the first two easy ones
so far)
--
Regards

Kieran

> 
> ?
> 
> Here is the V4L2 compliance report.
> 
> v4l2-compliance SHA   : abc1453dfe89f244dccd3460d8e1a2e3091cbadb
> 
> Driver Info:
> Driver name   : rcar_fdp1
> Card type : rcar_fdp1
> Bus info  : platform:rcar_fdp1
> Driver version: 4.8.0
> Capabilities  : 0x84204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> Device Capabilities
> Device Caps   : 0x04204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> 
> Compliance test for device /dev/video0 (not using libv4l2):
> 
> Required ioctls:
> test VIDIOC_QUERYCAP: OK
> 
> Allow for multiple opens:
> test second video open: OK
> test VIDIOC_QUERYCAP: OK
> test VIDIOC_G/S_PRIORITY: OK
> test for unlimited opens: OK
> 
> Debug ioctls:
> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> test VIDIOC_QUERYCTRL: OK
> test VIDIOC_G/S_CTRL: OK
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 5 Private Controls: 0
> 
> Format ioctls:
> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> test VIDIOC_G/S_PARM: OK (Not Supported)
> test VIDIOC_G_FBUF: OK (Not Supported)
> test VIDIOC_G_FMT: OK
> test VIDIOC_TRY_FMT: OK
> test VIDIOC_S_FMT: OK
> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> test Cropping: OK (Not Supported)
> test Composing: OK (Not Supported)
> test Scaling: OK
> 
> Codec ioctls:
> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>

[PATCH 1/1] ad5820: Use bool for boolean values

2016-09-08 Thread Sakari Ailus
The driver used integers for what boolean would have been a better fit.
Use boolean instead.

Signed-off-by: Sakari Ailus 
---
 drivers/media/i2c/ad5820.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c
index d7ad5c1..a9382d1 100644
--- a/drivers/media/i2c/ad5820.c
+++ b/drivers/media/i2c/ad5820.c
@@ -58,7 +58,7 @@ struct ad5820_device {
struct mutex power_lock;
int power_count;
 
-   unsigned int standby : 1;
+   bool standby;
 };
 
 static int ad5820_write(struct ad5820_device *coil, u16 data)
@@ -108,7 +108,7 @@ static int ad5820_update_hw(struct ad5820_device *coil)
 /*
  * Power handling
  */
-static int ad5820_power_off(struct ad5820_device *coil, int standby)
+static int ad5820_power_off(struct ad5820_device *coil, bool standby)
 {
int ret = 0, ret2;
 
@@ -117,7 +117,7 @@ static int ad5820_power_off(struct ad5820_device *coil, int 
standby)
 * (single power line control for both coil and sensor).
 */
if (standby) {
-   coil->standby = 1;
+   coil->standby = true;
ret = ad5820_update_hw(coil);
}
 
@@ -127,7 +127,7 @@ static int ad5820_power_off(struct ad5820_device *coil, int 
standby)
return ret2;
 }
 
-static int ad5820_power_on(struct ad5820_device *coil, int restore)
+static int ad5820_power_on(struct ad5820_device *coil, bool restore)
 {
int ret;
 
@@ -137,7 +137,7 @@ static int ad5820_power_on(struct ad5820_device *coil, int 
restore)
 
if (restore) {
/* Restore the hardware settings. */
-   coil->standby = 0;
+   coil->standby = false;
ret = ad5820_update_hw(coil);
if (ret)
goto fail;
@@ -145,7 +145,7 @@ static int ad5820_power_on(struct ad5820_device *coil, int 
restore)
return 0;
 
 fail:
-   coil->standby = 1;
+   coil->standby = true;
regulator_disable(coil->vana);
 
return ret;
@@ -227,7 +227,8 @@ ad5820_set_power(struct v4l2_subdev *subdev, int on)
 * update the power state.
 */
if (coil->power_count == !on) {
-   ret = on ? ad5820_power_on(coil, 1) : ad5820_power_off(coil, 1);
+   ret = on ? ad5820_power_on(coil, true) :
+   ad5820_power_off(coil, false);
if (ret < 0)
goto done;
}
@@ -279,7 +280,7 @@ static int ad5820_suspend(struct device *dev)
if (!coil->power_count)
return 0;
 
-   return ad5820_power_off(coil, 0);
+   return ad5820_power_off(coil, false);
 }
 
 static int ad5820_resume(struct device *dev)
@@ -291,7 +292,7 @@ static int ad5820_resume(struct device *dev)
if (!coil->power_count)
return 0;
 
-   return ad5820_power_on(coil, 1);
+   return ad5820_power_on(coil, true);
 }
 
 #else
-- 
2.7.4


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


Re: [PATCH 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver

2016-09-08 Thread Tiffany Lin
Hi Hans,

On Thu, 2016-09-08 at 09:21 +0200, Hans Verkuil wrote:
> Hi Tiffany,
> 
> On 09/07/2016 08:56 AM, Tiffany Lin wrote:
> > This patch series add Mediatek compressed block format V4L2_PIX_FMT_MT21C, 
> > the
> > decoder driver will decoded bitstream to V4L2_PIX_FMT_MT21C format.
> > 
> > User space applications could use MT8173 MDP driver to convert 
> > V4L2_PIX_FMT_MT21C to
> > V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
> > 
> > MDP driver[1] is stand alone driver.
> > 
> > Usage:
> > MT21C -> MT8173 MDP -> NV12M/YUV420M/YVU420
> > NV12M/NV21M/YUV420M/YVU420M -> mt8173 Encoder -> H264/VP8
> > H264/VP8/VP9 -> mtk8173 Decoder -> MT21C
> > 
> > When encode with MT21 source, the pipeline will be:
> > MT21C -> MDP driver-> NV12M/NV21M/YUV420M/YVU420M -> Encoder -> H264/VP8
> > 
> > When playback, the pipeline will be:
> > H264/VP8/VP9 -> Decoder driver -> MT21C -> MDP Driver -> DRM
> > 
> > [1]https://patchwork.kernel.org/patch/9305329/
> > 
> > Tiffany Lin (4):
> >   v4l: add Mediatek compressed video block format
> >   docs-rst: Add compressed video formats used on MT8173 codec driver
> >   vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
> >   arm64: dts: mediatek: Add Video Decoder for MT8173
> > 
> >  Documentation/media/uapi/v4l/pixfmt-reserved.rst   |6 +++
> >  arch/arm64/boot/dts/mediatek/mt8173.dtsi   |   44 
> > 
> >  drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c |7 +++-
> >  drivers/media/v4l2-core/v4l2-ioctl.c   |1 +
> >  include/uapi/linux/videodev2.h |1 +
> >  5 files changed, 58 insertions(+), 1 deletion(-)
> > 
> 
> So basically the video decoder is useless without support for this format and
> without the MDP driver, right?
> 
Yes. It also require new vpu firmware.
Andrew will help release new vpu firmware include encode/decode/mdp
capability.

best regards,
Tiffany


> I'm wondering if I should hold off on merging the decoder driver until these 
> two
> are in. What is the timeline for v6 of the MDP driver?
> 
> If a v6 is posted early next week, then I have time to review and (assuming 
> it is
> OK) I can make a pull request for both this driver and the MDP driver.
> 
> If it takes longer, then there is a good chance that it will slip to 4.10. I 
> will
> have very little time in the period September 20 - October 14.
> 
> 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


[PATCH v6 2/2] media: Add a driver for the ov5645 camera sensor.

2016-09-08 Thread Todor Tomov
The ov5645 sensor from Omnivision supports up to 2592x1944
and CSI2 interface.

The driver adds support for the following modes:
- 1280x960
- 1920x1080
- 2592x1944

Output format is packed 8bit UYVY.

Signed-off-by: Todor Tomov 
---
 drivers/media/i2c/Kconfig  |   12 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/ov5645.c | 1372 
 3 files changed, 1385 insertions(+)
 create mode 100644 drivers/media/i2c/ov5645.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index ce9006e..f934d1f 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -524,6 +524,18 @@ config VIDEO_OV2659
  To compile this driver as a module, choose M here: the
  module will be called ov2659.
 
+config VIDEO_OV5645
+   tristate "OmniVision OV5645 sensor support"
+   depends on OF
+   depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+   depends on MEDIA_CAMERA_SUPPORT
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+ OV5645 camera.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ov5645.
+
 config VIDEO_OV7640
tristate "OmniVision OV7640 sensor support"
depends on I2C && VIDEO_V4L2
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 94f2c99..2485aed 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_VIDEO_VP27SMPX) += vp27smpx.o
 obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o
 obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
 obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
+obj-$(CONFIG_VIDEO_OV5645) += ov5645.o
 obj-$(CONFIG_VIDEO_OV7640) += ov7640.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
new file mode 100644
index 000..5e5c37e
--- /dev/null
+++ b/drivers/media/i2c/ov5645.c
@@ -0,0 +1,1372 @@
+/*
+ * Driver for the OV5645 camera sensor.
+ *
+ * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2015 By Tech Design S.L. All Rights Reserved.
+ * Copyright (C) 2012-2013 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * Based on:
+ * - the OV5645 driver from QC msm-3.10 kernel on codeaurora.org:
+ *   https://us.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/
+ *   media/platform/msm/camera_v2/sensor/ov5645.c?h=LA.BR.1.2.4_rb1.41
+ * - the OV5640 driver posted on linux-media:
+ *   https://www.mail-archive.com/linux-media%40vger.kernel.org/msg92671.html
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define OV5645_VOLTAGE_ANALOG   280
+#define OV5645_VOLTAGE_DIGITAL_CORE 150
+#define OV5645_VOLTAGE_DIGITAL_IO   180
+
+#define OV5645_SYSTEM_CTRL00x3008
+#defineOV5645_SYSTEM_CTRL0_START   0x02
+#defineOV5645_SYSTEM_CTRL0_STOP0x42
+#define OV5645_CHIP_ID_HIGH0x300A
+#defineOV5645_CHIP_ID_HIGH_BYTE0x56
+#define OV5645_CHIP_ID_LOW 0x300B
+#defineOV5645_CHIP_ID_LOW_BYTE 0x45
+#define OV5645_AWB_MANUAL_CONTROL  0x3406
+#defineOV5645_AWB_MANUAL_ENABLEBIT(0)
+#define OV5645_AEC_PK_MANUAL   0x3503
+#defineOV5645_AEC_MANUAL_ENABLEBIT(0)
+#defineOV5645_AGC_MANUAL_ENABLEBIT(1)
+#define OV5645_TIMING_TC_REG20 0x3820
+#defineOV5645_SENSOR_VFLIP BIT(1)
+#defineOV5645_ISP_VFLIPBIT(2)
+#define OV5645_TIMING_TC_REG21 0x3821
+#defineOV5645_SENSOR_MIRRORBIT(1)
+#define OV5645_PRE_ISP_TEST_SETTING_1  0x503d
+#defineOV5645_TEST_PATTERN_MASK0x3
+#defineOV5645_SET_TEST_PATTERN(x)  ((x) & 
OV5645_TEST_PATTERN_MASK)
+#defineOV5645_TEST_PATTERN_ENABLE  BIT(7)
+#define OV5645_SDE_SAT_U   0x5583
+#define OV5645_SDE_SAT_V   0x5584
+
+enum ov5645_mode {
+   OV5645_MODE_MIN = 0,
+   OV5645_MODE_SXGA = 0,
+   OV5645_MODE_1080P = 1,
+   OV5645_MODE_FULL = 2,
+   

[PATCH v6 1/2] media: i2c/ov5645: add the device tree binding document

2016-09-08 Thread Todor Tomov
Add the document for ov5645 device tree binding.

Signed-off-by: Todor Tomov 
---
 .../devicetree/bindings/media/i2c/ov5645.txt   | 52 ++
 1 file changed, 52 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5645.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ov5645.txt 
b/Documentation/devicetree/bindings/media/i2c/ov5645.txt
new file mode 100644
index 000..bcf6dba
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov5645.txt
@@ -0,0 +1,52 @@
+* Omnivision 1/4-Inch 5Mp CMOS Digital Image Sensor
+
+The Omnivision OV5645 is a 1/4-Inch CMOS active pixel digital image sensor with
+an active array size of 2592H x 1944V. It is programmable through a serial I2C
+interface.
+
+Required Properties:
+- compatible: Value should be "ovti,ov5645".
+- clocks: Reference to the xclk clock.
+- clock-names: Should be "xclk".
+- clock-frequency: Frequency of the xclk clock.
+- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH.
+- reset-gpios: Chip reset GPIO. Polarity is GPIO_ACTIVE_LOW.
+- vdddo-supply: Chip digital IO regulator.
+- vdda-supply: Chip analog regulator.
+- vddd-supply: Chip digital core regulator.
+
+The device node must contain one 'port' child node for its digital output
+video port, in accordance with the video interface bindings defined in
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+{
+   ...
+
+   ov5645: ov5645@78 {
+   compatible = "ovti,ov5645";
+   reg = <0x78>;
+
+   enable-gpios = < 6 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 20 GPIO_ACTIVE_LOW>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_rear_default>;
+
+   clocks = < 200>;
+   clock-names = "xclk";
+   clock-frequency = <2388>;
+
+   vdddo-supply = <_dovdd_1v8>;
+   vdda-supply = <_avdd_2v8>;
+   vddd-supply = <_dvdd_1v2>;
+
+   port {
+   ov5645_ep: endpoint {
+   clock-lanes = <1>;
+   data-lanes = <0 2>;
+   remote-endpoint = <_ep>;
+   };
+   };
+   };
+   };
-- 
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 v6 0/2] OV5645 camera sensor driver

2016-09-08 Thread Todor Tomov
This is the sixth version of the OV5645 camera sensor driver patchset.

Changes since version 5 include:
- external clock frequency set in DT;
- added v4l2_subdev_pad_ops.init_cfg function to initialize formats;
- current sensor mode not updated if set_fmt is TRY (not ACTIVE);
- other small changes - debug messages removed, register addresses defines
  renamed, redundant safety checks removed, unnecessary labels removed,
  mutex_destroy added.

Two one-line changes since version 4:
- return current format on set_format;
- return all frame sizes when enumerating them.

Only one change since version 3:
- build failure on kernel v4.7-rc1 fixed:
  s/media_entity_init/media_entity_pads_init/

Changes from version 2 include:
- external camera clock configuration is moved from DT to driver;
- pwdn-gpios renamed to enable-gpios;
- switched polarity of reset-gpios to the more intuitive active low;
- added Kconfig dependency to OF;
- return values checks;
- regulators and gpios are now required (not optional);
- regulators names renamed;
- power counter variable changed to a bool power state;
- ov5645_registered() is removed and sensor id reading moved to probe().

Changes from version 1 include:
- patch split to dt binding doc patch and driver patch;
- changes in power on/off logic - s_power is now not called on
  open/close;
- using assigned-clock-rates in dt for setting camera external
  clock rate;
- correct api for gpio handling;
- return values checks;
- style fixes.

Todor Tomov (2):
  media: i2c/ov5645: add the device tree binding document
  media: Add a driver for the ov5645 camera sensor.

 .../devicetree/bindings/media/i2c/ov5645.txt   |   52 +
 drivers/media/i2c/Kconfig  |   12 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/ov5645.c | 1372 
 4 files changed, 1437 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5645.txt
 create mode 100644 drivers/media/i2c/ov5645.c

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


Re: [PATCH v3 02/10] v4l: ctrls: Add deinterlacing mode control

2016-09-08 Thread Kieran Bingham
On 07/09/16 23:25, Laurent Pinchart wrote:
> The menu control selects the operation mode of a video deinterlacer. The
> menu entries are driver specific.

Excellent. This makes a lot more sense than adding a custom control in
the driver :D

> Signed-off-by: Laurent Pinchart 

Reviewed-by: Kieran Bingham 

> ---
>  Documentation/media/uapi/v4l/extended-controls.rst | 4 
>  drivers/media/v4l2-core/v4l2-ctrls.c   | 2 ++
>  include/uapi/linux/v4l2-controls.h | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst 
> b/Documentation/media/uapi/v4l/extended-controls.rst
> index 1f1518e4859d..8e6314e23cd3 100644
> --- a/Documentation/media/uapi/v4l/extended-controls.rst
> +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> @@ -4250,6 +4250,10 @@ Image Process Control IDs
>  test pattern images. These hardware specific test patterns can be
>  used to test if a device is working properly.
>  
> +``V4L2_CID_DEINTERLACING_MODE (menu)``
> +The video deinterlacing mode (such as Bob, Weave, ...). The menu items 
> are
> +driver specific.
> +
>  
>  .. _dv-controls:
>  
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
> b/drivers/media/v4l2-core/v4l2-ctrls.c
> index adc2147fcff7..47001e25fd9e 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -885,6 +885,7 @@ const char *v4l2_ctrl_get_name(u32 id)
>   case V4L2_CID_LINK_FREQ:return "Link Frequency";
>   case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
>   case V4L2_CID_TEST_PATTERN: return "Test Pattern";
> + case V4L2_CID_DEINTERLACING_MODE:   return "Deinterlacing Mode";
>  
>   /* DV controls */
>   /* Keep the order of the 'case's the same as in v4l2-controls.h! */
> @@ -1058,6 +1059,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
> v4l2_ctrl_type *type,
>   case V4L2_CID_DV_RX_RGB_RANGE:
>   case V4L2_CID_DV_RX_IT_CONTENT_TYPE:
>   case V4L2_CID_TEST_PATTERN:
> + case V4L2_CID_DEINTERLACING_MODE:
>   case V4L2_CID_TUNE_DEEMPHASIS:
>   case V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL:
>   case V4L2_CID_DETECT_MD_MODE:
> diff --git a/include/uapi/linux/v4l2-controls.h 
> b/include/uapi/linux/v4l2-controls.h
> index b6a357a5f053..0d2e1e01fbd5 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -892,6 +892,7 @@ enum v4l2_jpeg_chroma_subsampling {
>  #define V4L2_CID_LINK_FREQ   (V4L2_CID_IMAGE_PROC_CLASS_BASE 
> + 1)
>  #define V4L2_CID_PIXEL_RATE  (V4L2_CID_IMAGE_PROC_CLASS_BASE 
> + 2)
>  #define V4L2_CID_TEST_PATTERN
> (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
> +#define V4L2_CID_DEINTERLACING_MODE  (V4L2_CID_IMAGE_PROC_CLASS_BASE 
> + 4)
>  
>  
>  /*  DV-class control IDs defined by V4L2 */
> 

-- 
Regards

Kieran Bingham
--
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 05/10] v4l: fdp1: vb2_queue dev conversion

2016-09-08 Thread Kieran Bingham
On 07/09/16 23:25, Laurent Pinchart wrote:
> From: Geert Uytterhoeven 
> 
> drivers/media/platform/rcar_fdp1.c:1972:2: warning: initialization from 
> incompatible pointer type
>   .queue_setup  = fdp1_queue_setup,
>   ^
> drivers/media/platform/rcar_fdp1.c:1972:2: warning: (near initialization 
> for 'fdp1_qops.queue_setup')
> drivers/media/platform/rcar_fdp1.c: In function 'fdp1_probe':
> drivers/media/platform/rcar_fdp1.c:2264:2: error: implicit declaration of 
> function 'vb2_dma_contig_init_ctx' [-Werror=implicit-function-declaration]
>   fdp1->alloc_ctx = vb2_dma_contig_init_ctx(>dev);
>   ^
> drivers/media/platform/rcar_fdp1.c:2264:18: warning: assignment makes 
> pointer from integer without a cast
>   fdp1->alloc_ctx = vb2_dma_contig_init_ctx(>dev);
> ^
> drivers/media/platform/rcar_fdp1.c:2331:2: error: implicit declaration of 
> function 'vb2_dma_contig_cleanup_ctx' [-Werror=implicit-function-declaration]
>   vb2_dma_contig_cleanup_ctx(fdp1->alloc_ctx);
>   ^
> 
> Commit 36c0f8b32c4bd4f6 ("[media] vb2: replace void *alloc_ctxs by
> struct device *alloc_devs") removed the vb2_dma_contig_init_ctx() and
> vb2_dma_contig_cleanup_ctx() functions, and changed the prototype of
> vb2_ops.queue_setup().
> 
> To fix this:
>   - Update the signature of fdp1_queue_setup(),
>   - Convert the FDP1 driver to use the new vb2_queue dev field, cfr.
> commit 53ddcc683faef8c7 ("[media] media/platform: convert drivers to
> use the new vb2_queue dev field").
> 
> Signed-off-by: Geert Uytterhoeven 

This looks like a good fix to me. Tested, and verified as well.

Reviewed-by: Kieran Bingham 

> ---
>  drivers/media/platform/rcar_fdp1.c | 26 ++
>  1 file changed, 6 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar_fdp1.c 
> b/drivers/media/platform/rcar_fdp1.c
> index c7280183262a..a2587745ca68 100644
> --- a/drivers/media/platform/rcar_fdp1.c
> +++ b/drivers/media/platform/rcar_fdp1.c
> @@ -570,7 +570,6 @@ struct fdp1_dev {
>   void __iomem*regs;
>   unsigned intirq;
>   struct device   *dev;
> - void*alloc_ctx;
>  
>   /* Job Queues */
>   struct fdp1_job jobs[FDP1_NUMBER_JOBS];
> @@ -1788,7 +1787,8 @@ static const struct v4l2_ioctl_ops fdp1_ioctl_ops = {
>  
>  static int fdp1_queue_setup(struct vb2_queue *vq,
>   unsigned int *nbuffers, unsigned int *nplanes,
> - unsigned int sizes[], void *alloc_ctxs[])
> + unsigned int sizes[],
> + struct device *alloc_ctxs[])
>  {
>   struct fdp1_ctx *ctx = vb2_get_drv_priv(vq);
>   struct fdp1_q_data *q_data;
> @@ -1800,18 +1800,13 @@ static int fdp1_queue_setup(struct vb2_queue *vq,
>   if (*nplanes > FDP1_MAX_PLANES)
>   return -EINVAL;
>  
> - for (i = 0; i < *nplanes; i++)
> - alloc_ctxs[i] = ctx->fdp1->alloc_ctx;
> -
>   return 0;
>   }
>  
>   *nplanes = q_data->format.num_planes;
>  
> - for (i = 0; i < *nplanes; i++) {
> + for (i = 0; i < *nplanes; i++)
>   sizes[i] = q_data->format.plane_fmt[i].sizeimage;
> - alloc_ctxs[i] = ctx->fdp1->alloc_ctx;
> - }
>  
>   return 0;
>  }
> @@ -1992,6 +1987,7 @@ static int queue_init(void *priv, struct vb2_queue 
> *src_vq,
>   src_vq->mem_ops = _dma_contig_memops;
>   src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>   src_vq->lock = >fdp1->dev_mutex;
> + src_vq->dev = ctx->fdp1->dev;
>  
>   ret = vb2_queue_init(src_vq);
>   if (ret)
> @@ -2005,6 +2001,7 @@ static int queue_init(void *priv, struct vb2_queue 
> *src_vq,
>   dst_vq->mem_ops = _dma_contig_memops;
>   dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>   dst_vq->lock = >fdp1->dev_mutex;
> + dst_vq->dev = ctx->fdp1->dev;
>  
>   return vb2_queue_init(dst_vq);
>  }
> @@ -2260,18 +2257,11 @@ static int fdp1_probe(struct platform_device *pdev)
>   fdp1->clk_rate = clk_get_rate(clk);
>   clk_put(clk);
>  
> - /* Memory allocation contexts */
> - fdp1->alloc_ctx = vb2_dma_contig_init_ctx(>dev);
> - if (IS_ERR(fdp1->alloc_ctx)) {
> - v4l2_err(>v4l2_dev, "Failed to init memory allocator\n");
> - return PTR_ERR(fdp1->alloc_ctx);
> - }
> -
>   /* V4L2 device registration */
>   ret = v4l2_device_register(>dev, >v4l2_dev);
>   if (ret) {
>   v4l2_err(>v4l2_dev, "Failed to register video device\n");
> - goto vb2_allocator_rollback;
> + return ret;
>   }
>  
>   /* M2M registration */
> @@ -2327,9 +2317,6 @@ release_m2m:
>  unreg_dev:
>   v4l2_device_unregister(>v4l2_dev);
>  
> 

Re: [PATCH 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver

2016-09-08 Thread Hans Verkuil

On 09/08/16 11:11, Tiffany Lin wrote:

Hi Hans,

On Thu, 2016-09-08 at 09:21 +0200, Hans Verkuil wrote:

Hi Tiffany,

On 09/07/2016 08:56 AM, Tiffany Lin wrote:

This patch series add Mediatek compressed block format V4L2_PIX_FMT_MT21C, the
decoder driver will decoded bitstream to V4L2_PIX_FMT_MT21C format.

User space applications could use MT8173 MDP driver to convert 
V4L2_PIX_FMT_MT21C to
V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.

MDP driver[1] is stand alone driver.

Usage:
MT21C -> MT8173 MDP -> NV12M/YUV420M/YVU420
NV12M/NV21M/YUV420M/YVU420M -> mt8173 Encoder -> H264/VP8
H264/VP8/VP9 -> mtk8173 Decoder -> MT21C

When encode with MT21 source, the pipeline will be:
MT21C -> MDP driver-> NV12M/NV21M/YUV420M/YVU420M -> Encoder -> H264/VP8

When playback, the pipeline will be:
H264/VP8/VP9 -> Decoder driver -> MT21C -> MDP Driver -> DRM

[1]https://patchwork.kernel.org/patch/9305329/

Tiffany Lin (4):
  v4l: add Mediatek compressed video block format
  docs-rst: Add compressed video formats used on MT8173 codec driver
  vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
  arm64: dts: mediatek: Add Video Decoder for MT8173

 Documentation/media/uapi/v4l/pixfmt-reserved.rst   |6 +++
 arch/arm64/boot/dts/mediatek/mt8173.dtsi   |   44 
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c |7 +++-
 drivers/media/v4l2-core/v4l2-ioctl.c   |1 +
 include/uapi/linux/videodev2.h |1 +
 5 files changed, 58 insertions(+), 1 deletion(-)



So basically the video decoder is useless without support for this format and
without the MDP driver, right?


Yes. It also require new vpu firmware.
Andrew will help release new vpu firmware include encode/decode/mdp
capability.


OK, then I'll park this until:

- the MT21C patch series is OK
- the MDP patch series is OK
- the new firmware is released

For the record: the decoder patch series is OK as far as I am concerned.
It's in my mtkdec branch.

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: [PATCH v5 0/5] Add MT8173 MDP Driver

2016-09-08 Thread Hans Verkuil
FYI: I'm missing a MAINTAINERS entry for this driver.

Please add one when you post v6.

Thanks!

Hans

On 08/30/2016 02:25 PM, Minghsiu Tsai wrote:
> Changes in v5:
> - Add ack in the comment of dts patch 
> - Fix s/g_selection()
> - Separate format V4L2_PIX_FMT_MT21C into new patch  
> 
> Changes in v4:
> - Add "depends on HAS_DMA" in Kconfig.
> - Fix s/g_selection()
> - Replace struct v4l2_crop with u32 and struct v4l2_rect
> - Remove VB2_USERPTR
> - Move mutex lock after ctx allocation in mtk_mdp_m2m_open()
> - Add new format V4L2_PIX_FMT_YVU420 to support software on Android platform.
> - Only width/height of image in format V4L2_PIX_FMT_MT21 is aligned to 16/16,
>   other ones are aligned to 2/2 by default
> 
> Changes in v3:
> - Modify device ndoe as structured one.
> - Fix conflict in dts on Linux 4.8-rc1
> 
> Changes in v2:
> - Add section to describe blocks function in dts-bindings
> - Remove the assignment of device_caps in querycap()
> - Remove format's name assignment
> - Copy colorspace-related parameters from OUTPUT to CAPTURE
> - Use m2m helper functions
> - Fix DMA allocation failure
> - Initialize lazily vpu instance in streamon()
> 
> ==
>  Introduction
> ==
> 
> The purpose of this series is to add the driver for Media Data Path HW 
> embedded in the Mediatek's MT8173 SoC.
> MDP is used for scaling and color space conversion.
> 
> It could convert V4L2_PIX_FMT_MT21 to V4L2_PIX_FMT_NV12M or 
> V4L2_PIX_FMT_YUV420M.
> 
> NV12M/YUV420M/MT21 -> MDP -> NV12M/YUV420M
> 
> This patch series rely on MTK VPU driver in patch series "Add MT8173 Video 
> Encoder Driver and VPU Driver"[1] and "Add MT8173 Video Decoder Driver"[2].
> MDP driver rely on VPU driver to load, communicate with VPU.
> 
> Internally the driver uses videobuf2 framework and MTK IOMMU and MTK SMI both 
> have been merged in v4.6-rc1.
> 
> [1]https://patchwork.kernel.org/patch/9002171/
> [2]https://patchwork.kernel.org/patch/9141245/
> 
> ==
>  Device interface
> ==
> 
> In principle the driver bases on v4l2 memory-to-memory framework:
> it provides a single video node and each opened file handle gets its own 
> private context with separate buffer queues. Each context consist of 2 buffer 
> queues: OUTPUT (for source buffers) and CAPTURE (for destination buffers).
> OUTPUT and CAPTURE buffer could be MMAP or DMABUF memory type.
> 
> v4l2-compliance test output:
> # v4l2-compliance -d /dev/image-proc0
> v4l2-compliance SHA   : a737a6161485fffb70bf51e4fd7f6e2d910174c1
> 
> Driver Info:
> Driver name   : mtk-mdp
> Card type : soc:mdp
> Bus info  : platform:mt8173
> Driver version: 4.8.0
> Capabilities  : 0x84204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> Device Capabilities
> Device Caps   : 0x04204000
> Video Memory-to-Memory Multiplanar
> Streaming
> Extended Pix Format
> 
> Compliance test for device /dev/image-proc0 (not using libv4l2):
> 
> Required ioctls:
> test VIDIOC_QUERYCAP: OK
> 
> Allow for multiple opens:
> test second video open: OK
> test VIDIOC_QUERYCAP: OK
> test VIDIOC_G/S_PRIORITY: OK
> test for unlimited opens: OK
> 
> Debug ioctls:
> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> test VIDIOC_QUERYCTRL: OK
> test VIDIOC_G/S_CTRL: OK
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 5 Private Controls: 0
> 
> Format ioctls:
> test 

Re: [PATCH 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver

2016-09-08 Thread Hans Verkuil
Hi Tiffany,

On 09/07/2016 08:56 AM, Tiffany Lin wrote:
> This patch series add Mediatek compressed block format V4L2_PIX_FMT_MT21C, the
> decoder driver will decoded bitstream to V4L2_PIX_FMT_MT21C format.
> 
> User space applications could use MT8173 MDP driver to convert 
> V4L2_PIX_FMT_MT21C to
> V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
> 
> MDP driver[1] is stand alone driver.
> 
> Usage:
> MT21C -> MT8173 MDP -> NV12M/YUV420M/YVU420
> NV12M/NV21M/YUV420M/YVU420M -> mt8173 Encoder -> H264/VP8
> H264/VP8/VP9 -> mtk8173 Decoder -> MT21C
> 
> When encode with MT21 source, the pipeline will be:
> MT21C -> MDP driver-> NV12M/NV21M/YUV420M/YVU420M -> Encoder -> H264/VP8
> 
> When playback, the pipeline will be:
> H264/VP8/VP9 -> Decoder driver -> MT21C -> MDP Driver -> DRM
> 
> [1]https://patchwork.kernel.org/patch/9305329/
> 
> Tiffany Lin (4):
>   v4l: add Mediatek compressed video block format
>   docs-rst: Add compressed video formats used on MT8173 codec driver
>   vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
>   arm64: dts: mediatek: Add Video Decoder for MT8173
> 
>  Documentation/media/uapi/v4l/pixfmt-reserved.rst   |6 +++
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi   |   44 
> 
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c |7 +++-
>  drivers/media/v4l2-core/v4l2-ioctl.c   |1 +
>  include/uapi/linux/videodev2.h |1 +
>  5 files changed, 58 insertions(+), 1 deletion(-)
> 

So basically the video decoder is useless without support for this format and
without the MDP driver, right?

I'm wondering if I should hold off on merging the decoder driver until these two
are in. What is the timeline for v6 of the MDP driver?

If a v6 is posted early next week, then I have time to review and (assuming it 
is
OK) I can make a pull request for both this driver and the MDP driver.

If it takes longer, then there is a good chance that it will slip to 4.10. I 
will
have very little time in the period September 20 - October 14.

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: [PATCH 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver

2016-09-08 Thread Tiffany Lin
Hi Hans,

On Wed, 2016-09-07 at 11:23 +0200, Hans Verkuil wrote:
> On 09/07/16 08:56, Tiffany Lin wrote:
> > Add V4L2_PIX_FMT_MT21C documentation
> >
> > Signed-off-by: Tiffany Lin 
> > ---
> >  Documentation/media/uapi/v4l/pixfmt-reserved.rst |6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst 
> > b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > index 0dd2f7f..2e21fbc 100644
> > --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > @@ -339,7 +339,13 @@ please make a proposal on the linux-media mailing list.
> >   array. Anything what's in between the UYVY lines is JPEG data and
> >   should be concatenated to form the JPEG stream.
> >
> > +-  .. _V4L2-PIX-FMT-MT21C:
> >
> > +   -  ``V4L2_PIX_FMT_MT21C``
> > +
> > +   -  'MT21C'
> > +
> > +   -  Compressed two-planar YVU420 format used by Mediatek MT8173.
> 
> This really needs to be expanded.
> 
> Ideally this should reference the precise specification of this format if
> available.
> 

> It certainly should explain which HW blocks of the mediatek SoC use this
> format, it should explain that is it meant as an opaque intermediate format
> between those blocks.
> 

Yes. it is an opaque intermediate format.
VDEC HW only output MT21C format, and it need MDP HW to convert to other
standard format.

At first, we plan to put "convert MT21C to other standard format" in our
v4l2 decoder driver, actually in VPU firmware.
In this case, there is no need to expose MT21C format to user space.

But consider that MDP is a stand alone HW (interrupt, power, clk),
combine decode and format convert in one decode step impact performance.
VDEC HW and MDP HW could process different frame at same time.
MDP may also used by other modules to do format convert, not only VDEC.

That's why we need to expose MT21C to user space.
When user space application enumerate VDEC and display HW and found that
the format is not match.
It need to use MDP driver to do format convert.


> If you have some characteristics (i.e. is it lossy or lossless 
> compression, I
> presume it's lossless), then that will be useful to add as well.
> 
I will update this in next version.


best regards,
Tiffany

> We like to have as much information about formats as possible.
> 
> Regards,
> 
>   Hans
> 
> >
> >  .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
> >
> >


--
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 01/10] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field

2016-09-08 Thread Sakari Ailus
On Thu, Sep 08, 2016 at 01:25:01AM +0300, Laurent Pinchart wrote:
> The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
> the reserved fields of the v4l2_format structure after the pix_mp
> member. However, the reserved fields are inside pix_mp, not after it.
> 
> Signed-off-by: Laurent Pinchart 
> Tested-by: Kieran Bingham 

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.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


Re: [PATCH] [media] VPU: mediatek: fix null pointer dereference on pdev

2016-09-08 Thread Tiffany Lin
On Wed, 2016-09-07 at 18:10 +0100, Colin King wrote:
> From: Colin Ian King 
> 
> pdev is being null checked, however, prior to that it is being
> dereferenced by platform_get_drvdata.  Move the assignments of
> vpu and run to after the pdev null check to avoid a potential
> null pointer dereference.
> 

Reviewed-by:Tiffany Lin 

> Signed-off-by: Colin Ian King 
> ---
>  drivers/media/platform/mtk-vpu/mtk_vpu.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c 
> b/drivers/media/platform/mtk-vpu/mtk_vpu.c
> index c9bf58c..43907a3 100644
> --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
> +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
> @@ -523,9 +523,9 @@ static int load_requested_vpu(struct mtk_vpu *vpu,
>  
>  int vpu_load_firmware(struct platform_device *pdev)
>  {
> - struct mtk_vpu *vpu = platform_get_drvdata(pdev);
> + struct mtk_vpu *vpu;
>   struct device *dev = >dev;
> - struct vpu_run *run = >run;
> + struct vpu_run *run;
>   const struct firmware *vpu_fw = NULL;
>   int ret;
>  
> @@ -534,6 +534,9 @@ int vpu_load_firmware(struct platform_device *pdev)
>   return -EINVAL;
>   }
>  
> + vpu = platform_get_drvdata(pdev);
> + run = >run;
> +
>   mutex_lock(>vpu_mutex);
>   if (vpu->fw_loaded) {
>   mutex_unlock(>vpu_mutex);


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


Re: [PATCH 1/4] exynos4-is: Clear isp-i2c adapter power.ignore_children flag

2016-09-08 Thread Sylwester Nawrocki
On 09/07/2016 10:38 PM, Linus Walleij wrote:
> On Thu, Sep 1, 2016 at 1:47 PM, Wolfram Sang  wrote:
>> On Thu, Sep 01, 2016 at 01:39:16PM +0200, Sylwester Nawrocki wrote:
> 
>>> Since commit 04f59143b571161d25315dd52d7a2ecc022cb71a
>>> ("i2c: let I2C masters ignore their children for PM")
>>> the power.ignore_children flag is set when registering an I2C
>>> adapter. Since I2C transfers are not managed by the fimc-isp-i2c
>>> driver its clients use pm_runtime_* calls directly to communicate
>>> required power state of the bus controller.
>>> However when the power.ignore_children flag is set that doesn't
>>> work, so clear that flag back after registering the adapter.
>>> While at it drop pm_runtime_enable() call on the i2c_adapter
>>> as it is already done by the I2C subsystem when registering
>>> I2C adapter.
>>>
>>> Cc:  # 4.7+
>>> Reported-by: Marek Szyprowski 
>>> Signed-off-by: Sylwester Nawrocki 
> 
> I understand what the patch is doing but not this commit message.
> 
> What does it mean when you say "Since I2C transfers are not
> managed by the fimc-isp-i2c driver its clients use pm_runtime_*
> calls directly to communicate required power state of the bus
> controller."?
> 
> I find it very hard to understand.

When a video device node is opened the I2C client (v4l2 subdevice)
in its s_power() handler makes pm_runtime_get/pm_runtime_put calls
on its corresponding i2c_client.  It's true we use an imitation of
I2C bus adapter just to make things work with standard DT bindings
and except of device instantiation this adapter's task is just
to control the clock.
I admit that it's all an odd use case, it comes from the fact that
the image sensor devices are handled in the ISP's firmware, where
normally we have an I2C client driver for each sensor in V4L2.

Now, I don't like those pm_runtime_* calls in the sensor drivers
as that's a non standard thing.  The other option to fix the
regression which I have been considering is to remove the whole
PM runtime dependency and make the driver of the I2C controller's
parent device [1] handle the clocks, as it's done with clocks of
some other IP blocks in that whole camera subsystem.  Probably
it's the lesser of two evils.

> The intent of the commit is to decouple I2C slave devices'
> runtime PM state from their parents, so say a gyroscope on an
> I2C bus does not have to bring up it's host controller to be
> active, for example it usually has an IRQ line to wake up
> the driver and that will talk using I2C and the I2C traffic will
> wake up the I2C master.
> 
> When I look at the driver it appears it is not even used for
> I2C traffic, just to take the clocks up and down and make it
> possible to manage a clock using runtime PM and interface
> with the DT logic... so I guess since it's likely and odd one-off
> and the driver is sufficiently weird anyways, it's fine to merge
> this patch making it even weirder.

Yeah, it's an odd one-off, there is no other drivers in mainline
with such a "non standard" split of hardware control responsibility
between main CPU and the ISP's MCU.

I'd merge the $subject patch as a regression fix for 4.7 and 4.8
and then think about a little larger patch moving the clock handling
responsibility the the ISP_I2C controller's parent driver.

> Maybe a sort of mock adapter type should actually be
> created in the I2C core for these things so it can be handled
> there but who am I to say.

Not sure if we need it right now, probably if there is more such
use cases we could think about something like this.

[1] http://lxr.linux.no/#linux+v4.7.3/arch/arm/boot/dts/exynos4x12.dtsi#L148

-- 
Thanks,
Sylwester
--
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] docs-rst: ignore arguments on macro definitions

2016-09-08 Thread Mauro Carvalho Chehab
Hi Jon/Markus,

Em Mon, 29 Aug 2016 16:12:39 +0200
Markus Heiser  escreveu:

> Am 29.08.2016 um 15:13 schrieb Mauro Carvalho Chehab 
> :
> 
> > A macro definition is mapped via .. c:function:: at the
> > ReST markup when using the following kernel-doc tag:
> > 
> > /**
> >  * DMX_FE_ENTRY - Casts elements in the list of registered
> >  *   front-ends from the generic type struct list_head
> >  *   to the type * struct dmx_frontend
> >  *
> >  * @list: list of struct dmx_frontend
> >  */
> >  #define DMX_FE_ENTRY(list) \
> > list_entry(list, struct dmx_frontend, connectivity_list)
> > 
> > However, unlike a function description, the arguments of a macro
> > doesn't contain the data type.
> > 
> > This causes warnings when enabling Sphinx on nitkpick mode,
> > like this one:
> > ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
> > not found: list  
> 
> I think this is a drawback of sphinx's C-domain, using function
> definition for macros also. From the function documentation
> 
>  """This is also used to describe function-like preprocessor
> macros. The names of the arguments should be given so
> they may be used in the description."""
> 
> I think about to fix the nitpick message for macros (aka function
> directive) in the C-domain extension (we already have).
> 
> But for this, I need a rule to distinguish between macros
> and functions ... is the uppercase of the macro name a good
> rule to suppress the nitpick message? Any other suggestions?

What's the status of the C domain patches meant to fix this issue?

I managed to fix most warnings on media documents on nitpick mode.
With this patch applied, there are only 21 warnings (and all are
due to the lack of function or struct documentation). I'm about
to patchbomb such fixup series.

Yet, without  this patch, and latest docs-next, there are 20 extra
bogus warnings, due to function parameters:

 ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
target not found: offs
 ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
target not found: num
 ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
target not found: byte
 ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target not 
found: list
 ./include/media/media-device.h:263: WARNING: c:type reference target not 
found: mdev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: mdev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: udev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: name
 ./include/media/media-entity.h:527: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:536: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:545: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:554: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:563: WARNING: c:type reference target not 
found: intf
 ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
found: entity
 ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
found: operation
 ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
hdl
 ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
nr_of_controls_hint

So, it would be great if we could either merge this patch or the ones that
Markus did (assuming they're ready for merge).

Regards,
Mauro

> 
> -- Markus --
> 
> > 
> > That happens because kernel-doc output for the above is:
> > 
> > .. c:function:: DMX_FE_ENTRY ( list)
> > 
> >Casts elements in the list of registered front-ends from the generic 
> > type struct list_head to the type * struct dmx_frontend
> > 
> > **Parameters**
> > 
> > ``list``
> >   list of struct dmx_frontend
> > 
> > As the type is blank, Sphinx would think that ``list`` is a type,
> > and will try to add a cross reference for it, using their internal
> > representation for c:type:`list`.
> > 
> > However, ``list`` is not a type. So, that would cause either the
> > above warning, or if a ``list`` type exists, it would create
> > a reference to the wrong place at the doc.
> > 
> > To avoid that, let's ommit macro arguments from c:function::
> > declaration. As each argument will appear below the Parameters,
> > the type of the argument can be described there, if needed.
> > 
> > Signed-off-by: Mauro Carvalho Chehab 

[PATCH 34/47] [media] fix broken references on dvb/video*rst

2016-09-08 Thread Mauro Carvalho Chehab
Trivially fix those broken references, by copying the structs
fron the header, just like other API documentation at the
DVB side.

This doesn't have the level of quality used at the V4L2 side
of the API, but, as this documents a deprecated API, used
only by av7110 driver, it doesn't make much sense to invest
time making it better.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/video-command.rst | 30 ++
 Documentation/media/uapi/dvb/video-get-event.rst   | 17 
 Documentation/media/uapi/dvb/video-get-navi.rst| 10 +++-
 Documentation/media/uapi/dvb/video-get-size.rst| 10 
 Documentation/media/uapi/dvb/video-get-status.rst  | 11 
 .../media/uapi/dvb/video-select-source.rst | 10 
 .../media/uapi/dvb/video-set-attributes.rst| 16 
 .../media/uapi/dvb/video-set-display-format.rst|  2 +-
 Documentation/media/uapi/dvb/video-set-format.rst  |  9 +++
 .../media/uapi/dvb/video-set-highlight.rst | 26 ++-
 .../media/uapi/dvb/video-set-spu-palette.rst   | 10 +++-
 Documentation/media/uapi/dvb/video-set-spu.rst | 11 +++-
 include/uapi/linux/dvb/video.h |  3 ++-
 13 files changed, 159 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/dvb/video-command.rst 
b/Documentation/media/uapi/dvb/video-command.rst
index 4772562036f1..536d0fdd8399 100644
--- a/Documentation/media/uapi/dvb/video-command.rst
+++ b/Documentation/media/uapi/dvb/video-command.rst
@@ -59,6 +59,36 @@ subset of the ``v4l2_decoder_cmd`` struct, so refer to the
 :ref:`VIDIOC_DECODER_CMD` documentation for
 more information.
 
+.. c:type:: struct video_command
+
+.. code-block:: c
+
+   /* The structure must be zeroed before use by the application
+   This ensures it can be extended safely in the future. */
+   struct video_command {
+   __u32 cmd;
+   __u32 flags;
+   union {
+   struct {
+   __u64 pts;
+   } stop;
+
+   struct {
+   /* 0 or 1000 specifies normal speed,
+   1 specifies forward single stepping,
+   -1 specifies backward single stepping,
+   >1: playback at speed/1000 of the normal speed,
+   <-1: reverse playback at (-speed/1000) of the 
normal speed. */
+   __s32 speed;
+   __u32 format;
+   } play;
+
+   struct {
+   __u32 data[16];
+   } raw;
+   };
+   };
+
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-event.rst 
b/Documentation/media/uapi/dvb/video-get-event.rst
index 8c0c622c380b..6ad14cdb894a 100644
--- a/Documentation/media/uapi/dvb/video-get-event.rst
+++ b/Documentation/media/uapi/dvb/video-get-event.rst
@@ -64,6 +64,23 @@ included in the exceptfds argument, and for poll(), POLLPRI 
should be
 specified as the wake-up condition. Read-only permissions are sufficient
 for this ioctl call.
 
+.. c:type:: video_event
+
+.. code-block:: c
+
+   struct video_event {
+   __s32 type;
+   #define VIDEO_EVENT_SIZE_CHANGED1
+   #define VIDEO_EVENT_FRAME_RATE_CHANGED  2
+   #define VIDEO_EVENT_DECODER_STOPPED 3
+   #define VIDEO_EVENT_VSYNC   4
+   __kernel_time_t timestamp;
+   union {
+   video_size_t size;
+   unsigned int frame_rate;/* in frames per 
1000sec */
+   unsigned char vsync_field;  /* 
unknown/odd/even/progressive */
+   } u;
+   };
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-navi.rst 
b/Documentation/media/uapi/dvb/video-get-navi.rst
index b8de9ccf38c2..114a9ac48b9e 100644
--- a/Documentation/media/uapi/dvb/video-get-navi.rst
+++ b/Documentation/media/uapi/dvb/video-get-navi.rst
@@ -16,7 +16,7 @@ VIDEO_GET_NAVI
 Synopsis
 
 
-.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , video_navi_pack_t *navipack)
+.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , struct video_navi_pack 
*navipack)
 :name: VIDEO_GET_NAVI
 
 
@@ -54,6 +54,14 @@ This ioctl returns navigational information from the DVD 
stream. This is
 especially needed if an encoded stream has to be decoded by the
 hardware.
 
+.. c:type:: video_navi_pack
+
+.. code-block::c
+
+   typedef struct video_navi_pack {
+   int length;  /* 0 ... 1024 */
+   __u8 data[1024];
+   } video_navi_pack_t;
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-size.rst 
b/Documentation/media/uapi/dvb/video-get-size.rst

[PATCH 31/47] [media] ca-get-slot-info.rst: document struct ca_slot_info

2016-09-08 Thread Mauro Carvalho Chehab
Add documentation for struct ca_slot_info and for the two
sets of define used by it, according with what's there at the
ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-slot-info.rst | 84 ++-
 1 file changed, 83 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-slot-info.rst 
b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
index fcecd80e30d4..4398aeb83eb7 100644
--- a/Documentation/media/uapi/dvb/ca-get-slot-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
@@ -26,7 +26,89 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``info``
-  Undocumented.
+  Pointer to struct c:type:`ca_slot_info`.
+
+.. _ca_slot_info_type:
+
+.. flat-table:: ca_slot_info types
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+   - CA_CI
+   - 1
+   - CI high level interface
+
+-
+   - CA_CI_LINK
+   - 2
+   - CI link layer level interface
+
+-
+   - CA_CI_PHYS
+   - 4
+   - CI physical layer level interface
+
+-
+   - CA_DESCR
+   - 8
+   - built-in descrambler
+
+-
+   - CA_SC
+   - 128
+   - simple smart card interface
+
+.. _ca_slot_info_flag:
+
+.. flat-table:: ca_slot_info flags
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+   - CA_CI_MODULE_PRESENT
+   - 1
+   - module (or card) inserted
+
+-
+   - CA_CI_MODULE_READY
+   - 2
+   -
+
+.. c:type:: ca_slot_info
+
+.. flat-table:: struct ca_slot_info
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+   - int
+   - num
+   - slot number
+
+-
+   - int
+   - type
+   - CA interface this slot supports, as defined at 
:ref:`ca_slot_info_type`.
+
+-
+   - unsigned int
+   - flags
+   - flags as defined at :ref:`ca_slot_info_flag`.
 
 
 Description
-- 
2.7.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 09/47] [media] mc-core.rst: Fix cross-references to the source

2016-09-08 Thread Mauro Carvalho Chehab
The cross-reference to "struct media_pad" was pointing to
a place that doesn't exist. Fix it, and adjust the second
reference on the same paragraph to use the same text.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/mc-core.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/kapi/mc-core.rst 
b/Documentation/media/kapi/mc-core.rst
index 569cfc4f01cd..fb839a6c1f46 100644
--- a/Documentation/media/kapi/mc-core.rst
+++ b/Documentation/media/kapi/mc-core.rst
@@ -85,8 +85,9 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad`, making the
-:c:type:`media_pad` pointer the canonical way to store and pass link 
references.
+Both information are stored in the :c:type:`struct media_pad `,
+making the :c:type:`struct media_pad ` pointer the canonical way
+to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
 
-- 
2.7.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 26/47] [media] v4l2-subdev.h: fix a doc nitpick warning

2016-09-08 Thread Mauro Carvalho Chehab
One markup tag is wrong here.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-subdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 6e1d044e3ee8..2c1e328ccb1d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -226,7 +226,7 @@ struct v4l2_subdev_core_ops {
  *
  * @g_tuner: callback for %VIDIOC_G_TUNER ioctl handler code.
  *
- * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. >type must be
+ * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. @vt->type must be
  *  filled in. Normally done by video_ioctl2 or the
  *  bridge driver.
  *
-- 
2.7.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 45/47] [media] media-ioc-g-topology.rst: fix a c domain reference

2016-09-08 Thread Mauro Carvalho Chehab
One reference there is still using :ref:. Fix it, to solve this
warning:
  Documentation/media/uapi/mediactl/media-ioc-g-topology.rst:236: WARNING: 
undefined label: media-v2-intf-devnode (if the link has no caption the label 
must precede a section header)

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/mediactl/media-ioc-g-topology.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst 
b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
index 0b26fd865b72..48c9531f4db0 100644
--- a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
+++ b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
@@ -234,7 +234,7 @@ desired arrays with the media graph elements.
-  ``devnode``
 
-  Used only for device node interfaces. See
- :ref:`media-v2-intf-devnode` for details..
+ :c:type:`media_v2_intf_devnode` for details..
 
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
-- 
2.7.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 36/47] [media] docs-rst: fix cec bad cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Fix some CEC cross references that are broken.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/cec.h.rst.exceptions  |  6 --
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 10 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst  |  9 +
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/Documentation/media/cec.h.rst.exceptions 
b/Documentation/media/cec.h.rst.exceptions
index b79339433718..b1687532742f 100644
--- a/Documentation/media/cec.h.rst.exceptions
+++ b/Documentation/media/cec.h.rst.exceptions
@@ -1,12 +1,6 @@
 # Ignore header name
 ignore define _CEC_UAPI_H
 
-# Rename some symbols, to avoid namespace conflicts
-replace struct cec_event_state_change cec-event-state-change_s
-replace struct cec_event_lost_msgs cec-event-lost-msgs_s
-replace enum cec_mode_initiator cec-mode-initiator_e
-replace enum cec_mode_follower cec-mode-follower_e
-
 # define macros to ignore
 
 ignore define CEC_MAX_MSG_SIZE
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index bd0756ff022e..6c314c2db73e 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -30,7 +30,7 @@ Arguments
 File descriptor returned by :c:func:`open() `.
 
 ``argp``
-Pointer to struct cec_log_addrs
+Pointer to struct :c:type:`cec_log_addrs`.
 
 Description
 ===
@@ -42,10 +42,10 @@ Description
 
 To query the current CEC logical addresses, applications call
 :ref:`ioctl CEC_ADAP_G_LOG_ADDRS ` with a pointer to a
-:c:type:`struct cec_log_addrs` where the driver stores the logical addresses.
+struct :c:type:`cec_log_addrs` where the driver stores the logical addresses.
 
 To set new logical addresses, applications fill in
-:c:type:`struct cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
+struct :c:type:`cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
 with a pointer to this struct. The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
 is only available if ``CEC_CAP_LOG_ADDRS`` is set (the ``ENOTTY`` error code is
 returned otherwise). The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
@@ -66,10 +66,10 @@ logical addresses are claimed or cleared.
 Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS ` 
when
 logical address types are already defined will return with error ``EBUSY``.
 
-.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
-
 .. c:type:: cec_log_addrs
 
+.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
+
 .. cssclass:: longtable
 
 .. flat-table:: struct cec_log_addrs
diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst 
b/Documentation/media/uapi/cec/cec-ioc-receive.rst
index f015f1259b27..18620f81b7d9 100644
--- a/Documentation/media/uapi/cec/cec-ioc-receive.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -40,7 +40,8 @@ Description
and is currently only available as a staging kernel module.
 
 To receive a CEC message the application has to fill in the
-``timeout`` field of :c:type:`struct cec_msg` and pass it to :ref:`ioctl 
CEC_RECEIVE `.
+``timeout`` field of struct :c:type:`cec_msg` and pass it to
+:ref:`ioctl CEC_RECEIVE `.
 If the file descriptor is in non-blocking mode and there are no received
 messages pending, then it will return -1 and set errno to the ``EAGAIN``
 error code. If the file descriptor is in blocking mode and ``timeout``
@@ -54,9 +55,9 @@ A received message can be:
 2. the result of an earlier non-blocking transmit (the ``sequence`` field will
be non-zero).
 
-To send a CEC message the application has to fill in the
-:c:type:`struct cec_msg` and pass it to
-:ref:`ioctl CEC_TRANSMIT `. The :ref:`ioctl CEC_TRANSMIT 
` is only available if
+To send a CEC message the application has to fill in the struct
+:c:type:` cec_msg` and pass it to :ref:`ioctl CEC_TRANSMIT `.
+The :ref:`ioctl CEC_TRANSMIT ` is only available if
 ``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit
 queue, then it will return -1 and set errno to the ``EBUSY`` error code.
 The transmit queue has enough room for 18 messages (about 1 second worth
-- 
2.7.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 08/47] [media] demux.h: Fix a few documentation issues

2016-09-08 Thread Mauro Carvalho Chehab
demux.h was lacking documentation for the DMX_FE_ENTRY macro:
./drivers/media/dvb-core/demux.h:511: WARNING: c:func reference target 
not found: DMX_FE_ENTRY

While here, get rid of unused parameters and fix a few minor issues
at the header file.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/demux.h | 36 
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/media/dvb-core/demux.h b/drivers/media/dvb-core/demux.h
index 4b4c1da20f4b..0d9c53518be2 100644
--- a/drivers/media/dvb-core/demux.h
+++ b/drivers/media/dvb-core/demux.h
@@ -202,7 +202,7 @@ struct dmx_section_feed {
  *
  * This function callback prototype, provided by the client of the demux API,
  * is called from the demux code. The function is only called when filtering
- * on ae TS feed has been enabled using the start_filtering() function at
+ * on a TS feed has been enabled using the start_filtering\(\) function at
  * the _demux.
  * Any TS packets that match the filter settings are copied to a circular
  * buffer. The filtered TS packets are delivered to the client using this
@@ -243,8 +243,10 @@ struct dmx_section_feed {
  * will also be sent to the hardware MPEG decoder.
  *
  * Return:
- * 0, on success;
- * -EOVERFLOW, on buffer overflow.
+ *
+ * - 0, on success;
+ *
+ * - -EOVERFLOW, on buffer overflow.
  */
 typedef int (*dmx_ts_cb)(const u8 *buffer1,
 size_t buffer1_length,
@@ -293,9 +295,9 @@ typedef int (*dmx_section_cb)(const u8 *buffer1,
  size_t buffer2_len,
  struct dmx_section_filter *source);
 
-/*--*/
-/* DVB Front-End */
-/*--*/
+/*
+ * DVB Front-End
+ */
 
 /**
  * enum dmx_frontend_source - Used to identify the type of frontend
@@ -349,15 +351,15 @@ enum dmx_demux_caps {
 
 /*
  * Demux resource type identifier.
-*/
-
-/*
- * DMX_FE_ENTRY(): Casts elements in the list of registered
- * front-ends from the generic type struct list_head
- * to the type * struct dmx_frontend
- *.
-*/
+ */
 
+/**
+ * DMX_FE_ENTRY - Casts elements in the list of registered
+ *   front-ends from the generic type struct list_head
+ *   to the type * struct dmx_frontend
+ *
+ * @list: list of struct dmx_frontend
+ */
 #define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)
 
@@ -551,7 +553,6 @@ enum dmx_demux_caps {
  * 0 on success;
  * -EINVAL on bad parameter.
  */
-
 struct dmx_demux {
enum dmx_demux_caps capabilities;
struct dmx_frontend *frontend;
@@ -581,11 +582,6 @@ struct dmx_demux {
 
int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
-   /* private: Not used upstream and never documented */
-#if 0
-   int (*get_caps)(struct dmx_demux *demux, struct dmx_caps *caps);
-   int (*set_source)(struct dmx_demux *demux, const dmx_source_t *src);
-#endif
/*
 * private: Only used at av7110, to read some data from firmware.
 *  As this was never documented, we have no clue about what's
-- 
2.7.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 40/47] [media] libv4l-introdution.rst: fix function definitions

2016-09-08 Thread Mauro Carvalho Chehab
c:type is not the right tag for function definitions.
Replace them by .. c:function::

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/v4l/libv4l-introduction.rst | 62 --
 1 file changed, 35 insertions(+), 27 deletions(-)

diff --git a/Documentation/media/uapi/v4l/libv4l-introduction.rst 
b/Documentation/media/uapi/v4l/libv4l-introduction.rst
index 61d085f9f105..1c1278d17fa7 100644
--- a/Documentation/media/uapi/v4l/libv4l-introduction.rst
+++ b/Documentation/media/uapi/v4l/libv4l-introduction.rst
@@ -116,45 +116,53 @@ The common file operation methods are provided by libv4l.
 Those functions operate just like glibc
 open/close/dup/ioctl/read/mmap/munmap:
 
--  :c:type:`int v4l2_open(const char *file, int oflag, ...)` - operates like 
the
-   standard :ref:`open() ` function.
+.. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
--  :c:type:`int v4l2_close(int fd)` - operates like the standard
-   :ref:`close() ` function.
+   operates like the standard :ref:`open() ` function.
 
--  :c:type:`int v4l2_dup(int fd)` - operates like the standard dup() function,
-   duplicating a file handler.
+.. c:function:: int v4l2_close(int fd)
 
--  :c:type:`int v4l2_ioctl (int fd, unsigned long int request, ...)` - operates
-   like the standard :ref:`ioctl() ` function.
+   operates like the standard :ref:`close() ` function.
 
--  :c:type:`int v4l2_read (int fd, void* buffer, size_t n)` - operates like the
-   standard :ref:`read() ` function.
+.. c:function:: int v4l2_dup(int fd)
 
--  :c:type:`void v4l2_mmap(void *start, size_t length, int prot, int flags, int
-   fd, int64_t offset);` - operates like the standard
-   :ref:`mmap() ` function.
+   operates like the standard dup() function, duplicating a file handler.
 
--  :c:type:`int v4l2_munmap(void *_start, size_t length);` - operates like the
-   standard :ref:`munmap() ` function.
+.. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
+
+   operates like the standard :ref:`ioctl() ` function.
+
+.. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
+
+   operates like the standard :ref:`read() ` function.
+
+.. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int 
flags, int fd, int64_t offset);
+
+   operates like the standard :ref:`mmap() ` function.
+
+.. c:function:: int v4l2_munmap(void *_start, size_t length);
+   operates like the standard :ref:`munmap() ` function.
 
 Those functions provide additional control:
 
--  :c:type:`int v4l2_fd_open(int fd, int v4l2_flags)` - opens an already opened
-   fd for further use through v4l2lib and possibly modify libv4l2's
-   default behavior through the v4l2_flags argument. Currently,
-   v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable format
-   conversion.
+.. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
--  :c:type:`int v4l2_set_control(int fd, int cid, int value)` - This function
-   takes a value of 0 - 65535, and then scales that range to the actual
-   range of the given v4l control id, and then if the cid exists and is
+   opens an already opened fd for further use through v4l2lib and possibly
+   modify libv4l2's default behavior through the v4l2_flags argument.
+   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   format conversion.
+
+.. c:function:: int v4l2_set_control(int fd, int cid, int value)
+
+   This function takes a value of 0 - 65535, and then scales that range to the
+   actual range of the given v4l control id, and then if the cid exists and is
not locked sets the cid to the scaled value.
 
--  :c:type:`int v4l2_get_control(int fd, int cid)` - This function returns a
-   value of 0 - 65535, scaled to from the actual range of the given v4l
-   control id. when the cid does not exist, could not be accessed for
-   some reason, or some error occurred 0 is returned.
+.. c:function:: int v4l2_get_control(int fd, int cid)
+
+   This function returns a value of 0 - 65535, scaled to from the actual range
+   of the given v4l control id. when the cid does not exist, could not be
+   accessed for some reason, or some error occurred 0 is returned.
 
 
 v4l1compat.so wrapper library
-- 
2.7.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 42/47] [media] hist-v4l2.rst: don't do refs to old structures

2016-09-08 Thread Mauro Carvalho Chehab
Several structs were renamed or removed during V4L2 development.
Don't try to cross-reference the legacy ones.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/hist-v4l2.rst | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index b18fb7e6c39a..d86d6343a20a 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -30,14 +30,14 @@ aliases ``O_NONCAP`` and ``O_NOIO`` were defined. 
Applications can set
 this flag if they intend to access controls only, as opposed to capture
 applications which need exclusive access. The ``VIDEO_STD_XXX``
 identifiers are now ordinals instead of flags, and the
-:c:func:`video_std_construct()` helper function takes id and
+``video_std_construct()`` helper function takes id and
 transmission arguments.
 
 1998-09-28: Revamped video standard. Made video controls individually
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-struct :c:type:`video_standard` and the color subcarrier fields were
+struct ``video_standard`` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT ` to
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT ` and
 :ref:`VIDIOC_S_FMT ` ioctls may fail now if the struct
-struct :c:type:`v4l2_fmt` ``type`` field does not contain
+struct ``v4l2_fmt`` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 originally needed to distguish between variations of standards, were
 removed.
 
-Struct struct :c:type:`v4l2_enumstd` ceased to be.
+Struct ``v4l2_enumstd`` ceased to be.
 :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
 struct :c:type:`v4l2_standard` directly. The
 information which standards are supported by a particular video
@@ -671,11 +671,11 @@ This unnamed version was finally merged into Linux 2.5.46.
 distinguish between field and frame (interlaced) overlay.
 
 17. The digital zoom interface, including struct
-struct :c:type:`v4l2_zoomcap`, struct
-struct :c:type:`v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
+struct ``v4l2_zoomcap``, struct
+struct ``v4l2_zoom``, ``V4L2_ZOOM_NONCAP`` and
 ``V4L2_ZOOM_WHILESTREAMING`` was replaced by a new cropping and
 scaling interface. The previously unused struct
-struct :c:type:`v4l2_cropcap` and :c:type:`struct v4l2_crop`
+struct :c:type:`v4l2_cropcap` and struct :c:type:`v4l2_crop`
 where redefined for this purpose. See :ref:`crop` for details.
 
 18. In struct :c:type:`v4l2_vbi_format` the
@@ -694,7 +694,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 Similar changes were made to struct
 :c:type:`v4l2_outputparm`.
 
-20. The struct :c:type:`v4l2_performance` and
+20. The struct ``v4l2_performance`` and
 ``VIDIOC_G_PERF`` ioctl were dropped. Except when using the
 :ref:`read/write I/O method `, which is limited anyway, this
 information is already available to applications.
@@ -882,7 +882,7 @@ V4L2 in Linux 2.6.15
 3. The ``VIDIOC_G_COMP`` and ``VIDIOC_S_COMP`` ioctl were renamed to
``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` respectively. Their
argument was replaced by a struct
-   struct :c:type:`v4l2_mpeg_compression` pointer. (The
+   ``v4l2_mpeg_compression`` pointer. (The
``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls where removed
in Linux 2.6.25.)
 
@@ -982,7 +982,7 @@ V4L2 in Linux 2.6.18
flag to skip unsupported controls with
:ref:`VIDIOC_QUERYCTRL`, new control types
``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_TYPE_CTRL_CLASS``
-   (:ref:`v4l2-ctrl-type`), and new control flags
+   (:c:type:`v4l2_ctrl_type`), and new control flags
``V4L2_CTRL_FLAG_READ_ONLY``, ``V4L2_CTRL_FLAG_UPDATE``,
``V4L2_CTRL_FLAG_INACTIVE`` and ``V4L2_CTRL_FLAG_SLIDER``
(:ref:`control-flags`). See :ref:`extended-controls` for details.
@@ -1127,8 +1127,8 @@ V4L2 in Linux 2.6.29
 1. The ``VIDIOC_G_CHIP_IDENT`` ioctl was renamed to
``VIDIOC_G_CHIP_IDENT_OLD`` and ``VIDIOC_DBG_G_CHIP_IDENT`` was
introduced in its place. The old struct
-   struct :c:type:`v4l2_chip_ident` was renamed to
-   struct :c:type:`v4l2_chip_ident_old`.
+   struct ``v4l2_chip_ident`` was renamed to
+   struct ``v4l2_chip_ident_old``.
 
 2. The pixel formats ``V4L2_PIX_FMT_VYUY``, ``V4L2_PIX_FMT_NV16`` and
``V4L2_PIX_FMT_NV61`` were added.
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a 

[PATCH 12/47] [media] conf_nitpick.py: ignore external functions used on mediactl

2016-09-08 Thread Mauro Carvalho Chehab
There are some functions/macros used by the mediactl documentation
that are alien to the media subsystem. Ignore them.

After this patch, the media core will only complain about this
static function:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference 
target not found: media_devnode_release

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 4de9533ce361..1c7928abace5 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -28,6 +28,7 @@ nitpick_ignore = [
 ("c:func", "i2c_new_device"),
 ("c:func", "ioctl"),
 ("c:func", "IS_ERR"),
+("c:func", "KERNEL_VERSION"),
 ("c:func", "mmap"),
 ("c:func", "open"),
 ("c:func", "pci_name"),
@@ -66,6 +67,7 @@ nitpick_ignore = [
 ("c:type", "off_t"),
 ("c:type", "pci_dev"),
 ("c:type", "pdvbdev"),
+("c:type", "platform_device"),
 ("c:type", "pollfd"),
 ("c:type", "poll_table_struct"),
 ("c:type", "s32"),
@@ -93,5 +95,6 @@ nitpick_ignore = [
 ("c:type", "union"),
 ("c:type", "__user"),
 ("c:type", "usb_device"),
+("c:type", "usb_interface"),
 ("c:type", "video_system_t"),
 ]
-- 
2.7.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 17/47] [media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()

2016-09-08 Thread Mauro Carvalho Chehab
The prepare_ext_ctrls() function is actually internal to the
v4l2-ctrls.c implementation, so it doesn't have a declaration
for the kAPI header to reference it.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index a63f37044f1c..ff2847705dac 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -239,7 +239,7 @@ struct v4l2_ctrl {
  * @next:  Single-link list node for the hash.
  * @ctrl:  The actual control information.
  * @helper:Pointer to helper struct. Used internally in
- * prepare_ext_ctrls().
+ * ``prepare_ext_ctrls`` function at ``v4l2-ctrl.c``.
  *
  * Each control handler has a list of these refs. The list_head is used to
  * keep a sorted-by-control-ID list of all controls, while the next pointer
-- 
2.7.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 10/47] [media] demux.h: fix a documentation warning

2016-09-08 Thread Mauro Carvalho Chehab
The kernel-doc parser didn't handle well the private:
tag. Rewrite it.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/demux.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-core/demux.h b/drivers/media/dvb-core/demux.h
index 0d9c53518be2..aeda2b64931c 100644
--- a/drivers/media/dvb-core/demux.h
+++ b/drivers/media/dvb-core/demux.h
@@ -582,10 +582,12 @@ struct dmx_demux {
 
int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
+   /* private: */
+
/*
-* private: Only used at av7110, to read some data from firmware.
-*  As this was never documented, we have no clue about what's
-*  there, and its usage on other drivers aren't encouraged.
+* Only used at av7110, to read some data from firmware.
+* As this was never documented, we have no clue about what's
+* there, and its usage on other drivers aren't encouraged.
 */
int (*get_stc)(struct dmx_demux *demux, unsigned int num,
   u64 *stc, unsigned int *base);
-- 
2.7.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 13/47] [media] rc-map.h: document structs/enums on it

2016-09-08 Thread Mauro Carvalho Chehab
There are some structs/enums that aren't documented via
kernel-doc markup. Add documentation for them.

Fix those warnings:
./include/media/rc-map.h:103: WARNING: c:type reference target not found: 
rc_map_list
./include/media/rc-map.h:110: WARNING: c:type reference target not found: 
rc_map_list
./include/media/rc-map.h:117: WARNING: c:type reference target not found: rc_map

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/rc-map.h | 94 ++
 1 file changed, 71 insertions(+), 23 deletions(-)

diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index daa75fcc1ff1..173ad58fb61b 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -11,27 +11,51 @@
 
 #include 
 
+/**
+ * enum rc_type - type of the Remote Controller protocol
+ *
+ * @RC_TYPE_UNKNOWN: Protocol not known
+ * @RC_TYPE_OTHER: Protocol known but proprietary
+ * @RC_TYPE_RC5: Philips RC5 protocol
+ * @RC_TYPE_RC5X: Philips RC5x protocol
+ * @RC_TYPE_RC5_SZ: StreamZap variant of RC5
+ * @RC_TYPE_JVC: JVC protocol
+ * @RC_TYPE_SONY12: Sony 12 bit protocol
+ * @RC_TYPE_SONY15: Sony 15 bit protocol
+ * @RC_TYPE_SONY20: Sony 20 bit protocol
+ * @RC_TYPE_NEC: NEC protocol
+ * @RC_TYPE_SANYO: Sanyo protocol
+ * @RC_TYPE_MCE_KBD: RC6-ish MCE keyboard/mouse
+ * @RC_TYPE_RC6_0: Philips RC6-0-16 protocol
+ * @RC_TYPE_RC6_6A_20: Philips RC6-6A-20 protocol
+ * @RC_TYPE_RC6_6A_24: Philips RC6-6A-24 protocol
+ * @RC_TYPE_RC6_6A_32: Philips RC6-6A-32 protocol
+ * @RC_TYPE_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocol
+ * @RC_TYPE_SHARP: Sharp protocol
+ * @RC_TYPE_XMP: XMP protocol
+ * @RC_TYPE_CEC: CEC protocol
+ */
 enum rc_type {
-   RC_TYPE_UNKNOWN = 0,/* Protocol not known */
-   RC_TYPE_OTHER   = 1,/* Protocol known but proprietary */
-   RC_TYPE_RC5 = 2,/* Philips RC5 protocol */
-   RC_TYPE_RC5X= 3,/* Philips RC5x protocol */
-   RC_TYPE_RC5_SZ  = 4,/* StreamZap variant of RC5 */
-   RC_TYPE_JVC = 5,/* JVC protocol */
-   RC_TYPE_SONY12  = 6,/* Sony 12 bit protocol */
-   RC_TYPE_SONY15  = 7,/* Sony 15 bit protocol */
-   RC_TYPE_SONY20  = 8,/* Sony 20 bit protocol */
-   RC_TYPE_NEC = 9,/* NEC protocol */
-   RC_TYPE_SANYO   = 10,   /* Sanyo protocol */
-   RC_TYPE_MCE_KBD = 11,   /* RC6-ish MCE keyboard/mouse */
-   RC_TYPE_RC6_0   = 12,   /* Philips RC6-0-16 protocol */
-   RC_TYPE_RC6_6A_20   = 13,   /* Philips RC6-6A-20 protocol */
-   RC_TYPE_RC6_6A_24   = 14,   /* Philips RC6-6A-24 protocol */
-   RC_TYPE_RC6_6A_32   = 15,   /* Philips RC6-6A-32 protocol */
-   RC_TYPE_RC6_MCE = 16,   /* MCE (Philips RC6-6A-32 subtype) 
protocol */
-   RC_TYPE_SHARP   = 17,   /* Sharp protocol */
-   RC_TYPE_XMP = 18,   /* XMP protocol */
-   RC_TYPE_CEC = 19,   /* CEC protocol */
+   RC_TYPE_UNKNOWN = 0,
+   RC_TYPE_OTHER   = 1,
+   RC_TYPE_RC5 = 2,
+   RC_TYPE_RC5X= 3,
+   RC_TYPE_RC5_SZ  = 4,
+   RC_TYPE_JVC = 5,
+   RC_TYPE_SONY12  = 6,
+   RC_TYPE_SONY15  = 7,
+   RC_TYPE_SONY20  = 8,
+   RC_TYPE_NEC = 9,
+   RC_TYPE_SANYO   = 10,
+   RC_TYPE_MCE_KBD = 11,
+   RC_TYPE_RC6_0   = 12,
+   RC_TYPE_RC6_6A_20   = 13,
+   RC_TYPE_RC6_6A_24   = 14,
+   RC_TYPE_RC6_6A_32   = 15,
+   RC_TYPE_RC6_MCE = 16,
+   RC_TYPE_SHARP   = 17,
+   RC_TYPE_XMP = 18,
+   RC_TYPE_CEC = 19,
 };
 
 #define RC_BIT_NONE0ULL
@@ -76,21 +100,45 @@ enum rc_type {
 #define RC_SCANCODE_RC6_0(sys, cmd)(((sys) << 8) | (cmd))
 #define RC_SCANCODE_RC6_6A(vendor, sys, cmd)   (((vendor) << 16) | ((sys) << 
8) | (cmd))
 
+/**
+ * struct rc_map_table - represents a scancode/keycode pair
+ *
+ * @scancode: scan code (u32)
+ * @keycode: Linux input keycode
+ */
 struct rc_map_table {
u32 scancode;
u32 keycode;
 };
 
+/**
+ * struct rc_map - represents a keycode map table
+ *
+ * @scan: pointer to struct _map_table
+ * @size: Max number of entries
+ * @len: Number of entries that are in use
+ * @alloc: size of *scan, in bytes
+ * @rc_type: type of the remote controller protocol, as defined at
+ *  enum _type
+ * @name: name of the key map table
+ * @lock: lock to protect access to this structure
+ */
 struct rc_map {
struct rc_map_table *scan;
-   unsigned intsize;   /* Max number of entries */
-   unsigned intlen;/* Used number of entries */
-   unsigned intalloc;  /* Size of *scan in bytes */
+   unsigned intsize;
+   unsigned 

[PATCH 33/47] [media] docs-rst: fix the remaining broken links for DVB CA API

2016-09-08 Thread Mauro Carvalho Chehab
Several links are broken, as they were using the typedef
name, instead of using the corresponding structs. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-cap.rst| 4 ++--
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 2 +-
 Documentation/media/uapi/dvb/ca-get-msg.rst| 2 +-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  | 2 +-
 Documentation/media/uapi/dvb/ca-send-msg.rst   | 4 ++--
 Documentation/media/uapi/dvb/ca-set-descr.rst  | 6 +++---
 Documentation/media/uapi/dvb/ca-set-pid.rst| 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-cap.rst 
b/Documentation/media/uapi/dvb/ca-get-cap.rst
index 77c57ac59535..fbf7e359cb8a 100644
--- a/Documentation/media/uapi/dvb/ca-get-cap.rst
+++ b/Documentation/media/uapi/dvb/ca-get-cap.rst
@@ -15,7 +15,7 @@ CA_GET_CAP
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_CAP, ca_caps_t *caps)
+.. c:function:: int ioctl(fd, CA_GET_CAP, struct ca_caps *caps)
 :name: CA_GET_CAP
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``caps``
-  struct :c:type:`ca_caps` pointer
+  Pointer to struct :c:type:`ca_caps`.
 
 .. c:type:: struct ca_caps
 
diff --git a/Documentation/media/uapi/dvb/ca-get-descr-info.rst 
b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
index b4a31940cec0..7bf327a3d0e3 100644
--- a/Documentation/media/uapi/dvb/ca-get-descr-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
@@ -15,7 +15,7 @@ CA_GET_DESCR_INFO
 Synopsis
 
 
-.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, ca_descr_info_t *desc)
+.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, struct ca_descr_info *desc)
 :name: CA_GET_DESCR_INFO
 
 Arguments
diff --git a/Documentation/media/uapi/dvb/ca-get-msg.rst 
b/Documentation/media/uapi/dvb/ca-get-msg.rst
index 03b2a602f02a..121588da3ef1 100644
--- a/Documentation/media/uapi/dvb/ca-get-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-get-msg.rst
@@ -15,7 +15,7 @@ CA_GET_MSG
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_GET_MSG, struct ca_msg *msg)
 :name: CA_GET_MSG
 
 
diff --git a/Documentation/media/uapi/dvb/ca-get-slot-info.rst 
b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
index 4398aeb83eb7..54e5dc78a2dc 100644
--- a/Documentation/media/uapi/dvb/ca-get-slot-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
@@ -15,7 +15,7 @@ CA_GET_SLOT_INFO
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, ca_slot_info_t *info)
+.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, struct ca_slot_info *info)
 :name: CA_GET_SLOT_INFO
 
 
diff --git a/Documentation/media/uapi/dvb/ca-send-msg.rst 
b/Documentation/media/uapi/dvb/ca-send-msg.rst
index 0c42b10cf4f4..532ef5f9d6ac 100644
--- a/Documentation/media/uapi/dvb/ca-send-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-send-msg.rst
@@ -15,7 +15,7 @@ CA_SEND_MSG
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SEND_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_SEND_MSG, struct ca_msg *msg)
 :name: CA_SEND_MSG
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
 
 
 Description
diff --git a/Documentation/media/uapi/dvb/ca-set-descr.rst 
b/Documentation/media/uapi/dvb/ca-set-descr.rst
index 63dcc2b751ef..70f7b3cf12ad 100644
--- a/Documentation/media/uapi/dvb/ca-set-descr.rst
+++ b/Documentation/media/uapi/dvb/ca-set-descr.rst
@@ -15,8 +15,8 @@ CA_SET_DESCR
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SET_DESCR, ca_descr_t *desc)
-:name:
+.. c:function:: int ioctl(fd, CA_SET_DESCR, struct ca_descr *desc)
+:name: CA_SET_DESCR
 
 
 Arguments
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr`.
 
 
 Description
diff --git a/Documentation/media/uapi/dvb/ca-set-pid.rst 
b/Documentation/media/uapi/dvb/ca-set-pid.rst
index 06bdaf4afada..891c1c72ef24 100644
--- a/Documentation/media/uapi/dvb/ca-set-pid.rst
+++ b/Documentation/media/uapi/dvb/ca-set-pid.rst
@@ -15,7 +15,7 @@ CA_SET_PID
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SET_PID, ca_pid_t *pid)
+.. c:function:: int ioctl(fd, CA_SET_PID, struct ca_pid *pid)
 :name: CA_SET_PID
 
 
-- 
2.7.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 30/47] [media] ca-get-msg.rst: add a boilerplate for struct ca_msg

2016-09-08 Thread Mauro Carvalho Chehab
There are no descriptions at ca.h header for this struct.
Yet, as we want to get rid of the warnings, let's add a
boilerplate, with just the struct types and fields.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-msg.rst | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-msg.rst 
b/Documentation/media/uapi/dvb/ca-get-msg.rst
index 880995230909..03b2a602f02a 100644
--- a/Documentation/media/uapi/dvb/ca-get-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-get-msg.rst
@@ -26,7 +26,38 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
+
+
+.. c:type:: struct ca_msg
+
+.. flat-table:: struct ca_msg
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+   - unsigned int
+   - index
+   -
+
+-
+   - unsigned int
+   - type
+   -
+
+-
+   - unsigned int
+   - length
+   -
+
+-
+   - unsigned char
+   - msg[256]
+   -
 
 
 Description
-- 
2.7.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 21/47] [media] v4l2-ioctl.h: document the remaining functions

2016-09-08 Thread Mauro Carvalho Chehab
There are several undocumented functions here; document them.

While here, make checkpatch.pl happy.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py |   1 +
 include/media/v4l2-ioctl.h  | 502 +---
 2 files changed, 301 insertions(+), 202 deletions(-)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 1c7928abace5..1f3ef3ded2d4 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -96,5 +96,6 @@ nitpick_ignore = [
 ("c:type", "__user"),
 ("c:type", "usb_device"),
 ("c:type", "usb_interface"),
+("c:type", "v4l2_std_id"),
 ("c:type", "video_system_t"),
 ]
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 8b1d19bc9b0e..574ff2ae94be 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -287,273 +287,286 @@ struct v4l2_ioctl_ops {
/* ioctl callbacks */
 
/* VIDIOC_QUERYCAP handler */
-   int (*vidioc_querycap)(struct file *file, void *fh, struct 
v4l2_capability *cap);
+   int (*vidioc_querycap)(struct file *file, void *fh,
+  struct v4l2_capability *cap);
 
/* VIDIOC_ENUM_FMT handlers */
-   int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
  struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
  struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_sdr_out) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
 
/* VIDIOC_G_FMT handlers */
-   int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
struct v4l2_format *f);
-   int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
-   struct v4l2_format *f);
-   int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
-   int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
+   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
+  struct v4l2_format *f);
int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+  struct v4l2_format *f);
int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void 

[PATCH 28/47] [media] ca-get-cap.rst: add a table for struct ca_caps

2016-09-08 Thread Mauro Carvalho Chehab
Add a flat-table describing struct ca_caps, as found at
the source file.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-cap.rst | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-cap.rst 
b/Documentation/media/uapi/dvb/ca-get-cap.rst
index 3486805b62a9..77c57ac59535 100644
--- a/Documentation/media/uapi/dvb/ca-get-cap.rst
+++ b/Documentation/media/uapi/dvb/ca-get-cap.rst
@@ -26,7 +26,34 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``caps``
-  Undocumented.
+  struct :c:type:`ca_caps` pointer
+
+.. c:type:: struct ca_caps
+
+.. flat-table:: struct ca_caps
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+  -unsigned int
+  - slot_num
+  - total number of CA card and module slots
+-
+  - unsigned int
+  - slot_type
+  - bitmask with all supported slot types
+-
+  - unsigned int
+  - descr_num
+  - total number of descrambler slots (keys)
+-
+  - unsigned int
+  - descr_type
+  - bit mask with all supported descr types
 
 
 Description
-- 
2.7.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 27/47] [media] docs-rst exceptions: use C domain references for DVB headers

2016-09-08 Thread Mauro Carvalho Chehab
Now that we moved away from the :ref: type of references,
we need to update the exceptions lists.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/audio.h.rst.exceptions |  6 +-
 Documentation/media/ca.h.rst.exceptions| 32 
 Documentation/media/dmx.h.rst.exceptions   | 85 +++---
 Documentation/media/frontend.h.rst.exceptions  |  8 +-
 Documentation/media/intro.rst  |  2 +-
 Documentation/media/net.h.rst.exceptions   |  4 +-
 .../uapi/dvb/audio-bilingual-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-select-source.rst |  2 +-
 .../media/uapi/dvb/audio-set-attributes.rst|  2 +-
 Documentation/media/uapi/dvb/audio-set-karaoke.rst |  2 +-
 Documentation/media/uapi/dvb/audio-set-mixer.rst   |  2 +-
 Documentation/media/uapi/dvb/audio_data_types.rst  | 31 +---
 Documentation/media/uapi/dvb/dmx_types.rst | 39 --
 Documentation/media/uapi/dvb/fe-bandwidth-t.rst|  5 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  3 -
 .../media/uapi/dvb/fe-diseqc-send-burst.rst|  9 +--
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |  4 +-
 Documentation/media/uapi/dvb/fe-get-info.rst   | 11 +--
 Documentation/media/uapi/dvb/fe-read-status.rst|  8 +-
 Documentation/media/uapi/dvb/fe-set-tone.rst   |  9 +--
 Documentation/media/uapi/dvb/fe-set-voltage.rst|  4 +-
 Documentation/media/uapi/dvb/fe-type-t.rst |  4 +-
 .../media/uapi/dvb/fe_property_parameters.rst  | 69 ++
 Documentation/media/uapi/dvb/net-add-if.rst|  6 --
 Documentation/media/video.h.rst.exceptions | 20 ++---
 26 files changed, 144 insertions(+), 227 deletions(-)

diff --git a/Documentation/media/audio.h.rst.exceptions 
b/Documentation/media/audio.h.rst.exceptions
index 8330edcd906d..f40f3cbfe4c9 100644
--- a/Documentation/media/audio.h.rst.exceptions
+++ b/Documentation/media/audio.h.rst.exceptions
@@ -2,7 +2,7 @@
 ignore define _DVBAUDIO_H_
 
 # Typedef pointing to structs
-replace typedef audio_karaoke_t audio-karaoke
+replace typedef audio_karaoke_t :c:type:`audio_karaoke`
 
 # Undocumented audio caps, as this is a deprecated API anyway
 ignore define AUDIO_CAP_DTS
@@ -16,5 +16,5 @@ ignore define AUDIO_CAP_SDDS
 ignore define AUDIO_CAP_AC3
 
 # some typedefs should point to struct/enums
-replace typedef audio_mixer_t audio-mixer
-replace typedef audio_status_t audio-status
+replace typedef audio_mixer_t :c:type:`audio_mixer`
+replace typedef audio_status_t :c:type:`audio_status`
diff --git a/Documentation/media/ca.h.rst.exceptions 
b/Documentation/media/ca.h.rst.exceptions
index 09c13be67527..d7c9fed8c004 100644
--- a/Documentation/media/ca.h.rst.exceptions
+++ b/Documentation/media/ca.h.rst.exceptions
@@ -2,23 +2,23 @@
 ignore define _DVBCA_H_
 
 # struct ca_slot_info defines
-replace define CA_CI ca-slot-info
-replace define CA_CI_LINK ca-slot-info
-replace define CA_CI_PHYS ca-slot-info
-replace define CA_DESCR ca-slot-info
-replace define CA_SC ca-slot-info
-replace define CA_CI_MODULE_PRESENT ca-slot-info
-replace define CA_CI_MODULE_READY ca-slot-info
+replace define CA_CI :c:type:`ca_slot_info`
+replace define CA_CI_LINK :c:type:`ca_slot_info`
+replace define CA_CI_PHYS :c:type:`ca_slot_info`
+replace define CA_DESCR :c:type:`ca_slot_info`
+replace define CA_SC :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_PRESENT :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_READY :c:type:`ca_slot_info`
 
 # struct ca_descr_info defines
-replace define CA_ECD ca-descr-info
-replace define CA_NDS ca-descr-info
-replace define CA_DSS ca-descr-info
+replace define CA_ECD :c:type:`ca_descr_info`
+replace define CA_NDS :c:type:`ca_descr_info`
+replace define CA_DSS :c:type:`ca_descr_info`
 
 # some typedefs should point to struct/enums
-replace typedef ca_pid_t ca-pid
-replace typedef ca_slot_info_t ca-slot-info
-replace typedef ca_descr_info_t ca-descr-info
-replace typedef ca_caps_t ca-caps
-replace typedef ca_msg_t ca-msg
-replace typedef ca_descr_t ca-descr
+replace typedef ca_pid_t :c:type:`ca_pid`
+replace typedef ca_slot_info_t :c:type:`ca_slot_info`
+replace typedef ca_descr_info_t :c:type:`ca_descr_info`
+replace typedef ca_caps_t :c:type:`ca_caps`
+replace typedef ca_msg_t :c:type:`ca_msg`
+replace typedef ca_descr_t :c:type:`ca_descr`
diff --git a/Documentation/media/dmx.h.rst.exceptions 
b/Documentation/media/dmx.h.rst.exceptions
index 8200653839d2..2fdb458564ba 100644
--- a/Documentation/media/dmx.h.rst.exceptions
+++ b/Documentation/media/dmx.h.rst.exceptions
@@ -4,29 +4,29 @@ ignore define _UAPI_DVBDMX_H_
 # Ignore limit constants
 ignore define DMX_FILTER_SIZE
 
-# dmx-pes-type-t enum symbols
-replace enum dmx_ts_pes dmx-pes-type-t
-replace symbol DMX_PES_AUDIO0 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO0 dmx-pes-type-t
-replace symbol 

[PATCH 04/47] [media] conf_nitpick.py: add external vars to ignore list

2016-09-08 Thread Mauro Carvalho Chehab
There a some other types and functions that aren't declared
inside the media document but are elsewhere. Add them to the
ignore list.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 227deee68c88..4de9533ce361 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -21,8 +21,11 @@ nitpick_ignore = [
 ("c:func", "clock_gettime"),
 ("c:func", "close"),
 ("c:func", "container_of"),
+("c:func", "copy_from_user"),
+("c:func", "copy_to_user"),
 ("c:func", "determine_valid_ioctls"),
 ("c:func", "ERR_PTR"),
+("c:func", "i2c_new_device"),
 ("c:func", "ioctl"),
 ("c:func", "IS_ERR"),
 ("c:func", "mmap"),
@@ -37,6 +40,7 @@ nitpick_ignore = [
 ("c:func", "struct pollfd"),
 ("c:func", "usb_make_path"),
 ("c:func", "write"),
+
 ("c:type", "atomic_t"),
 ("c:type", "bool"),
 ("c:type", "boolean"),
@@ -72,10 +76,10 @@ nitpick_ignore = [
 ("c:type", "spi_device"),
 ("c:type", "spi_master"),
 ("c:type", "ssize_t"),
-("c:type", "struct fb_fix_screeninfo"),
-("c:type", "struct pollfd"),
-("c:type", "struct timeval"),
-("c:type", "struct video_capability"),
+("c:type", "fb_fix_screeninfo"),
+("c:type", "pollfd"),
+("c:type", "timeval"),
+("c:type", "video_capability"),
 ("c:type", "timeval"),
 ("c:type", "__u16"),
 ("c:type", "u16"),
@@ -87,6 +91,7 @@ nitpick_ignore = [
 ("c:type", "uint16_t"),
 ("c:type", "uint32_t"),
 ("c:type", "union"),
+("c:type", "__user"),
 ("c:type", "usb_device"),
 ("c:type", "video_system_t"),
 ]
-- 
2.7.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 38/47] [media] docs-rst: fix some broken struct references

2016-09-08 Thread Mauro Carvalho Chehab
The :c:type: references point to the structure name, and not to
struct foo.

Fixed via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if 
(s/\:c\:type\:\`struct\s*(\S+)\`/struct :c:type:`$1`/) { 
s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  } 
print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-poll.rst |  2 +-
 Documentation/media/uapi/v4l/buffer.rst|  2 +-
 Documentation/media/uapi/v4l/dev-osd.rst   |  4 +--
 Documentation/media/uapi/v4l/hist-v4l2.rst | 34 +-
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst 
b/Documentation/media/uapi/cec/cec-func-poll.rst
index 5bacb7c6f33b..cfb73e6027a5 100644
--- a/Documentation/media/uapi/cec/cec-func-poll.rst
+++ b/Documentation/media/uapi/cec/cec-func-poll.rst
@@ -49,7 +49,7 @@ events.
 
 On success :c:func:`poll()` returns the number of file descriptors
 that have been selected (that is, file descriptors for which the
-``revents`` field of the respective :c:type:`struct pollfd` structure
+``revents`` field of the respective struct :c:type:`pollfd`
 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
 the ``revents`` field if there are messages in the receive queue. If the
 transmit queue has room for new messages, the ``POLLOUT`` and
diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 7b64a1986d66..7d2d81a771b1 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -825,7 +825,7 @@ Timecodes
 
 The struct :c:type:`v4l2_timecode` structure is designed to hold a
 :ref:`smpte12m` or similar timecode. (struct
-:c:type:`struct timeval` timestamps are stored in struct
+struct :c:type:`timeval` timestamps are stored in struct
 :c:type:`v4l2_buffer` field ``timestamp``.)
 
 
diff --git a/Documentation/media/uapi/v4l/dev-osd.rst 
b/Documentation/media/uapi/v4l/dev-osd.rst
index 0b246c31b6a3..71da85ed7e4b 100644
--- a/Documentation/media/uapi/v4l/dev-osd.rst
+++ b/Documentation/media/uapi/v4l/dev-osd.rst
@@ -44,8 +44,8 @@ other information, the physical address of the framebuffer in 
the
 ``base`` field of struct :c:type:`v4l2_framebuffer`.
 The framebuffer device ioctl ``FBIOGET_FSCREENINFO`` returns the same
 address in the ``smem_start`` field of struct
-:c:type:`struct fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
-ioctl and struct :c:type:`struct fb_fix_screeninfo` are defined in
+struct :c:type:`fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
+ioctl and struct :c:type:`fb_fix_screeninfo` are defined in
 the ``linux/fb.h`` header file.
 
 The width and height of the framebuffer depends on the current video
diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index bd45431ed00e..b18fb7e6c39a 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -37,7 +37,7 @@ transmission arguments.
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-:c:type:`struct video_standard` and the color subcarrier fields were
+struct :c:type:`video_standard` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT ` to
@@ -151,7 +151,7 @@ common Linux driver API conventions.
This change obsoletes the following ioctls: ``VIDIOC_S_INFMT``,
``VIDIOC_G_INFMT``, ``VIDIOC_S_OUTFMT``, ``VIDIOC_G_OUTFMT``,
``VIDIOC_S_VBIFMT`` and ``VIDIOC_G_VBIFMT``. The image format
-   structure :c:type:`struct v4l2_format` was renamed to struct
+   structure struct :c:type:`v4l2_format` was renamed to struct
:c:type:`v4l2_pix_format`, while struct
:c:type:`v4l2_format` is now the envelopping structure
for all format negotiations.
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT ` and
 :ref:`VIDIOC_S_FMT ` ioctls may fail now if the struct
-:c:type:`struct v4l2_fmt` ``type`` field does not contain
+struct :c:type:`v4l2_fmt` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 originally needed to distguish between variations of standards, were
 removed.
 
-Struct :c:type:`struct v4l2_enumstd` ceased to be.
+Struct struct :c:type:`v4l2_enumstd` ceased to be.
 :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
 struct :c:type:`v4l2_standard` directly. The
 information which standards are supported by a particular video
@@ -636,7 +636,7 @@ This unnamed version was 

[PATCH 00/47] Fix most of Sphinx warnings in nitpick mode

2016-09-08 Thread Mauro Carvalho Chehab
Before this patch series, there is ~400 warnings when building docs in nitpick 
mode.
That means ~400 broken links.

This patch series move the C references to use Sphinx C domain, instead of 
using :ref:, add more documentation to some V4L2 headers and fix several broken
links. After this series, only 21 errors remain, and they all seem to be due to 
the
lack of documentation that should be there:


 make cleandocs; make DOCBOOKS="" SPHINXOPTS="-j5" SPHINXDIRS=media 
SPHINX_CONF="conf_nitpick.py" htmldocs

./include/media/media-entity.h:1053: warning: No description found for 
parameter '...'
/devel/v4l/patchwork/Documentation/media/kapi/mc-core.rst:97: WARNING: c:func 
reference target not found: media_devnode_release
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func 
reference target not found: vb2_ops_wait_prepare
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func 
reference target not found: vb2_ops_wait_finish
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-fh.rst:56: WARNING: c:type 
reference target not found: v4l2_m2m_ctx
./include/media/v4l2-flash-led-class.h:103: WARNING: c:type reference target 
not found: v4l2_flash_ops
./include/media/v4l2-mem2mem.h:25: WARNING: c:func reference target not found: 
v4l2_m2m_job_finish
./include/media/v4l2-mem2mem.h:36: WARNING: c:func reference target not found: 
v4l2_m2m_job_finish
./include/media/v4l2-mem2mem.h:168: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:180: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:194: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:205: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:216: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:227: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:240: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:251: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-subdev.h:424: WARNING: c:type reference target not found: 
v4l2_sliced_vbi_line
./include/media/v4l2-subdev.h:768: WARNING: c:type reference target not found: 
v4l2_dev
./include/media/videobuf2-core.h:349: WARNING: c:func reference target not 
found: vb2_wait_for_all_buffers
./include/media/videobuf2-core.h:355: WARNING: c:func reference target not 
found: vb2_buffer_done
./include/media/videobuf2-core.h:442: WARNING: c:func reference target not 
found: start_streaming
./include/media/videobuf2-core.h:592: WARNING: c:type reference target not 
found: vb2_thread_fnc

So, it seems to fix the issue of identifying the documentation gaps via nitpick 
mode.

Please notice that the first patch were already submitted, and Markus proposed 
to
fix it via the C domain override extension.

Yet, as it reduces 20 bogus warnings, I'm keeping in this series for the ones
that may want to test this patchset.

As usual, I'm placing those patches on my development tree:

https://git.linuxtv.org//mchehab/experimental.git/log/?h=docs-next

git//linuxtv.org/mchehab/experimental.git docs-next

Jon,

Please notice that patches 2 and 3 touches at 
Documentation/sphinx/parse-headers.pl.

If it is ok for you, I intend to merge those patches (except for patch 1)
on my tree, including the two patches that touch at the parse-headers.pl
script, as, currently, the only user for it is media. I'm also OK if you prefer
to merge patches 2 and 3 on your tree instead.

Regards,
Mauro

Mauro Carvalho Chehab (47):
  kernel-doc: ignore arguments on macro definitions
  docs-rst: parse-headers.pl: make debug a command line option
  docs-rst: parse-headers.pl: use the C domain for cross-references
  [media] conf_nitpick.py: add external vars to ignore list
  [media] dvb_ringbuffer.h: Document all functions
  [media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc
  [media] dvb_ringbuffer.h: document the define macros
  [media] demux.h: Fix a few documentation issues
  [media] mc-core.rst: Fix cross-references to the source
  [media] demux.h: fix a documentation warning
  [media] docs-rst: improve the kAPI documentation for the mediactl
  [media] conf_nitpick.py: ignore external functions used on mediactl
  [media] rc-map.h: document structs/enums on it
  [media] v4l2-ctrls: document some extra data structures
  [media] docs-rst: convert uAPI structs to C domain
  [media] diff-v4l.rst: Fix V4L version 1 references
  [media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()
  [media] docs-rst: use C domain for enum references on uapi
  [media] v4l2-ctrls.h: Fix some c:type references
  [media] cec-ioc-dqevent.rst: fix some undefined references
  [media] v4l2-ioctl.h: document the remaining functions
  [media] v4l2-dev.rst: fix a broken c domain reference
  [media] v4l2-device.h: fix some 

[PATCH 29/47] [media] ca-get-descr-info.rst: add doc for for struct ca_descr_info

2016-09-08 Thread Mauro Carvalho Chehab
The documentation follows what's there at the ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 23 +-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-descr-info.rst 
b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
index b007f10b4910..b4a31940cec0 100644
--- a/Documentation/media/uapi/dvb/ca-get-descr-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
@@ -25,7 +25,28 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``desc``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr_info`.
+
+.. c:type:: struct ca_descr_info
+
+.. flat-table:: struct ca_descr_info
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+  - unsigned int
+  - num
+  - number of available descramblers (keys)
+-
+  - unsigned int
+  - type
+  - type of supported scrambling system. Valid values are:
+   ``CA_ECD``, ``CA_NDS`` and ``CA_DSS``.
 
 
 Description
-- 
2.7.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 03/47] docs-rst: parse-headers.pl: use the C domain for cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Instead of keep using the normal reference, move to the C
domain ones. Using C domains everywhere will allow
cross-references between kAPI and uAPI docs.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 113 ++
 1 file changed, 59 insertions(+), 54 deletions(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 531c710fc73f..db0186a7618f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -57,7 +57,7 @@ while () {
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;
 
-   $enum_symbols{$s} = $n;
+   $enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
 
$is_enum = 0 if ($is_enum && m/\}/);
next;
@@ -69,7 +69,7 @@ while () {
my $n = $1;
$n =~ tr/A-Z/a-z/;
 
-   $ioctls{$s} = $n;
+   $ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
next;
}
 
@@ -79,17 +79,15 @@ while () {
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;
 
-   $defines{$s} = $n;
+   $defines{$s} = "\\ :ref:`$s <$n>`\\ ";
next;
}
 
-   if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
-   my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
+   if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
+   my $s = $2;
+   my $n = $3;
 
-   $typedefs{$s} = $n;
+   $typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
next;
}
if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
@@ -97,11 +95,8 @@ while () {
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
 
-   $enums{$s} = $n;
+   $enums{$s} =  "enum :c:type:`$s`\\ ";
 
$is_enum = $1;
next;
@@ -112,11 +107,8 @@ while () {
|| $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
) {
my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
 
-   $structs{$s} = $n;
+   $structs{$s} = "struct :c:type:`$s`\\ ";
next;
}
 }
@@ -129,12 +121,9 @@ close IN;
 my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
   $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
 foreach my $m (@matches) {
-   my $s = $m;
-   my $n = $m;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
+   my $s = $m;
 
-   $typedefs{$s} = $n;
+   $typedefs{$s} = "\\ :c:type:`$s`\\ ";
next;
 }
 
@@ -142,6 +131,15 @@ foreach my $m (@matches) {
 # Handle exceptions, if any
 #
 
+my %def_reftype = (
+   "ioctl"   => ":ref",
+   "define"  => ":ref",
+   "symbol"  => ":ref",
+   "typedef" => ":c:type",
+   "enum"=> ":c:type",
+   "struct"  => ":c:type",
+);
+
 if ($file_exceptions) {
open IN, $file_exceptions or die "Can't read $file_exceptions";
while () {
@@ -175,29 +173,49 @@ if ($file_exceptions) {
}
 
# Parsers to replace a symbol
+   my ($type, $old, $new, $reftype);
 
-   if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
-   $ioctls{$1} = $2 if (exists($ioctls{$1}));
+   if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
+   $type = $1;
+   $old = $2;
+   $new = $3;
+   } else {
+   die "Can't parse $file_exceptions: $_";
+   }
+
+   if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
+   $reftype = ":c:$1";
+   $new = $2;
+   } elsif ($new =~ m/\:ref\:\`(.+)\`/) {
+   $reftype = ":ref";
+   $new = $1;
+   } else {
+   $reftype = $def_reftype{$type};
+   }
+   $new = "$reftype:`$old <$new>`";
+
+   if ($type eq "ioctl") {
+   $ioctls{$old} = $new if (exists($ioctls{$old}));
next;
}
-   if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
-   $defines{$1} = $2 if (exists($defines{$1}));
+   if ($type eq "define") {
+   $defines{$old} = $new if (exists($defines{$old}));
next;
}
-   if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
-   

[PATCH 02/47] docs-rst: parse-headers.pl: make debug a command line option

2016-09-08 Thread Mauro Carvalho Chehab
Add a parser for the --debug option, in order to allow
seeing what the parser is doing.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 74089b0da798..531c710fc73f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -2,12 +2,18 @@
 use strict;
 use Text::Tabs;
 
-# Uncomment if debug is needed
-#use Data::Dumper;
-
-# change to 1 to generate some debug prints
 my $debug = 0;
 
+while ($ARGV[0] =~ m/^-(.*)/) {
+   my $cmd = shift @ARGV;
+   if ($cmd eq "--debug") {
+   require Data::Dumper;
+   $debug = 1;
+   next;
+   }
+   die "argument $cmd unknown";
+}
+
 if (scalar @ARGV < 2 || scalar @ARGV > 3) {
die "Usage:\n\t$0   []\n";
 }
-- 
2.7.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 25/47] [media] v4l2-subdev.rst: get rid of legacy functions

2016-09-08 Thread Mauro Carvalho Chehab
There are two warnings that are due to functions that has long
gone:

Documentation/media/kapi/v4l2-subdev.rst:417: WARNING: c:func reference 
target not found: v4l2_i2c_new_subdev_cfg
Documentation/media/kapi/v4l2-subdev.rst:436: WARNING: c:func reference 
target not found: v4l2_i2c_new_probed_subdev

Update the documentation to remove those.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/v4l2-subdev.rst | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/Documentation/media/kapi/v4l2-subdev.rst 
b/Documentation/media/kapi/v4l2-subdev.rst
index fcecce01a35c..e1f0b726e438 100644
--- a/Documentation/media/kapi/v4l2-subdev.rst
+++ b/Documentation/media/kapi/v4l2-subdev.rst
@@ -412,19 +412,7 @@ later date. It differs between i2c drivers and as such can 
be confusing.
 To see which chip variants are supported you can look in the i2c driver code
 for the i2c_device_id table. This lists all the possibilities.
 
-There are two more helper functions:
-
-:c:func:`v4l2_i2c_new_subdev_cfg`: this function adds new irq and
-platform_data arguments and has both 'addr' and 'probed_addrs' arguments:
-if addr is not 0 then that will be used (non-probing variant), otherwise the
-probed_addrs are probed.
-
-For example: this will probe for address 0x10:
-
-.. code-block:: c
-
-   struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
- "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
+There are one more helper function:
 
 :c:func:`v4l2_i2c_new_subdev_board` uses an :c:type:`i2c_board_info` struct
 which is passed to the i2c driver and replaces the irq, platform_data and addr
@@ -433,9 +421,10 @@ arguments.
 If the subdev supports the s_config core ops, then that op is called with
 the irq and platform_data arguments after the subdev was setup.
 
-The older :c:func:`v4l2_i2c_new_subdev` and
-:c:func:`v4l2_i2c_new_probed_subdev` functions will call ``s_config`` as
-well, but with irq set to 0 and platform_data set to ``NULL``.
+The :c:func:`v4l2_i2c_new_subdev` function will call
+:c:func:`v4l2_i2c_new_subdev_board`, internally filling a
+:c:type:`i2c_board_info` structure using the ``client_type`` and the
+``addr`` to fill it.
 
 V4L2 sub-device functions and data structures
 -
-- 
2.7.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 07/47] [media] dvb_ringbuffer.h: document the define macros

2016-09-08 Thread Mauro Carvalho Chehab
There are a few define macros not documented, because the ReST
output was causing more warnings.

Now that this got fixed, document them. While here, fix the
remaining coding style issues.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_ringbuffer.h | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index f64bd86fe5fd..eae3f091b6a0 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -97,7 +97,6 @@ extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer 
*rbuf);
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
-
 /*
  * read routines & macros
  */
@@ -117,11 +116,21 @@ extern void dvb_ringbuffer_flush(struct dvb_ringbuffer 
*rbuf);
  */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+/**
+ * DVB_RINGBUFFER_PEEK - peek at byte @offs in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @offs: offset inside the ringbuffer
+ */
 #define DVB_RINGBUFFER_PEEK(rbuf, offs)\
-   (rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
+   ((rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size])
 
-/* advance read ptr by @num: bytes */
+/**
+ * DVB_RINGBUFFER_SKIP - advance read ptr by @num bytes
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @num: number of bytes to advance
+ */
 #define DVB_RINGBUFFER_SKIP(rbuf, num) {\
(rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
 }
@@ -155,12 +164,16 @@ extern ssize_t dvb_ringbuffer_read_user(struct 
dvb_ringbuffer *rbuf,
 extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
   u8 *buf, size_t len);
 
-
 /*
  * write routines & macros
  */
 
-/* write single byte to ring buffer */
+/**
+ * DVB_RINGBUFFER_WRITE_BYTE - write single byte to ring buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @byte: byte to write
+ */
 #define DVB_RINGBUFFER_WRITE_BYTE(rbuf, byte)  \
{ (rbuf)->data[(rbuf)->pwrite] = (byte); \
(rbuf)->pwrite = ((rbuf)->pwrite + 1) % (rbuf)->size; }
@@ -194,7 +207,6 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer 
*rbuf, const u8 *buf,
 extern ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
 const u8 __user *buf, size_t len);
 
-
 /**
  * dvb_ringbuffer_pkt_write - Write a packet into the ringbuffer.
  *
@@ -265,5 +277,4 @@ extern void dvb_ringbuffer_pkt_dispose(struct 
dvb_ringbuffer *rbuf, size_t idx);
 extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf,
   size_t idx, size_t *pktlen);
 
-
 #endif /* _DVB_RINGBUFFER_H_ */
-- 
2.7.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 43/47] [media] docs-rst: fix cross-references for videodev2.h

2016-09-08 Thread Mauro Carvalho Chehab
There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:

# funcs is a file with the broken functions/references
for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); 
do
i=${i//-/_}
echo $i
j=${i//_/-}
for k in $(git grep -l "_$j:" Documentation/); do
sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/media/*.exceptions); 
do
sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/); do
sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a 
$k
sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a 
&& mv a $k
done
for k in $(git grep -l "<$j>" include/media); do
sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a 
$k
done
done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/buffer.rst|  14 +-
 Documentation/media/uapi/v4l/field-order.rst   |   4 +-
 Documentation/media/uapi/v4l/hist-v4l2.rst |  30 +--
 Documentation/media/uapi/v4l/pixfmt-002.rst|  10 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst|  10 +-
 Documentation/media/uapi/v4l/pixfmt-006.rst|  16 +-
 Documentation/media/uapi/v4l/planar-apis.rst   |   2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst|  10 +-
 Documentation/media/uapi/v4l/tuner.rst |   4 +-
 Documentation/media/uapi/v4l/v4l2.rst  |   4 +-
 .../media/uapi/v4l/vidioc-create-bufs.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-cropcap.rst|   2 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst|   2 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   2 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |   2 +-
 .../media/uapi/v4l/vidioc-enum-framesizes.rst  |   2 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-expbuf.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-frequency.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-parm.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-selection.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|   4 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst|   4 +-
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst   |   2 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst |   7 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-size.rst |   6 +-
 .../uapi/v4l/vidioc-subdev-enum-mbus-code.rst  |   6 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst|   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-fmt.rst |   2 +-
 .../uapi/v4l/vidioc-subdev-g-frame-interval.rst|   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-selection.rst   |   4 +-
 Documentation/media/videodev2.h.rst.exceptions | 204 ++---
 41 files changed, 201 insertions(+), 202 deletions(-)

diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index e71a458712d3..21893ee1384a 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -74,7 +74,7 @@ struct v4l2_buffer
-  Type of the buffer, same as struct
  :c:type:`v4l2_format` ``type`` or struct
  :c:type:`v4l2_requestbuffers` ``type``, set
- by the application. See :ref:`v4l2-buf-type`
+ by the application. See :c:type:`v4l2_buf_type`
 
 -  .. row 3
 
@@ -110,7 +110,7 @@ struct v4l2_buffer
 
-
-  Indicates the field order of the image in the buffer, see
- :ref:`v4l2-field`. This field is not used when the buffer
+ :c:type:`v4l2_field`. This field is not used when the buffer
  contains VBI data. Drivers must set it when ``type`` refers to a
  capture stream, applications when it refers to an output stream.
 
@@ -142,7 +142,7 @@ struct v4l2_buffer
-  When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
  ``V4L2_BUF_FLAG_TIMECODE`` flag is set in 

[PATCH 23/47] [media] v4l2-device.h: fix some doc tags

2016-09-08 Thread Mauro Carvalho Chehab
Fix some minor issues at the documentation tags on this file,
adding cross-references where needed, and fixing some broken
ones.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-device.h | 54 ++---
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index a9d6aa41790e..781cbfd168f0 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -39,7 +39,7 @@ struct v4l2_ctrl_handler;
  * if this struct is embedded into a larger struct.
  * @name: unique device name, by default the driver name + bus ID
  * @notify: notify callback called by some sub-devices.
- * @ctrl_handler: The control handler. May be NULL.
+ * @ctrl_handler: The control handler. May be %NULL.
  * @prio: Device's priority state
  * @ref: Keep track of the references to this struct.
  * @release: Release function that is called when the ref count
@@ -53,8 +53,8 @@ struct v4l2_ctrl_handler;
  *
  * .. note::
  *
- *#) dev->driver_data points to this struct.
- *#) dev might be NULL if there is no parent device
+ *#) @dev->driver_data points to this struct.
+ *#) @dev might be %NULL if there is no parent device
  */
 
 struct v4l2_device {
@@ -76,10 +76,10 @@ struct v4l2_device {
 /**
  * v4l2_device_get - gets a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct _device
  *
  * This is an ancillary routine meant to increment the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct _device pointed by @v4l2_dev.
  */
 static inline void v4l2_device_get(struct v4l2_device *v4l2_dev)
 {
@@ -89,23 +89,23 @@ static inline void v4l2_device_get(struct v4l2_device 
*v4l2_dev)
 /**
  * v4l2_device_put - putss a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct _device
  *
  * This is an ancillary routine meant to decrement the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct _device pointed by @v4l2_dev.
  */
 int v4l2_device_put(struct v4l2_device *v4l2_dev);
 
 /**
- * v4l2_device_register -Initialize v4l2_dev and make dev->driver_data
- * point to v4l2_dev.
+ * v4l2_device_register - Initialize v4l2_dev and make @dev->driver_data
+ * point to @v4l2_dev.
  *
- * @dev: pointer to struct device
- * @v4l2_dev: pointer to struct v4l2_device
+ * @dev: pointer to struct 
+ * @v4l2_dev: pointer to struct _device
  *
  * .. note::
- * dev may be NULL in rare cases (ISA devices).
- * In such case the caller must fill in the v4l2_dev->name field
+ * @dev may be %NULL in rare cases (ISA devices).
+ * In such case the caller must fill in the @v4l2_dev->name field
  * before calling this function.
  */
 int __must_check v4l2_device_register(struct device *dev,
@@ -113,14 +113,14 @@ int __must_check v4l2_device_register(struct device *dev,
 
 /**
  * v4l2_device_set_name - Optional function to initialize the
- * name field of struct v4l2_device
+ * name field of struct _device
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct _device
  * @basename: base name for the device name
  * @instance: pointer to a static atomic_t var with the instance usage for
  * the device driver.
  *
- * v4l2_device_set_name() initializes the name field of struct v4l2_device
+ * v4l2_device_set_name() initializes the name field of struct _device
  * using the driver name and a driver-global atomic_t instance.
  *
  * This function will increment the instance counter and returns the
@@ -132,7 +132,7 @@ int __must_check v4l2_device_register(struct device *dev,
  *
  *   ...
  *
- *   instance = v4l2_device_set_name(_dev, "foo", _instance);
+ *   instance = v4l2_device_set_name(&\ v4l2_dev, "foo", &\ drv_instance);
  *
  * The first time this is called the name field will be set to foo0 and
  * this function returns 0. If the name ends with a digit (e.g. cx18),
@@ -147,16 +147,16 @@ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, 
const char *basename,
  * @v4l2_dev: pointer to struct v4l2_device
  *
  * Should be called when the USB parent disconnects.
- * Since the parent disappears, this ensures that v4l2_dev doesn't have
+ * Since the parent disappears, this ensures that @v4l2_dev doesn't have
  * an invalid parent pointer.
  *
- * .. note:: This function sets v4l2_dev->dev to NULL.
+ * .. note:: This function sets @v4l2_dev->dev to NULL.
  */
 void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
 
 /**
  *  v4l2_device_unregister - Unregister all sub-devices and any other
- *  resources related to v4l2_dev.
+ *  resources related to @v4l2_dev.
  *
  * @v4l2_dev: pointer to struct v4l2_device
  */
@@ -165,8 +165,8 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
 /**
  * v4l2_device_register_subdev - Registers a subdev with a v4l2 device.
  *
- * 

[PATCH 22/47] [media] v4l2-dev.rst: fix a broken c domain reference

2016-09-08 Thread Mauro Carvalho Chehab
The "struct" were inside the reference, causing it to break.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/v4l2-dev.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/kapi/v4l2-dev.rst 
b/Documentation/media/kapi/v4l2-dev.rst
index 5782be725334..0a3b4503a89f 100644
--- a/Documentation/media/kapi/v4l2-dev.rst
+++ b/Documentation/media/kapi/v4l2-dev.rst
@@ -56,7 +56,7 @@ You should also set these fields of :c:type:`video_device`:
   :c:type:`video_device`->vfl_dir fields are used to disable ops that do not
   match the type/dir combination. E.g. VBI ops are disabled for non-VBI nodes,
   and output ops  are disabled for a capture device. This makes it possible to
-  provide just one :c:type:`v4l2_ioctl_ops struct` for both vbi and
+  provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi and
   video nodes.
 
 - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the
-- 
2.7.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 35/47] [media] docs-rst: fix dmx bad cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Some structs are pointed via the typedef. As we replaced
those references, fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/dmx-get-caps.rst   | 5 ++---
 Documentation/media/uapi/dvb/dmx-set-source.rst | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/uapi/dvb/dmx-get-caps.rst 
b/Documentation/media/uapi/dvb/dmx-get-caps.rst
index aaf084a245fd..145fb520d779 100644
--- a/Documentation/media/uapi/dvb/dmx-get-caps.rst
+++ b/Documentation/media/uapi/dvb/dmx-get-caps.rst
@@ -15,7 +15,7 @@ DMX_GET_CAPS
 Synopsis
 
 
-.. c:function:: int ioctl(fd, DMX_GET_CAPS, dmx_caps_t *caps)
+.. c:function:: int ioctl(fd, DMX_GET_CAPS, struct dmx_caps *caps)
 :name: DMX_GET_CAPS
 
 Arguments
@@ -25,7 +25,7 @@ Arguments
 File descriptor returned by :c:func:`open() `.
 
 ``caps``
-Undocumented.
+Pointer to struct :c:type:`dmx_caps`
 
 
 Description
@@ -33,7 +33,6 @@ Description
 
 .. note:: This ioctl is undocumented. Documentation is welcome.
 
-
 Return Value
 
 
diff --git a/Documentation/media/uapi/dvb/dmx-set-source.rst 
b/Documentation/media/uapi/dvb/dmx-set-source.rst
index a232fd6e5f52..ac7f77b25e06 100644
--- a/Documentation/media/uapi/dvb/dmx-set-source.rst
+++ b/Documentation/media/uapi/dvb/dmx-set-source.rst
@@ -15,7 +15,7 @@ DMX_SET_SOURCE
 Synopsis
 
 
-.. c:function:: int ioctl(fd, DMX_SET_SOURCE, dmx_source_t *src)
+.. c:function:: int ioctl(fd, DMX_SET_SOURCE, struct dmx_source *src)
 :name: DMX_SET_SOURCE
 
 
-- 
2.7.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 16/47] [media] diff-v4l.rst: Fix V4L version 1 references

2016-09-08 Thread Mauro Carvalho Chehab
The V4L version 1 structures had long gone from the Linux Kernel.
It doesn't make sense to use cross-references for them, as they
won't be found.

So, get rid of them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/diff-v4l.rst | 38 +++
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/Documentation/media/uapi/v4l/diff-v4l.rst 
b/Documentation/media/uapi/v4l/diff-v4l.rst
index 93794e015e7c..0419e2051759 100644
--- a/Documentation/media/uapi/v4l/diff-v4l.rst
+++ b/Documentation/media/uapi/v4l/diff-v4l.rst
@@ -87,7 +87,7 @@ Querying Capabilities
 The V4L ``VIDIOCGCAP`` ioctl is equivalent to V4L2's
 :ref:`VIDIOC_QUERYCAP`.
 
-The ``name`` field in struct :c:type:`struct video_capability` became
+The ``name`` field in struct ``video_capability`` became
 ``card`` in struct :c:type:`v4l2_capability`, ``type``
 was replaced by ``capabilities``. Note V4L2 does not distinguish between
 device types like this, better think of basic video input, video output
@@ -264,7 +264,7 @@ Video Sources
 =
 
 V4L provides the ``VIDIOCGCHAN`` and ``VIDIOCSCHAN`` ioctl using struct
-:c:type:`struct video_channel` to enumerate the video inputs of a V4L
+``video_channel`` to enumerate the video inputs of a V4L
 device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_ENUMINPUT`,
 :ref:`VIDIOC_G_INPUT ` and
@@ -283,7 +283,7 @@ video input types were renamed as follows:
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_channel` ``type``
+   -  struct ``video_channel`` ``type``
 
-  struct :c:type:`v4l2_input` ``type``
 
@@ -328,7 +328,7 @@ Tuning
 ==
 
 The V4L ``VIDIOCGTUNER`` and ``VIDIOCSTUNER`` ioctl and struct
-:c:type:`struct video_tuner` can be used to enumerate the tuners of a
+``video_tuner`` can be used to enumerate the tuners of a
 V4L TV or radio device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_TUNER ` and
 :ref:`VIDIOC_S_TUNER ` using struct
@@ -374,7 +374,7 @@ Image Properties
 
 
 V4L2 has no equivalent of the ``VIDIOCGPICT`` and ``VIDIOCSPICT`` ioctl
-and struct :c:type:`struct video_picture`. The following fields where
+and struct ``video_picture``. The following fields where
 replaced by V4L2 controls accessible with the
 :ref:`VIDIOC_QUERYCTRL`,
 :ref:`VIDIOC_G_CTRL ` and
@@ -389,7 +389,7 @@ replaced by V4L2 controls accessible with the
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_picture`
+   -  struct ``video_picture``
 
-  V4L2 Control ID
 
@@ -445,7 +445,7 @@ into the struct :c:type:`v4l2_pix_format`:
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_picture` ``palette``
+   -  struct ``video_picture`` ``palette``
 
-  struct :c:type:`v4l2_pix_format` ``pixfmt``
 
@@ -554,7 +554,7 @@ Audio
 =
 
 The ``VIDIOCGAUDIO`` and ``VIDIOCSAUDIO`` ioctl and struct
-:c:type:`struct video_audio` are used to enumerate the audio inputs
+``video_audio`` are used to enumerate the audio inputs
 of a V4L device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_AUDIO ` and
 :ref:`VIDIOC_S_AUDIO ` using struct
@@ -591,7 +591,7 @@ The following fields where replaced by V4L2 controls 
accessible with the
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_audio`
+   -  struct ``video_audio``
 
-  V4L2 Control ID
 
@@ -629,7 +629,7 @@ and ``VIDEO_AUDIO_MUTE`` flags where replaced by the boolean
 ``V4L2_CID_AUDIO_MUTE`` control.
 
 All V4L2 controls have a ``step`` attribute replacing the struct
-:c:type:`struct video_audio` ``step`` field. The V4L audio controls
+``video_audio`` ``step`` field. The V4L audio controls
 are assumed to range from 0 to 65535 with no particular reset value. The
 V4L2 API permits arbitrary limits and defaults which can be queried with
 the :ref:`VIDIOC_QUERYCTRL` ioctl. For general
@@ -642,7 +642,7 @@ Frame Buffer Overlay
 The V4L2 ioctls equivalent to ``VIDIOCGFBUF`` and ``VIDIOCSFBUF`` are
 :ref:`VIDIOC_G_FBUF ` and
 :ref:`VIDIOC_S_FBUF `. The ``base`` field of struct
-:c:type:`struct video_buffer` remained unchanged, except V4L2 defines
+``video_buffer`` remained unchanged, except V4L2 defines
 a flag to indicate non-destructive overlays instead of a ``NULL``
 pointer. All other fields moved into the struct
 :c:type:`v4l2_pix_format` ``fmt`` substructure of
@@ -659,13 +659,13 @@ of the ``fmt`` union is used, a struct
 :c:type:`v4l2_window`.
 
 The ``x``, ``y``, ``width`` and ``height`` fields of struct
-:c:type:`struct video_window` moved into struct
+``video_window`` moved into struct
 :c:type:`v4l2_rect` substructure ``w`` of struct
-:c:type:`struct v4l2_window`. The ``chromakey``, ``clips``, and
+:c:type:`v4l2_window`. The ``chromakey``, ``clips``, and
 ``clipcount`` fields remained unchanged. Struct
-:c:type:`struct video_clip` was renamed to struct
+``video_clip`` was renamed to struct
 :c:type:`v4l2_clip`, also containing a struct
-:c:type:`struct v4l2_rect`, but the 

[PATCH 01/47] kernel-doc: ignore arguments on macro definitions

2016-09-08 Thread Mauro Carvalho Chehab
A macro definition is mapped via .. c:function:: at the
ReST markup when using the following kernel-doc tag:

/**
 * DMX_FE_ENTRY - Casts elements in the list of registered
 *   front-ends from the generic type struct list_head
 *   to the type * struct dmx_frontend
 *
 * @list: list of struct dmx_frontend
 */
 #define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)

However, unlike a function description, the arguments of a macro
doesn't contain the data type.

This causes warnings when enabling Sphinx on nitkpick mode,
like this one:
./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
not found: list

That happens because kernel-doc output for the above is:

.. c:function:: DMX_FE_ENTRY ( list)

   Casts elements in the list of registered front-ends from the generic 
type struct list_head to the type * struct dmx_frontend

**Parameters**

``list``
  list of struct dmx_frontend

As the type is blank, Sphinx would think that ``list`` is a type,
and will try to add a cross reference for it, using their internal
representation for c:type:`list`.

However, ``list`` is not a type. So, that would cause either the
above warning, or if a ``list`` type exists, it would create
a reference to the wrong place at the doc.

To avoid that, let's ommit macro arguments from c:function::
declaration. As each argument will appear below the Parameters,
the type of the argument can be described there, if needed.

Signed-off-by: Mauro Carvalho Chehab 
---
 scripts/kernel-doc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 93721f3c91bf..3db6e6ac83f1 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1857,14 +1857,15 @@ sub output_function_rst(%) {
if ($count ne 0) {
print ", ";
}
-   $count++;
$type = $args{'parametertypes'}{$parameter};
 
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function
print $1 . $parameter . ") (" . $2;
-   } else {
+   $count++;
+   } elsif ($type ne "") {
print $type . " " . $parameter;
+   $count++;
}
 }
 if ($args{'typedef'}) {
-- 
2.7.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 18/47] [media] docs-rst: use C domain for enum references on uapi

2016-09-08 Thread Mauro Carvalho Chehab
Change the parse-headers.pl and the corresponding files to use
the C domain for enum references.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/hist-v4l2.rst   |  2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst  |  2 +-
 Documentation/media/uapi/v4l/v4l2.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-priority.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst| 14 +++---
 Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst | 10 +-
 include/media/v4l2-dev.h | 12 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index a84895968349..bd45431ed00e 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -1361,7 +1361,7 @@ V4L2 in Linux 3.19
:ref:`v4l2_quantization ` fields to struct
:c:type:`v4l2_pix_format`, struct
:c:type:`v4l2_pix_format_mplane` and
-   struct :ref:`v4l2_mbus_framefmt `.
+   struct :c:type:`v4l2_mbus_framefmt`.
 
 
 V4L2 in Linux 4.4
diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst 
b/Documentation/media/uapi/v4l/subdev-formats.rst
index 52013b55ea80..f0d7754f1906 100644
--- a/Documentation/media/uapi/v4l/subdev-formats.rst
+++ b/Documentation/media/uapi/v4l/subdev-formats.rst
@@ -7,7 +7,7 @@ Media Bus Formats
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-mbus-framefmt:
+.. c:type:: v4l2_mbus_framefmt
 
 .. flat-table:: struct v4l2_mbus_framefmt
 :header-rows:  0
diff --git a/Documentation/media/uapi/v4l/v4l2.rst 
b/Documentation/media/uapi/v4l/v4l2.rst
index 785d4cdd2f85..e020c57f98d4 100644
--- a/Documentation/media/uapi/v4l/v4l2.rst
+++ b/Documentation/media/uapi/v4l/v4l2.rst
@@ -116,7 +116,7 @@ Rewrote Colorspace chapter, added new enum
 :ref:`v4l2_quantization ` fields to struct
 :c:type:`v4l2_pix_format`, struct
 :c:type:`v4l2_pix_format_mplane` and struct
-:ref:`v4l2_mbus_framefmt `.
+:c:type:`v4l2_mbus_framefmt`.
 
 
 :revision: 3.17 / 2014-08-04 (*lp, hv*)
diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index cf0e98f5112f..3038f349049c 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -356,7 +356,7 @@ call.
 
-
-  The type of the control. See enum
- :ref:`v4l2_ctrl_type `.
+ :c:type:`v4l2_ctrl_type`.
 
 -  .. row 3
 
diff --git a/Documentation/media/uapi/v4l/vidioc-g-priority.rst 
b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
index d6a07c076837..cbd2a3cbb18e 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-priority.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
@@ -44,7 +44,7 @@ an enum v4l2_priority variable and call 
:ref:`VIDIOC_S_PRIORITY ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the minimum value is to be used for each possible control type.
  Note that this a signed 32-bit value.
 
@@ -153,7 +153,7 @@ See also the examples in :ref:`control`.
-  ``maximum``
 
-  Maximum value, inclusive. This field gives an upper bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the maximum value is to be used for each possible control type.
  Note that this a signed 32-bit value.
 
@@ -164,7 +164,7 @@ See also the examples in :ref:`control`.
-  ``step``
 
-  This field gives a step size for the control. See enum
- :ref:`v4l2_ctrl_type ` how the step value is
+ :c:type:`v4l2_ctrl_type` how the step value is
  to be used for each possible control type. Note that this an
  unsigned 32-bit value.
 
@@ -269,7 +269,7 @@ See also the examples in :ref:`control`.
-  ``minimum``
 
-  Minimum value, inclusive. This field gives a lower bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the minimum value is to be used for each possible control type.
  Note that this a signed 64-bit value.
 
@@ -280,7 +280,7 @@ See also the examples in :ref:`control`.
-  ``maximum``
 
-  Maximum value, inclusive. This field gives an upper bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the maximum value is to be used for each possible control type.
  Note that this a signed 64-bit value.
 
@@ -291,7 +291,7 @@ See also the examples in :ref:`control`.
-  ``step``
 
-  This field gives a step size for the control. See enum
- :ref:`v4l2_ctrl_type ` how the step value is
+ 

[PATCH 37/47] [media] docs-rst: simplify c:type: cross references

2016-09-08 Thread Mauro Carvalho Chehab
Instead of using c:type:`struct foo `, use:
struct c:type:`foo`

This patch was generated via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if 
(m/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/) { $s=$1; $r=$2; if ($s eq $r) { 
s/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/struct :c:type:`$2`/; 
s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  
}} print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/mc-core.rst   | 24 +++---
 Documentation/media/uapi/dvb/dvbproperty.rst   |  2 +-
 Documentation/media/uapi/v4l/buffer.rst| 12 +--
 Documentation/media/uapi/v4l/dev-osd.rst   |  2 +-
 Documentation/media/uapi/v4l/dev-overlay.rst   |  2 +-
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst|  6 +++---
 Documentation/media/uapi/v4l/extended-controls.rst |  2 +-
 Documentation/media/uapi/v4l/pixfmt-002.rst|  4 ++--
 Documentation/media/uapi/v4l/pixfmt-003.rst|  6 +++---
 Documentation/media/uapi/v4l/pixfmt.rst|  4 ++--
 .../media/uapi/v4l/vidioc-create-bufs.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audio.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst  |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-parm.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-std.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|  2 +-
 .../media/uapi/v4l/vidioc-prepare-buf.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-qbuf.rst   |  4 ++--
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst|  2 +-
 25 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/Documentation/media/kapi/mc-core.rst 
b/Documentation/media/kapi/mc-core.rst
index fb839a6c1f46..1a738e5f6056 100644
--- a/Documentation/media/kapi/mc-core.rst
+++ b/Documentation/media/kapi/mc-core.rst
@@ -34,7 +34,7 @@ pad to a sink pad.
 Media device
 
 
-A media device is represented by a :c:type:`struct media_device `
+A media device is represented by a struct :c:type:`media_device`
 instance, defined in ``include/media/media-device.h``.
 Allocation of the structure is handled by the media device driver, usually by
 embedding the :c:type:`media_device` instance in a larger driver-specific
@@ -47,7 +47,7 @@ and unregistered by calling 
:c:func:`media_device_unregister()`.
 Entities
 
 
-Entities are represented by a :c:type:`struct media_entity `
+Entities are represented by a struct :c:type:`media_entity`
 instance, defined in ``include/media/media-entity.h``. The structure is usually
 embedded into a higher-level structure, such as
 :c:type:`v4l2_subdev` or :c:type:`video_device`
@@ -65,10 +65,10 @@ Interfaces
 ^^
 
 Interfaces are represented by a
-:c:type:`struct media_interface ` instance, defined in
+struct :c:type:`media_interface` instance, defined in
 ``include/media/media-entity.h``. Currently, only one type of interface is
 defined: a device node. Such interfaces are represented by a
-:c:type:`struct media_intf_devnode `.
+struct :c:type:`media_intf_devnode`.
 
 Drivers initialize and create device node interfaces by calling
 :c:func:`media_devnode_create()`
@@ -77,7 +77,7 @@ and remove them by calling:
 
 Pads
 
-Pads are represented by a :c:type:`struct media_pad ` instance,
+Pads are represented by a struct :c:type:`media_pad` instance,
 defined in ``include/media/media-entity.h``. Each entity stores its pads in
 a pads array managed by the entity driver. Drivers usually embed the array in
 a driver-specific structure.
@@ -85,8 +85,8 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad `,
-making the :c:type:`struct media_pad ` pointer the canonical way
+Both information are stored in the struct :c:type:`media_pad`,
+making the struct :c:type:`media_pad` pointer the canonical way
 to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
@@ -102,7 +102,7 @@ Pads have flags that describe the pad capabilities and 
state.
 Links
 ^
 
-Links are represented by a :c:type:`struct media_link ` instance,
+Links are represented by a struct :c:type:`media_link` instance,
 defined in ``include/media/media-entity.h``. There are two types of links:
 
 **1. pad to pad links**:
@@ -185,7 +185,7 @@ Use count and power handling
 
 Due to the wide differences between drivers regarding power management
 needs, 

[PATCH 24/47] [media] v4l2-dv-timings.h: let kernel-doc parte the typedef argument

2016-09-08 Thread Mauro Carvalho Chehab
Now that scripts/kernel-doc was fixed to parse the typedef
argument used here, let it produce documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-dv-timings.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
index 65caadf13eec..0a7d9e1fc8c8 100644
--- a/include/media/v4l2-dv-timings.h
+++ b/include/media/v4l2-dv-timings.h
@@ -28,8 +28,8 @@
  */
 extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
 
-/*
- * v4l2_check_dv_timings_fnc - timings check callback
+/**
+ * typedef v4l2_check_dv_timings_fnc - timings check callback
  *
  * @t: the v4l2_dv_timings struct.
  * @handle: a handle from the driver.
-- 
2.7.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 39/47] [media] fix clock_gettime cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Fix those warnings:

Documentation/media/uapi/cec/cec-ioc-dqevent.rst:124: WARNING: c:func 
reference target not found: clock_gettime(2)

By replacing it with the right function name, using this shell script:

for i in `find Documentation/media -type f`; do sed 
's,clock_gettime(2),clock_gettime,' <$i >a && mv a $i; done

Please notice that this will make the nitpick mode to shut up
complaining about that, becasue clock_gettime is on its exclude list,
but the cross reference will be undefined until someone documents
this function at the core documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 2 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst | 4 ++--
 Documentation/media/uapi/v4l/buffer.rst  | 4 ++--
 Documentation/media/uapi/v4l/vidioc-dqevent.rst  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 06b79361254c..060c455380ce 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -122,7 +122,7 @@ it is guaranteed that the state did change in between the 
two events.
-  :cspan:`1` Timestamp of the event in ns.
 
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 2
 
diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst 
b/Documentation/media/uapi/cec/cec-ioc-receive.rst
index 18620f81b7d9..d585b1bba6ac 100644
--- a/Documentation/media/uapi/cec/cec-ioc-receive.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -95,7 +95,7 @@ result.
 
-  Timestamp in ns of when the last byte of the message was transmitted.
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 2
 
@@ -105,7 +105,7 @@ result.
 
-  Timestamp in ns of when the last byte of the message was received.
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 3
 
diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 7d2d81a771b1..e71a458712d3 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -712,7 +712,7 @@ Buffer Flags
  clock). Monotonic clock has been favoured in embedded systems
  whereas most of the drivers use the realtime clock. Either kinds
  of timestamps are available in user space via
- :c:func:`clock_gettime(2)` using clock IDs ``CLOCK_MONOTONIC``
+ :c:func:`clock_gettime` using clock IDs ``CLOCK_MONOTONIC``
  and ``CLOCK_REALTIME``, respectively.
 
 -  .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
@@ -723,7 +723,7 @@ Buffer Flags
 
-  The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
  clock. To access the same clock outside V4L2, use
- :c:func:`clock_gettime(2)`.
+ :c:func:`clock_gettime`.
 
 -  .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
 
diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index 3038f349049c..1e435ab674a2 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -152,7 +152,7 @@ call.
-
-  Event timestamp. The timestamp has been taken from the
  ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2,
- use :c:func:`clock_gettime(2)`.
+ use :c:func:`clock_gettime`.
 
 -  .. row 12
 
-- 
2.7.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 14/47] [media] v4l2-ctrls: document some extra data structures

2016-09-08 Thread Mauro Carvalho Chehab
The typedefs and a macro are not defined. While here, improve a
few bits on the documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 51 +++---
 1 file changed, 44 insertions(+), 7 deletions(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 178a88d45aea..a63f37044f1c 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -93,6 +93,16 @@ struct v4l2_ctrl_type_ops {
union v4l2_ctrl_ptr ptr);
 };
 
+/**
+ * typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
+ * that should be called when a control value has changed.
+ *
+ * @ctrl: pointer to struct _ctrl
+ * @priv: control private data
+ *
+ * This typedef definition is used as an argument to v4l2_ctrl_notify()
+ * and as an argument at struct _ctrl_handler.
+ */
 typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
 
 /**
@@ -369,17 +379,38 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
  * @key:   Used by the lock validator if CONFIG_LOCKDEP is set.
  * @name:  Used by the lock validator if CONFIG_LOCKDEP is set.
  *
- * Returns an error if the buckets could not be allocated. This error will
- * also be stored in @hdl->error.
+ * .. attention::
  *
- * Never use this call directly, always use the v4l2_ctrl_handler_init
- * macro that hides the @key and @name arguments.
+ *Never use this call directly, always use the v4l2_ctrl_handler_init()
+ *macro that hides the @key and @name arguments.
+ *
+ * Return: returns an error if the buckets could not be allocated. This
+ * error will also be stored in @hdl->error.
  */
 int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
 unsigned int nr_of_controls_hint,
 struct lock_class_key *key, const char *name);
 
 #ifdef CONFIG_LOCKDEP
+
+/**
+ * v4l2_ctrl_handler_init -
+ *
+ * @hdl:   The control handler.
+ * @nr_of_controls_hint: A hint of how many controls this handler is
+ * expected to refer to. This is the total number, so including
+ * any inherited controls. It doesn't have to be precise, but if
+ * it is way off, then you either waste memory (too many buckets
+ * are allocated) or the control lookup becomes slower (not enough
+ * buckets are allocated, so there are more slow list lookups).
+ * It will always work, though.
+ *
+ * This helper function creates a static struct _class_key and
+ * calls v4l2_ctrl_handler_init_class(), providing a proper name for the lock
+ * validador.
+ *
+ * Use this helper function to initialize a control handler.
+ */
 #define v4l2_ctrl_handler_init(hdl, nr_of_controls_hint)   \
 (  \
({  \
@@ -564,6 +595,13 @@ struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct 
v4l2_ctrl_handler *hdl,
 u32 id, u8 max, u8 def,
 const s64 *qmenu_int);
 
+/**
+ * typedef v4l2_ctrl_filter - Typedef to define the filter function to be
+ * used when adding a control handler.
+ *
+ * @ctrl: pointer to struct _ctrl.
+ */
+
 typedef bool (*v4l2_ctrl_filter)(const struct v4l2_ctrl *ctrl);
 
 /**
@@ -635,8 +673,8 @@ void v4l2_ctrl_cluster(unsigned int ncontrols, struct 
v4l2_ctrl **controls);
  * be marked active, and any reads will just return the current value without
  * going through g_volatile_ctrl.
  *
- * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
- * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
+ * In addition, this function will set the %V4L2_CTRL_FLAG_UPDATE flag
+ * on the autofoo control and %V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
  * if autofoo is in auto mode.
  */
 void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
@@ -686,7 +724,6 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool 
active);
  */
 void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
 
-
 /**
  *__v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range()
  *
-- 
2.7.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 32/47] [media] ca-set-pid.rst: document struct ca_pid

2016-09-08 Thread Mauro Carvalho Chehab
Add a table describing the fields on this struct, based
on ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-set-pid.rst | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-set-pid.rst 
b/Documentation/media/uapi/dvb/ca-set-pid.rst
index 8e13ad9595d3..06bdaf4afada 100644
--- a/Documentation/media/uapi/dvb/ca-set-pid.rst
+++ b/Documentation/media/uapi/dvb/ca-set-pid.rst
@@ -26,7 +26,24 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``pid``
-  Undocumented.
+  Pointer to struct :c:type:`ca_pid`.
+
+.. c:type:: ca_pid
+
+.. flat-table:: struct ca_pid
+:header-rows:  1
+:stub-columns: 0
+
+-
+   - unsigned int
+   - pid
+   - Program ID
+
+-
+   - int
+   - index
+   - PID index. Use -1 to disable.
+
 
 
 Description
-- 
2.7.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 20/47] [media] cec-ioc-dqevent.rst: fix some undefined references

2016-09-08 Thread Mauro Carvalho Chehab
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 10228eb0fd4a..06b79361254c 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -51,7 +51,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}|
 
-.. _cec-event-state-change_s:
+.. c:type:: cec_event_state_change
 
 .. flat-table:: struct cec_event_state_change
 :header-rows:  0
@@ -78,7 +78,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}|
 
-.. _cec-event-lost-msgs_s:
+.. c:type:: cec_event_lost_msgs
 
 .. flat-table:: struct cec_event_lost_msgs
 :header-rows:  0
-- 
2.7.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 11/47] [media] docs-rst: improve the kAPI documentation for the mediactl

2016-09-08 Thread Mauro Carvalho Chehab
There are several issues on the documentation:
  - the media.h header were not properly referenced;
  - verbatim expressions were not properly marked as such;
  - struct member references were wrong;
  - some notes were not using the right markup;
  - a comment that were moved to the kernel-doc markup were
duplicated as a comment inside the struct media_entity;
  - some args were not pointing to the struct they're using;
  - macros weren't documented.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/media-device.h  | 115 
 include/media/media-devnode.h |   2 +-
 include/media/media-entity.h  | 237 --
 3 files changed, 231 insertions(+), 123 deletions(-)

diff --git a/include/media/media-device.h b/include/media/media-device.h
index 28195242386c..481dd6c672cb 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -53,7 +53,7 @@ struct media_entity_notify {
  * @dev:   Parent device
  * @devnode:   Media device node
  * @driver_name: Optional device driver name. If not set, calls to
- * %MEDIA_IOC_DEVICE_INFO will return dev->driver->name.
+ * %MEDIA_IOC_DEVICE_INFO will return ``dev->driver->name``.
  * This is needed for USB drivers for example, as otherwise
  * they'll all appear as if the driver name was "usb".
  * @model: Device model name
@@ -102,16 +102,18 @@ struct media_entity_notify {
  * sink entity  and deactivate the link between them. Drivers
  * should call this handler to release the source.
  *
- * Note: Bridge driver is expected to implement and set the
- * handler when media_device is registered or when
- * bridge driver finds the media_device during probe.
- * Bridge driver sets source_priv with information
- * necessary to run enable/disable source handlers.
- *
  * Use-case: find tuner entity connected to the decoder
  * entity and check if it is available, and activate the
- * the link between them from enable_source and deactivate
- * from disable_source.
+ * the link between them from @enable_source and deactivate
+ * from @disable_source.
+ *
+ * .. note::
+ *
+ *Bridge driver is expected to implement and set the
+ *handler when _device is registered or when
+ *bridge driver finds the media_device during probe.
+ *Bridge driver sets source_priv with information
+ *necessary to run @enable_source and @disable_source handlers.
  */
 struct media_device {
/* dev->driver_data points to this struct. */
@@ -168,7 +170,7 @@ struct usb_device;
  * @ent_enum: Entity enumeration to be initialised
  * @mdev: The related media device
  *
- * Returns zero on success or a negative error code.
+ * Return: zero on success or a negative error code.
  */
 static inline __must_check int media_entity_enum_init(
struct media_entity_enum *ent_enum, struct media_device *mdev)
@@ -211,36 +213,38 @@ void media_device_cleanup(struct media_device *mdev);
  *
  * Users, should, instead, call the media_device_register() macro.
  *
- * The caller is responsible for initializing the media_device structure before
- * registration. The following fields must be set:
+ * The caller is responsible for initializing the _device structure
+ * before registration. The following fields of _device must be set:
  *
- *  - dev must point to the parent device (usually a _dev, _interface 
or
- *_device instance).
+ *  - _entity.dev must point to the parent device (usually a _dev,
+ *_interface or _device instance).
  *
- *  - model must be filled with the device model name as a NUL-terminated UTF-8
- *string. The device/model revision must not be stored in this field.
+ *  - _entity.model must be filled with the device model name as a
+ *NUL-terminated UTF-8 string. The device/model revision must not be
+ *stored in this field.
  *
  * The following fields are optional:
  *
- *  - serial is a unique serial number stored as a NUL-terminated ASCII string.
- *The field is big enough to store a GUID in text form. If the hardware
- *doesn't provide a unique serial number this field must be left empty.
+ *  - _entity.serial is a unique serial number stored as a
+ *NUL-terminated ASCII string. The field is big enough to store a GUID
+ *in text form. If the hardware doesn't provide a unique serial number
+ *this field must be left empty.
  *
- *  - bus_info represents the location of the device in the system as a
- *NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to
- *"PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices,
- *the usb_make_path() function must be used. This field is used by
- *applications to distinguish between otherwise identical devices that 
don't
- *provide a serial number.
+ *  - _entity.bus_info represents the location of the device in the
+ *system as a NUL-terminated ASCII string. For PCI/PCIe 

[PATCH 44/47] [media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0

2016-09-08 Thread Mauro Carvalho Chehab
The struct v4l2_mpeg_vbi_ITV0 is identical to struct v4l2_mpeg_vbi_itv0,
except by its size, and it is documented at the same place at the
book.

Fix cross reference for it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/v4l/dev-sliced-vbi.rst 
b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
index 7f159c3d4942..019cac7e90e4 100644
--- a/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
+++ b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
@@ -672,8 +672,10 @@ Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic 
field
 
 .. c:type:: v4l2_mpeg_vbi_itv0
 
-struct v4l2_mpeg_vbi_itv0
--
+.. c:type:: v4l2_mpeg_vbi_ITV0
+
+structs v4l2_mpeg_vbi_itv0 and v4l2_mpeg_vbi_ITV0
+-
 
 .. tabularcolumns:: |p{4.4cm}|p{2.4cm}|p{10.7cm}|
 
-- 
2.7.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 41/47] [media] libv4l-introduction.rst: improve crossr-references

2016-09-08 Thread Mauro Carvalho Chehab
Use C cross-references to mention the V4L2 API calls on all
places it occurs inside this file.

While here, also mark constants as such.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/v4l/libv4l-introduction.rst | 33 +-
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/Documentation/media/uapi/v4l/libv4l-introduction.rst 
b/Documentation/media/uapi/v4l/libv4l-introduction.rst
index 1c1278d17fa7..ccc3c4d2fc0f 100644
--- a/Documentation/media/uapi/v4l/libv4l-introduction.rst
+++ b/Documentation/media/uapi/v4l/libv4l-introduction.rst
@@ -113,43 +113,47 @@ Libv4l device control functions
 
 The common file operation methods are provided by libv4l.
 
-Those functions operate just like glibc
-open/close/dup/ioctl/read/mmap/munmap:
+Those functions operate just like the gcc function ``dup()`` and
+V4L2 functions
+:c:func:`open() `, :c:func:`close() `,
+:c:func:`ioctl() `, :c:func:`read() `,
+:c:func:`mmap() ` and :c:func:`munmap() `:
 
 .. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
-   operates like the standard :ref:`open() ` function.
+   operates like the :c:func:`open() ` function.
 
 .. c:function:: int v4l2_close(int fd)
 
-   operates like the standard :ref:`close() ` function.
+   operates like the :c:func:`close() ` function.
 
 .. c:function:: int v4l2_dup(int fd)
 
-   operates like the standard dup() function, duplicating a file handler.
+   operates like the libc ``dup()`` function, duplicating a file handler.
 
 .. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
 
-   operates like the standard :ref:`ioctl() ` function.
+   operates like the :c:func:`ioctl() ` function.
 
 .. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
 
-   operates like the standard :ref:`read() ` function.
+   operates like the :c:func:`read() ` function.
 
 .. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int 
flags, int fd, int64_t offset);
 
-   operates like the standard :ref:`mmap() ` function.
+   operates like the :c:func:`munmap() ` function.
 
 .. c:function:: int v4l2_munmap(void *_start, size_t length);
-   operates like the standard :ref:`munmap() ` function.
+
+   operates like the :c:func:`munmap() ` function.
 
 Those functions provide additional control:
 
 .. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
opens an already opened fd for further use through v4l2lib and possibly
-   modify libv4l2's default behavior through the v4l2_flags argument.
-   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   modify libv4l2's default behavior through the ``v4l2_flags`` argument.
+   Currently, ``v4l2_flags`` can be ``V4L2_DISABLE_CONVERSION``, to disable
format conversion.
 
 .. c:function:: int v4l2_set_control(int fd, int cid, int value)
@@ -168,9 +172,12 @@ Those functions provide additional control:
 v4l1compat.so wrapper library
 =
 
-This library intercepts calls to open/close/ioctl/mmap/mmunmap
+This library intercepts calls to
+:c:func:`open() `, :c:func:`close() `,
+:c:func:`ioctl() `, :c:func:`mmap() ` and
+:c:func:`munmap() `
 operations and redirects them to the libv4l counterparts, by using
-LD_PRELOAD=/usr/lib/v4l1compat.so. It also emulates V4L1 calls via V4L2
+``LD_PRELOAD=/usr/lib/v4l1compat.so``. It also emulates V4L1 calls via V4L2
 API.
 
 It allows usage of binary legacy applications that still don't use
-- 
2.7.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 06/47] [media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc

2016-09-08 Thread Mauro Carvalho Chehab
Instead of keeping those notes at the file on a non-structured
way, move them to dtv-core.rst, using the proper ReST tags.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/dtv-core.rst   | 38 +++--
 drivers/media/dvb-core/dvb_ringbuffer.h | 28 
 2 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/Documentation/media/kapi/dtv-core.rst 
b/Documentation/media/kapi/dtv-core.rst
index 41df9f144fcb..a3c4642eabfc 100644
--- a/Documentation/media/kapi/dtv-core.rst
+++ b/Documentation/media/kapi/dtv-core.rst
@@ -6,8 +6,6 @@ Digital TV Common functions
 
 .. kernel-doc:: drivers/media/dvb-core/dvb_math.h
 
-.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
-
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
 
 
@@ -18,6 +16,42 @@ Digital TV Common functions
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
:export: drivers/media/dvb-core/dvbdev.c
 
+Digital TV Ring buffer
+--
+
+Those routines implement ring buffers used to handle digital TV data and
+copy it from/to userspace.
+
+.. note::
+
+  1) For performance reasons read and write routines don't check buffer sizes
+ and/or number of bytes free/available. This has to be done before these
+ routines are called. For example:
+
+   .. code-block:: c
+
+/* write @buflen: bytes */
+free = dvb_ringbuffer_free(rbuf);
+if (free >= buflen)
+count = dvb_ringbuffer_write(rbuf, buffer, buflen);
+else
+/* do something */
+
+/* read min. 1000, max. @bufsize: bytes */
+avail = dvb_ringbuffer_avail(rbuf);
+if (avail >= 1000)
+count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
+else
+/* do something */
+
+  2) If there is exactly one reader and one writer, there is no need
+ to lock read or write operations.
+ Two or more readers must be locked against each other.
+ Flushing the buffer counts as a read operation.
+ Resetting the buffer counts as a read and write operation.
+ Two or more writers must be locked against each other.
+
+.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
 
 
 Digital TV Frontend kABI
diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index 8209eb4db2aa..f64bd86fe5fd 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -66,34 +66,6 @@ extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, 
void *data,
  *
  * @rbuf: pointer to struct dvb_ringbuffer
  */
-/*
- * Notes:
- * --
- * (1) For performance reasons read and write routines don't check buffer sizes
- * and/or number of bytes free/available. This has to be done before these
- * routines are called. For example:
- *
- * *** write @buflen: bytes ***
- * free = dvb_ringbuffer_free(rbuf);
- * if (free >= buflen)
- * count = dvb_ringbuffer_write(rbuf, buffer, buflen);
- * else
- * ...
- *
- * *** read min. 1000, max. @bufsize: bytes ***
- * avail = dvb_ringbuffer_avail(rbuf);
- * if (avail >= 1000)
- * count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
- * else
- * ...
- *
- * (2) If there is exactly one reader and one writer, there is no need
- * to lock read or write operations.
- * Two or more readers must be locked against each other.
- * Flushing the buffer counts as a read operation.
- * Resetting the buffer counts as a read and write operation.
- * Two or more writers must be locked against each other.
- */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
 /**
-- 
2.7.4


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


Re: [PATCH v5 3/5] media: Add Mediatek MDP Driver

2016-09-08 Thread Minghsiu Tsai
On Mon, 2016-09-05 at 12:17 +0200, Hans Verkuil wrote:
> On 08/30/2016 02:25 PM, Minghsiu Tsai wrote:
> > Add MDP driver for MT8173
> > 
> > Signed-off-by: Minghsiu Tsai 
> > ---
> >  drivers/media/platform/Kconfig|   17 +
> >  drivers/media/platform/Makefile   |2 +
> >  drivers/media/platform/mtk-mdp/Makefile   |9 +
> >  drivers/media/platform/mtk-mdp/mtk_mdp_comp.c |  159 
> >  drivers/media/platform/mtk-mdp/mtk_mdp_comp.h |   72 ++
> >  drivers/media/platform/mtk-mdp/mtk_mdp_core.c |  294 ++
> >  drivers/media/platform/mtk-mdp/mtk_mdp_core.h |  260 +
> >  drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h  |  126 +++
> >  drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c  | 1270 
> > +
> >  drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h  |   22 +
> >  drivers/media/platform/mtk-mdp/mtk_mdp_regs.c |  152 +++
> >  drivers/media/platform/mtk-mdp/mtk_mdp_regs.h |   31 +
> >  drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c  |  145 +++
> >  drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h  |   41 +
> >  14 files changed, 2600 insertions(+)
> >  create mode 100644 drivers/media/platform/mtk-mdp/Makefile
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.h
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.c
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.h
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.h
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
> >  create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h
> > 
> 
> 
> 
> > +static inline bool mtk_mdp_is_target_compose(u32 target)
> > +{
> > +   if (target == V4L2_SEL_TGT_COMPOSE_DEFAULT
> > +   || target == V4L2_SEL_TGT_COMPOSE_BOUNDS
> > +   || target == V4L2_SEL_TGT_COMPOSE)
> > +   return true;
> > +   return false;
> > +}
> > +
> > +static inline bool mtk_mdp_is_target_crop(u32 target)
> > +{
> > +   if (target == V4L2_SEL_TGT_CROP_DEFAULT
> > +   || target == V4L2_SEL_TGT_CROP_BOUNDS
> > +   || target == V4L2_SEL_TGT_CROP)
> > +   return true;
> > +   return false;
> > +}
> > +
> > +static int mtk_mdp_m2m_g_selection(struct file *file, void *fh,
> > +  struct v4l2_selection *s)
> > +{
> > +   struct mtk_mdp_frame *frame;
> > +   struct mtk_mdp_ctx *ctx = fh_to_ctx(fh);
> > +   bool valid = false;
> > +
> > +   if (s->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
> > +   if (mtk_mdp_is_target_compose(s->target))
> > +   valid = true;
> > +   } else if (s->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
> > +   if (mtk_mdp_is_target_crop(s->target))
> > +   valid = true;
> > +   }
> > +   if (!valid) {
> > +   mtk_mdp_dbg(1, "[%d] invalid type:%d,%u", ctx->id, s->type,
> > +   s->target);
> > +   return -EINVAL;
> > +   }
> > +
> > +   frame = mtk_mdp_ctx_get_frame(ctx, s->type);
> > +
> > +   switch (s->target) {
> > +   case V4L2_SEL_TGT_COMPOSE_DEFAULT:
> > +   case V4L2_SEL_TGT_COMPOSE_BOUNDS:
> > +   case V4L2_SEL_TGT_CROP_BOUNDS:
> > +   case V4L2_SEL_TGT_CROP_DEFAULT:
> > +   s->r.left = 0;
> > +   s->r.top = 0;
> > +   s->r.width = frame->width;
> > +   s->r.height = frame->height;
> > +   return 0;
> > +
> > +   case V4L2_SEL_TGT_COMPOSE:
> > +   case V4L2_SEL_TGT_CROP:
> > +   s->r.left = frame->crop.left;
> > +   s->r.top = frame->crop.top;
> > +   s->r.width = frame->crop.width;
> > +   s->r.height = frame->crop.height;
> > +   return 0;
> > +   }
> > +
> > +   return -EINVAL;
> > +}
> > +
> > +static int mtk_mdp_check_scaler_ratio(struct mtk_mdp_variant *var, int 
> > src_w,
> > + int src_h, int dst_w, int dst_h, int rot)
> > +{
> > +   int tmp_w, tmp_h;
> > +
> > +   if (rot == 90 || rot == 270) {
> > +   tmp_w = dst_h;
> > +   tmp_h = dst_w;
> > +   } else {
> > +   tmp_w = dst_w;
> > +   tmp_h = dst_h;
> > +   }
> > +
> > +   if ((src_w / tmp_w) > var->h_scale_down_max ||
> > +   (src_h / tmp_h) > var->v_scale_down_max ||
> > +   (tmp_w / src_w) > var->h_scale_up_max ||
> > +   (tmp_h / src_h) > var->v_scale_up_max)
> > +   return -EINVAL;
> > +
> > +   return 0;
> > +}
> > +
> > +static int mtk_mdp_m2m_s_selection(struct file *file, void *fh,
> > +  struct v4l2_selection *s)
> > +{
> > +   struct mtk_mdp_frame *frame;
> > +   struct mtk_mdp_ctx *ctx = fh_to_ctx(fh);
> > +   struct v4l2_rect 

Re: [PATCH 22/47] [media] v4l2-dev.rst: fix a broken c domain reference

2016-09-08 Thread Laurent Pinchart
Hi Mauro,

Thank you for the patch.

On Thursday 08 Sep 2016 09:03:44 Mauro Carvalho Chehab wrote:
> The "struct" were inside the reference, causing it to break.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Acked-by: Laurent Pinchart 

> ---
>  Documentation/media/kapi/v4l2-dev.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/media/kapi/v4l2-dev.rst
> b/Documentation/media/kapi/v4l2-dev.rst index 5782be725334..0a3b4503a89f
> 100644
> --- a/Documentation/media/kapi/v4l2-dev.rst
> +++ b/Documentation/media/kapi/v4l2-dev.rst
> 
> @@ -56,7 +56,7 @@ You should also set these fields of 
:c:type:`video_device`:
>:c:type:`video_device`->vfl_dir fields are used to disable ops that do
>:not
> 
>match the type/dir combination. E.g. VBI ops are disabled for non-VBI
> nodes, and output ops  are disabled for a capture device. This makes it
> possible to -  provide just one :c:type:`v4l2_ioctl_ops struct` for both
> vbi and +  provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi
> and video nodes.
> 
>  - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the

-- 
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 v6 2/2] media: Add a driver for the ov5645 camera sensor.

2016-09-08 Thread Laurent Pinchart
Hi Todor,

Thank you for the patch.

On Thursday 08 Sep 2016 12:13:55 Todor Tomov wrote:
> The ov5645 sensor from Omnivision supports up to 2592x1944
> and CSI2 interface.
> 
> The driver adds support for the following modes:
> - 1280x960
> - 1920x1080
> - 2592x1944
> 
> Output format is packed 8bit UYVY.
> 
> Signed-off-by: Todor Tomov 
> ---
>  drivers/media/i2c/Kconfig  |   12 +
>  drivers/media/i2c/Makefile |1 +
>  drivers/media/i2c/ov5645.c | 1372 +
>  3 files changed, 1385 insertions(+)
>  create mode 100644 drivers/media/i2c/ov5645.c

[snip]

> diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
> new file mode 100644
> index 000..5e5c37e
> --- /dev/null
> +++ b/drivers/media/i2c/ov5645.c
> @@ -0,0 +1,1372 @@

[snip]

> +#define OV5645_VOLTAGE_ANALOG   280
> +#define OV5645_VOLTAGE_DIGITAL_CORE 150
> +#define OV5645_VOLTAGE_DIGITAL_IO   180
> +
> +#define OV5645_SYSTEM_CTRL0  0x3008
> +#define  OV5645_SYSTEM_CTRL0_START   0x02
> +#define  OV5645_SYSTEM_CTRL0_STOP0x42
> +#define OV5645_CHIP_ID_HIGH  0x300A
> +#define  OV5645_CHIP_ID_HIGH_BYTE0x56
> +#define OV5645_CHIP_ID_LOW   0x300B
> +#define  OV5645_CHIP_ID_LOW_BYTE 0x45
> +#define OV5645_AWB_MANUAL_CONTROL0x3406
> +#define  OV5645_AWB_MANUAL_ENABLEBIT(0)
> +#define OV5645_AEC_PK_MANUAL 0x3503
> +#define  OV5645_AEC_MANUAL_ENABLEBIT(0)
> +#define  OV5645_AGC_MANUAL_ENABLEBIT(1)
> +#define OV5645_TIMING_TC_REG20   0x3820
> +#define  OV5645_SENSOR_VFLIP BIT(1)
> +#define  OV5645_ISP_VFLIPBIT(2)
> +#define OV5645_TIMING_TC_REG21   0x3821
> +#define  OV5645_SENSOR_MIRRORBIT(1)
> +#define OV5645_PRE_ISP_TEST_SETTING_10x503d

You're using a mix of upper and lower case hex values in the driver. I would 
standardize on lower case as that's what the majority of the kernel code uses.

> +#define  OV5645_TEST_PATTERN_MASK0x3
> +#define  OV5645_SET_TEST_PATTERN(x)  ((x) & 
OV5645_TEST_PATTERN_MASK)
> +#define  OV5645_TEST_PATTERN_ENABLE  BIT(7)
> +#define OV5645_SDE_SAT_U 0x5583
> +#define OV5645_SDE_SAT_V 0x5584
> +
> +enum ov5645_mode {
> + OV5645_MODE_MIN = 0,

OV5645_MODE_MIN isn't used.

> + OV5645_MODE_SXGA = 0,
> + OV5645_MODE_1080P = 1,
> + OV5645_MODE_FULL = 2,
> + OV5645_MODE_MAX = 2
> +};
> +
> +struct reg_value {
> + u16 reg;
> + u8 val;
> +};
> +
> +struct ov5645_mode_info {
> + enum ov5645_mode mode;

This field is never used, you can remove it.

> + u32 width;
> + u32 height;
> + struct reg_value *data;
> + u32 data_size;
> +};
> +
> +struct ov5645 {
> + struct i2c_client *i2c_client;
> + struct device *dev;
> + struct v4l2_subdev sd;
> + struct media_pad pad;
> + struct v4l2_of_endpoint ep;
> + struct v4l2_mbus_framefmt fmt;
> + struct v4l2_rect crop;
> + struct clk *xclk;
> + /* External clock frequency currently supported is 2388Hz */
> + u32 xclk_freq;
> +
> + struct regulator *io_regulator;
> + struct regulator *core_regulator;
> + struct regulator *analog_regulator;
> +
> + enum ov5645_mode current_mode;

You could store a pointer to struct ov5645_mode_info instead, it would save 
the array lookup when using it.

> + /* Cached control values */
> + struct v4l2_ctrl_handler ctrls;
> + struct v4l2_ctrl *saturation;
> + struct v4l2_ctrl *hflip;
> + struct v4l2_ctrl *vflip;
> + struct v4l2_ctrl *autogain;
> + struct v4l2_ctrl *autoexposure;
> + struct v4l2_ctrl *awb;
> + struct v4l2_ctrl *pattern;
> +
> + struct mutex power_lock; /* lock to protect power state */
> + bool power;
> +
> + struct gpio_desc *enable_gpio;
> + struct gpio_desc *rst_gpio;
> +};
> +
> +static inline struct ov5645 *to_ov5645(struct v4l2_subdev *sd)
> +{
> + return container_of(sd, struct ov5645, sd);
> +}
> +
> +static struct reg_value ov5645_global_init_setting[] = {

You can make this static const. Same comment for the other register arrays.

> + { 0x3103, 0x11 },
> + { 0x3008, 0x82 },
> + { 0x3008, 0x42 },
> + { 0x3103, 0x03 },
> + { 0x3503, 0x07 },

[snip]

> + { 0x3503, 0x00 },

Can't you get rid of the first write to 0x3503 ?

[snip]

> +};

[snip]

> +static struct ov5645_mode_info ov5645_mode_info_data[OV5645_MODE_MAX + 1] =

static const here too.

You can leave the array size out here (ov5645_mode_info_data[]), use 
ARRAY_SIZE(ov5645_mode_info_data) instead of OV5645_MODE_MAX below, and drop 
the OV5645_MODE_MAX enum value completely. I might even go as far as dropping 
enum ov5645_mode 

Re: [PATCH v6 1/2] media: i2c/ov5645: add the device tree binding document

2016-09-08 Thread Laurent Pinchart
Hi Todor,

Thank you for the patch.

On Thursday 08 Sep 2016 12:13:54 Todor Tomov wrote:
> Add the document for ov5645 device tree binding.
> 
> Signed-off-by: Todor Tomov 
> ---
>  .../devicetree/bindings/media/i2c/ov5645.txt   | 52 +++
>  1 file changed, 52 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5645.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov5645.txt
> b/Documentation/devicetree/bindings/media/i2c/ov5645.txt new file mode
> 100644
> index 000..bcf6dba
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ov5645.txt
> @@ -0,0 +1,52 @@
> +* Omnivision 1/4-Inch 5Mp CMOS Digital Image Sensor
> +
> +The Omnivision OV5645 is a 1/4-Inch CMOS active pixel digital image sensor
> with +an active array size of 2592H x 1944V. It is programmable through a
> serial I2C +interface.
> +
> +Required Properties:
> +- compatible: Value should be "ovti,ov5645".
> +- clocks: Reference to the xclk clock.
> +- clock-names: Should be "xclk".
> +- clock-frequency: Frequency of the xclk clock.
> +- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH.
> +- reset-gpios: Chip reset GPIO. Polarity is GPIO_ACTIVE_LOW.

Shouldn't the enable and reset GPIOs be optional ?

> +- vdddo-supply: Chip digital IO regulator.
> +- vdda-supply: Chip analog regulator.
> +- vddd-supply: Chip digital core regulator.
> +
> +The device node must contain one 'port' child node for its digital output
> +video port, in accordance with the video interface bindings defined in
> +Documentation/devicetree/bindings/media/video-interfaces.txt.
> +
> +Example:
> +
> +  {
> + ...
> +
> + ov5645: ov5645@78 {
> + compatible = "ovti,ov5645";
> + reg = <0x78>;
> +
> + enable-gpios = < 6 GPIO_ACTIVE_HIGH>;
> + reset-gpios = < 20 GPIO_ACTIVE_LOW>;
> + pinctrl-names = "default";
> + pinctrl-0 = <_rear_default>;
> +
> + clocks = < 200>;
> + clock-names = "xclk";
> + clock-frequency = <2388>;
> +
> + vdddo-supply = <_dovdd_1v8>;
> + vdda-supply = <_avdd_2v8>;
> + vddd-supply = <_dvdd_1v2>;
> +
> + port {
> + ov5645_ep: endpoint {
> + clock-lanes = <1>;
> + data-lanes = <0 2>;
> + remote-endpoint = <_ep>;
> + };
> + };
> + };
> + };

-- 
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 00/47] Fix most of Sphinx warnings in nitpick mode

2016-09-08 Thread Jonathan Corbet
On Thu,  8 Sep 2016 09:03:22 -0300
Mauro Carvalho Chehab  wrote:

> Please notice that patches 2 and 3 touches at 
> Documentation/sphinx/parse-headers.pl.
> 
> If it is ok for you, I intend to merge those patches (except for patch 1)
> on my tree, including the two patches that touch at the parse-headers.pl
> script, as, currently, the only user for it is media. I'm also OK if you 
> prefer
> to merge patches 2 and 3 on your tree instead.

Go ahead and keep them with the rest.

Acked-by: Jonathan Corbet 

jon
--
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 05/47] [media] dvb_ringbuffer.h: Document all functions

2016-09-08 Thread Mauro Carvalho Chehab
There are several functions there there weren't properly
documented. Add documentation for them.

While here, make checkpatch.pl happier.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_ringbuffer.h | 179 
 1 file changed, 134 insertions(+), 45 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index 8af642399f1e..8209eb4db2aa 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -18,10 +18,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 #ifndef _DVB_RINGBUFFER_H_
@@ -30,6 +26,18 @@
 #include 
 #include 
 
+/**
+ * struct dvb_ringbuffer - Describes a ring buffer used at DVB framework
+ *
+ * @data: Area were the ringbuffer data is written
+ * @size: size of the ringbuffer
+ * @pread: next position to read
+ * @pwrite: next position to write
+ * @error: used by ringbuffer clients to indicate that an error happened.
+ * @queue: Wait queue used by ringbuffer clients to indicate when buffer
+ * was filled
+ * @lock: Spinlock used to protect the ringbuffer
+ */
 struct dvb_ringbuffer {
u8   *data;
ssize_t   size;
@@ -43,7 +51,21 @@ struct dvb_ringbuffer {
 
 #define DVB_RINGBUFFER_PKTHDRSIZE 3
 
+/**
+ * dvb_ringbuffer_init - initialize ring buffer, lock and queue
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @data: pointer to the buffer where the data will be stored
+ * @len: bytes from ring buffer into @buf
+ */
+extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data,
+   size_t len);
 
+/**
+ * dvb_ringbuffer_empty - test whether buffer is empty
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 /*
  * Notes:
  * --
@@ -72,69 +94,133 @@ struct dvb_ringbuffer {
  * Resetting the buffer counts as a read and write operation.
  * Two or more writers must be locked against each other.
  */
-
-/* initialize ring buffer, lock and queue */
-extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, 
size_t len);
-
-/* test whether buffer is empty */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
-/* return the number of free bytes in the buffer */
+/**
+ * dvb_ringbuffer_free - returns the number of free bytes in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of free bytes in the buffer
+ */
 extern ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf);
 
-/* return the number of bytes waiting in the buffer */
+/**
+ * dvb_ringbuffer_avail - returns the number of bytes waiting in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of bytes waiting in the buffer
+ */
 extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
 
-
-/*
- * Reset the read and write pointers to zero and flush the buffer
+/**
+ * dvb_ringbuffer_reset - resets the ringbuffer to initial state
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Resets the read and write pointers to zero and flush the buffer.
+ *
  * This counts as a read and write operation
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
 
-/* read routines & macros */
-/* -- */
-/* flush buffer */
+/*
+ * read routines & macros
+ */
+
+/**
+ * dvb_ringbuffer_flush - flush buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf);
 
-/* flush buffer protected by spinlock and wake-up waiting task(s) */
+/**
+ * dvb_ringbuffer_flush_spinlock_wakeup- flush buffer protected by spinlock
+ *  and wake-up waiting task(s)
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* peek at byte @offs: in the buffer */
-#define DVB_RINGBUFFER_PEEK(rbuf,offs) \
-   (rbuf)->data[((rbuf)->pread+(offs))%(rbuf)->size]
+/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+#define DVB_RINGBUFFER_PEEK(rbuf, offs)\
+   (rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
 
 /* advance read ptr by @num: bytes */
-#define DVB_RINGBUFFER_SKIP(rbuf,num)  \
-   (rbuf)->pread=((rbuf)->pread+(num))%(rbuf)->size
+#define DVB_RINGBUFFER_SKIP(rbuf, num) {\
+   (rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
+}
 
-/*
- * read @len: bytes from ring buffer into @buf:
- * @usermem: specifies whether @buf: resides in user space
- * returns 

[PATCH 46/47] [media] docs-rst: fix two wrong :name: tags

2016-09-08 Thread Mauro Carvalho Chehab
There's a typo there, causing 4 warnings:

  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference 
target not found: name
  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference 
target not found: lirc
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference 
target not found: name
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference 
target not found: v4l2

 Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/rc/lirc-read.rst  | 2 +-
 Documentation/media/uapi/v4l/func-poll.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/rc/lirc-read.rst 
b/Documentation/media/uapi/rc/lirc-read.rst
index 62bd3d8c9c67..4c678f60e872 100644
--- a/Documentation/media/uapi/rc/lirc-read.rst
+++ b/Documentation/media/uapi/rc/lirc-read.rst
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: ssize_t read( int fd, void *buf, size_t count )
-:name lirc-read
+:name: lirc-read
 
 
 Arguments
diff --git a/Documentation/media/uapi/v4l/func-poll.rst 
b/Documentation/media/uapi/v4l/func-poll.rst
index 186cd61b6cd1..d0432dc09b05 100644
--- a/Documentation/media/uapi/v4l/func-poll.rst
+++ b/Documentation/media/uapi/v4l/func-poll.rst
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
-name: v4l2-poll
+:name: v4l2-poll
 
 Arguments
 =
-- 
2.7.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 47/47] [media] rc-map.h: fix a Sphinx warning

2016-09-08 Thread Mauro Carvalho Chehab
./include/media/rc-map.h:121: WARNING: Inline emphasis start-string 
without end-string.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/rc-map.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 173ad58fb61b..3c8edb34f84a 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -117,7 +117,7 @@ struct rc_map_table {
  * @scan: pointer to struct _map_table
  * @size: Max number of entries
  * @len: Number of entries that are in use
- * @alloc: size of *scan, in bytes
+ * @alloc: size of \*scan, in bytes
  * @rc_type: type of the remote controller protocol, as defined at
  *  enum _type
  * @name: name of the key map table
-- 
2.7.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 19/47] [media] v4l2-ctrls.h: Fix some c:type references

2016-09-08 Thread Mauro Carvalho Chehab
Now that the uAPI is using c:type, let's use it here too.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index ff2847705dac..86702037cf5d 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -973,9 +973,9 @@ extern const struct v4l2_subscribed_event_ops 
v4l2_ctrl_sub_ev_ops;
  * v4l2_ctrl_replace - Function to be used as a callback to
  *  v4l2_subscribed_event_ops replace\(\)
  *
- * @old: pointer to :ref:`struct v4l2_event ` with the reported
+ * @old: pointer to struct _event with the reported
  *  event;
- * @new: pointer to :ref:`struct v4l2_event ` with the modified
+ * @new: pointer to struct _event with the modified
  *  event;
  */
 void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
@@ -984,9 +984,9 @@ void v4l2_ctrl_replace(struct v4l2_event *old, const struct 
v4l2_event *new);
  * v4l2_ctrl_merge - Function to be used as a callback to
  *  v4l2_subscribed_event_ops merge(\)
  *
- * @old: pointer to :ref:`struct v4l2_event ` with the reported
+ * @old: pointer to struct _event with the reported
  *  event;
- * @new: pointer to :ref:`struct v4l2_event ` with the merged
+ * @new: pointer to struct _event with the merged
  *  event;
  */
 void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new);
-- 
2.7.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


pull request: linux-firmware: Update Mediatek MT8173 VPU firmware

2016-09-08 Thread Andrew-CT Chen
Hi linux-firmware maintainers,

The following changes since commit c883a6b6186bb2415761d287cbac773062911212:

  rtl_bt: Add firmware and config file for RTL8822BE (2016-08-31 02:38:31 +0100)

are available in the git repository at:

  https://github.com/andrewct-chen/linux_fw_vpu_v1.0.2.git decoder_mdp

for you to fetch changes up to 5b0873b6e750f906fe4244fd173df919c66e1b73:

  mediatek: Update firmware for decoder and MDP (2016-09-08 18:58:37 +0800)


Andrew-CT Chen (1):
  mediatek: Update firmware for decoder and MDP

 vpu_d.bin |  Bin 4084848 -> 4082928 bytes
 vpu_p.bin |  Bin 131036 -> 131160 bytes
 2 files changed, 0 insertions(+), 0 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


[PATCH v6 2/6] dt-bindings: Add a binding for Mediatek MDP

2016-09-08 Thread Minghsiu Tsai
Add a DT binding documentation of MDP for the MT8173 SoC
from Mediatek

Signed-off-by: Minghsiu Tsai 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/media/mediatek-mdp.txt |  109 
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt

diff --git a/Documentation/devicetree/bindings/media/mediatek-mdp.txt 
b/Documentation/devicetree/bindings/media/mediatek-mdp.txt
new file mode 100644
index 000..4182063
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek-mdp.txt
@@ -0,0 +1,109 @@
+* Mediatek Media Data Path
+
+Media Data Path is used for scaling and color space conversion.
+
+Required properties (controller (parent) node):
+- compatible: "mediatek,mt8173-mdp"
+- mediatek,vpu: the node of video processor unit, see
+  Documentation/devicetree/bindings/media/mediatek-vpu.txt for details.
+
+Required properties (all function blocks, child node):
+- compatible: Should be one of
+"mediatek,mt8173-mdp-rdma"  - read DMA
+"mediatek,mt8173-mdp-rsz"   - resizer
+"mediatek,mt8173-mdp-wdma"  - write DMA
+"mediatek,mt8173-mdp-wrot"  - write DMA with rotation
+- reg: Physical base address and length of the function block register space
+- clocks: device clocks, see
+  Documentation/devicetree/bindings/clock/clock-bindings.txt for details.
+- power-domains: a phandle to the power domain, see
+  Documentation/devicetree/bindings/power/power_domain.txt for details.
+
+Required properties (DMA function blocks, child node):
+- compatible: Should be one of
+"mediatek,mt8173-mdp-rdma"
+"mediatek,mt8173-mdp-wdma"
+"mediatek,mt8173-mdp-wrot"
+- iommus: should point to the respective IOMMU block with master port as
+  argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
+  for details.
+- mediatek,larb: must contain the local arbiters in the current Socs, see
+  Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
+  for details.
+
+Example:
+mdp {
+   compatible = "mediatek,mt8173-mdp";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+   mediatek,vpu = <>;
+
+   mdp_rdma0: rdma@14001000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14001000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA0>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rdma1: rdma@14002000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14002000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA1>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA1>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rsz0: rsz@14003000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14003000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ0>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz1: rsz@14004000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14004000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ1>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz2: rsz@14005000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14005000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ2>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_wdma0: wdma@14006000 {
+   compatible = "mediatek,mt8173-mdp-wdma";
+   reg = <0 0x14006000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WDMA>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WDMA>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot0: wrot@14007000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14007000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT0>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot1: wrot@14008000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14008000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT1>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT1>;
+   mediatek,larb = <>;
+   };
+};
-- 
1.7.9.5

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

[PATCH v6 1/6] VPU: mediatek: Add mdp support

2016-09-08 Thread Minghsiu Tsai
VPU driver add mdp support

Signed-off-by: Minghsiu Tsai 
---
 drivers/media/platform/mtk-vpu/mtk_vpu.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.h 
b/drivers/media/platform/mtk-vpu/mtk_vpu.h
index f457479..291ae46 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.h
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.h
@@ -53,6 +53,8 @@ typedef void (*ipi_handler_t) (void *data,
 handle H264 video encoder job, and vice versa.
  * @IPI_VENC_VP8:   The interrupt fro vpu is to notify kernel to
 handle VP8 video encoder job,, and vice versa.
+ * @IPI_MDP:The interrupt from vpu is to notify kernel to
+handle MDP (Media Data Path) job, and vice versa.
  * @IPI_MAX:The maximum IPI number
  */
 
@@ -63,6 +65,7 @@ enum ipi_id {
IPI_VDEC_VP9,
IPI_VENC_H264,
IPI_VENC_VP8,
+   IPI_MDP,
IPI_MAX,
 };
 
@@ -71,11 +74,13 @@ enum ipi_id {
  *
  * @VPU_RST_ENC: encoder reset id
  * @VPU_RST_DEC: decoder reset id
+ * @VPU_RST_MDP: MDP (Media Data Path) reset id
  * @VPU_RST_MAX: maximum reset id
  */
 enum rst_id {
VPU_RST_ENC,
VPU_RST_DEC,
+   VPU_RST_MDP,
VPU_RST_MAX,
 };
 
-- 
1.7.9.5

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


Re: [PATCH v3] docs-rst: ignore arguments on macro definitions

2016-09-08 Thread Markus Heiser

Am 08.09.2016 um 13:40 schrieb Mauro Carvalho Chehab :

> Hi Jon/Markus,
> 
> Em Mon, 29 Aug 2016 16:12:39 +0200
> Markus Heiser  escreveu:
> 
>> Am 29.08.2016 um 15:13 schrieb Mauro Carvalho Chehab 
>> :
>> 
>>> A macro definition is mapped via .. c:function:: at the
>>> ReST markup when using the following kernel-doc tag:
>>> 
>>> /**
>>>  * DMX_FE_ENTRY - Casts elements in the list of registered
>>>  *   front-ends from the generic type struct list_head
>>>  *   to the type * struct dmx_frontend
>>>  *
>>>  * @list: list of struct dmx_frontend
>>>  */
>>>  #define DMX_FE_ENTRY(list) \
>>> list_entry(list, struct dmx_frontend, connectivity_list)
>>> 
>>> However, unlike a function description, the arguments of a macro
>>> doesn't contain the data type.
>>> 
>>> This causes warnings when enabling Sphinx on nitkpick mode,
>>> like this one:
>>> ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
>>> not found: list  
>> 
>> I think this is a drawback of sphinx's C-domain, using function
>> definition for macros also. From the function documentation
>> 
>> """This is also used to describe function-like preprocessor
>>macros. The names of the arguments should be given so
>>they may be used in the description."""
>> 
>> I think about to fix the nitpick message for macros (aka function
>> directive) in the C-domain extension (we already have).
>> 
>> But for this, I need a rule to distinguish between macros
>> and functions ... is the uppercase of the macro name a good
>> rule to suppress the nitpick message? Any other suggestions?
> 
> What's the status of the C domain patches meant to fix this issue?
> 
> I managed to fix most warnings on media documents on nitpick mode.
> With this patch applied, there are only 21 warnings (and all are
> due to the lack of function or struct documentation). I'm about
> to patchbomb such fixup series.
> 
> Yet, without  this patch, and latest docs-next, there are 20 extra
> bogus warnings, due to function parameters:
> 
> ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
> target not found: offs
> ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
> target not found: num
> ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
> target not found: byte
> ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target not 
> found: list
> ./include/media/media-device.h:263: WARNING: c:type reference target not 
> found: mdev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: mdev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: udev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: name
> ./include/media/media-entity.h:527: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:536: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:545: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:554: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:563: WARNING: c:type reference target not 
> found: intf
> ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
> found: entity
> ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
> found: operation
> ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
> hdl
> ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
> nr_of_controls_hint
> 
> So, it would be great if we could either merge this patch or the ones that
> Markus did (assuming they're ready for merge).

I fixed the remarks of Jon and resend v2 yesterday ...

https://www.mail-archive.com/linux-media@vger.kernel.org/msg102259.html

sorry, I'am currently in a hurry, may do you like to test the
patch, to see if we get rid of those 20 extra bogus warnings?

Thanks!

-- Markus --


--
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] ov9650: add support for asynchronous probing

2016-09-08 Thread Javier Martinez Canillas
Allow the sub-device to be probed asynchronously so a bridge driver that's
waiting for the device can be notified and its .bound callback executed.

Signed-off-by: Javier Martinez Canillas 

---

 drivers/media/i2c/ov9650.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c
index be5a7fd4f076..502c72238a4a 100644
--- a/drivers/media/i2c/ov9650.c
+++ b/drivers/media/i2c/ov9650.c
@@ -23,6 +23,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1520,6 +1521,10 @@ static int ov965x_probe(struct i2c_client *client,
/* Update exposure time min/max to match frame format */
ov965x_update_exposure_ctrl(ov965x);
 
+   ret = v4l2_async_register_subdev(sd);
+   if (ret < 0)
+   goto err_ctrls;
+
return 0;
 err_ctrls:
v4l2_ctrl_handler_free(sd->ctrl_handler);
@@ -1532,7 +1537,7 @@ static int ov965x_remove(struct i2c_client *client)
 {
struct v4l2_subdev *sd = i2c_get_clientdata(client);
 
-   v4l2_device_unregister_subdev(sd);
+   v4l2_async_unregister_subdev(sd);
v4l2_ctrl_handler_free(sd->ctrl_handler);
media_entity_cleanup(>entity);
 
-- 
2.7.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 v6 3/6] media: Add Mediatek MDP Driver

2016-09-08 Thread Minghsiu Tsai
Add MDP driver for MT8173

Signed-off-by: Minghsiu Tsai 
---
 drivers/media/platform/Kconfig|   17 +
 drivers/media/platform/Makefile   |2 +
 drivers/media/platform/mtk-mdp/Makefile   |9 +
 drivers/media/platform/mtk-mdp/mtk_mdp_comp.c |  159 
 drivers/media/platform/mtk-mdp/mtk_mdp_comp.h |   72 ++
 drivers/media/platform/mtk-mdp/mtk_mdp_core.c |  294 ++
 drivers/media/platform/mtk-mdp/mtk_mdp_core.h |  260 +
 drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h  |  126 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c  | 1270 +
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h  |   22 +
 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c |  152 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_regs.h |   31 +
 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c  |  145 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h  |   41 +
 14 files changed, 2600 insertions(+)
 create mode 100644 drivers/media/platform/mtk-mdp/Makefile
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index f25344b..0c88532 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -166,6 +166,23 @@ config VIDEO_MEDIATEK_VPU
To compile this driver as a module, choose M here: the
module will be called mtk-vpu.
 
+config VIDEO_MEDIATEK_MDP
+   tristate "Mediatek MDP driver"
+   depends on MTK_IOMMU || COMPILE_TEST
+   depends on VIDEO_DEV && VIDEO_V4L2
+   depends on ARCH_MEDIATEK || COMPILE_TEST
+   depends on HAS_DMA
+   select VIDEOBUF2_DMA_CONTIG
+   select V4L2_MEM2MEM_DEV
+   select VIDEO_MEDIATEK_VPU
+   default n
+   ---help---
+   It is a v4l2 driver and present in Mediatek MT8173 SoCs.
+   The driver supports for scaling and color space conversion.
+
+   To compile this driver as a module, choose M here: the
+   module will be called mtk-mdp.
+
 config VIDEO_MEDIATEK_VCODEC
tristate "Mediatek Video Codec driver"
depends on MTK_IOMMU || COMPILE_TEST
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 21771c1..221aace 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -63,3 +63,5 @@ ccflags-y += -I$(srctree)/drivers/media/i2c
 obj-$(CONFIG_VIDEO_MEDIATEK_VPU)   += mtk-vpu/
 
 obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC)+= mtk-vcodec/
+
+obj-$(CONFIG_VIDEO_MEDIATEK_MDP)   += mtk-mdp/
diff --git a/drivers/media/platform/mtk-mdp/Makefile 
b/drivers/media/platform/mtk-mdp/Makefile
new file mode 100644
index 000..f802569
--- /dev/null
+++ b/drivers/media/platform/mtk-mdp/Makefile
@@ -0,0 +1,9 @@
+mtk-mdp-y += mtk_mdp_core.o
+mtk-mdp-y += mtk_mdp_comp.o
+mtk-mdp-y += mtk_mdp_m2m.o
+mtk-mdp-y += mtk_mdp_regs.o
+mtk-mdp-y += mtk_mdp_vpu.o
+
+obj-$(CONFIG_VIDEO_MEDIATEK_MDP) += mtk-mdp.o
+
+ccflags-y += -I$(srctree)/drivers/media/platform/mtk-vpu
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
new file mode 100644
index 000..aa8f9fd
--- /dev/null
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2016 MediaTek Inc.
+ * Author: Ming Hsiu Tsai 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "mtk_mdp_comp.h"
+
+
+static const char * const mtk_mdp_comp_stem[MTK_MDP_COMP_TYPE_MAX] = {
+   "mdp_rdma",
+   "mdp_rsz",
+   "mdp_wdma",
+   "mdp_wrot",
+};
+
+struct mtk_mdp_comp_match {
+   enum mtk_mdp_comp_type type;
+   int alias_id;
+};
+
+static const struct mtk_mdp_comp_match mtk_mdp_matches[MTK_MDP_COMP_ID_MAX] = {
+   { MTK_MDP_RDMA, 0 },
+   { MTK_MDP_RDMA, 1 },
+   { 

[PATCH v6 5/6] media: mtk-mdp: support pixelformat V4L2_PIX_FMT_MT21C

2016-09-08 Thread Minghsiu Tsai
Add V4L2_PIX_FMT_MT21C in format list.

Signed-off-by: Minghsiu Tsai 
---
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c  |8 
 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c |4 
 2 files changed, 12 insertions(+)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 0655027..a90972e 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -54,6 +54,14 @@ static struct mtk_mdp_pix_align mtk_mdp_size_align = {
 
 static const struct mtk_mdp_fmt mtk_mdp_formats[] = {
{
+   .pixelformat= V4L2_PIX_FMT_MT21C,
+   .depth  = { 8, 4 },
+   .row_depth  = { 8, 8 },
+   .num_planes = 2,
+   .num_comp   = 2,
+   .align  = _mdp_size_align,
+   .flags  = MTK_MDP_FMT_FLAG_OUTPUT,
+   }, {
.pixelformat= V4L2_PIX_FMT_NV12M,
.depth  = { 8, 4 },
.row_depth  = { 8, 8 },
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
index a5601e1..86d57f3 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
@@ -29,6 +29,8 @@ enum MDP_COLOR_ENUM {
MDP_COLOR_NV12 = MDP_COLORFMT_PACK(0, 2, 1, 1, 1, 8, 1, 0, 12),
MDP_COLOR_I420 = MDP_COLORFMT_PACK(0, 3, 0, 1, 1, 8, 1, 0, 8),
MDP_COLOR_YV12 = MDP_COLORFMT_PACK(0, 3, 0, 1, 1, 8, 1, 1, 8),
+   /* Mediatek proprietary format */
+   MDP_COLOR_420_MT21 = MDP_COLORFMT_PACK(5, 2, 1, 1, 1, 256, 1, 0, 12),
 };
 
 static int32_t mtk_mdp_map_color_format(int v4l2_format)
@@ -37,6 +39,8 @@ static int32_t mtk_mdp_map_color_format(int v4l2_format)
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV12:
return MDP_COLOR_NV12;
+   case V4L2_PIX_FMT_MT21C:
+   return MDP_COLOR_420_MT21;
case V4L2_PIX_FMT_YUV420M:
case V4L2_PIX_FMT_YUV420:
return MDP_COLOR_I420;
-- 
1.7.9.5

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


[PATCH v6 0/6] Add MT8173 MDP Driver

2016-09-08 Thread Minghsiu Tsai
Changes in v6:
- s_selection() can't set the _DEFAULT and _BOUNDS targets
- Add Maintainers entry

Changes in v5:
- Add ack in the comment of dts patch
- Fix s/g_selection()
- Separate format V4L2_PIX_FMT_MT21C into new patch  

Changes in v4:
- Add "depends on HAS_DMA" in Kconfig.
- Fix s/g_selection()
- Replace struct v4l2_crop with u32 and struct v4l2_rect
- Remove VB2_USERPTR
- Move mutex lock after ctx allocation in mtk_mdp_m2m_open()
- Add new format V4L2_PIX_FMT_YVU420 to support software on Android platform.
- Only width/height of image in format V4L2_PIX_FMT_MT21 is aligned to 16/16,
  other ones are aligned to 2/2 by default

Changes in v3:
- Modify device ndoe as structured one.
- Fix conflict in dts on Linux 4.8-rc1

Changes in v2:
- Add section to describe blocks function in dts-bindings
- Remove the assignment of device_caps in querycap()
- Remove format's name assignment
- Copy colorspace-related parameters from OUTPUT to CAPTURE
- Use m2m helper functions
- Fix DMA allocation failure
- Initialize lazily vpu instance in streamon()

==
 Introduction
==

The purpose of this series is to add the driver for Media Data Path HW embedded 
in the Mediatek's MT8173 SoC.
MDP is used for scaling and color space conversion.

It could convert V4L2_PIX_FMT_MT21 to V4L2_PIX_FMT_NV12M or 
V4L2_PIX_FMT_YUV420M.

NV12M/YUV420M/MT21 -> MDP -> NV12M/YUV420M

This patch series rely on MTK VPU driver in patch series "Add MT8173 Video 
Encoder Driver and VPU Driver"[1] and "Add MT8173 Video Decoder Driver"[2].
MDP driver rely on VPU driver to load, communicate with VPU.

Internally the driver uses videobuf2 framework and MTK IOMMU and MTK SMI both 
have been merged in v4.6-rc1.

[1]https://patchwork.kernel.org/patch/9002171/
[2]https://patchwork.kernel.org/patch/9141245/

==
 Device interface
==

In principle the driver bases on v4l2 memory-to-memory framework:
it provides a single video node and each opened file handle gets its own 
private context with separate buffer queues. Each context consist of 2 buffer 
queues: OUTPUT (for source buffers) and CAPTURE (for destination buffers).
OUTPUT and CAPTURE buffer could be MMAP or DMABUF memory type.

v4l2-compliance test output:
v4l2-compliance SHA   : abc1453dfe89f244dccd3460d8e1a2e3091cbadb

Driver Info:
Driver name   : mtk-mdp
Card type : soc:mdp
Bus info  : platform:mt8173
Driver version: 4.8.0
Capabilities  : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format

Compliance test for device /dev/image-proc0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 5 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test 

[PATCH v6 4/6] arm64: dts: mediatek: Add MDP for MT8173

2016-09-08 Thread Minghsiu Tsai
Add MDP node for MT8173

Signed-off-by: Minghsiu Tsai 
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi |   84 ++
 1 file changed, 84 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi 
b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 10f638f..cd93228 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -41,6 +41,14 @@
dpi0 = 
dsi0 = 
dsi1 = 
+   mdp_rdma0 = _rdma0;
+   mdp_rdma1 = _rdma1;
+   mdp_rsz0 = _rsz0;
+   mdp_rsz1 = _rsz1;
+   mdp_rsz2 = _rsz2;
+   mdp_wdma0 = _wdma0;
+   mdp_wrot0 = _wrot0;
+   mdp_wrot1 = _wrot1;
};
 
cpus {
@@ -716,6 +724,82 @@
#clock-cells = <1>;
};
 
+   mdp {
+   compatible = "mediatek,mt8173-mdp";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+   mediatek,vpu = <>;
+
+   mdp_rdma0: rdma@14001000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14001000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA0>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rdma1: rdma@14002000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14002000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA1>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA1>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rsz0: rsz@14003000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14003000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ0>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz1: rsz@14004000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14004000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ1>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz2: rsz@14005000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14005000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ2>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_wdma0: wdma@14006000 {
+   compatible = "mediatek,mt8173-mdp-wdma";
+   reg = <0 0x14006000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WDMA>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WDMA>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot0: wrot@14007000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14007000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT0>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot1: wrot@14008000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14008000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT1>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT1>;
+   mediatek,larb = <>;
+   };
+   };
+
ovl0: ovl@1400c000 {
compatible = "mediatek,mt8173-disp-ovl";
reg = <0 0x1400c000 0 0x1000>;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org

[PATCH v6 6/6] media: mtk-mdp: add Maintainers entry for Mediatek MDP driver

2016-09-08 Thread Minghsiu Tsai
Add Minghsiu Tsai, Houlong Wei and Andrew-CT Chen as
maintainers for Mediatek MDP driver

Signed-off-by: Minghsiu Tsai 
Signed-off-by: Houlong Wei 
Signed-off-by: Andrew-CT Chen 
---
 MAINTAINERS |9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 20bb1d0..e17e681 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7605,6 +7605,15 @@ L:   net...@vger.kernel.org
 S: Maintained
 F: drivers/net/ethernet/mediatek/
 
+MEDIATEK MDP DRIVER
+M: Minghsiu Tsai 
+M: Houlong Wei 
+M: Andrew-CT Chen 
+S: Supported
+F: drivers/media/platform/mtk-mdp/
+F: drivers/media/platform/mtk-vpu/
+F: Documentation/devicetree/bindings/media/mediatek-mdp.txt
+
 MEDIATEK MT7601U WIRELESS LAN DRIVER
 M: Jakub Kicinski 
 L: linux-wirel...@vger.kernel.org
-- 
1.7.9.5

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


Re: [PATCH 03/47] docs-rst: parse-headers.pl: use the C domain for cross-references

2016-09-08 Thread Markus Heiser
Hi 

BTW: porting parse-headers to python / get rid of media/Makefile

* https://www.mail-archive.com/linux-media@vger.kernel.org/msg101261.html

I think last relevant comment was from you Mauro:

* https://www.mail-archive.com/linux-media@vger.kernel.org/msg101426.html

should we continue this task? If yes what are the next steps, where can I help?

-- Markus --



Am 08.09.2016 um 14:03 schrieb Mauro Carvalho Chehab :

> Instead of keep using the normal reference, move to the C
> domain ones. Using C domains everywhere will allow
> cross-references between kAPI and uAPI docs.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
> Documentation/sphinx/parse-headers.pl | 113 ++
> 1 file changed, 59 insertions(+), 54 deletions(-)
> 
> diff --git a/Documentation/sphinx/parse-headers.pl 
> b/Documentation/sphinx/parse-headers.pl
> index 531c710fc73f..db0186a7618f 100755
> --- a/Documentation/sphinx/parse-headers.pl
> +++ b/Documentation/sphinx/parse-headers.pl
> @@ -57,7 +57,7 @@ while () {
>   $n =~ tr/A-Z/a-z/;
>   $n =~ tr/_/-/;
> 
> - $enum_symbols{$s} = $n;
> + $enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
> 
>   $is_enum = 0 if ($is_enum && m/\}/);
>   next;
> @@ -69,7 +69,7 @@ while () {
>   my $n = $1;
>   $n =~ tr/A-Z/a-z/;
> 
> - $ioctls{$s} = $n;
> + $ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
>   next;
>   }
> 
> @@ -79,17 +79,15 @@ while () {
>   $n =~ tr/A-Z/a-z/;
>   $n =~ tr/_/-/;
> 
> - $defines{$s} = $n;
> + $defines{$s} = "\\ :ref:`$s <$n>`\\ ";
>   next;
>   }
> 
> - if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
> - my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> + if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
> + my $s = $2;
> + my $n = $3;
> 
> - $typedefs{$s} = $n;
> + $typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
>   next;
>   }
>   if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
> @@ -97,11 +95,8 @@ while () {
>   || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
>   || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
>   my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> 
> - $enums{$s} = $n;
> + $enums{$s} =  "enum :c:type:`$s`\\ ";
> 
>   $is_enum = $1;
>   next;
> @@ -112,11 +107,8 @@ while () {
>   || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
>   ) {
>   my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> 
> - $structs{$s} = $n;
> + $structs{$s} = "struct :c:type:`$s`\\ ";
>   next;
>   }
> }
> @@ -129,12 +121,9 @@ close IN;
> my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
>  $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
> foreach my $m (@matches) {
> - my $s = $m;
> - my $n = $m;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> + my $s = $m;
> 
> - $typedefs{$s} = $n;
> + $typedefs{$s} = "\\ :c:type:`$s`\\ ";
>   next;
> }
> 
> @@ -142,6 +131,15 @@ foreach my $m (@matches) {
> # Handle exceptions, if any
> #
> 
> +my %def_reftype = (
> + "ioctl"   => ":ref",
> + "define"  => ":ref",
> + "symbol"  => ":ref",
> + "typedef" => ":c:type",
> + "enum"=> ":c:type",
> + "struct"  => ":c:type",
> +);
> +
> if ($file_exceptions) {
>   open IN, $file_exceptions or die "Can't read $file_exceptions";
>   while () {
> @@ -175,29 +173,49 @@ if ($file_exceptions) {
>   }
> 
>   # Parsers to replace a symbol
> + my ($type, $old, $new, $reftype);
> 
> - if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
> - $ioctls{$1} = $2 if (exists($ioctls{$1}));
> + if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
> + $type = $1;
> + $old = $2;
> + $new = $3;
> + } else {
> + die "Can't parse $file_exceptions: $_";
> + }
> +
> + if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
> + $reftype = ":c:$1";
> + $new = $2;
> + } elsif ($new =~ m/\:ref\:\`(.+)\`/) {
> + $reftype = ":ref";
> + $new = $1;
> + } else {
> + $reftype = $def_reftype{$type};
> + }
> + $new = "$reftype:`$old <$new>`";
> +
> + 

[PATCH] [media] cec: fix Kconfig help text

2016-09-08 Thread Jean Delvare
MEDIA_CEC is no longer a tristate option, so the user can't actually
choose M. Whether the code is built-in or built as a module is
decided somewhere else. 

Signed-off-by: Jean Delvare 
Fixes: 5bb2399a4fe4 ("[media] cec: fix Kconfig dependency problems")
Cc: Hans Verkuil 
Cc: Arnd Bergmann 
Cc: Mauro Carvalho Chehab 
---
 drivers/staging/media/cec/Kconfig |3 ---
 1 file changed, 3 deletions(-)

--- linux-4.8-rc5.orig/drivers/staging/media/cec/Kconfig2016-09-04 
23:31:46.0 +0200
+++ linux-4.8-rc5/drivers/staging/media/cec/Kconfig 2016-09-08 
17:20:03.048392694 +0200
@@ -5,9 +5,6 @@ config MEDIA_CEC
---help---
  Enable the CEC API.
 
- To compile this driver as a module, choose M here: the
- module will be called cec.
-
 config MEDIA_CEC_DEBUG
bool "CEC debugfs interface (EXPERIMENTAL)"
depends on MEDIA_CEC && DEBUG_FS


-- 
Jean Delvare
SUSE L3 Support
--
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] omap3isp: don't call of_node_put

2016-09-08 Thread H. Nikolaus Schaller
of_node_put() has already been called inside of_graph_get_next_endpoint().

Otherwise we may get warnings like

[   10.118286] omap3isp 480bc000.isp: parsing endpoint 
/ocp/isp@480bc000/ports/port@0/endpoint, interface 0
[   10.118499] ERROR: Bad of_node_put() on 
/ocp/isp@480bc000/ports/port@0/endpoint
[   10.118499] CPU: 0 PID: 968 Comm: udevd Not tainted 4.7.0-rc4-letux+ #376
[   10.118530] Hardware name: Generic OMAP36xx (Flattened Device Tree)
[   10.118560] [] (unwind_backtrace) from [] 
(show_stack+0x10/0x14)
[   10.118591] [] (show_stack) from [] 
(dump_stack+0x98/0xd0)
[   10.118591] [] (dump_stack) from [] 
(kobject_release+0x60/0x74)
[   10.118621] [] (kobject_release) from [] 
(__of_get_next_child+0x40/0x48)
[   10.118652] [] (__of_get_next_child) from [] 
(of_get_next_child+0x28/0x44)
[   10.118652] [] (of_get_next_child) from [] 
(of_graph_get_next_endpoint+0xe4/0x124)
[   10.118804] [] (of_graph_get_next_endpoint) from [] 
(isp_probe+0xdc/0xd80 [omap3_isp])
[   10.118896] [] (isp_probe [omap3_isp]) from [] 
(platform_drv_probe+0x50/0xa0)
[   10.118927] [] (platform_drv_probe) from [] 
(driver_probe_device+0x134/0x29c)
[   10.118957] [] (driver_probe_device) from [] 
(__driver_attach+0x88/0xac)
[   10.118957] [] (__driver_attach) from [] 
(bus_for_each_dev+0x6c/0x90)
[   10.118957] [] (bus_for_each_dev) from [] 
(bus_add_driver+0xcc/0x1e8)
[   10.118988] [] (bus_add_driver) from [] 
(driver_register+0xac/0xf4)
[   10.118988] [] (driver_register) from [] 
(do_one_initcall+0xac/0x154)
[   10.119018] [] (do_one_initcall) from [] 
(do_init_module+0x58/0x39c)
[   10.119049] [] (do_init_module) from [] 
(load_module+0xe5c/0x1004)
[   10.119049] [] (load_module) from [] 
(SyS_finit_module+0x88/0x90)
[   10.119079] [] (SyS_finit_module) from [] 
(ret_fast_syscall+0x0/0x1c)

Signed-off-by: H. Nikolaus Schaller 
---
 drivers/media/platform/omap3isp/isp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index 5d54e2c..6e2624e 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2114,7 +2114,6 @@ static int isp_of_parse_nodes(struct device *dev,
 
isd = devm_kzalloc(dev, sizeof(*isd), GFP_KERNEL);
if (!isd) {
-   of_node_put(node);
return -ENOMEM;
}
 
@@ -2126,7 +2125,7 @@ static int isp_of_parse_nodes(struct device *dev,
}
 
isd->asd.match.of.node = of_graph_get_remote_port_parent(node);
-   of_node_put(node);
+
if (!isd->asd.match.of.node) {
dev_warn(dev, "bad remote port parent\n");
return -EINVAL;
-- 
2.7.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


Re: [PATCH 2/2] v4l-utils: fixed dvbv5 vdr format

2016-09-08 Thread VDR User
>> There is already a publicly available VDR repository offering the
>> current stable & developer versions, along with all previous versions:
>> http://www.tvdr.de/download.htm
>
> ?? these are tarballs, where is the version control system?

That would be a question for Klaus, the author of VDR. I will say that
whatever system he uses for `version control` has seemed to work fine
in the 12 years or so I've been using VDR. If it's that important to
you to download from git instead, you can use the following mirror:
https://projects.vdr-developer.org/git/vdr.git/

Don't expect that to be of any real advantage however. VDR is not
developed that way.

>> It's best to refer to VDRs packaged documention. You can get the
>> channels.conf format definition with `man 5 vdr`.
>
> Good point, but I have only 2.2 installed, so where get I the backward
> informations .. should I extract all theses tarballs and read through
> them .. you see my point?

That's not necessary. Klaus has designed VDR in such a way that things
don't break when they're updated. You only need to refer to the
documentation of the most recent version.

>> That wiki shouldn't be viewed as a main reference point in general but
>> especially for scanning.
>
> And the main ref is https://www.linuxtv.org ... which is not updated?

That page is certainly outdated and has never been considered a main
reference. People by far have always used vdrportal, another forum
which is now defunct (which focused on NA/SA), and the VDR mailing
list as their main reference points.

> What I said, nobody use the vdr format of dvbv5-tools, since it
> is broken and now, Chris and I want to fix it.

That, and there are other tools that are easier and/or simply work
better for some people (such as nscan).

>> I'd recommend posting to the VDR mailing list where you'll find more
>> people who use and would be affected by these changes. Additionally,
>> you could inquire at vdr-portal.de, which is one of the most supported
>> VDR forums for both users and developers.
>
> Chris and I want to patch something in v4l-utils which is broken
> and YOU make the assumption that our patches are not OK ... and now, #
> I have to ask someone other on a different projects ML and their portal?

I made no claim whether your patches are ok or not. I simply said you
should not intentionally or unnecessarily break backwards
compatibility, and I based that comment on what others have said.
Additionally, if you want to update tools to be more usable why
wouldn't you want input from the very people you hope will use them?!
Suggesting you should inquire on the VDR mailing list is clearly NOT
bad advice.

> If you have a doubt about the patches from Chris and mine, make a test and
> if you see any regression it would be great to post your experience here ...

Since everything I say is met with resistance, I think I'll pass. I
only replied in this thread to help but now I've lost interest. Good
luck with your patch however.
--
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] [media] ov9650: add support for asynchronous probing

2016-09-08 Thread H. Nikolaus Schaller

> Am 08.09.2016 um 15:05 schrieb Javier Martinez Canillas 
> :
> 
> Allow the sub-device to be probed asynchronously so a bridge driver that's
> waiting for the device can be notified and its .bound callback executed.
> 
> Signed-off-by: Javier Martinez Canillas 

Tested-by: h...@goldelico.com

> 
> ---
> 
> drivers/media/i2c/ov9650.c | 7 ++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c
> index be5a7fd4f076..502c72238a4a 100644
> --- a/drivers/media/i2c/ov9650.c
> +++ b/drivers/media/i2c/ov9650.c
> @@ -23,6 +23,7 @@
> #include 
> 
> #include 
> +#include 
> #include 
> #include 
> #include 
> @@ -1520,6 +1521,10 @@ static int ov965x_probe(struct i2c_client *client,
>   /* Update exposure time min/max to match frame format */
>   ov965x_update_exposure_ctrl(ov965x);
> 
> + ret = v4l2_async_register_subdev(sd);
> + if (ret < 0)
> + goto err_ctrls;
> +
>   return 0;
> err_ctrls:
>   v4l2_ctrl_handler_free(sd->ctrl_handler);
> @@ -1532,7 +1537,7 @@ static int ov965x_remove(struct i2c_client *client)
> {
>   struct v4l2_subdev *sd = i2c_get_clientdata(client);
> 
> - v4l2_device_unregister_subdev(sd);
> + v4l2_async_unregister_subdev(sd);
>   v4l2_ctrl_handler_free(sd->ctrl_handler);
>   media_entity_cleanup(>entity);
> 
> -- 
> 2.7.4
> 

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


Re: [PATCH 2/2] v4l-utils: fixed dvbv5 vdr format

2016-09-08 Thread Mauro Carvalho Chehab
Em Wed, 7 Sep 2016 10:59:32 -0700
VDR User  escreveu:

> I use nscan, which has easily been the
> most successful of the scanners. An additional benefit to nscan is you
> only supply a single transponder on the command line and it will
> populate a channel list for the entire sat. You don't need to supply
> an entire list of transponders to scan.

Well, AFAIKT, nowadays, almost all scanners need just one frequency for
satellite and cable to get all channels (and even for some DVB-T/T2
broadcasters, but this is a way more commonly found on DVB-S/S2/C).

If the extra transponders are listed via other NIT tables (it depends on
the broadcaster), an extra parameter is needed (-N, in the case of
dvbv5-scan), as the scan time per channel increases a lot if it has to
wait to receive all NIT tables. So, most scanners default to use just
the main NIT table, providing an option to parse the other ones.


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


[PATCH 03/15] [media] v4l2-mem2mem.h: document function arguments

2016-09-08 Thread Mauro Carvalho Chehab
There are lots of troubles with the function arguments on this
file. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-mem2mem.h | 93 +---
 1 file changed, 80 insertions(+), 13 deletions(-)

diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index e5449a2c8475..78eadca27a21 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -97,11 +97,16 @@ struct v4l2_m2m_buffer {
 /**
  * v4l2_m2m_get_curr_priv() - return driver private data for the currently
  * running instance or NULL if no instance is running
+ *
+ * @m2m_dev: pointer to struct _m2m_dev
  */
 void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev);
 
 /**
  * v4l2_m2m_get_vq() - return vb2_queue for the given type
+ *
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @type: type of the V4L2 buffer, as defined by enum _buf_type
  */
 struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx,
   enum v4l2_buf_type type);
@@ -109,7 +114,8 @@ struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx 
*m2m_ctx,
 /**
  * v4l2_m2m_try_schedule() - check whether an instance is ready to be added to
  * the pending job queue and add it if so.
- * @m2m_ctx:   m2m context assigned to the instance to be checked
+ *
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
  *
  * There are three basic requirements an instance has to meet to be able to 
run:
  * 1) at least one source buffer has to be queued,
@@ -132,6 +138,9 @@ void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx);
  * v4l2_m2m_job_finish() - inform the framework that a job has been finished
  * and have it clean up
  *
+ * @m2m_dev: pointer to struct _m2m_dev
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ *
  * Called by a driver to yield back the device after it has finished with it.
  * Should be called as soon as possible after reaching a state which allows
  * other instances to take control of the device.
@@ -151,6 +160,10 @@ v4l2_m2m_buf_done(struct vb2_v4l2_buffer *buf, enum 
vb2_buffer_state state)
 
 /**
  * v4l2_m2m_reqbufs() - multi-queue-aware REQBUFS multiplexer
+ *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @reqbufs: pointer to struct _requestbuffers
  */
 int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 struct v4l2_requestbuffers *reqbufs);
@@ -158,6 +171,10 @@ int v4l2_m2m_reqbufs(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 /**
  * v4l2_m2m_querybuf() - multi-queue-aware QUERYBUF multiplexer
  *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @buf: pointer to struct _buffer
+ *
  * See v4l2_m2m_mmap() documentation for details.
  */
 int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
@@ -166,6 +183,10 @@ int v4l2_m2m_querybuf(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 /**
  * v4l2_m2m_qbuf() - enqueue a source or destination buffer, depending on
  * the type
+ *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @buf: pointer to struct _buffer
  */
 int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
  struct v4l2_buffer *buf);
@@ -173,6 +194,10 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx 
*m2m_ctx,
 /**
  * v4l2_m2m_dqbuf() - dequeue a source or destination buffer, depending on
  * the type
+ *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @buf: pointer to struct _buffer
  */
 int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
   struct v4l2_buffer *buf);
@@ -180,6 +205,10 @@ int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx 
*m2m_ctx,
 /**
  * v4l2_m2m_prepare_buf() - prepare a source or destination buffer, depending 
on
  * the type
+ *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @buf: pointer to struct _buffer
  */
 int v4l2_m2m_prepare_buf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 struct v4l2_buffer *buf);
@@ -187,6 +216,10 @@ int v4l2_m2m_prepare_buf(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 /**
  * v4l2_m2m_create_bufs() - create a source or destination buffer, depending
  * on the type
+ *
+ * @file: pointer to struct 
+ * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
+ * @create: pointer to struct _create_buffers
  */
 int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 struct v4l2_create_buffers *create);
@@ -194,18 +227,30 @@ int v4l2_m2m_create_bufs(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 /**
  * v4l2_m2m_expbuf() 

[PATCH 00/15] Fix another set of nitpick warnings

2016-09-08 Thread Mauro Carvalho Chehab
After this series, there are only 3 warnings left:

./include/media/media-entity.h:1053: warning: No description found for 
parameter '...'
./include/media/v4l2-mem2mem.h:339: WARNING: c:type reference target not found: 
queue_init
./include/media/v4l2-subdev.h:424: WARNING: c:type reference target not found: 
v4l2_sliced_vbi_line

The first two seems to be related to some kernel-doc parser issue.

The last one is actually a documentation error: the documentation is pointing 
to a
struct that doesn't exist! Probably, it got renamed during development.

I'll look into those three remaining issues likely tomorrow.

Mauro Carvalho Chehab (15):
  [media] mc-core.rst: fix a warning about an internal routine
  [media] v4l2-mem2mem.h: move descriptions from .c file
  [media] v4l2-mem2mem.h: document function arguments
  [media] v4l2-mem2mem.h: document the public structures
  [media] v4l2-mem2mem.h: make kernel-doc parse v4l2-mem2mem.h again
  [media] conf_nitpick.py: ignore an opaque struct from v4l2-mem2mem.h
  [media] videobuf2-core.h: move function descriptions from c file
  [media] videobuf2-core.h: document enum vb2_memory
  [media] videobuf2-core.h: improve documentation
  [media] conf_nitpick.py: ignore C domain data used on vb2
  [media] videobuf2-v4l2.h: get kernel-doc tags from C file
  [media] videobuf2-v4l2.h: improve documentation
  [media] videobuf2-v4l2: document two helper functions
  [media] v4l2-flash-led-class.h: document v4l2_flash_ops
  [media] v4l2-subdev: fix some references to v4l2_dev

 Documentation/media/conf_nitpick.py  |   8 +
 drivers/media/v4l2-core/v4l2-mem2mem.c   | 128 +--
 drivers/media/v4l2-core/videobuf2-core.c | 254 -
 drivers/media/v4l2-core/videobuf2-v4l2.c | 142 
 include/media/media-devnode.h|   3 +-
 include/media/v4l2-flash-led-class.h |  15 +-
 include/media/v4l2-mem2mem.h | 262 --
 include/media/v4l2-subdev.h  |   8 +-
 include/media/videobuf2-core.h   | 372 ---
 include/media/videobuf2-v4l2.h   | 182 ++-
 10 files changed, 791 insertions(+), 583 deletions(-)

-- 
2.7.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: constify vb2_ops structures

2016-09-08 Thread Julia Lawall
Check for vb2_ops structures that are only stored in the ops field of a
vb2_queue structure.  That field is declared const, so vb2_ops structures
that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p = { ... };

@ok@
identifier r.i;
struct vb2_queue e;
position p;
@@
e.ops = @p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct vb2_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct vb2_ops i = { ... };
// 

Signed-off-by: Julia Lawall 

---
 drivers/media/pci/cx23885/cx23885-417.c|2 +-
 drivers/media/pci/cx23885/cx23885-dvb.c|2 +-
 drivers/media/pci/cx23885/cx23885-video.c  |2 +-
 drivers/media/pci/cx25821/cx25821-video.c  |2 +-
 drivers/media/pci/cx88/cx88-blackbird.c|2 +-
 drivers/media/pci/cx88/cx88-dvb.c  |2 +-
 drivers/media/pci/cx88/cx88-video.c|2 +-
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c |2 +-
 drivers/media/pci/saa7134/saa7134-empress.c|2 +-
 drivers/media/pci/saa7134/saa7134-video.c  |2 +-
 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c |2 +-
 drivers/media/pci/tw68/tw68-video.c|2 +-
 drivers/media/pci/tw686x/tw686x-video.c|2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c 
b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
index 3991643..25a2137 100644
--- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
+++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
@@ -759,7 +759,7 @@ static void solo_enc_buf_finish(struct vb2_buffer *vb)
}
 }
 
-static struct vb2_ops solo_enc_video_qops = {
+static const struct vb2_ops solo_enc_video_qops = {
.queue_setup= solo_enc_queue_setup,
.buf_queue  = solo_enc_buf_queue,
.buf_finish = solo_enc_buf_finish,
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c 
b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index ac547cb..b078ac2 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -353,7 +353,7 @@ static void netup_unidvb_stop_streaming(struct vb2_queue *q)
netup_unidvb_queue_cleanup(dma);
 }
 
-static struct vb2_ops dvb_qops = {
+static const struct vb2_ops dvb_qops = {
.queue_setup= netup_unidvb_queue_setup,
.buf_prepare= netup_unidvb_buf_prepare,
.buf_queue  = netup_unidvb_buf_queue,
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c 
b/drivers/media/pci/cx88/cx88-blackbird.c
index 04fe9af..b532e49 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -756,7 +756,7 @@ static void stop_streaming(struct vb2_queue *q)
spin_unlock_irqrestore(>slock, flags);
 }
 
-static struct vb2_ops blackbird_qops = {
+static const struct vb2_ops blackbird_qops = {
.queue_setup= queue_setup,
.buf_prepare  = buffer_prepare,
.buf_finish = buffer_finish,
diff --git a/drivers/media/pci/cx88/cx88-dvb.c 
b/drivers/media/pci/cx88/cx88-dvb.c
index 5bb63e7..ac2392d 100644
--- a/drivers/media/pci/cx88/cx88-dvb.c
+++ b/drivers/media/pci/cx88/cx88-dvb.c
@@ -156,7 +156,7 @@ static void stop_streaming(struct vb2_queue *q)
spin_unlock_irqrestore(>slock, flags);
 }
 
-static struct vb2_ops dvb_qops = {
+static const struct vb2_ops dvb_qops = {
.queue_setup= queue_setup,
.buf_prepare  = buffer_prepare,
.buf_finish = buffer_finish,
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 5dc1e3f..d83eb3b 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -567,7 +567,7 @@ static void stop_streaming(struct vb2_queue *q)
spin_unlock_irqrestore(>slock, flags);
 }
 
-static struct vb2_ops cx8800_video_qops = {
+static const struct vb2_ops cx8800_video_qops = {
.queue_setup= queue_setup,
.buf_prepare  = buffer_prepare,
.buf_finish = buffer_finish,
diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
b/drivers/media/pci/tw686x/tw686x-video.c
index cdb16de..7339b9a 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -577,7 +577,7 @@ static int tw686x_buf_prepare(struct vb2_buffer *vb)
return 0;
 }
 
-static struct vb2_ops tw686x_video_qops = {
+static const struct vb2_ops tw686x_video_qops = {
.queue_setup= tw686x_queue_setup,
.buf_queue  = tw686x_buf_queue,
.buf_prepare= tw686x_buf_prepare,
diff --git a/drivers/media/pci/tw68/tw68-video.c 

[PATCH] [media] platform: constify vb2_ops structures

2016-09-08 Thread Julia Lawall
Check for vb2_ops structures that are only stored in the ops field of a
vb2_queue structure.  That field is declared const, so vb2_ops structures
that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p = { ... };

@ok@
identifier r.i;
struct vb2_queue e;
position p;
@@
e.ops = @p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct vb2_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct vb2_ops i = { ... };
// 

Signed-off-by: Julia Lawall 

---
 drivers/media/platform/exynos-gsc/gsc-m2m.c  |2 +-
 drivers/media/platform/exynos4-is/fimc-capture.c |2 +-
 drivers/media/platform/exynos4-is/fimc-m2m.c |2 +-
 drivers/media/platform/m2m-deinterlace.c |2 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c   |2 +-
 drivers/media/platform/mx2_emmaprp.c |2 +-
 drivers/media/platform/rcar-vin/rcar-dma.c   |2 +-
 drivers/media/platform/rcar_jpu.c|2 +-
 drivers/media/platform/s5p-g2d/g2d.c |2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c  |2 +-
 drivers/media/platform/sh_vou.c  |2 +-
 drivers/media/platform/soc_camera/atmel-isi.c|2 +-
 drivers/media/platform/soc_camera/rcar_vin.c |2 +-
 drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c |2 +-
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c|2 +-
 drivers/media/platform/ti-vpe/cal.c  |2 +-
 drivers/media/platform/ti-vpe/vpe.c  |2 +-
 drivers/media/platform/vim2m.c   |2 +-
 drivers/media/platform/xilinx/xilinx-dma.c   |2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-dma.c 
b/drivers/media/platform/xilinx/xilinx-dma.c
index 7ae1a13..1d5836c 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -474,7 +474,7 @@ static void xvip_dma_stop_streaming(struct vb2_queue *vq)
spin_unlock_irq(>queued_lock);
 }
 
-static struct vb2_ops xvip_dma_queue_qops = {
+static const struct vb2_ops xvip_dma_queue_qops = {
.queue_setup = xvip_dma_queue_setup,
.buf_prepare = xvip_dma_buffer_prepare,
.buf_queue = xvip_dma_buffer_queue,
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 30211f6..46de657 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -536,7 +536,7 @@ static void stop_streaming(struct vb2_queue *vq)
pm_runtime_put(ici->v4l2_dev.dev);
 }
 
-static struct vb2_ops isi_video_qops = {
+static const struct vb2_ops isi_video_qops = {
.queue_setup= queue_setup,
.buf_init   = buffer_init,
.buf_prepare= buffer_prepare,
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 785e693..d9c07b8 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2538,7 +2538,7 @@ static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
pm_runtime_put(ctx->jpeg->dev);
 }
 
-static struct vb2_ops s5p_jpeg_qops = {
+static const struct vb2_ops s5p_jpeg_qops = {
.queue_setup= s5p_jpeg_queue_setup,
.buf_prepare= s5p_jpeg_buf_prepare,
.buf_queue  = s5p_jpeg_buf_queue,
diff --git a/drivers/media/platform/ti-vpe/cal.c 
b/drivers/media/platform/ti-vpe/cal.c
index e967fcf..44323cb 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1379,7 +1379,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
cal_runtime_put(ctx->dev);
 }
 
-static struct vb2_ops cal_video_qops = {
+static const struct vb2_ops cal_video_qops = {
.queue_setup= cal_queue_setup,
.buf_prepare= cal_buffer_prepare,
.buf_queue  = cal_buffer_queue,
diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index 55a1458..0189f7f 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -1878,7 +1878,7 @@ static void vpe_stop_streaming(struct vb2_queue *q)
vpdma_dump_regs(ctx->dev->vpdma);
 }
 
-static struct vb2_ops vpe_qops = {
+static const struct vb2_ops vpe_qops = {
.queue_setup = vpe_queue_setup,
.buf_prepare = vpe_buf_prepare,
.buf_queue   = vpe_buf_queue,
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 

[PATCH 01/15] [media] mc-core.rst: fix a warning about an internal routine

2016-09-08 Thread Mauro Carvalho Chehab
Fix this warning:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference 
target not found: media_devnode_release

The media_device_release() is a function internal to media-devnode.c,
and not exported elsewhere. So, we can't cross-reference it here.
Make it explicit at the documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/media-devnode.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h
index 972168e90413..cd23e915764c 100644
--- a/include/media/media-devnode.h
+++ b/include/media/media-devnode.h
@@ -76,7 +76,8 @@ struct media_file_operations {
  * @parent:parent device
  * @minor: device node minor number
  * @flags: flags, combination of the ``MEDIA_FLAG_*`` constants
- * @release:   release callback called at the end of media_devnode_release()
+ * @release:   release callback called at the end of 
``media_devnode_release()``
+ * routine at media-device.c.
  *
  * This structure represents a media-related device node.
  *
-- 
2.7.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 05/15] [media] v4l2-mem2mem.h: make kernel-doc parse v4l2-mem2mem.h again

2016-09-08 Thread Mauro Carvalho Chehab
The kernel-doc C parser doesn't like opaque structures. So,
document it on another way.

This should get rid of this warning:
./include/media/v4l2-mem2mem.h:62: error: Cannot parse struct or union!

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-mem2mem.h | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index f74ea7026c88..9a7eb5605254 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -53,12 +53,6 @@ struct v4l2_m2m_ops {
void (*unlock)(void *priv);
 };
 
-/**
- * struct v4l2_m2m_dev - opaque struct used to represent a V4L2 M2M device.
- *
- * This structure is has the per-device context for a memory to memory
- * device, and it is used internally at v4l2-mem2mem.c.
- */
 struct v4l2_m2m_dev;
 
 /**
@@ -88,7 +82,7 @@ struct v4l2_m2m_queue_ctx {
  * struct v4l2_m2m_ctx - Memory to memory context structure
  *
  * @q_lock: struct  lock
- * @m2m_dev: pointer to struct _m2m_dev
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
  * @cap_q_ctx: Capture (output to memory) queue context
  * @out_q_ctx: Output (input from memory) queue context
  * @queue: List of memory to memory contexts
@@ -131,7 +125,7 @@ struct v4l2_m2m_buffer {
  * v4l2_m2m_get_curr_priv() - return driver private data for the currently
  * running instance or NULL if no instance is running
  *
- * @m2m_dev: pointer to struct _m2m_dev
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
  */
 void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev);
 
@@ -171,7 +165,7 @@ void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx);
  * v4l2_m2m_job_finish() - inform the framework that a job has been finished
  * and have it clean up
  *
- * @m2m_dev: pointer to struct _m2m_dev
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
  * @m2m_ctx: m2m context assigned to the instance given by struct _m2m_ctx
  *
  * Called by a driver to yield back the device after it has finished with it.
@@ -334,7 +328,7 @@ struct v4l2_m2m_dev *v4l2_m2m_init(const struct 
v4l2_m2m_ops *m2m_ops);
 /**
  * v4l2_m2m_release() - cleans up and frees a m2m_dev structure
  *
- * @m2m_dev: pointer to struct _m2m_dev
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
  *
  * Usually called from driver's ``remove()`` function.
  */
@@ -343,7 +337,7 @@ void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev);
 /**
  * v4l2_m2m_ctx_init() - allocate and initialize a m2m context
  *
- * @m2m_dev: a previously initialized m2m_dev struct
+ * @m2m_dev: opaque pointer to the internal data to handle M2M context
  * @drv_priv: driver's instance private data
  * @queue_init: a callback for queue type-specific initialization function
  * to be used for initializing videobuf_queues
-- 
2.7.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] usb: constify vb2_ops structures

2016-09-08 Thread Julia Lawall
Check for vb2_ops structures that are only stored in the ops field of a
vb2_queue structure.  That field is declared const, so vb2_ops structures
that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p = { ... };

@ok@
identifier r.i;
struct vb2_queue e;
position p;
@@
e.ops = @p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct vb2_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct vb2_ops i = { ... };
// 

Signed-off-by: Julia Lawall 

---
 drivers/media/usb/airspy/airspy.c   |2 +-
 drivers/media/usb/au0828/au0828-video.c |2 +-
 drivers/media/usb/em28xx/em28xx-video.c |2 +-
 drivers/media/usb/go7007/go7007-v4l2.c  |2 +-
 drivers/media/usb/hackrf/hackrf.c   |2 +-
 drivers/media/usb/msi2500/msi2500.c |2 +-
 drivers/media/usb/pwc/pwc-if.c  |2 +-
 drivers/media/usb/s2255/s2255drv.c  |2 +-
 drivers/media/usb/stk1160/stk1160-v4l.c |2 +-
 drivers/media/usb/usbtv/usbtv-video.c   |2 +-
 drivers/media/usb/uvc/uvc_queue.c   |2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/hackrf/hackrf.c 
b/drivers/media/usb/hackrf/hackrf.c
index c2c8d12..75e0363 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -891,7 +891,7 @@ static void hackrf_stop_streaming(struct vb2_queue *vq)
mutex_unlock(>v4l2_lock);
 }
 
-static struct vb2_ops hackrf_vb2_ops = {
+static const struct vb2_ops hackrf_vb2_ops = {
.queue_setup= hackrf_queue_setup,
.buf_queue  = hackrf_buf_queue,
.start_streaming= hackrf_start_streaming,
diff --git a/drivers/media/usb/em28xx/em28xx-video.c 
b/drivers/media/usb/em28xx/em28xx-video.c
index 7968695..1f7fa05 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1204,7 +1204,7 @@ buffer_queue(struct vb2_buffer *vb)
spin_unlock_irqrestore(>slock, flags);
 }
 
-static struct vb2_ops em28xx_video_qops = {
+static const struct vb2_ops em28xx_video_qops = {
.queue_setup= queue_setup,
.buf_prepare= buffer_prepare,
.buf_queue  = buffer_queue,
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index c4454c9..ff65764 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -707,7 +707,7 @@ static void stop_streaming(struct vb2_queue *vq)
mutex_unlock(>v4l2_lock);
 }
 
-static struct vb2_ops pwc_vb_queue_ops = {
+static const struct vb2_ops pwc_vb_queue_ops = {
.queue_setup= queue_setup,
.buf_init   = buffer_init,
.buf_prepare= buffer_prepare,
diff --git a/drivers/media/usb/go7007/go7007-v4l2.c 
b/drivers/media/usb/go7007/go7007-v4l2.c
index af84589..4eaba0c 100644
--- a/drivers/media/usb/go7007/go7007-v4l2.c
+++ b/drivers/media/usb/go7007/go7007-v4l2.c
@@ -477,7 +477,7 @@ static void go7007_stop_streaming(struct vb2_queue *q)
go7007_write_addr(go, 0x3c82, 0x000d);
 }
 
-static struct vb2_ops go7007_video_qops = {
+static const struct vb2_ops go7007_video_qops = {
.queue_setup= go7007_queue_setup,
.buf_queue  = go7007_buf_queue,
.buf_prepare= go7007_buf_prepare,
diff --git a/drivers/media/usb/airspy/airspy.c 
b/drivers/media/usb/airspy/airspy.c
index 3c556ee..8251942 100644
--- a/drivers/media/usb/airspy/airspy.c
+++ b/drivers/media/usb/airspy/airspy.c
@@ -605,7 +605,7 @@ static void airspy_stop_streaming(struct vb2_queue *vq)
mutex_unlock(>v4l2_lock);
 }
 
-static struct vb2_ops airspy_vb2_ops = {
+static const struct vb2_ops airspy_vb2_ops = {
.queue_setup= airspy_queue_setup,
.buf_queue  = airspy_buf_queue,
.start_streaming= airspy_start_streaming,
diff --git a/drivers/media/usb/au0828/au0828-video.c 
b/drivers/media/usb/au0828/au0828-video.c
index 13b8387..85dd9a8 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -928,7 +928,7 @@ void au0828_stop_vbi_streaming(struct vb2_queue *vq)
del_timer_sync(>vbi_timeout);
 }
 
-static struct vb2_ops au0828_video_qops = {
+static const struct vb2_ops au0828_video_qops = {
.queue_setup = queue_setup,
.buf_prepare = buffer_prepare,
.buf_queue   = buffer_queue,
diff --git a/drivers/media/usb/s2255/s2255drv.c 
b/drivers/media/usb/s2255/s2255drv.c
index 9458eb0..c3a0e87 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -717,7 +717,7 @@ static void buffer_queue(struct vb2_buffer *vb)
 static int start_streaming(struct vb2_queue *vq, unsigned int count);
 static 

[PATCH 13/15] [media] videobuf2-v4l2: document two helper functions

2016-09-08 Thread Mauro Carvalho Chehab
Document vb2_ops_wait_prepare() and vb2_ops_wait_finish(),
in order to fix those two warnings:
Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference 
target not found: vb2_ops_wait_prepare
Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference 
target not found: vb2_ops_wait_finish

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/videobuf2-v4l2.h | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 611d4f330a4c..036127c54bbf 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -268,9 +268,22 @@ unsigned long vb2_fop_get_unmapped_area(struct file *file, 
unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags);
 #endif
 
-/* struct vb2_ops helpers, only use if vq->lock is non-NULL. */
-
+/**
+ * vb2_ops_wait_prepare - helper function to lock a struct _queue
+ *
+ * @vq: pointer to struct vb2_queue
+ *
+ * ..note:: only use if vq->lock is non-NULL.
+ */
 void vb2_ops_wait_prepare(struct vb2_queue *vq);
+
+/**
+ * vb2_ops_wait_finish - helper function to unlock a struct _queue
+ *
+ * @vq: pointer to struct vb2_queue
+ *
+ * ..note:: only use if vq->lock is non-NULL.
+ */
 void vb2_ops_wait_finish(struct vb2_queue *vq);
 
 #endif /* _MEDIA_VIDEOBUF2_V4L2_H */
-- 
2.7.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 08/15] [media] videobuf2-core.h: document enum vb2_memory

2016-09-08 Thread Mauro Carvalho Chehab
This enum was not documented. Document it.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/videobuf2-core.h | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 68f93dacb38f..65eeca83687a 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -20,6 +20,20 @@
 #define VB2_MAX_FRAME  (32)
 #define VB2_MAX_PLANES (8)
 
+/**
+ * enum vb2_memory - type of memory model used to make the buffers visible
+ * on userspace.
+ *
+ * @VB2_MEMORY_UNKNOWN:Buffer status is unknown or it is not used yet 
on
+ * userspace.
+ * @VB2_MEMORY_MMAP:   The buffers are allocated by the Kernel and it is
+ * memory mapped via mmap() ioctl. This model is
+ * also used when the user is using the buffers via
+ * read() or write() system calls.
+ * @VB2_MEMORY_USERPTR:The buffers was allocated in userspace and it is
+ * memory mapped via mmap() ioctl.
+ * @VB2_MEMORY_DMABUF: The buffers are passed to userspace via DMA buffer.
+ */
 enum vb2_memory {
VB2_MEMORY_UNKNOWN  = 0,
VB2_MEMORY_MMAP = 1,
-- 
2.7.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 09/15] [media] videobuf2-core.h: improve documentation

2016-09-08 Thread Mauro Carvalho Chehab
There are several small issues with the documentation. Fix them,
in order to avoid producing warnings.

While here, also make checkpatch.pl happy.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/videobuf2-core.h | 143 -
 1 file changed, 85 insertions(+), 58 deletions(-)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 65eeca83687a..9a144f2d9083 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -49,13 +49,13 @@ struct vb2_threadio_data;
  * @alloc: allocate video memory and, optionally, allocator private data,
  * return ERR_PTR() on failure or a pointer to allocator private,
  * per-buffer data on success; the returned private structure
- * will then be passed as buf_priv argument to other ops in this
+ * will then be passed as @buf_priv argument to other ops in this
  * structure. Additional gfp_flags to use when allocating the
  * are also passed to this operation. These flags are from the
  * gfp_flags field of vb2_queue.
  * @put:   inform the allocator that the buffer will no longer be used;
  * usually will result in the allocator freeing the buffer (if
- * no other users of this buffer are present); the buf_priv
+ * no other users of this buffer are present); the @buf_priv
  * argument is the allocator private per-buffer structure
  * previously returned from the alloc callback.
  * @get_dmabuf: acquire userspace memory for a hardware operation; used for
@@ -65,7 +65,7 @@ struct vb2_threadio_data;
  *  videobuf layer when queuing a video buffer of USERPTR type;
  *  should return an allocator private per-buffer structure
  *  associated with the buffer on success, ERR_PTR() on failure;
- *  the returned private structure will then be passed as buf_priv
+ *  the returned private structure will then be passed as @buf_priv
  *  argument to other ops in this structure.
  * @put_userptr: inform the allocator that a USERPTR buffer will no longer
  *  be used.
@@ -75,7 +75,7 @@ struct vb2_threadio_data;
  *allocator private per-buffer structure on success;
  *this needs to be used for further accesses to the buffer.
  * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF
- *buffer is no longer used; the buf_priv argument is the
+ *buffer is no longer used; the @buf_priv argument is the
  *allocator private per-buffer structure previously returned
  *from the attach_dmabuf callback.
  * @map_dmabuf: request for access to the dmabuf from allocator; the allocator
@@ -109,11 +109,13 @@ struct vb2_threadio_data;
  *
  *#) Required ops for read/write access types: alloc, put, num_users, 
vaddr.
  *
- *#) Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, 
map_dmabuf, unmap_dmabuf.
+ *#) Required ops for DMABUF types: attach_dmabuf, detach_dmabuf,
+ *   map_dmabuf, unmap_dmabuf.
  */
 struct vb2_mem_ops {
void*(*alloc)(struct device *dev, unsigned long attrs,
- unsigned long size, enum dma_data_direction 
dma_dir,
+ unsigned long size,
+ enum dma_data_direction dma_dir,
  gfp_t gfp_flags);
void(*put)(void *buf_priv);
struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags);
@@ -126,7 +128,8 @@ struct vb2_mem_ops {
void(*prepare)(void *buf_priv);
void(*finish)(void *buf_priv);
 
-   void*(*attach_dmabuf)(struct device *dev, struct dma_buf 
*dbuf,
+   void*(*attach_dmabuf)(struct device *dev,
+ struct dma_buf *dbuf,
  unsigned long size,
  enum dma_data_direction dma_dir);
void(*detach_dmabuf)(void *buf_priv);
@@ -291,7 +294,7 @@ struct vb2_buffer {
 /**
  * struct vb2_ops - driver-specific callbacks
  *
- * @queue_setup:   called from %VIDIOC_REQBUFS and %VIDIOC_CREATE_BUFS
+ * @queue_setup:   called from VIDIOC_REQBUFS() and VIDIOC_CREATE_BUFS()
  * handlers before memory allocation. It can be called
  * twice: if the original number of requested buffers
  * could not be allocated, then it will be called a
@@ -302,11 +305,11 @@ struct vb2_buffer {
  * buffer in \*num_planes, the size of each plane should be
  * set in the sizes\[\] array and optional per-plane
  * allocator 

[PATCH 12/15] [media] videobuf2-v4l2.h: improve documentation

2016-09-08 Thread Mauro Carvalho Chehab
There are a few issues at the documentation: fields not documented,
bad cross refrences, etc.

Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/videobuf2-v4l2.h | 52 +++---
 1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 01b1b71fc6fd..611d4f330a4c 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -25,11 +25,13 @@
 
 /**
  * struct vb2_v4l2_buffer - video buffer information for v4l2
+ *
  * @vb2_buf:   video buffer 2
  * @flags: buffer informational flags
  * @field: enum v4l2_field; field order of the image in the buffer
  * @timecode:  frame timecode
  * @sequence:  sequence count of this frame
+ *
  * Should contain enough information to be able to cover all the fields
  * of struct v4l2_buffer at videodev2.h
  */
@@ -53,6 +55,7 @@ int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
 /**
  * vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies
  * the memory and type values.
+ *
  * @q: videobuf2 queue
  * @req:   struct passed from userspace to vidioc_reqbufs handler
  * in driver
@@ -62,6 +65,7 @@ int vb2_reqbufs(struct vb2_queue *q, struct 
v4l2_requestbuffers *req);
 /**
  * vb2_create_bufs() - Wrapper for vb2_core_create_bufs() that also verifies
  * the memory and type values.
+ *
  * @q: videobuf2 queue
  * @create:creation parameters, passed from userspace to vidioc_create_bufs
  * handler in driver
@@ -70,15 +74,17 @@ int vb2_create_bufs(struct vb2_queue *q, struct 
v4l2_create_buffers *create);
 
 /**
  * vb2_prepare_buf() - Pass ownership of a buffer from userspace to the kernel
+ *
  * @q: videobuf2 queue
  * @b: buffer structure passed from userspace to vidioc_prepare_buf
  * handler in driver
  *
  * Should be called from vidioc_prepare_buf ioctl handler of a driver.
  * This function:
- * 1) verifies the passed buffer,
- * 2) calls buf_prepare callback in the driver (if provided), in which
- *driver-specific buffer initialization can be performed,
+ *
+ * #) verifies the passed buffer,
+ * #) calls buf_prepare callback in the driver (if provided), in which
+ *driver-specific buffer initialization can be performed.
  *
  * The return values from this function are intended to be directly returned
  * from vidioc_prepare_buf handler in driver.
@@ -88,53 +94,57 @@ int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer 
*b);
 /**
  * vb2_qbuf() - Queue a buffer from userspace
  * @q: videobuf2 queue
- * @b: buffer structure passed from userspace to vidioc_qbuf handler
+ * @b: buffer structure passed from userspace to VIDIOC_QBUF() handler
  * in driver
  *
- * Should be called from vidioc_qbuf ioctl handler of a driver.
+ * Should be called from VIDIOC_QBUF() ioctl handler of a driver.
+ *
  * This function:
- * 1) verifies the passed buffer,
- * 2) if necessary, calls buf_prepare callback in the driver (if provided), in
+ *
+ * #) verifies the passed buffer,
+ * #) if necessary, calls buf_prepare callback in the driver (if provided), in
  *which driver-specific buffer initialization can be performed,
- * 3) if streaming is on, queues the buffer in driver by the means of buf_queue
+ * #) if streaming is on, queues the buffer in driver by the means of buf_queue
  *callback for processing.
  *
  * The return values from this function are intended to be directly returned
- * from vidioc_qbuf handler in driver.
+ * from VIDIOC_QBUF() handler in driver.
  */
 int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b);
 
 /**
  * vb2_expbuf() - Export a buffer as a file descriptor
  * @q: videobuf2 queue
- * @eb:export buffer structure passed from userspace to 
vidioc_expbuf
+ * @eb:export buffer structure passed from userspace to 
VIDIOC_EXPBUF()
  * handler in driver
  *
  * The return values from this function are intended to be directly returned
- * from vidioc_expbuf handler in driver.
+ * from VIDIOC_EXPBUF() handler in driver.
  */
 int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb);
 
 /**
  * vb2_dqbuf() - Dequeue a buffer to the userspace
  * @q: videobuf2 queue
- * @b: buffer structure passed from userspace to vidioc_dqbuf handler
+ * @b: buffer structure passed from userspace to VIDIOC_DQBUF() handler
  * in driver
  * @nonblocking: if true, this call will not sleep waiting for a buffer if no
  *  buffers ready for dequeuing are present. Normally the driver
  *  would be passing (file->f_flags & O_NONBLOCK) here
  *
- * Should be called from vidioc_dqbuf ioctl handler of a driver.
+ * Should be called from VIDIOC_DQBUF() ioctl handler of a driver.
+ *
  * This function:
- * 1) verifies the passed buffer,
- 

[PATCH 14/15] [media] v4l2-flash-led-class.h: document v4l2_flash_ops

2016-09-08 Thread Mauro Carvalho Chehab
Fix this warning:
./include/media/v4l2-flash-led-class.h:103: WARNING: c:type reference 
target not found: v4l2_flash_ops

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-flash-led-class.h | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/media/v4l2-flash-led-class.h 
b/include/media/v4l2-flash-led-class.h
index 3d184ab52274..b0fe4d6f4a5f 100644
--- a/include/media/v4l2-flash-led-class.h
+++ b/include/media/v4l2-flash-led-class.h
@@ -20,7 +20,7 @@ struct led_classdev;
 struct v4l2_flash;
 enum led_brightness;
 
-/*
+/**
  * struct v4l2_flash_ctrl_data - flash control initialization data, filled
  * basing on the features declared by the LED flash
  * class driver in the v4l2_flash_config
@@ -33,14 +33,21 @@ struct v4l2_flash_ctrl_data {
u32 cid;
 };
 
+/**
+ * struct v4l2_flash_ops - V4L2 flash operations
+ *
+ * @external_strobe_set: Setup strobing the flash by hardware pin state
+ * assertion.
+ * @intensity_to_led_brightness: Convert intensity to brightness in a device
+ * specific manner
+ * @led_brightness_to_intensity: convert brightness to intensity in a device
+ * specific manner.
+ */
 struct v4l2_flash_ops {
-   /* setup strobing the flash by hardware pin state assertion */
int (*external_strobe_set)(struct v4l2_flash *v4l2_flash,
bool enable);
-   /* convert intensity to brightness in a device specific manner */
enum led_brightness (*intensity_to_led_brightness)
(struct v4l2_flash *v4l2_flash, s32 intensity);
-   /* convert brightness to intensity in a device specific manner */
s32 (*led_brightness_to_intensity)
(struct v4l2_flash *v4l2_flash, enum led_brightness);
 };
-- 
2.7.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 07/15] [media] videobuf2-core.h: move function descriptions from c file

2016-09-08 Thread Mauro Carvalho Chehab
There are several functions that were documented at the .c
file. As we only include the headers, we need to move them to
there, in order to have documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/v4l2-core/videobuf2-core.c | 254 -
 include/media/videobuf2-core.h   | 269 +++
 2 files changed, 269 insertions(+), 254 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index bfe85879c563..21900202ff83 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -528,10 +528,6 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned 
int buffers)
return 0;
 }
 
-/**
- * vb2_buffer_in_use() - return true if the buffer is in use and
- * the queue cannot be freed (by the means of REQBUFS(0)) call
- */
 bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb)
 {
unsigned int plane;
@@ -564,16 +560,6 @@ static bool __buffers_in_use(struct vb2_queue *q)
return false;
 }
 
-/**
- * vb2_core_querybuf() - query video buffer information
- * @q: videobuf queue
- * @index: id number of the buffer
- * @pb:buffer struct passed from userspace
- *
- * Should be called from vidioc_querybuf ioctl handler in driver.
- * The passed buffer should have been verified.
- * This function fills the relevant information for the userspace.
- */
 void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
 {
call_void_bufop(q, fill_user_buffer, q->bufs[index], pb);
@@ -620,10 +606,6 @@ static int __verify_dmabuf_ops(struct vb2_queue *q)
return 0;
 }
 
-/**
- * vb2_verify_memory_type() - Check whether the memory type and buffer type
- * passed to a buffer operation are compatible with the queue.
- */
 int vb2_verify_memory_type(struct vb2_queue *q,
enum vb2_memory memory, unsigned int type)
 {
@@ -670,30 +652,6 @@ int vb2_verify_memory_type(struct vb2_queue *q,
 }
 EXPORT_SYMBOL(vb2_verify_memory_type);
 
-/**
- * vb2_core_reqbufs() - Initiate streaming
- * @q: videobuf2 queue
- * @memory: memory type
- * @count: requested buffer count
- *
- * Should be called from vidioc_reqbufs ioctl handler of a driver.
- * This function:
- * 1) verifies streaming parameters passed from the userspace,
- * 2) sets up the queue,
- * 3) negotiates number of buffers and planes per buffer with the driver
- *to be used during streaming,
- * 4) allocates internal buffer structures (struct vb2_buffer), according to
- *the agreed parameters,
- * 5) for MMAP memory type, allocates actual video memory, using the
- *memory handling/allocation routines provided during queue initialization
- *
- * If req->count is 0, all the memory will be freed instead.
- * If the queue has been allocated previously (by a previous vb2_reqbufs) call
- * and the queue is not busy, memory will be reallocated.
- *
- * The return values from this function are intended to be directly returned
- * from vidioc_reqbufs handler in driver.
- */
 int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
unsigned int *count)
 {
@@ -819,22 +777,6 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory 
memory,
 }
 EXPORT_SYMBOL_GPL(vb2_core_reqbufs);
 
-/**
- * vb2_core_create_bufs() - Allocate buffers and any required auxiliary structs
- * @q: videobuf2 queue
- * @memory: memory type
- * @count: requested buffer count
- * @parg: parameter passed to device driver
- *
- * Should be called from vidioc_create_bufs ioctl handler of a driver.
- * This function:
- * 1) verifies parameter sanity
- * 2) calls the .queue_setup() queue operation
- * 3) performs any necessary memory allocations
- *
- * The return values from this function are intended to be directly returned
- * from vidioc_create_bufs handler in driver.
- */
 int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
unsigned int *count, unsigned requested_planes,
const unsigned requested_sizes[])
@@ -924,14 +866,6 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum 
vb2_memory memory,
 }
 EXPORT_SYMBOL_GPL(vb2_core_create_bufs);
 
-/**
- * vb2_plane_vaddr() - Return a kernel virtual address of a given plane
- * @vb:vb2_buffer to which the plane in question belongs to
- * @plane_no:  plane number for which the address is to be returned
- *
- * This function returns a kernel virtual address of a given plane if
- * such a mapping exist, NULL otherwise.
- */
 void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no)
 {
if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv)
@@ -942,17 +876,6 @@ void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int 
plane_no)
 }
 EXPORT_SYMBOL_GPL(vb2_plane_vaddr);
 
-/**
- * vb2_plane_cookie() - Return allocator specific cookie for the given 

[PATCH 11/15] [media] videobuf2-v4l2.h: get kernel-doc tags from C file

2016-09-08 Thread Mauro Carvalho Chehab
There are several functions documented at the C file. Move
them to the header, as this is the one used to build the
media books.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/v4l2-core/videobuf2-v4l2.c | 142 -
 include/media/videobuf2-v4l2.h   | 151 ++-
 2 files changed, 150 insertions(+), 143 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c 
b/drivers/media/v4l2-core/videobuf2-v4l2.c
index 9cfbb6e4bc28..52ef8833f6b6 100644
--- a/drivers/media/v4l2-core/videobuf2-v4l2.c
+++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
@@ -483,13 +483,6 @@ int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer 
*b)
 }
 EXPORT_SYMBOL(vb2_querybuf);
 
-/**
- * vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies
- * the memory and type values.
- * @q: videobuf2 queue
- * @req:   struct passed from userspace to vidioc_reqbufs handler
- * in driver
- */
 int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
 {
int ret = vb2_verify_memory_type(q, req->memory, req->type);
@@ -498,21 +491,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct 
v4l2_requestbuffers *req)
 }
 EXPORT_SYMBOL_GPL(vb2_reqbufs);
 
-/**
- * vb2_prepare_buf() - Pass ownership of a buffer from userspace to the kernel
- * @q: videobuf2 queue
- * @b: buffer structure passed from userspace to vidioc_prepare_buf
- * handler in driver
- *
- * Should be called from vidioc_prepare_buf ioctl handler of a driver.
- * This function:
- * 1) verifies the passed buffer,
- * 2) calls buf_prepare callback in the driver (if provided), in which
- *driver-specific buffer initialization can be performed,
- *
- * The return values from this function are intended to be directly returned
- * from vidioc_prepare_buf handler in driver.
- */
 int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b)
 {
int ret;
@@ -528,13 +506,6 @@ int vb2_prepare_buf(struct vb2_queue *q, struct 
v4l2_buffer *b)
 }
 EXPORT_SYMBOL_GPL(vb2_prepare_buf);
 
-/**
- * vb2_create_bufs() - Wrapper for vb2_core_create_bufs() that also verifies
- * the memory and type values.
- * @q: videobuf2 queue
- * @create:creation parameters, passed from userspace to vidioc_create_bufs
- * handler in driver
- */
 int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
 {
unsigned requested_planes = 1;
@@ -586,23 +557,6 @@ int vb2_create_bufs(struct vb2_queue *q, struct 
v4l2_create_buffers *create)
 }
 EXPORT_SYMBOL_GPL(vb2_create_bufs);
 
-/**
- * vb2_qbuf() - Queue a buffer from userspace
- * @q: videobuf2 queue
- * @b: buffer structure passed from userspace to vidioc_qbuf handler
- * in driver
- *
- * Should be called from vidioc_qbuf ioctl handler of a driver.
- * This function:
- * 1) verifies the passed buffer,
- * 2) if necessary, calls buf_prepare callback in the driver (if provided), in
- *which driver-specific buffer initialization can be performed,
- * 3) if streaming is on, queues the buffer in driver by the means of buf_queue
- *callback for processing.
- *
- * The return values from this function are intended to be directly returned
- * from vidioc_qbuf handler in driver.
- */
 int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
 {
int ret;
@@ -617,27 +571,6 @@ int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
 }
 EXPORT_SYMBOL_GPL(vb2_qbuf);
 
-/**
- * vb2_dqbuf() - Dequeue a buffer to the userspace
- * @q: videobuf2 queue
- * @b: buffer structure passed from userspace to vidioc_dqbuf handler
- * in driver
- * @nonblocking: if true, this call will not sleep waiting for a buffer if no
- *  buffers ready for dequeuing are present. Normally the driver
- *  would be passing (file->f_flags & O_NONBLOCK) here
- *
- * Should be called from vidioc_dqbuf ioctl handler of a driver.
- * This function:
- * 1) verifies the passed buffer,
- * 2) calls buf_finish callback in the driver (if provided), in which
- *driver can perform any additional operations that may be required before
- *returning the buffer to userspace, such as cache sync,
- * 3) the buffer struct members are filled with relevant information for
- *the userspace.
- *
- * The return values from this function are intended to be directly returned
- * from vidioc_dqbuf handler in driver.
- */
 int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
 {
int ret;
@@ -664,19 +597,6 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, 
bool nonblocking)
 }
 EXPORT_SYMBOL_GPL(vb2_dqbuf);
 
-/**
- * vb2_streamon - start streaming
- * @q: videobuf2 queue
- * @type:  type argument passed from userspace to vidioc_streamon handler
- *
- * Should be called from vidioc_streamon handler of a driver.
- * This function:
- * 1) verifies 

[PATCH 02/15] [media] v4l2-mem2mem.h: move descriptions from .c file

2016-09-08 Thread Mauro Carvalho Chehab
Several routines are somewhat documented at v4l2-mem2mem.c
file. Move what's there to the header file.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/v4l2-core/v4l2-mem2mem.c | 128 +---
 include/media/v4l2-mem2mem.h   | 132 +
 2 files changed, 133 insertions(+), 127 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c 
b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 61d56c940f80..6bc27e7b2a33 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -76,9 +76,6 @@ static struct v4l2_m2m_queue_ctx *get_queue_ctx(struct 
v4l2_m2m_ctx *m2m_ctx,
return _ctx->cap_q_ctx;
 }
 
-/**
- * v4l2_m2m_get_vq() - return vb2_queue for the given type
- */
 struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx,
   enum v4l2_buf_type type)
 {
@@ -92,9 +89,6 @@ struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx 
*m2m_ctx,
 }
 EXPORT_SYMBOL(v4l2_m2m_get_vq);
 
-/**
- * v4l2_m2m_next_buf() - return next buffer from the list of ready buffers
- */
 void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)
 {
struct v4l2_m2m_buffer *b;
@@ -113,10 +107,6 @@ void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_next_buf);
 
-/**
- * v4l2_m2m_buf_remove() - take off a buffer from the list of ready buffers and
- * return it
- */
 void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx)
 {
struct v4l2_m2m_buffer *b;
@@ -140,10 +130,6 @@ EXPORT_SYMBOL_GPL(v4l2_m2m_buf_remove);
  * Scheduling handlers
  */
 
-/**
- * v4l2_m2m_get_curr_priv() - return driver private data for the currently
- * running instance or NULL if no instance is running
- */
 void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev)
 {
unsigned long flags;
@@ -188,26 +174,6 @@ static void v4l2_m2m_try_run(struct v4l2_m2m_dev *m2m_dev)
m2m_dev->m2m_ops->device_run(m2m_dev->curr_ctx->priv);
 }
 
-/**
- * v4l2_m2m_try_schedule() - check whether an instance is ready to be added to
- * the pending job queue and add it if so.
- * @m2m_ctx:   m2m context assigned to the instance to be checked
- *
- * There are three basic requirements an instance has to meet to be able to 
run:
- * 1) at least one source buffer has to be queued,
- * 2) at least one destination buffer has to be queued,
- * 3) streaming has to be on.
- *
- * If a queue is buffered (for example a decoder hardware ringbuffer that has
- * to be drained before doing streamoff), allow scheduling without v4l2 buffers
- * on that queue.
- *
- * There may also be additional, custom requirements. In such case the driver
- * should supply a custom callback (job_ready in v4l2_m2m_ops) that should
- * return 1 if the instance is ready.
- * An example of the above could be an instance that requires more than one
- * src/dst buffer per transaction.
- */
 void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
 {
struct v4l2_m2m_dev *m2m_dev;
@@ -311,18 +277,6 @@ static void v4l2_m2m_cancel_job(struct v4l2_m2m_ctx 
*m2m_ctx)
}
 }
 
-/**
- * v4l2_m2m_job_finish() - inform the framework that a job has been finished
- * and have it clean up
- *
- * Called by a driver to yield back the device after it has finished with it.
- * Should be called as soon as possible after reaching a state which allows
- * other instances to take control of the device.
- *
- * This function has to be called only after device_run() callback has been
- * called on the driver. To prevent recursion, it should not be called directly
- * from the device_run() callback though.
- */
 void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev,
 struct v4l2_m2m_ctx *m2m_ctx)
 {
@@ -350,9 +304,6 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev,
 }
 EXPORT_SYMBOL(v4l2_m2m_job_finish);
 
-/**
- * v4l2_m2m_reqbufs() - multi-queue-aware REQBUFS multiplexer
- */
 int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 struct v4l2_requestbuffers *reqbufs)
 {
@@ -370,11 +321,6 @@ int v4l2_m2m_reqbufs(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_reqbufs);
 
-/**
- * v4l2_m2m_querybuf() - multi-queue-aware QUERYBUF multiplexer
- *
- * See v4l2_m2m_mmap() documentation for details.
- */
 int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
  struct v4l2_buffer *buf)
 {
@@ -400,10 +346,6 @@ int v4l2_m2m_querybuf(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_querybuf);
 
-/**
- * v4l2_m2m_qbuf() - enqueue a source or destination buffer, depending on
- * the type
- */
 int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
  struct v4l2_buffer *buf)
 {
@@ -419,10 +361,6 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx 
*m2m_ctx,
 }
 

  1   2   >