[PATCH] cec-funcs.h: add missing const modifier

2016-07-08 Thread Hans Verkuil
The cec_ops_* functions never touch cec_msg, so mark it as const.

This was done for some of the cec_ops_ functions, but not all.

Signed-off-by: Hans Verkuil 

diff --git a/include/linux/cec-funcs.h b/include/linux/cec-funcs.h
index 1948600..dfb945a 100644
--- a/include/linux/cec-funcs.h
+++ b/include/linux/cec-funcs.h
@@ -420,7 +420,7 @@ static inline void cec_msg_timer_status(struct cec_msg *msg,
}
 }

-static inline void cec_ops_timer_status(struct cec_msg *msg,
+static inline void cec_ops_timer_status(const struct cec_msg *msg,
__u8 *timer_overlap_warning,
__u8 *media_info,
__u8 *prog_info,
@@ -455,7 +455,7 @@ static inline void cec_msg_timer_cleared_status(struct 
cec_msg *msg,
msg->msg[2] = timer_cleared_status;
 }

-static inline void cec_ops_timer_cleared_status(struct cec_msg *msg,
+static inline void cec_ops_timer_cleared_status(const struct cec_msg *msg,
__u8 *timer_cleared_status)
 {
*timer_cleared_status = msg->msg[2];
@@ -491,7 +491,7 @@ static inline void cec_msg_clear_analogue_timer(struct 
cec_msg *msg,
msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0;
 }

-static inline void cec_ops_clear_analogue_timer(struct cec_msg *msg,
+static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg,
__u8 *day,
__u8 *month,
__u8 *start_hr,
@@ -541,7 +541,7 @@ static inline void cec_msg_clear_digital_timer(struct 
cec_msg *msg,
cec_set_digital_service_id(msg->msg + 9, digital);
 }

-static inline void cec_ops_clear_digital_timer(struct cec_msg *msg,
+static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg,
__u8 *day,
__u8 *month,
__u8 *start_hr,
@@ -592,7 +592,7 @@ static inline void cec_msg_clear_ext_timer(struct cec_msg 
*msg,
msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0;
 }

-static inline void cec_ops_clear_ext_timer(struct cec_msg *msg,
+static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg,
   __u8 *day,
   __u8 *month,
   __u8 *start_hr,
@@ -647,7 +647,7 @@ static inline void cec_msg_set_analogue_timer(struct 
cec_msg *msg,
msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0;
 }

-static inline void cec_ops_set_analogue_timer(struct cec_msg *msg,
+static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg,
  __u8 *day,
  __u8 *month,
  __u8 *start_hr,
@@ -697,7 +697,7 @@ static inline void cec_msg_set_digital_timer(struct cec_msg 
*msg,
cec_set_digital_service_id(msg->msg + 9, digital);
 }

-static inline void cec_ops_set_digital_timer(struct cec_msg *msg,
+static inline void cec_ops_set_digital_timer(const struct cec_msg *msg,
__u8 *day,
__u8 *month,
__u8 *start_hr,
@@ -748,7 +748,7 @@ static inline void cec_msg_set_ext_timer(struct cec_msg 
*msg,
msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0;
 }

-static inline void cec_ops_set_ext_timer(struct cec_msg *msg,
+static inline void cec_ops_set_ext_timer(const struct cec_msg *msg,
 __u8 *day,
 __u8 *month,
 __u8 *start_hr,
@@ -853,7 +853,7 @@ static inline void cec_msg_set_menu_language(struct cec_msg 
*msg,
memcpy(msg->msg + 2, language, 3);
 }

-static inline void cec_ops_set_menu_language(struct cec_msg *msg,
+static inline void cec_ops_set_menu_language(const struct cec_msg *msg,
 char *language)
 {
memcpy(language, msg->msg + 2, 3);
@@ -926,7 +926,7 @@ static inline void cec_msg_deck_control(struct cec_msg *msg,
msg->msg[2] = deck_control_mode;
 }

-static inline void cec_ops_deck_control(struct cec_msg *msg,
+static inline void cec_ops_deck_control(const struct cec_msg *msg,
__u8 *deck_control_mode)
 {
*deck_control_mode = msg->msg[2];
@@ -940,7 +940,7 @@ static inline void cec_msg_deck_status(struct cec_msg *msg,
msg->msg[2] = deck_info;
 }

-static inline void cec_ops_deck_status(struct cec_msg *msg,
+static inline void cec_ops_deck_status(const struct cec_msg *msg,
   __u8 *deck_info)
 {
*deck_info = msg->msg[2];
@@ -956,7 +956,7 @@ static inline void cec_msg_give_deck_status(struct cec_msg 
*msg,
   

[PATCHv2] cec-funcs.h: add missing 'reply' for short audio descriptor

2016-07-08 Thread Hans Verkuil
The cec_msg_request_short_audio_descriptor function was missing the reply
argument. That's needed if you want the framework to wait for the reply
message.

Signed-off-by: Hans Verkuil 
---
The bool reply should come after the msg argument, not the num_descriptors 
argument as was
the case in v1 of this patch.
---
diff --git a/include/linux/cec-funcs.h b/include/linux/cec-funcs.h
index 1948600..506bca9 100644
--- a/include/linux/cec-funcs.h
+++ b/include/linux/cec-funcs.h
@@ -1494,6 +1494,7 @@ static inline void 
cec_ops_report_short_audio_descriptor(const struct cec_msg *m
 }

 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg,
+   bool reply,
__u8 num_descriptors,
const __u8 *audio_format_id,
const __u8 *audio_format_code)
@@ -1504,6 +1505,7 @@ static inline void 
cec_msg_request_short_audio_descriptor(struct cec_msg *msg,
num_descriptors = 4;
msg->len = 2 + num_descriptors;
msg->msg[1] = CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR;
+   msg->reply = reply ? CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR : 0;
for (i = 0; i < num_descriptors; i++)
msg->msg[2 + i] = (audio_format_id[i] << 6) |
  (audio_format_code[i] & 0x3f);
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2.1 6/9] v4l: Add 14-bit raw bayer pixel format definitions

2016-07-08 Thread Hans Verkuil
On 06/27/2016 04:45 PM, Sakari Ailus wrote:
> The formats added by this patch are:
> 
>   V4L2_PIX_FMT_SBGGR14
>   V4L2_PIX_FMT_SGBRG14
>   V4L2_PIX_FMT_SGRBG14
>   V4L2_PIX_FMT_SRGGB14
> 
> Signed-off-by: Jouni Ukkonen 
> Signed-off-by: Sakari Ailus 
> Acked-by: Hans Verkuil 

You also need to update v4l2-ioctl.c, v4l_fill_fmtdesc() with the new pixel 
formats.

I'm OK if that's done in a follow-up patch for all the new pixelformat you
have defined in these patches.

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


[GIT PULL FOR v4.8] (v4) cec updates

2016-07-08 Thread Hans Verkuil
(This supersedes my previous three CEC pull request)

This adds the missing rc-cec keymap module, two bugfixes, three cec-funcs.h
improvements, Kconfig fixes from Arnd and it dual-licenses the headers for BSD,
just as we do for videodev2.h.

I originally thought the rc-cec module was already merged in the cec topic 
branch,
but I later discovered that it wasn't.

Regards,

Hans

The following changes since commit c7169ad5616229b87cabf886bc5f9cbd1fc35a5f:

  [media] DocBook/media: add CEC documentation (2016-06-28 11:45:24 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git cec-topic2

for you to fetch changes up to 7cd64ba7d9b1c49b5a1f8b0101384b43ba79bc18:

  cec-funcs.h: add missing 'reply' for short audio descriptor (2016-07-08 
11:57:06 +0200)


Arnd Bergmann (2):
  s5p_cec: mark suspend/resume as __maybe_unused
  cec: add MEDIA_SUPPORT dependency

Hans Verkuil (7):
  cec-adap: on reply, restore the tx_status value from the transmit
  cec.h/cec-funcs.h: add option to use BSD license
  cec-adap: prevent write to out-of-bounds array index
  cec: fix Kconfig dependency problems
  cec-funcs.h: add length checks
  cec-funcs.h: add missing const modifier
  cec-funcs.h: add missing 'reply' for short audio descriptor

Kamil Debski (1):
  rc-cec: Add HDMI CEC keymap module

 drivers/media/Kconfig   |   2 +-
 drivers/media/Makefile  |   4 +-
 drivers/media/rc/keymaps/Makefile   |   1 +
 drivers/media/rc/keymaps/rc-cec.c   | 182 

 drivers/staging/media/cec/Kconfig   |   3 +-
 drivers/staging/media/cec/Makefile  |   4 +-
 drivers/staging/media/cec/TODO  |   5 ++
 drivers/staging/media/cec/cec-adap.c|  18 +++---
 drivers/staging/media/cec/cec-core.c|  10 ++--
 drivers/staging/media/s5p-cec/s5p_cec.c |   4 +-
 include/linux/cec-funcs.h   |  64 +
 include/linux/cec.h |  16 ++
 12 files changed, 272 insertions(+), 41 deletions(-)
 create mode 100644 drivers/media/rc/keymaps/rc-cec.c
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/9] [media] : v4l: add Mediatek compressed video block format

2016-07-08 Thread Hans Verkuil
On 05/12/2016 01:24 PM, Tiffany Lin wrote:
> Add V4L2_PIX_FMT_MT21 format used on MT8173 driver.
> It is compressed format and need MT8173 MDP driver to transfer to other 
> standard format.
> 
> Signed-off-by: Tiffany Lin 
> ---
>  include/uapi/linux/videodev2.h |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 8f95191..52feea6 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -625,6 +625,7 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_Y8I  v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 
> 8-bit L/R interleaved */
>  #define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 
> 12-bit L/R interleaved */
>  #define V4L2_PIX_FMT_Z16  v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
> 16-bit */
> +#define V4L2_PIX_FMT_MT21 v4l2_fourcc('M', 'T', '2', '1') /* Mediatek 
> compressed block mode  */

v4l2-ioctl.c should be modified as well so the correct description string is 
filled in.

Regards,

Hans

>  
>  /* SDR formats - used only for Software Defined Radio devices */
>  #define V4L2_SDR_FMT_CU8  v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
> 
--
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 3/9] DocBook/v4l: Add compressed video formats used on MT8173 codec driver

2016-07-08 Thread Hans Verkuil
On 05/30/2016 02:29 PM, Tiffany Lin wrote:
> Add V4L2_PIX_FMT_MT21 documentation
> 
> Signed-off-by: Tiffany Lin 
> ---
>  Documentation/DocBook/media/v4l/pixfmt.xml |6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
> b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 5a08aee..d40e0ce 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -1980,6 +1980,12 @@ array. Anything what's in between the UYVY lines is 
> JPEG data and should be
>  concatenated to form the JPEG stream. 
>  
> 
> +   
> + V4L2_PIX_FMT_MT21
> + 'MT21'
> + Compressed two-planar YVU420 format used by Mediatek MT8173
> + codec driver.

Can you give a few more details? The encoder driver doesn't seem to produce this
format, so who is creating this? Where is this format documented?

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] [media] rcar-vin: add legacy mode for wrong media bus formats

2016-07-08 Thread Niklas Söderlund
A recent bugfix to adv7180 brought to light that the rcar-vin driver are
looking for the wrong media bus format. It was looking for a YUVU format
but then expecting UYVY data. The bugfix for adv7180 will break the
usage of rcar-vin together with a adv7180 as found on Renesas R-Car2
Koelsch boards for example.

This patch fix the rcar-vin driver to look for the correct UYVU formats
and adds a legacy mode. The legacy mode is needed since I don't know if
other devices provide a incorrect media bus format and I don't want to
break any working configurations. Hopefully the legacy mode can be
removed sometime in the future.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 39 +++--
 drivers/media/platform/rcar-vin/rcar-dma.c  |  4 +--
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index 4b2007b..481d82a 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -37,6 +37,7 @@ static int rvin_mbus_supported(struct rvin_dev *vin)
struct v4l2_subdev_mbus_code_enum code = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
+   bool found;
 
sd = vin_to_source(vin);
 
@@ -45,8 +46,8 @@ static int rvin_mbus_supported(struct rvin_dev *vin)
code.index++;
switch (code.code) {
case MEDIA_BUS_FMT_YUYV8_1X16:
-   case MEDIA_BUS_FMT_YUYV8_2X8:
-   case MEDIA_BUS_FMT_YUYV10_2X10:
+   case MEDIA_BUS_FMT_UYVY8_2X8:
+   case MEDIA_BUS_FMT_UYVY10_2X10:
case MEDIA_BUS_FMT_RGB888_1X24:
vin->source.code = code.code;
vin_dbg(vin, "Found supported media bus format: %d\n",
@@ -57,6 +58,40 @@ static int rvin_mbus_supported(struct rvin_dev *vin)
}
}
 
+   /*
+* Older versions where looking for the wrong media bus format.
+* It where looking for a YUVY format but then treated it as a
+* UYVY format. This was not noticed since atlest one subdevice
+* used for testing (adv7180) reported a YUVY media bus format
+* but provided UYVY data. There might be other unknown subdevices
+* which also do this, to not break compatibility try to use them
+* in legacy mode.
+*/
+   found = false;
+   code.index = 0;
+   while (!v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code)) {
+   code.index++;
+   switch (code.code) {
+   case MEDIA_BUS_FMT_YUYV8_2X8:
+   vin->source.code = MEDIA_BUS_FMT_UYVY8_2X8;
+   found = true;
+   break;
+   case MEDIA_BUS_FMT_YUYV10_2X10:
+   vin->source.code = MEDIA_BUS_FMT_UYVY10_2X10;
+   found = true;
+   break;
+   default:
+   break;
+   }
+
+   if (found) {
+   vin_err(vin,
+   "media bus %d not supported, trying legacy mode 
%d\n",
+   code.code, vin->source.code);
+   return true;
+   }
+   }
+
return false;
 }
 
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
b/drivers/media/platform/rcar-vin/rcar-dma.c
index dad3b03..0836b15 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -169,7 +169,7 @@ static int rvin_setup(struct rvin_dev *vin)
vnmc |= VNMC_INF_YUV16;
input_is_yuv = true;
break;
-   case MEDIA_BUS_FMT_YUYV8_2X8:
+   case MEDIA_BUS_FMT_UYVY8_2X8:
/* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */
vnmc |= vin->mbus_cfg.type == V4L2_MBUS_BT656 ?
VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601;
@@ -178,7 +178,7 @@ static int rvin_setup(struct rvin_dev *vin)
case MEDIA_BUS_FMT_RGB888_1X24:
vnmc |= VNMC_INF_RGB888;
break;
-   case MEDIA_BUS_FMT_YUYV10_2X10:
+   case MEDIA_BUS_FMT_UYVY10_2X10:
/* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */
vnmc |= vin->mbus_cfg.type == V4L2_MBUS_BT656 ?
VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601;
-- 
2.9.0

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


Re: [PATCH 07/11] media: adv7180: change mbus format to UYVY

2016-07-08 Thread Niklas Söderlund
On 2016-07-07 17:18:25 +0200, Lars-Peter Clausen wrote:
> On 07/07/2016 01:00 AM, Steve Longerbeam wrote:
> > Change the media bus format from YUYV8_2X8 to UYVY8_2X8. Colors
> > now look correct when capturing with the i.mx6 backend. The other
> > option is to set the SWPC bit in register 0x27 to swap the Cr and Cb
> > output samples.
> > 
> > Signed-off-by: Steve Longerbeam 
> 
> The patch is certainly correct from the technical point of view. But we need
> to be careful not to break any existing platforms which rely on this
> setting. So the alternative solution of changing the default output order is
> not an option.
> 
> Looking at things it seems like the Renesas vin driver, which is used in
> combination with the adv7180 on some boards, uses the return value from
> enum_mbus_code to setup the video pipeline. Adding Niklas to Cc, maybe he
> can help to test this.

Yes this change will make the rcar-vin driver fail to probe since it do 
not recognise the MEDIA_BUS_FMT_UYVY8_2X8 format.

There is a error in the Renesas VIN driver where it looks for the wrong 
media format YUVU but expects UYVY data. This error have masked the bug 
in adv7180 fixed in this commit.

I have have sent a patch '[media] rcar-vin: add legacy mode for wrong 
media bus formats' which tries to remedy this. I would like to see that 
patched (or similar solution) merged before this one as to not break the 
Renesas R-Car2 Koelsch board which uses the adv7180.

If that can be arranged

Acked-by: Niklas Söderlund 

> 
> But otherwise
> 
> Acked-by: Lars-Peter Clausen 
> 
> > ---
> >  drivers/media/i2c/adv7180.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> > index fff887c..427695d 100644
> > --- a/drivers/media/i2c/adv7180.c
> > +++ b/drivers/media/i2c/adv7180.c
> > @@ -654,7 +654,7 @@ static int adv7180_enum_mbus_code(struct v4l2_subdev 
> > *sd,
> > if (code->index != 0)
> > return -EINVAL;
> >  
> > -   code->code = MEDIA_BUS_FMT_YUYV8_2X8;
> > +   code->code = MEDIA_BUS_FMT_UYVY8_2X8;
> >  
> > return 0;
> >  }
> > @@ -664,7 +664,7 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
> >  {
> > struct adv7180_state *state = to_state(sd);
> >  
> > -   fmt->code = MEDIA_BUS_FMT_YUYV8_2X8;
> > +   fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
> > fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
> > fmt->width = 720;
> > fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;
> > 
> 

-- 
Regards,
Niklas Söderlund
--
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 5/9] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver

2016-07-08 Thread Hans Verkuil
On 05/30/2016 02:29 PM, Tiffany Lin wrote:
> Add v4l2 layer decoder driver for MT8173
> 
> Signed-off-by: Tiffany Lin 
> ---
>  drivers/media/platform/mtk-vcodec/Makefile |   10 +-
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 1348 
> 
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h |   88 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c |  408 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c  |  206 +++
>  .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h  |   28 +
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |   88 +-
>  .../media/platform/mtk-vcodec/mtk_vcodec_intr.c|4 +-
>  .../media/platform/mtk-vcodec/mtk_vcodec_intr.h|2 +-
>  .../media/platform/mtk-vcodec/mtk_vcodec_util.c|   31 +-
>  .../media/platform/mtk-vcodec/mtk_vcodec_util.h|7 +-
>  drivers/media/platform/mtk-vcodec/vdec_drv_base.h  |   56 +
>  drivers/media/platform/mtk-vcodec/vdec_drv_if.c|  107 ++
>  drivers/media/platform/mtk-vcodec/vdec_drv_if.h|  101 ++
>  drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h   |  103 ++
>  15 files changed, 2569 insertions(+), 18 deletions(-)
>  create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
>  create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h
>  create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
>  create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
>  create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h
>  create mode 100644 drivers/media/platform/mtk-vcodec/vdec_drv_base.h
>  create mode 100644 drivers/media/platform/mtk-vcodec/vdec_drv_if.c
>  create mode 100644 drivers/media/platform/mtk-vcodec/vdec_drv_if.h
>  create mode 100644 drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h
> 
> diff --git a/drivers/media/platform/mtk-vcodec/Makefile 
> b/drivers/media/platform/mtk-vcodec/Makefile
> index dc5cb00..4c8ed2f 100644
> --- a/drivers/media/platform/mtk-vcodec/Makefile
> +++ b/drivers/media/platform/mtk-vcodec/Makefile
> @@ -1,7 +1,13 @@
>  
>  
> -obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) += mtk-vcodec-enc.o mtk-vcodec-common.o
> -
> +obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) += mtk-vcodec-dec.o \
> +mtk-vcodec-enc.o \
> +mtk-vcodec-common.o
> +
> +mtk-vcodec-dec-y := mtk_vcodec_dec_drv.o \
> + vdec_drv_if.o \
> + mtk_vcodec_dec.o \
> + mtk_vcodec_dec_pm.o \
>  
>  
>  mtk-vcodec-enc-y := venc/venc_vp8_if.o \
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c 
> b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
> new file mode 100644
> index 000..792858a
> --- /dev/null
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
> @@ -0,0 +1,1348 @@
> +/*
> +* Copyright (c) 2016 MediaTek Inc.
> +* Author: PC Chen 
> +* Tiffany Lin 
> +*
> +* 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 "mtk_vcodec_drv.h"
> +#include "mtk_vcodec_dec.h"
> +#include "mtk_vcodec_intr.h"
> +#include "mtk_vcodec_util.h"
> +#include "vdec_drv_if.h"
> +#include "mtk_vcodec_dec_pm.h"
> +
> +#define OUT_FMT_IDX  0
> +#define CAP_FMT_IDX  3
> +
> +#define MTK_VDEC_MIN_W   64U
> +#define MTK_VDEC_MIN_H   64U
> +#define DFT_CFG_WIDTHMTK_VDEC_MIN_W
> +#define DFT_CFG_HEIGHT   MTK_VDEC_MIN_H
> +
> +static struct mtk_video_fmt mtk_video_formats[] = {
> + {
> + .fourcc = V4L2_PIX_FMT_H264,
> + .type = MTK_FMT_DEC,
> + .num_planes = 1,
> + },
> + {
> + .fourcc = V4L2_PIX_FMT_VP8,
> + .type = MTK_FMT_DEC,
> + .num_planes = 1,
> + },
> + {
> + .fourcc = V4L2_PIX_FMT_VP9,
> + .type = MTK_FMT_DEC,
> + .num_planes = 1,
> + },
> + {
> + .fourcc = V4L2_PIX_FMT_MT21,
> + .type = MTK_FMT_FRAME,
> + .num_planes = 2,
> + },
> +};
> +
> +static const struct mtk_codec_framesizes mtk_vdec_framesizes[] = {
> + {
> + .fourcc = V4L2_PIX_FMT_H264,
> + .stepwise = {  MTK_VDEC_MIN_W, MTK_VDEC_MAX_W, 16,
> + MTK_VDEC_MIN_H, MTK_VDEC_MAX_H, 16 },
> + },
> + {
> + .fourcc = V4L2_PIX_FMT_VP8,
> + .stepwise = {  MTK_VDEC_MIN_W, MTK_VDEC_MAX_W, 16,
> + MTK_VDEC_MIN_H, MTK_VDEC_MAX_H, 16 },
> + },
> + {
> + .fourcc = V4L2_PIX_FMT_VP9,
> +  

[PATCH v7 02/11] v4l2-core: Add support for touch devices

2016-07-08 Thread Nick Dyer
Some touch controllers send out touch data in a similar way to a
greyscale frame grabber.

Add new device type VFL_TYPE_TOUCH:
- This uses a new device prefix v4l-touch for these devices, to stop
  generic capture software from treating them as webcams. Otherwise,
  touch is treated similarly to video capture.
- Add V4L2_INPUT_TYPE_TOUCH
- Add MEDIA_INTF_T_V4L_TOUCH
- Add V4L2_CAP_TOUCH to indicate device is a touch device

Add formats:
- V4L2_TCH_FMT_DELTA_TD16 for signed 16-bit touch deltas
- V4L2_TCH_FMT_DELTA_TD08 for signed 16-bit touch deltas
- V4L2_TCH_FMT_TU16 for unsigned 16-bit touch data
- V4L2_TCH_FMT_TU08 for unsigned 8-bit touch data

This support will be used by:
- Atmel maXTouch (atmel_mxt_ts)
- Synaptics RMI4.
- sur40

Signed-off-by: Nick Dyer 
Tested-By: Chris Healy 
---
 drivers/media/media-entity.c |2 ++
 drivers/media/v4l2-core/v4l2-dev.c   |   16 ---
 drivers/media/v4l2-core/v4l2-ioctl.c |   36 +-
 include/media/v4l2-dev.h |3 ++-
 include/uapi/linux/media.h   |1 +
 include/uapi/linux/videodev2.h   |9 +
 6 files changed, 58 insertions(+), 9 deletions(-)

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index d8a2299..9014362 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -65,6 +65,8 @@ static inline const char *intf_type(struct media_interface 
*intf)
return "v4l-subdev";
case MEDIA_INTF_T_V4L_SWRADIO:
return "v4l-swradio";
+   case MEDIA_INTF_T_V4L_TOUCH:
+   return "v4l-touch";
case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
return "alsa-pcm-capture";
case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
b/drivers/media/v4l2-core/v4l2-dev.c
index 70b559d..21ba9b4 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -527,6 +527,7 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI;
bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO;
bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR;
+   bool is_tch = vdev->vfl_type == VFL_TYPE_TOUCH;
bool is_rx = vdev->vfl_dir != VFL_DIR_TX;
bool is_tx = vdev->vfl_dir != VFL_DIR_RX;
 
@@ -573,7 +574,7 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
if (ops->vidioc_enum_freq_bands || ops->vidioc_g_tuner || 
ops->vidioc_g_modulator)
set_bit(_IOC_NR(VIDIOC_ENUM_FREQ_BANDS), valid_ioctls);
 
-   if (is_vid) {
+   if (is_vid || is_tch) {
/* video specific ioctls */
if ((is_rx && (ops->vidioc_enum_fmt_vid_cap ||
   ops->vidioc_enum_fmt_vid_cap_mplane ||
@@ -662,7 +663,7 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
}
 
-   if (is_vid || is_vbi || is_sdr) {
+   if (is_vid || is_vbi || is_sdr || is_tch) {
/* ioctls valid for video, vbi or sdr */
SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
@@ -675,7 +676,7 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff);
}
 
-   if (is_vid || is_vbi) {
+   if (is_vid || is_vbi || is_tch) {
/* ioctls valid for video or vbi */
if (ops->vidioc_s_std)
set_bit(_IOC_NR(VIDIOC_ENUMSTD), valid_ioctls);
@@ -751,6 +752,10 @@ static int video_register_media_controller(struct 
video_device *vdev, int type)
intf_type = MEDIA_INTF_T_V4L_SWRADIO;
vdev->entity.function = MEDIA_ENT_F_IO_SWRADIO;
break;
+   case VFL_TYPE_TOUCH:
+   intf_type = MEDIA_INTF_T_V4L_TOUCH;
+   vdev->entity.function = MEDIA_ENT_F_IO_V4L;
+   break;
case VFL_TYPE_RADIO:
intf_type = MEDIA_INTF_T_V4L_RADIO;
/*
@@ -845,6 +850,8 @@ static int video_register_media_controller(struct 
video_device *vdev, int type)
  * %VFL_TYPE_SUBDEV - A subdevice
  *
  * %VFL_TYPE_SDR - Software Defined Radio
+ *
+ * %VFL_TYPE_TOUCH - A touch sensor
  */
 int __video_register_device(struct video_device *vdev, int type, int nr,
int warn_if_nr_in_use, struct module *owner)
@@ -888,6 +895,9 @@ int __video_register_device(struct video_device *vdev, int 
type, int nr,
/* Use device name 'swradio' because 'sdr' was already taken. */
name_base = "swradio";
break;
+   case VFL_TYPE_TOUCH:
+   name_base = "v4l-touch";
+   break;
default:
printk(KERN_ERR "%s called with u

[PATCH v7 01/11] Input: atmel_mxt_ts - update MAINTAINERS email address

2016-07-08 Thread Nick Dyer
I'm leaving ITDev, so change to my personal email. My understanding is
that someone at Atmel will take this on once their takeover by Microchip
has settled down.

Signed-off-by: Nick Dyer 
---
 MAINTAINERS |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1209323..0461f0d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2181,9 +2181,9 @@ S:Maintained
 F: drivers/net/wireless/atmel/atmel*
 
 ATMEL MAXTOUCH DRIVER
-M: Nick Dyer 
-T: git git://github.com/atmel-maxtouch/linux.git
-S: Supported
+M: Nick Dyer 
+T: git git://github.com/ndyer/linux.git
+S: Maintained
 F: Documentation/devicetree/bindings/input/atmel,maxtouch.txt
 F: drivers/input/touchscreen/atmel_mxt_ts.c
 F: include/linux/platform_data/atmel_mxt_ts.h
-- 
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 v7 09/11] Input: atmel_mxt_ts - add support for reference data

2016-07-08 Thread Nick Dyer
There are different datatypes available from a maXTouch chip. Add
support to retrieve reference data as well.

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/atmel_mxt_ts.c |   57 ++
 1 file changed, 51 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index 7c4d937..f75f2ce 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -135,6 +135,7 @@ struct t9_range {
 /* MXT_DEBUG_DIAGNOSTIC_T37 */
 #define MXT_DIAGNOSTIC_PAGEUP  0x01
 #define MXT_DIAGNOSTIC_DELTAS  0x10
+#define MXT_DIAGNOSTIC_REFS0x11
 #define MXT_DIAGNOSTIC_SIZE128
 
 #define MXT_FAMILY_1386160
@@ -249,6 +250,12 @@ struct mxt_dbg {
int input;
 };
 
+enum v4l_dbg_inputs {
+   MXT_V4L_INPUT_DELTAS,
+   MXT_V4L_INPUT_REFS,
+   MXT_V4L_INPUT_MAX,
+};
+
 static const struct v4l2_file_operations mxt_video_fops = {
.owner = THIS_MODULE,
.open = v4l2_fh_open,
@@ -2273,6 +2280,7 @@ static void mxt_buffer_queue(struct vb2_buffer *vb)
struct mxt_data *data = vb2_get_drv_priv(vb->vb2_queue);
u16 *ptr;
int ret;
+   u8 mode;
 
ptr = vb2_plane_vaddr(vb, 0);
if (!ptr) {
@@ -2280,7 +2288,18 @@ static void mxt_buffer_queue(struct vb2_buffer *vb)
goto fault;
}
 
-   ret = mxt_read_diagnostic_debug(data, MXT_DIAGNOSTIC_DELTAS, ptr);
+   switch (data->dbg.input) {
+   case MXT_V4L_INPUT_DELTAS:
+   default:
+   mode = MXT_DIAGNOSTIC_DELTAS;
+   break;
+
+   case MXT_V4L_INPUT_REFS:
+   mode = MXT_DIAGNOSTIC_REFS;
+   break;
+   }
+
+   ret = mxt_read_diagnostic_debug(data, mode, ptr);
if (ret)
goto fault;
 
@@ -2325,11 +2344,21 @@ static int mxt_vidioc_querycap(struct file *file, void 
*priv,
 static int mxt_vidioc_enum_input(struct file *file, void *priv,
   struct v4l2_input *i)
 {
-   if (i->index > 0)
+   if (i->index >= MXT_V4L_INPUT_MAX)
return -EINVAL;
 
i->type = V4L2_INPUT_TYPE_TOUCH;
-   strlcpy(i->name, "Mutual Capacitance Deltas", sizeof(i->name));
+
+   switch (i->index) {
+   case MXT_V4L_INPUT_REFS:
+   strlcpy(i->name, "Mutual Capacitance References",
+   sizeof(i->name));
+   break;
+   case MXT_V4L_INPUT_DELTAS:
+   strlcpy(i->name, "Mutual Capacitance Deltas", sizeof(i->name));
+   break;
+   }
+
return 0;
 }
 
@@ -2337,12 +2366,16 @@ static int mxt_set_input(struct mxt_data *data, 
unsigned int i)
 {
struct v4l2_pix_format *f = &data->dbg.format;
 
-   if (i > 0)
+   if (i >= MXT_V4L_INPUT_MAX)
return -EINVAL;
 
+   if (i == MXT_V4L_INPUT_DELTAS)
+   f->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
+   else
+   f->pixelformat = V4L2_TCH_FMT_TU16;
+
f->width = data->xy_switch ? data->ysize : data->xsize;
f->height = data->xy_switch ? data->xsize : data->ysize;
-   f->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
f->field = V4L2_FIELD_NONE;
f->colorspace = V4L2_COLORSPACE_RAW;
f->bytesperline = f->width * sizeof(u16);
@@ -2383,7 +2416,19 @@ static int mxt_vidioc_enum_fmt(struct file *file, void 
*priv,
if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
 
-   fmt->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
+   switch (fmt->index) {
+   case 0:
+   fmt->pixelformat = V4L2_TCH_FMT_TU16;
+   break;
+
+   case 1:
+   fmt->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
+   break;
+
+   default:
+   return -EINVAL;
+   }
+
return 0;
 }
 
-- 
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] v4l2-compliance: Changes to support touch sensors

2016-07-08 Thread Nick Dyer
Signed-off-by: Nick Dyer 
---
 utils/v4l2-compliance/v4l2-compliance.cpp|   51 +-
 utils/v4l2-compliance/v4l2-compliance.h  |1 +
 utils/v4l2-compliance/v4l2-test-input-output.cpp |4 +-
 3 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp 
b/utils/v4l2-compliance/v4l2-compliance.cpp
index 48dc8b4..ca2eec7 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -55,6 +55,7 @@ enum Option {
OptSetRadioDevice = 'r',
OptStreaming = 's',
OptSetSWRadioDevice = 'S',
+   OptSetTouchDevice = 't',
OptTrace = 'T',
OptVerbose = 'v',
OptSetVbiDevice = 'V',
@@ -105,6 +106,7 @@ static struct option long_options[] = {
{"vbi-device", required_argument, 0, OptSetVbiDevice},
{"sdr-device", required_argument, 0, OptSetSWRadioDevice},
{"expbuf-device", required_argument, 0, OptSetExpBufDevice},
+   {"touch-device", required_argument, 0, OptSetTouchDevice},
{"help", no_argument, 0, OptHelp},
{"verbose", no_argument, 0, OptVerbose},
{"no-warnings", no_argument, 0, OptNoWarnings},
@@ -134,6 +136,9 @@ static void usage(void)
printf("  -S, --sdr-device=\n");
printf(" Use device  as the SDR device.\n");
printf(" If  starts with a digit, then 
/dev/swradio is used.\n");
+   printf("  -t, --touch-device=\n");
+   printf(" Use device  as the touch device.\n");
+   printf(" If  starts with a digit, then 
/dev/v4l-touch is used.\n");
printf("  -e, --expbuf-device=\n");
printf(" Use device  to obtain DMABUF 
handles.\n");
printf(" If  starts with a digit, then 
/dev/video is used.\n");
@@ -206,6 +211,8 @@ std::string cap2s(unsigned cap)
s += "\t\tSDR Capture\n";
if (cap & V4L2_CAP_SDR_OUTPUT)
s += "\t\tSDR Output\n";
+   if (cap & V4L2_CAP_TOUCH)
+   s += "\t\tTouch Capture\n";
if (cap & V4L2_CAP_TUNER)
s += "\t\tTuner\n";
if (cap & V4L2_CAP_HW_FREQ_SEEK)
@@ -533,7 +540,8 @@ static int testCap(struct node *node)
memcmp(vcap.bus_info, "ISA:", 4) &&
memcmp(vcap.bus_info, "I2C:", 4) &&
memcmp(vcap.bus_info, "parport", 7) &&
-   memcmp(vcap.bus_info, "platform:", 9))
+   memcmp(vcap.bus_info, "platform:", 9) &&
+   memcmp(vcap.bus_info, "rmi4:", 5))
return fail("missing bus_info prefix ('%s')\n", vcap.bus_info);
fail_on_test((vcap.version >> 16) < 3);
fail_on_test(check_0(vcap.reserved, sizeof(vcap.reserved)));
@@ -673,6 +681,8 @@ int main(int argc, char **argv)
struct node radio_node2;
struct node sdr_node;
struct node sdr_node2;
+   struct node touch_node;
+   struct node touch_node2;
struct node expbuf_node;
 
/* command args */
@@ -682,6 +692,7 @@ int main(int argc, char **argv)
const char *vbi_device = NULL;  /* -V device */
const char *radio_device = NULL;/* -r device */
const char *sdr_device = NULL;  /* -S device */
+   const char *touch_device = NULL;/* -t device */
const char *expbuf_device = NULL;   /* --expbuf-device device */
struct v4l2_capability vcap;/* list_cap */
unsigned frame_count = 60;
@@ -750,6 +761,15 @@ int main(int argc, char **argv)
sdr_device = newdev;
}
break;
+   case OptSetTouchDevice:
+   touch_device = optarg;
+   if (touch_device[0] >= '0' && touch_device[0] <= '9' && 
strlen(touch_device) <= 3) {
+   static char newdev[20];
+
+   sprintf(newdev, "/dev/v4l-touch%s", 
touch_device);
+   touch_device = newdev;
+   }
+   break;
case OptSetExpBufDevice:
expbuf_device = optarg;
if (expbuf_device[0] >= '0' && expbuf_device[0] <= '9' 
&& strlen(expbuf_device) <= 3) {
@@ -839,7 +859,8 @@ int main(int argc, char **argv)
if (v1 == 2 && v2 == 6)
kernel_version = v3;
 
-   if (!video_device && !vbi_device && !radio_device && !sdr_device)
+   if (!video_device && !vbi_device && !radio_device &&
+   !sdr_device && !touch_device)
video_device = "/dev/video0";
 
if (video_device) {
@@ -886,6 +907,17 @@ int main(int argc, char **argv)
}
}
 
+   if (touch_device) {
+   touch_node.s_trace(options[OptTrace]);
+   touch_node.s_direct(direct);
+  

[PATCH v7 03/11] DocBook: add support for touch devices

2016-07-08 Thread Nick Dyer
Signed-off-by: Nick Dyer 
---
 Documentation/DocBook/media/v4l/dev-touch.xml  |   51 
 Documentation/DocBook/media/v4l/media-types.xml|5 ++
 .../DocBook/media/v4l/pixfmt-tch-td08.xml  |   66 
 .../DocBook/media/v4l/pixfmt-tch-td16.xml  |   82 
 .../DocBook/media/v4l/pixfmt-tch-tu08.xml  |   66 
 .../DocBook/media/v4l/pixfmt-tch-tu16.xml  |   81 +++
 Documentation/DocBook/media/v4l/pixfmt.xml |   13 
 Documentation/DocBook/media/v4l/v4l2.xml   |1 +
 8 files changed, 365 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/dev-touch.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-tch-td08.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-tch-td16.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-tch-tu08.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-tch-tu16.xml

diff --git a/Documentation/DocBook/media/v4l/dev-touch.xml 
b/Documentation/DocBook/media/v4l/dev-touch.xml
new file mode 100644
index 000..85d492a
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-touch.xml
@@ -0,0 +1,51 @@
+Touch Devices
+
+Touch devices are accessed through character device special files
+  named /dev/v4l-touch0 to
+  /dev/v4l-touch255 with major number 81 and
+  dynamically allocated minor numbers 0 to 255.
+
+
+  Overview
+
+  Sensors may be Optical, or Projected Capacitive touch (PCT).
+
+  Processing is required to analyse the raw data and produce input
+events. In some systems, this may be performed on the ASIC and the raw data
+is purely a side-channel for diagnostics or tuning. In other systems, the
+ASIC is a simple analogue front end device which delivers touch data at
+high rate, and any touch processing must be done on the host.
+
+  For capacitive touch sensing, the touchscreen is composed of an array
+of horizontal and vertical conductors (alternatively called rows/columns,
+X/Y lines, or tx/rx). Mutual Capacitance measured is at the nodes where the
+conductors cross. Alternatively, Self Capacitance measures the signal from
+each column and row independently.
+
+  A touch input may be determined by comparing the raw capacitance
+measurement to a no-touch reference (or "baseline") measurement:
+
+  Delta = Raw - Reference
+
+  The reference measurement takes account of variations in the
+capacitance across the touch sensor matrix, for example
+manufacturing irregularities, environmental or edge effects.
+
+
+
+  Querying Capabilities
+
+  Devices supporting the touch interface set the
+V4L2_CAP_VIDEO_CAPTURE flag in the
+capabilities field of &v4l2-capability;
+returned by the &VIDIOC-QUERYCAP; ioctl.
+
+  At least one of the read/write or streaming I/O methods must be
+supported.
+
+
+
+  Data Format Negotiation
+
+  A touch device may support any I/O method.
+
diff --git a/Documentation/DocBook/media/v4l/media-types.xml 
b/Documentation/DocBook/media/v4l/media-types.xml
index 5e3f20f..fb957c7 100644
--- a/Documentation/DocBook/media/v4l/media-types.xml
+++ b/Documentation/DocBook/media/v4l/media-types.xml
@@ -202,6 +202,11 @@
typically, /dev/swradio?
  
  
+   MEDIA_INTF_T_V4L_TOUCH
+   Device node interface for Touch device (V4L)
+   typically, /dev/v4l-touch?
+ 
+ 
MEDIA_INTF_T_ALSA_PCM_CAPTURE
Device node interface for ALSA PCM Capture
typically, /dev/snd/pcmC?D?c
diff --git a/Documentation/DocBook/media/v4l/pixfmt-tch-td08.xml 
b/Documentation/DocBook/media/v4l/pixfmt-tch-td08.xml
new file mode 100644
index 000..2483eb0
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-tch-td08.xml
@@ -0,0 +1,66 @@
+
+  
+V4L2_TCH_FMT_DELTA_TD08 ('TD08')
+&manvol;
+  
+  
+V4L2_TCH_FMT_DELTA_TD08
+8-bit signed Touch Delta
+  
+  
+Description
+
+This format represents delta data from a touch controller
+
+Delta values may range from -128 to 127. Typically the values
+  will vary through a small range depending on whether the sensor is
+  touched or not. The full value may be seen if one of the
+  touchscreen nodes has a fault or the line is not connected.
+
+
+  V4L2_TCH_FMT_DELTA_TD08 4 × 4
+node matrix
+
+  
+Byte Order.
+Each cell is one byte.
+  
+
+  
+  
+
+  start + 0:
+  D'00
+  D'01
+  D'02
+  D'03
+
+
+  start + 4:
+  D'10
+  D'11
+  D'12
+  D'13
+
+
+  start + 8:
+  D'20
+  D'21
+  D'22
+

[PATCH v7 07/11] Input: atmel_mxt_ts - handle diagnostic data orientation

2016-07-08 Thread Nick Dyer
Invert the diagnostic data to match the orientation of the input device.

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/atmel_mxt_ts.c |   26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index d09ecc3..c35fca0 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -125,6 +125,8 @@ struct t9_range {
 
 /* MXT_TOUCH_MULTI_T9 orient */
 #define MXT_T9_ORIENT_SWITCH   (1 << 0)
+#define MXT_T9_ORIENT_INVERTX  (1 << 1)
+#define MXT_T9_ORIENT_INVERTY  (1 << 2)
 
 /* MXT_SPT_COMMSCONFIG_T18 */
 #define MXT_COMMS_CTRL 0
@@ -158,6 +160,8 @@ struct t37_debug {
 #define MXT_T100_YRANGE24
 
 #define MXT_T100_CFG_SWITCHXY  BIT(5)
+#define MXT_T100_CFG_INVERTY   BIT(6)
+#define MXT_T100_CFG_INVERTX   BIT(7)
 
 #define MXT_T100_TCHAUX_VECT   BIT(0)
 #define MXT_T100_TCHAUX_AMPL   BIT(1)
@@ -262,6 +266,8 @@ struct mxt_data {
unsigned int irq;
unsigned int max_x;
unsigned int max_y;
+   bool invertx;
+   bool inverty;
bool xy_switch;
u8 xsize;
u8 ysize;
@@ -1747,6 +1753,8 @@ static int mxt_read_t9_resolution(struct mxt_data *data)
return error;
 
data->xy_switch = orient & MXT_T9_ORIENT_SWITCH;
+   data->invertx = orient & MXT_T9_ORIENT_INVERTX;
+   data->inverty = orient & MXT_T9_ORIENT_INVERTY;
 
return 0;
 }
@@ -1801,6 +1809,8 @@ static int mxt_read_t100_config(struct mxt_data *data)
return error;
 
data->xy_switch = cfg & MXT_T100_CFG_SWITCHXY;
+   data->invertx = cfg & MXT_T100_CFG_INVERTX;
+   data->inverty = cfg & MXT_T100_CFG_INVERTY;
 
/* allocate aux bytes */
error =  __mxt_read_reg(client,
@@ -2145,13 +2155,19 @@ static int mxt_convert_debug_pages(struct mxt_data 
*data, u16 *outbuf)
struct mxt_dbg *dbg = &data->dbg;
unsigned int x = 0;
unsigned int y = 0;
-   unsigned int i;
+   unsigned int i, rx, ry;
 
for (i = 0; i < dbg->t37_nodes; i++) {
-   outbuf[i] = mxt_get_debug_value(data, x, y);
+   /* Handle orientation */
+   rx = data->xy_switch ? y : x;
+   ry = data->xy_switch ? x : y;
+   rx = data->invertx ? (data->xsize - 1 - rx) : rx;
+   ry = data->inverty ? (data->ysize - 1 - ry) : ry;
+
+   outbuf[i] = mxt_get_debug_value(data, rx, ry);
 
/* Next value */
-   if (++x >= data->xsize) {
+   if (++x >= (data->xy_switch ? data->ysize : data->xsize)) {
x = 0;
y++;
}
@@ -2306,8 +2322,8 @@ static int mxt_set_input(struct mxt_data *data, unsigned 
int i)
if (i > 0)
return -EINVAL;
 
-   f->width = data->xsize;
-   f->height = data->ysize;
+   f->width = data->xy_switch ? data->ysize : data->xsize;
+   f->height = data->xy_switch ? data->xsize : data->ysize;
f->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
f->field = V4L2_FIELD_NONE;
f->colorspace = V4L2_COLORSPACE_RAW;
-- 
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 v7 05/11] Input: atmel_mxt_ts - output diagnostic debug via V4L2 device

2016-07-08 Thread Nick Dyer
Register a video device to output T37 diagnostic data.

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/Kconfig|6 +-
 drivers/input/touchscreen/atmel_mxt_ts.c |  244 ++
 2 files changed, 248 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index da96ecf..7c1c5ec 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -117,9 +117,11 @@ config TOUCHSCREEN_ATMEL_MXT
 
 config TOUCHSCREEN_ATMEL_MXT_T37
bool "Support T37 Diagnostic Data"
-   depends on TOUCHSCREEN_ATMEL_MXT
+   depends on TOUCHSCREEN_ATMEL_MXT && VIDEO_V4L2
+   select VIDEOBUF2_VMALLOC
help
- Say Y here if you want support for the T37 Diagnostic Data object.
+ Say Y here if you want support to output data from the T37
+ Diagnostic Data object using a V4L device.
 
 config TOUCHSCREEN_AUO_PIXCIR
tristate "AUO in-cell touchscreen using Pixcir ICs"
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index 0048233..bea95a1 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -28,6 +28,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 /* Firmware files */
 #define MXT_FW_NAME"maxtouch.fw"
@@ -224,6 +228,23 @@ struct mxt_dbg {
struct t37_debug *t37_buf;
unsigned int t37_pages;
unsigned int t37_nodes;
+
+   struct v4l2_device v4l2;
+   struct v4l2_pix_format format;
+   struct video_device vdev;
+   struct vb2_queue queue;
+   struct mutex lock;
+   int input;
+};
+
+static const struct v4l2_file_operations mxt_video_fops = {
+   .owner = THIS_MODULE,
+   .open = v4l2_fh_open,
+   .release = vb2_fop_release,
+   .unlocked_ioctl = video_ioctl2,
+   .read = vb2_fop_read,
+   .mmap = vb2_fop_mmap,
+   .poll = vb2_fop_poll,
 };
 
 /* Each client has this additional data */
@@ -279,6 +300,11 @@ struct mxt_data {
struct completion crc_completion;
 };
 
+struct mxt_vb2_buffer {
+   struct vb2_buffer   vb;
+   struct list_headlist;
+};
+
 static size_t mxt_obj_size(const struct mxt_object *obj)
 {
return obj->size_minus_one + 1;
@@ -1525,6 +1551,11 @@ static void mxt_free_input_device(struct mxt_data *data)
 
 static void mxt_free_object_table(struct mxt_data *data)
 {
+#ifdef CONFIG_TOUCHSCREEN_ATMEL_MXT_T37
+   video_unregister_device(&data->dbg.vdev);
+   v4l2_device_unregister(&data->dbg.v4l2);
+#endif
+
kfree(data->object_table);
data->object_table = NULL;
kfree(data->msg_buf);
@@ -2157,10 +2188,191 @@ wait_cmd:
return mxt_convert_debug_pages(data, outbuf);
 }
 
+static int mxt_queue_setup(struct vb2_queue *q,
+  unsigned int *nbuffers, unsigned int *nplanes,
+  unsigned int sizes[], void *alloc_ctxs[])
+{
+   struct mxt_data *data = q->drv_priv;
+   size_t size = data->dbg.t37_nodes * sizeof(u16);
+
+   if (*nplanes)
+   return sizes[0] < size ? -EINVAL : 0;
+
+   *nplanes = 1;
+   sizes[0] = size;
+
+   return 0;
+}
+
+static void mxt_buffer_queue(struct vb2_buffer *vb)
+{
+   struct mxt_data *data = vb2_get_drv_priv(vb->vb2_queue);
+   u16 *ptr;
+   int ret;
+
+   ptr = vb2_plane_vaddr(vb, 0);
+   if (!ptr) {
+   dev_err(&data->client->dev, "Error acquiring frame ptr\n");
+   goto fault;
+   }
+
+   ret = mxt_read_diagnostic_debug(data, MXT_DIAGNOSTIC_DELTAS, ptr);
+   if (ret)
+   goto fault;
+
+   vb2_set_plane_payload(vb, 0, data->dbg.t37_nodes * sizeof(u16));
+   vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
+   return;
+
+fault:
+   vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
+}
+
+/* V4L2 structures */
+static const struct vb2_ops mxt_queue_ops = {
+   .queue_setup= mxt_queue_setup,
+   .buf_queue  = mxt_buffer_queue,
+   .wait_prepare   = vb2_ops_wait_prepare,
+   .wait_finish= vb2_ops_wait_finish,
+};
+
+static const struct vb2_queue mxt_queue = {
+   .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+   .io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ,
+   .buf_struct_size = sizeof(struct mxt_vb2_buffer),
+   .ops = &mxt_queue_ops,
+   .mem_ops = &vb2_vmalloc_memops,
+   .timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,
+   .min_buffers_needed = 1,
+};
+
+static int mxt_vidioc_querycap(struct file *file, void *priv,
+struct v4l2_capability *cap)
+{
+   struct mxt_data *data = video_drvdata(file);
+
+   strlcpy(cap->driver, "atmel_mxt_ts", sizeof(cap->driver));
+   strlcpy(cap->card, "atmel_mxt_ts touch", sizeof(cap->card));
+   snprintf(cap->bus_info, sizeof(cap

[PATCH v7 0/11] Output raw touch data via V4L2

2016-07-08 Thread Nick Dyer
This is a series of patches to add output of raw touch diagnostic data via V4L2
to the Atmel maXTouch and Synaptics RMI4 drivers.

It's a rewrite of the previous implementation which output via debugfs: it now
uses a V4L2 device in a similar way to the sur40 driver.

We have a utility which can read the data and display it in a useful format:
https://github.com/ndyer/heatmap/commits/heatmap-v4l

These patches are also available from
https://github.com/ndyer/linux/commits/v4l-touch-v7-2016-07-08

I will also send a patch to update v4l2-compliance.

Changes in v7:
- Tested by Andrew Duggan and Chris Healy.
- Update bus_info to add "rmi4:" bus.
- Fix code style issues in sur40 changes.

Changes in v6:
- Remove BUF_TYPE_TOUCH_CAPTURE, as discussed with Hans V touch devices will
  use BUF_TYPE_VIDEO_CAPTURE.
- Touch devices should now register CAP_VIDEO_CAPTURE: CAP_TOUCH just says that
  this is a touch device, not a video device, but otherwise it acts the same.
- Add some code to v4l_s_fmt() to set sensible default values for fields not
  used by touch.
- Improve naming/doc of RMI4 F54 report types.
- Various minor DocBook fixes, and split to separate patch.
- Update my email address.
- Rework sur40 changes so that PIX_FMT_GREY is supported for backward
  compatibility. Florian is it possible for you to test?

Changes in v5 (Hans Verkuil review):
- Update v4l2-core:
  - Add VFL_TYPE_TOUCH, V4L2_BUF_TYPE_TOUCH_CAPTURE and V4L2_CAP_TOUCH
  - Change V4L2_INPUT_TYPE_TOUCH_SENSOR to V4L2_INPUT_TYPE_TOUCH
  - Improve DocBook documentation
  - Add FMT definitions for touch data
  - Note this will need the latest version of the heatmap util
- Synaptics RMI4 driver:
  - Remove some less important non full frame report types
  - Switch report type names to const char * array
  - Move a static array to inside context struct
- Split sur40 changes to a separate commit

Changes in v4:
- Address nits from the input side in atmel_mxt_ts patches (Dmitry Torokhov)
- Add Synaptics RMI4 F54 support patch

Changes in v3:
- Address V4L2 review comments from Hans Verkuil
- Run v4l-compliance and fix all issues - needs minor patch here:
  https://github.com/ndyer/v4l-utils/commit/cf50469773f

Changes in v2:
- Split pixfmt changes into separate commit and add DocBook
- Introduce VFL_TYPE_TOUCH_SENSOR and /dev/v4l-touch
- Remove "single node" support for now, it may be better to treat it as
  metadata later
- Explicitly set VFL_DIR_RX
- Fix Kconfig

--
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 v7 04/11] Input: atmel_mxt_ts - add support for T37 diagnostic data

2016-07-08 Thread Nick Dyer
Atmel maXTouch devices have a T37 object which can be used to read raw
touch deltas from the device. This consists of an array of 16-bit
integers, one for each node on the touchscreen matrix.

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/Kconfig|6 ++
 drivers/input/touchscreen/atmel_mxt_ts.c |  159 ++
 2 files changed, 165 insertions(+)

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 8ecdc38..da96ecf 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -115,6 +115,12 @@ config TOUCHSCREEN_ATMEL_MXT
  To compile this driver as a module, choose M here: the
  module will be called atmel_mxt_ts.
 
+config TOUCHSCREEN_ATMEL_MXT_T37
+   bool "Support T37 Diagnostic Data"
+   depends on TOUCHSCREEN_ATMEL_MXT
+   help
+ Say Y here if you want support for the T37 Diagnostic Data object.
+
 config TOUCHSCREEN_AUO_PIXCIR
tristate "AUO in-cell touchscreen using Pixcir ICs"
depends on I2C
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index 5af7907..0048233 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -124,6 +124,19 @@ struct t9_range {
 #define MXT_COMMS_CTRL 0
 #define MXT_COMMS_CMD  1
 
+/* MXT_DEBUG_DIAGNOSTIC_T37 */
+#define MXT_DIAGNOSTIC_PAGEUP  0x01
+#define MXT_DIAGNOSTIC_DELTAS  0x10
+#define MXT_DIAGNOSTIC_SIZE128
+
+struct t37_debug {
+#ifdef CONFIG_TOUCHSCREEN_ATMEL_MXT_T37
+   u8 mode;
+   u8 page;
+   u8 data[MXT_DIAGNOSTIC_SIZE];
+#endif
+};
+
 /* Define for MXT_GEN_COMMAND_T6 */
 #define MXT_BOOT_VALUE 0xa5
 #define MXT_RESET_VALUE0x01
@@ -205,6 +218,14 @@ struct mxt_object {
u8 num_report_ids;
 } __packed;
 
+struct mxt_dbg {
+   u16 t37_address;
+   u16 diag_cmd_address;
+   struct t37_debug *t37_buf;
+   unsigned int t37_pages;
+   unsigned int t37_nodes;
+};
+
 /* Each client has this additional data */
 struct mxt_data {
struct i2c_client *client;
@@ -233,6 +254,7 @@ struct mxt_data {
u8 num_touchids;
u8 multitouch;
struct t7_config t7_cfg;
+   struct mxt_dbg dbg;
 
/* Cached parameters from object table */
u16 T5_address;
@@ -2043,6 +2065,141 @@ recheck:
return 0;
 }
 
+#ifdef CONFIG_TOUCHSCREEN_ATMEL_MXT_T37
+static u16 mxt_get_debug_value(struct mxt_data *data, unsigned int x,
+  unsigned int y)
+{
+   struct mxt_dbg *dbg = &data->dbg;
+   unsigned int ofs, page;
+
+   ofs = (y + (x * data->info.matrix_ysize)) * sizeof(u16);
+   page = ofs / MXT_DIAGNOSTIC_SIZE;
+   ofs %= MXT_DIAGNOSTIC_SIZE;
+
+   return get_unaligned_le16(&dbg->t37_buf[page].data[ofs]);
+}
+
+static int mxt_convert_debug_pages(struct mxt_data *data, u16 *outbuf)
+{
+   struct mxt_dbg *dbg = &data->dbg;
+   unsigned int x = 0;
+   unsigned int y = 0;
+   unsigned int i;
+
+   for (i = 0; i < dbg->t37_nodes; i++) {
+   outbuf[i] = mxt_get_debug_value(data, x, y);
+
+   /* Next value */
+   if (++x >= data->info.matrix_xsize) {
+   x = 0;
+   y++;
+   }
+   }
+
+   return 0;
+}
+
+static int mxt_read_diagnostic_debug(struct mxt_data *data, u8 mode,
+u16 *outbuf)
+{
+   struct mxt_dbg *dbg = &data->dbg;
+   int retries = 0;
+   int page;
+   int ret;
+   u8 cmd = mode;
+   struct t37_debug *p;
+   u8 cmd_poll;
+
+   for (page = 0; page < dbg->t37_pages; page++) {
+   p = dbg->t37_buf + page;
+
+   ret = mxt_write_reg(data->client, dbg->diag_cmd_address,
+   cmd);
+   if (ret)
+   return ret;
+
+   retries = 0;
+   msleep(20);
+wait_cmd:
+   /* Read back command byte */
+   ret = __mxt_read_reg(data->client, dbg->diag_cmd_address,
+sizeof(cmd_poll), &cmd_poll);
+   if (ret)
+   return ret;
+
+   /* Field is cleared once the command has been processed */
+   if (cmd_poll) {
+   if (retries++ > 100)
+   return -EINVAL;
+
+   msleep(20);
+   goto wait_cmd;
+   }
+
+   /* Read T37 page */
+   ret = __mxt_read_reg(data->client, dbg->t37_address,
+sizeof(struct t37_debug), p);
+   if (ret)
+   return ret;
+
+   if (p->mode != mode || p->page != page) {
+   dev_err(&data->client->dev, "T37 page mismatch\n");
+   

[PATCH v7 11/11] Input: sur40 - use new V4L2 touch input type

2016-07-08 Thread Nick Dyer
Support both V4L2_TCH_FMT_TU08 and V4L2_PIX_FMT_GREY for backwards
compatibility.

Note: I have not tested these changes (I have no access to the hardware)
so not signing off.
---
 drivers/input/touchscreen/sur40.c |  123 +++--
 1 file changed, 89 insertions(+), 34 deletions(-)

diff --git a/drivers/input/touchscreen/sur40.c 
b/drivers/input/touchscreen/sur40.c
index 880c40b..b6cbe74 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -139,6 +139,27 @@ struct sur40_image_header {
 #define SUR40_GET_STATE   0xc5 /*  4 bytes state (?) */
 #define SUR40_GET_SENSORS 0xb1 /*  8 bytes sensors   */
 
+static const struct v4l2_pix_format sur40_pix_format[] = {
+   {
+   .pixelformat = V4L2_TCH_FMT_TU08,
+   .width  = SENSOR_RES_X / 2,
+   .height = SENSOR_RES_Y / 2,
+   .field = V4L2_FIELD_NONE,
+   .colorspace = V4L2_COLORSPACE_SRGB,
+   .bytesperline = SENSOR_RES_X / 2,
+   .sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
+   },
+   {
+   .pixelformat = V4L2_PIX_FMT_GREY,
+   .width  = SENSOR_RES_X / 2,
+   .height = SENSOR_RES_Y / 2,
+   .field = V4L2_FIELD_NONE,
+   .colorspace = V4L2_COLORSPACE_SRGB,
+   .bytesperline = SENSOR_RES_X / 2,
+   .sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
+   }
+};
+
 /* master device state */
 struct sur40_state {
 
@@ -149,6 +170,7 @@ struct sur40_state {
struct v4l2_device v4l2;
struct video_device vdev;
struct mutex lock;
+   struct v4l2_pix_format pix_fmt;
 
struct vb2_queue queue;
struct vb2_alloc_ctx *alloc_ctx;
@@ -170,7 +192,6 @@ struct sur40_buffer {
 
 /* forward declarations */
 static const struct video_device sur40_video_device;
-static const struct v4l2_pix_format sur40_video_format;
 static const struct vb2_queue sur40_queue;
 static void sur40_process_video(struct sur40_state *sur40);
 
@@ -421,7 +442,7 @@ static void sur40_process_video(struct sur40_state *sur40)
goto err_poll;
}
 
-   if (le32_to_cpu(img->size) != sur40_video_format.sizeimage) {
+   if (le32_to_cpu(img->size) != sur40->pix_fmt.sizeimage) {
dev_err(sur40->dev, "image size mismatch\n");
goto err_poll;
}
@@ -432,7 +453,7 @@ static void sur40_process_video(struct sur40_state *sur40)
 
result = usb_sg_init(&sgr, sur40->usbdev,
usb_rcvbulkpipe(sur40->usbdev, VIDEO_ENDPOINT), 0,
-   sgt->sgl, sgt->nents, sur40_video_format.sizeimage, 0);
+   sgt->sgl, sgt->nents, sur40->pix_fmt.sizeimage, 0);
if (result < 0) {
dev_err(sur40->dev, "error %d in usb_sg_init\n", result);
goto err_poll;
@@ -593,13 +614,14 @@ static int sur40_probe(struct usb_interface *interface,
goto err_unreg_v4l2;
}
 
+   sur40->pix_fmt = sur40_pix_format[0];
sur40->vdev = sur40_video_device;
sur40->vdev.v4l2_dev = &sur40->v4l2;
sur40->vdev.lock = &sur40->lock;
sur40->vdev.queue = &sur40->queue;
video_set_drvdata(&sur40->vdev, sur40);
 
-   error = video_register_device(&sur40->vdev, VFL_TYPE_GRABBER, -1);
+   error = video_register_device(&sur40->vdev, VFL_TYPE_TOUCH, -1);
if (error) {
dev_err(&interface->dev,
"Unable to register video subdevice.");
@@ -662,10 +684,10 @@ static int sur40_queue_setup(struct vb2_queue *q,
alloc_ctxs[0] = sur40->alloc_ctx;
 
if (*nplanes)
-   return sizes[0] < sur40_video_format.sizeimage ? -EINVAL : 0;
+   return sizes[0] < sur40->pix_fmt.sizeimage ? -EINVAL : 0;
 
*nplanes = 1;
-   sizes[0] = sur40_video_format.sizeimage;
+   sizes[0] = sur40->pix_fmt.sizeimage;
 
return 0;
 }
@@ -677,7 +699,7 @@ static int sur40_queue_setup(struct vb2_queue *q,
 static int sur40_buffer_prepare(struct vb2_buffer *vb)
 {
struct sur40_state *sur40 = vb2_get_drv_priv(vb->vb2_queue);
-   unsigned long size = sur40_video_format.sizeimage;
+   unsigned long size = sur40->pix_fmt.sizeimage;
 
if (vb2_plane_size(vb, 0) < size) {
dev_err(&sur40->usbdev->dev, "buffer too small (%lu < %lu)\n",
@@ -751,7 +773,7 @@ static int sur40_vidioc_querycap(struct file *file, void 
*priv,
strlcpy(cap->driver, DRIVER_SHORT, sizeof(cap->driver));
strlcpy(cap->card, DRIVER_LONG, sizeof(cap->card));
usb_make_path(sur40->usbdev, cap->bus_info, sizeof(cap->bus_info));
-   cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
+   cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TOUCH |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -763,7 +785,7 @@

[PATCH v7 06/11] Input: atmel_mxt_ts - read touchscreen size

2016-07-08 Thread Nick Dyer
The touchscreen may have a margin where not all the matrix is used. Read
the parameters from T9 and T100 and take account of the difference.

Note: this does not read the XORIGIN/YORIGIN fields so it assumes that
the touchscreen starts at (0,0)

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/atmel_mxt_ts.c |   42 +-
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index bea95a1..d09ecc3 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -103,6 +103,8 @@ struct t7_config {
 
 /* MXT_TOUCH_MULTI_T9 field */
 #define MXT_T9_CTRL0
+#define MXT_T9_XSIZE   3
+#define MXT_T9_YSIZE   4
 #define MXT_T9_ORIENT  9
 #define MXT_T9_RANGE   18
 
@@ -150,7 +152,9 @@ struct t37_debug {
 #define MXT_T100_CTRL  0
 #define MXT_T100_CFG1  1
 #define MXT_T100_TCHAUX3
+#define MXT_T100_XSIZE 9
 #define MXT_T100_XRANGE13
+#define MXT_T100_YSIZE 20
 #define MXT_T100_YRANGE24
 
 #define MXT_T100_CFG_SWITCHXY  BIT(5)
@@ -259,6 +263,8 @@ struct mxt_data {
unsigned int max_x;
unsigned int max_y;
bool xy_switch;
+   u8 xsize;
+   u8 ysize;
bool in_bootloader;
u16 mem_size;
u8 t100_aux_ampl;
@@ -1714,6 +1720,18 @@ static int mxt_read_t9_resolution(struct mxt_data *data)
return -EINVAL;
 
error = __mxt_read_reg(client,
+  object->start_address + MXT_T9_XSIZE,
+  sizeof(data->xsize), &data->xsize);
+   if (error)
+   return error;
+
+   error = __mxt_read_reg(client,
+  object->start_address + MXT_T9_YSIZE,
+  sizeof(data->ysize), &data->ysize);
+   if (error)
+   return error;
+
+   error = __mxt_read_reg(client,
   object->start_address + MXT_T9_RANGE,
   sizeof(range), &range);
if (error)
@@ -1763,6 +1781,18 @@ static int mxt_read_t100_config(struct mxt_data *data)
 
data->max_y = get_unaligned_le16(&range_y);
 
+   error = __mxt_read_reg(client,
+  object->start_address + MXT_T100_XSIZE,
+  sizeof(data->xsize), &data->xsize);
+   if (error)
+   return error;
+
+   error = __mxt_read_reg(client,
+  object->start_address + MXT_T100_YSIZE,
+  sizeof(data->ysize), &data->ysize);
+   if (error)
+   return error;
+
/* read orientation config */
error =  __mxt_read_reg(client,
object->start_address + MXT_T100_CFG1,
@@ -2121,7 +2151,7 @@ static int mxt_convert_debug_pages(struct mxt_data *data, 
u16 *outbuf)
outbuf[i] = mxt_get_debug_value(data, x, y);
 
/* Next value */
-   if (++x >= data->info.matrix_xsize) {
+   if (++x >= data->xsize) {
x = 0;
y++;
}
@@ -2276,8 +2306,8 @@ static int mxt_set_input(struct mxt_data *data, unsigned 
int i)
if (i > 0)
return -EINVAL;
 
-   f->width = data->info.matrix_xsize;
-   f->height = data->info.matrix_ysize;
+   f->width = data->xsize;
+   f->height = data->ysize;
f->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
f->field = V4L2_FIELD_NONE;
f->colorspace = V4L2_COLORSPACE_RAW;
@@ -2392,9 +2422,9 @@ static void mxt_debug_init(struct mxt_data *data)
dbg->t37_address = object->start_address;
 
/* Calculate size of data and allocate buffer */
-   dbg->t37_nodes = data->info.matrix_xsize * data->info.matrix_ysize;
-   dbg->t37_pages = DIV_ROUND_UP(dbg->t37_nodes * sizeof(u16),
- sizeof(dbg->t37_buf->data));
+   dbg->t37_nodes = data->xsize * data->ysize;
+   dbg->t37_pages = DIV_ROUND_UP(data->xsize * data->info.matrix_ysize *
+ sizeof(u16), sizeof(dbg->t37_buf->data));
 
dbg->t37_buf = devm_kmalloc_array(&data->client->dev, dbg->t37_pages,
  sizeof(struct t37_debug), GFP_KERNEL);
-- 
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 v7 10/11] Input: synaptics-rmi4 - add support for F54 diagnostics

2016-07-08 Thread Nick Dyer
Function 54 implements access to various RMI4 diagnostic features.

This patch adds support for retrieving this data. It registers a V4L2
device to output the data to user space.

Signed-off-by: Nick Dyer 
Tested-by: Andrew Duggan 
Tested-by: Chris Healy 
---
 drivers/input/rmi4/Kconfig  |   11 +
 drivers/input/rmi4/Makefile |1 +
 drivers/input/rmi4/rmi_bus.c|3 +
 drivers/input/rmi4/rmi_driver.h |1 +
 drivers/input/rmi4/rmi_f54.c|  755 +++
 5 files changed, 771 insertions(+)
 create mode 100644 drivers/input/rmi4/rmi_f54.c

diff --git a/drivers/input/rmi4/Kconfig b/drivers/input/rmi4/Kconfig
index f73df24..f3418b6 100644
--- a/drivers/input/rmi4/Kconfig
+++ b/drivers/input/rmi4/Kconfig
@@ -61,3 +61,14 @@ config RMI4_F30
 
  Function 30 provides GPIO and LED support for RMI4 devices. This
  includes support for buttons on TouchPads and ClickPads.
+
+config RMI4_F54
+   bool "RMI4 Function 54 (Analog diagnostics)"
+   depends on RMI4_CORE
+   depends on VIDEO_V4L2
+   select VIDEOBUF2_VMALLOC
+   help
+ Say Y here if you want to add support for RMI4 function 54
+
+ Function 54 provides access to various diagnostic features in certain
+ RMI4 touch sensors.
diff --git a/drivers/input/rmi4/Makefile b/drivers/input/rmi4/Makefile
index 95c00a7..0bafc85 100644
--- a/drivers/input/rmi4/Makefile
+++ b/drivers/input/rmi4/Makefile
@@ -7,6 +7,7 @@ rmi_core-$(CONFIG_RMI4_2D_SENSOR) += rmi_2d_sensor.o
 rmi_core-$(CONFIG_RMI4_F11) += rmi_f11.o
 rmi_core-$(CONFIG_RMI4_F12) += rmi_f12.o
 rmi_core-$(CONFIG_RMI4_F30) += rmi_f30.o
+rmi_core-$(CONFIG_RMI4_F54) += rmi_f54.o
 
 # Transports
 obj-$(CONFIG_RMI4_I2C) += rmi_i2c.o
diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c
index b368b05..3aedc65 100644
--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -315,6 +315,9 @@ static struct rmi_function_handler *fn_handlers[] = {
 #ifdef CONFIG_RMI4_F30
&rmi_f30_handler,
 #endif
+#ifdef CONFIG_RMI4_F54
+   &rmi_f54_handler,
+#endif
 };
 
 static void __rmi_unregister_function_handlers(int start_idx)
diff --git a/drivers/input/rmi4/rmi_driver.h b/drivers/input/rmi4/rmi_driver.h
index 6e140fa..8dfbebe 100644
--- a/drivers/input/rmi4/rmi_driver.h
+++ b/drivers/input/rmi4/rmi_driver.h
@@ -102,4 +102,5 @@ extern struct rmi_function_handler rmi_f01_handler;
 extern struct rmi_function_handler rmi_f11_handler;
 extern struct rmi_function_handler rmi_f12_handler;
 extern struct rmi_function_handler rmi_f30_handler;
+extern struct rmi_function_handler rmi_f54_handler;
 #endif
diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c
new file mode 100644
index 000..bf0ada8
--- /dev/null
+++ b/drivers/input/rmi4/rmi_f54.c
@@ -0,0 +1,755 @@
+/*
+ * Copyright (c) 2012-2015 Synaptics Incorporated
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "rmi_driver.h"
+
+#define F54_NAME   "rmi4_f54"
+
+/* F54 data offsets */
+#define F54_REPORT_DATA_OFFSET  3
+#define F54_FIFO_OFFSET 1
+#define F54_NUM_TX_OFFSET   1
+#define F54_NUM_RX_OFFSET   0
+
+/* F54 commands */
+#define F54_GET_REPORT  1
+#define F54_FORCE_CAL   2
+
+/* Fixed sizes of reports */
+#define F54_QUERY_LEN  27
+
+/* F54 capabilities */
+#define F54_CAP_BASELINE   (1 << 2)
+#define F54_CAP_IMAGE8 (1 << 3)
+#define F54_CAP_IMAGE16(1 << 6)
+
+/**
+ * enum rmi_f54_report_type - RMI4 F54 report types
+ *
+ * @F54_8BIT_IMAGE:Normalized 8-Bit Image Report. The capacitance variance
+ * from baseline for each pixel.
+ *
+ * @F54_16BIT_IMAGE:   Normalized 16-Bit Image Report. The capacitance variance
+ * from baseline for each pixel.
+ *
+ * @F54_RAW_16BIT_IMAGE:
+ * Raw 16-Bit Image Report. The raw capacitance for each
+ * pixel.
+ *
+ * @F54_TRUE_BASELINE: True Baseline Report. The baseline capacitance for each
+ * pixel.
+ *
+ * @F54_FULL_RAW_CAP:   Full Raw Capacitance Report. The raw capacitance with
+ * low reference set to its minimum value and high
+ * reference set to its maximum value.
+ *
+ * @F54_FULL_RAW_CAP_RX_OFFSET_REMOVED:
+ * Full Raw Capacitance with Receiver Offset Removed
+ * Report. Set Low reference to its minimum value and high
+ * references to its maximum value, then report the raw
+ * capacitance for each pixel.
+ */
+enum rmi_f54_report_type {
+   F54_REPORT_NONE = 0,
+   F54_8BIT_IMAGE = 1,
+

[PATCH v7 08/11] Input: atmel_mxt_ts - add diagnostic data support for mXT1386

2016-07-08 Thread Nick Dyer
The mXT1386 family of chips have a different architecture which splits
the diagnostic data into 3 columns.

Signed-off-by: Nick Dyer 
---
 drivers/input/touchscreen/atmel_mxt_ts.c |   31 +++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index c35fca0..7c4d937 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -137,6 +137,10 @@ struct t9_range {
 #define MXT_DIAGNOSTIC_DELTAS  0x10
 #define MXT_DIAGNOSTIC_SIZE128
 
+#define MXT_FAMILY_1386160
+#define MXT1386_COLUMNS3
+#define MXT1386_PAGES_PER_COLUMN   8
+
 struct t37_debug {
 #ifdef CONFIG_TOUCHSCREEN_ATMEL_MXT_T37
u8 mode;
@@ -2140,13 +2144,27 @@ recheck:
 static u16 mxt_get_debug_value(struct mxt_data *data, unsigned int x,
   unsigned int y)
 {
+   struct mxt_info *info = &data->info;
struct mxt_dbg *dbg = &data->dbg;
unsigned int ofs, page;
+   unsigned int col = 0;
+   unsigned int col_width;
+
+   if (info->family_id == MXT_FAMILY_1386) {
+   col_width = info->matrix_ysize / MXT1386_COLUMNS;
+   col = y / col_width;
+   y = y % col_width;
+   } else {
+   col_width = info->matrix_ysize;
+   }
 
-   ofs = (y + (x * data->info.matrix_ysize)) * sizeof(u16);
+   ofs = (y + (x * col_width)) * sizeof(u16);
page = ofs / MXT_DIAGNOSTIC_SIZE;
ofs %= MXT_DIAGNOSTIC_SIZE;
 
+   if (info->family_id == MXT_FAMILY_1386)
+   page += col * MXT1386_PAGES_PER_COLUMN;
+
return get_unaligned_le16(&dbg->t37_buf[page].data[ofs]);
 }
 
@@ -2416,6 +2434,7 @@ static const struct video_device mxt_video_device = {
 
 static void mxt_debug_init(struct mxt_data *data)
 {
+   struct mxt_info *info = &data->info;
struct mxt_dbg *dbg = &data->dbg;
struct mxt_object *object;
int error;
@@ -2439,8 +2458,14 @@ static void mxt_debug_init(struct mxt_data *data)
 
/* Calculate size of data and allocate buffer */
dbg->t37_nodes = data->xsize * data->ysize;
-   dbg->t37_pages = DIV_ROUND_UP(data->xsize * data->info.matrix_ysize *
- sizeof(u16), sizeof(dbg->t37_buf->data));
+
+   if (info->family_id == MXT_FAMILY_1386)
+   dbg->t37_pages = MXT1386_COLUMNS * MXT1386_PAGES_PER_COLUMN;
+   else
+   dbg->t37_pages = DIV_ROUND_UP(data->xsize *
+ data->info.matrix_ysize *
+ sizeof(u16),
+ sizeof(dbg->t37_buf->data));
 
dbg->t37_buf = devm_kmalloc_array(&data->client->dev, dbg->t37_pages,
  sizeof(struct t37_debug), GFP_KERNEL);
-- 
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 0/9] Add MT8173 Video Decoder Driver

2016-07-08 Thread Hans Verkuil
On 07/07/2016 12:16 PM, tiffany lin wrote:
> Hi Hans,
> 
> 
> On Wed, 2016-07-06 at 15:19 +0200, Hans Verkuil wrote:
>> Hi Tiffany,
>>
>> I plan to review this patch series on Friday, but one obvious question is
>> what the reason for these failures is:
>>
>>> 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_QUERYCTRL/MENU: OK
>>> fail: 
>>> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-controls.cpp(357): 
>>> g_ctrl returned an error (11)
>>> test VIDIOC_G/S_CTRL: FAIL
>>> fail: 
>>> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-controls.cpp(579): 
>>> g_ext_ctrls returned an error (11)
>>> test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
> These fails are because VIDIOC_G_CTRL and VIDIOC_G_EXT_CTRLS return
> V4L2_CID_MIN_BUFFERS_FOR_CAPTURE only when dirver in MTK_STATE_HEADER
> state, or it will return EAGAIN.
> This could help user space get correct value, not default value that may
> changed base on media content.

OK, I really don't like this. I also looked what the s5p-mfc-dec driver does 
(the only other
driver currently implementing this), and that returns -EINVAL.

My proposal would be to change this. If this information isn't known yet, why 
not
just return 0 as the value? The doc would have to be updated and (preferably) 
also
the s5p-mfc-dec driver. I've added Samsung devs to the Cc list, let me know 
what you
think.

> 
>>> fail: 
>>> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-controls.cpp(721): 
>>> subscribe event for control 'User Controls' failed
>>> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> Driver do not support subscribe event for control 'User Controls' for
> now.
> Do we need to support this?

I don't see why this would fail. It's OK to subscribe to such controls, although
you'll never get an event.

>>> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>> Standard Controls: 2 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)
>>> fail: 
>>> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-formats.cpp(405): 
>>> expected EINVAL, but got 11 when getting format for buftype 9
>>> test VIDIOC_G_FMT: FAIL
> This is because vidioc_vdec_g_fmt only succeed when context is in
> MTK_STATE_HEADER state, or user space cannot get correct format data
> using this function.

Comparing this to s5p-mfc-dec I see that -EINVAL is returned in that case.

I am not opposed to using EAGAIN in s5p-mfc-dec as well. Marek, Kamil, what is
your opinion?

> 
>>> test VIDIOC_TRY_FMT: OK (Not Supported)
>>> test VIDIOC_S_FMT: OK (Not Supported)
>>> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>
>>> Codec ioctls:
>>> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>> test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>
>>> Buffer ioctls:
>>> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>> fail: 
>>> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-buffers.cpp(500): 
>>> q.has_expbuf(node)
> Our OUTPUT and CAPTURE queue support both VB2_DMABUF and VB2_MMAP, user
> space can select which to use in runtime.
> So our driver default support v4l2_m2m_ioctl_expbuf functionality.
> In v4l2-compliance test, it will check v4l2_m2m_ioctl_expbuf only valid
> when node->valid_memorytype is V4L2_MEMORY_MMAP.
> So when go through node->valid_memorytype is V4L2_MEMORY_DMABUF, it
> fail.

valid_memorytype should have both MMAP and DMABUF flags.

But v4l-utils-1.6.0 is way too old to be certain it isn't some v4l2-compliance 
bug
that has since been fixed.

Regards,

Hans

> 
> 
> best regards,
> Tiffany
> 
> 
> 
>>> test VIDIOC_EXPBUF: FAIL
>>>
>>>
>>> Total: 38, Succeeded: 33, Failed: 5, Warnings: 0
>>
>> If it is due to a bug in v4l2-compliance, then let me know and I'll fix it. 
>> If not,
>> then it should be fixed in the driver.
>>
>> Frankly, it was the presence of these failures that made me think this patch 
>> series
>> wasn't final. Before a v4l2 driver can be accepted in the kernel, 
>> v4l2-compliance must pass.
>>
>> 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.o

[PATCH] media: usbtv: prevent access to free'd resources

2016-07-08 Thread Matthew Leach
When disconnecting the usbtv device, the sound card is unregistered
from ALSA and the snd member of the usbtv struct is set to NULL.  If
the usbtv snd_trigger work is running, this can cause a race condition
where the kernel will attempt to access free'd resources, shown in
[1].

This patch fixes the disconnection code by cancelling any snd_trigger
work before unregistering the sound card from ALSA and checking that
the snd member still exists in the work function.

[1]:
 usb 3-1.2: USB disconnect, device number 6
 BUG: unable to handle kernel NULL pointer dereference at 0008
 IP: [] process_one_work+0x30/0x480
 PGD 405bbf067 PUD 405bbe067 PMD 0
 Call Trace:
  [] worker_thread+0x48/0x4e0
  [] ? process_one_work+0x480/0x480
  [] ? process_one_work+0x480/0x480
  [] kthread+0xd8/0xf0
  [] ret_from_fork+0x22/0x40
  [] ? kthread_worker_fn+0x170/0x170
 ---[ end trace 0f3dac5c1a38e610 ]---

Signed-off-by: Matthew Leach 
Tested-by: Peter Sutton 
Cc: sta...@vger.kernel.org
---
 drivers/media/usb/usbtv/usbtv-audio.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/usb/usbtv/usbtv-audio.c 
b/drivers/media/usb/usbtv/usbtv-audio.c
index 78c12d2..5dab024 100644
--- a/drivers/media/usb/usbtv/usbtv-audio.c
+++ b/drivers/media/usb/usbtv/usbtv-audio.c
@@ -278,6 +278,9 @@ static void snd_usbtv_trigger(struct work_struct *work)
 {
struct usbtv *chip = container_of(work, struct usbtv, snd_trigger);
 
+   if (!chip->snd)
+   return;
+
if (atomic_read(&chip->snd_stream))
usbtv_audio_start(chip);
else
@@ -378,6 +381,8 @@ err:
 
 void usbtv_audio_free(struct usbtv *usbtv)
 {
+   cancel_work_sync(&usbtv->snd_trigger);
+
if (usbtv->snd && usbtv->udev) {
snd_card_free(usbtv->snd);
usbtv->snd = NULL;
-- 
2.9.0

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


[PATCH 05/54] doc-rst: boilerplate HTML theme customization

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

Implements the minimal boilerplate for Sphinx HTML theme customization.

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/conf.py   | 9 -
 Documentation/sphinx-static/theme_overrides.css | 9 +
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/sphinx-static/theme_overrides.css

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 792b6338ef19..f35748b4bc26 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -176,7 +176,14 @@ except ImportError:
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
+
+html_static_path = ['sphinx-static']
+
+html_context = {
+'css_files': [
+'_static/theme_overrides.css',
+],
+}
 
 # Add any extra paths that contain custom files (such as robots.txt or
 # .htaccess) here, relative to this directory. These files are copied
diff --git a/Documentation/sphinx-static/theme_overrides.css 
b/Documentation/sphinx-static/theme_overrides.css
new file mode 100644
index ..4d670dbf7ffa
--- /dev/null
+++ b/Documentation/sphinx-static/theme_overrides.css
@@ -0,0 +1,9 @@
+/* -*- coding: utf-8; mode: css -*-
+ *
+ * Sphinx HTML theme customization
+ *
+ */
+
+@media screen {
+
+}
-- 
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/54] doc-rst: customize RTD theme, table & full width

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

The default table layout of the RTD theme does not fit for vast tables,
like the ones we have in the linux_tv project. This has been discussed
on the ML [1].

The RTD theme is a two column layout, with a navigation column on the
left and a content column on the right:

content column

 RTD theme's default is 800px as max width for the content, but we have
 tables with tons of columns, which need the full width of the
 view-port (BTW: *full width* is what DocBook's HTML is).

table

   - sequences of whitespace should collapse into a single whitespace.
   - make the overflow auto (scrollbar if needed)
   - align caption "left" ("center" is unsuitable on vast tables)

[1] http://article.gmane.org/gmane.linux.kernel/2216509

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx-static/theme_overrides.css | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/Documentation/sphinx-static/theme_overrides.css 
b/Documentation/sphinx-static/theme_overrides.css
index 4d670dbf7ffa..ea06799214fd 100644
--- a/Documentation/sphinx-static/theme_overrides.css
+++ b/Documentation/sphinx-static/theme_overrides.css
@@ -1,9 +1,28 @@
 /* -*- coding: utf-8; mode: css -*-
  *
- * Sphinx HTML theme customization
+ * Sphinx HTML theme customization: read the doc
  *
  */
 
 @media screen {
 
+/* content column
+ *
+ * RTD theme's default is 800px as max width for the content, but we have
+ * tables with tons of columns, which need the full width of the view-port.
+ */
+
+.wy-nav-content{max-width: none; }
+
+/* table:
+ *
+ *   - Sequences of whitespace should collapse into a single whitespace.
+ *   - make the overflow auto (scrollbar if needed)
+ *   - align caption "left" ("center" is unsuitable on vast tables)
+ */
+
+.wy-table-responsive table td { white-space: normal; }
+.wy-table-responsive { overflow: auto; }
+.rst-content table.docutils caption { text-align: left; font-size: 100%; }
+
 }
-- 
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 00/54] Second series of ReST convert patches for media

2016-07-08 Thread Mauro Carvalho Chehab
That's the second series of patches related to DocBook to ReST
conversion. With this patch series, we're ready to merge it
upstream.

There are still one thing to do: there are some new updates at
the DocBook pages on two topic branches (cec and vsp1). Those
changes should also be converted, in order to be able to remove
the DocBook pages.

Visually, I'm more happy with the new pages, as the produced
layout is more fancy, IMHO, using a modern visual.

Also, editing ReST pages is a way simpler than editing the
DocBooks. Also, reviewing documentation patches should be
simpler, with is a good thing.

On the bad side, Sphinx doesn't support auto-numberating
examples, figures or tables. We'll need some extension for
that. For now, the only impact is on the examples, that were
manually numerated. So, patches adding new examples will need
to check and manually renumerate other examples.

I hope we'll have soon some Sphinx extension to support
auto-numbering.

I'll soon change linux.org documentation page to show the
Sphinx-generated documenation. I intend to keep the old
one for a while, for people to be able to compare both.
I'll post an email once I do this at both linux-media and
linux-doc mailing lists.

I did a review on all pages, but, as I'm not a Vulcan,
I'm pretty sure I missed some things. So, feel free to
review the final document and send me patches with any
needed fixes or improvements.

Finally, you'll see some warnings produced by generating
the documentation.

There are actually two types of warnings there:

1) At least here where I sit, I'm getting those warnings:

Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst:18: WARNING: Error 
when parsing function declaration:
If no return type {
Invalid definition: Expected identifier in nested name, got keyword: int [error 
at 3]
  int ioctl( int fd, int request, enum fe_sec_mini_cmd *tone )
  ---^
} else if return type {
Invalid definition: Expected identifier in nested name, got keyword: enum 
[error at 36]
  int ioctl( int fd, int request, enum fe_sec_mini_cmd *tone )
  ^
}

It seems that the cpp:function:: parser on Sphinx doesn't
know how to handle enums. I'll try to woraround this issue later.

2) Undefined label warnings.

This is actually some gaps that I detected when comparing
what's documented with what's there at videodev2.h:
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
v4l2-ycbcr-encoding-fixme (if the link has no caption the label must precede a 
section header)
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
v4l2-ycbcr-encoding-fixme (if the link has no caption the label must precede a 
section header)
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
v4l2-ycbcr-encoding-fixme (if the link has no caption the label must precede a 
section header)
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
buffer-flags-fixme (if the link has no caption the label must precede a section 
header)
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
v4l2-dv-fixme (if the link has no caption the label must precede a section 
header)
Documentation/output/videodev2.h.rst:6: WARNING: undefined label: 
v4l2-dv-fixme (if the link has no caption the label must precede a section 
header)


Those are things that we need to fix by either documenting
some things or by removing/deprecating some old/unused stuff.

Markus Heiser (6):
  doc-rst: boilerplate HTML theme customization
  doc-rst: customize RTD theme, table & full width
  doc-rst: customize RTD theme, captions & inline literal
  doc-rst: auto-generate: fixed include "output/*.h.rst" content
  doc-rst: add kernel-include directive
  doc-rst: linux_tv/Makefile: Honor quiet make O=dir

Mauro Carvalho Chehab (48):
  doc-rst: linux_tv: split DVB function call documentation
  doc-rst: linux_tv: reformat all syscall pages
  doc-rst: linux_tv: dvb: use lowercase for filenames
  doc-rst: linux_tv: dvb: put return value at the end
  doc-rst: remove Documentation/linux_tv/conf.py file
  doc-rst: linux_tv: don't use uppercases for syscall sections
  doc-rst: linux_tv: use :cpp:function:: on all syscalls
  doc-rst: dmabuf: Fix the cross-reference
  doc-rst: dev-overlay: fix the last warning
  doc-rst: dvbapi: Fix conversion issues
  doc-rst: fix intro_files/dvbstb.png image
  doc-rst: dvb/intro: Better show the needed include blocks
  doc-rst: intro: remove obsolete headers
  doc-rst: media-controller: fix conversion issues
  doc-rst: media-controller: missing credits
  doc-rst: media-controller.rst: add missing copy symbol
  doc-rst: media-controller-model: fix a typo
  doc-rst: mediactl: fix some wrong cross references
  doc-rst: media-ioc-g-topology: Fix tables
  doc-rst: media-ioc-enum-entities: better format the table
  doc-rst: gen-errors: Improve table layout
  doc-rst: remote_controllers: fix conversion issues
  doc-rst: Rename the ti

[PATCH 03/54] doc-rst: linux_tv: dvb: use lowercase for filenames

2016-07-08 Thread Mauro Carvalho Chehab
There are some ioctls in upper case. This is not the standard.
Put them on lowercase, to match what's done with other ioctls.

Signed-off-by: Mauro Carvalho Chehab 
---
 ...LEGACY_CMD.rst => fe-dishnetwork-send-legacy-cmd.rst} |  0
 .../media/dvb/{FE_GET_EVENT.rst => fe-get-event.rst} |  0
 .../dvb/{FE_GET_FRONTEND.rst => fe-get-frontend.rst} |  0
 .../media/dvb/{FE_READ_BER.rst => fe-read-ber.rst}   |  0
 ...D_SIGNAL_STRENGTH.rst => fe-read-signal-strength.rst} |  0
 .../media/dvb/{FE_READ_SNR.rst => fe-read-snr.rst}   |  0
 ...RRECTED_BLOCKS.rst => fe-read-uncorrected-blocks.rst} |  0
 .../dvb/{FE_SET_FRONTEND.rst => fe-set-frontend.rst} |  0
 Documentation/linux_tv/media/dvb/frontend_legacy_api.rst | 16 
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename Documentation/linux_tv/media/dvb/{FE_DISHNETWORK_SEND_LEGACY_CMD.rst => 
fe-dishnetwork-send-legacy-cmd.rst} (100%)
 rename Documentation/linux_tv/media/dvb/{FE_GET_EVENT.rst => fe-get-event.rst} 
(100%)
 rename Documentation/linux_tv/media/dvb/{FE_GET_FRONTEND.rst => 
fe-get-frontend.rst} (100%)
 rename Documentation/linux_tv/media/dvb/{FE_READ_BER.rst => fe-read-ber.rst} 
(100%)
 rename Documentation/linux_tv/media/dvb/{FE_READ_SIGNAL_STRENGTH.rst => 
fe-read-signal-strength.rst} (100%)
 rename Documentation/linux_tv/media/dvb/{FE_READ_SNR.rst => fe-read-snr.rst} 
(100%)
 rename Documentation/linux_tv/media/dvb/{FE_READ_UNCORRECTED_BLOCKS.rst => 
fe-read-uncorrected-blocks.rst} (100%)
 rename Documentation/linux_tv/media/dvb/{FE_SET_FRONTEND.rst => 
fe-set-frontend.rst} (100%)

diff --git 
a/Documentation/linux_tv/media/dvb/FE_DISHNETWORK_SEND_LEGACY_CMD.rst 
b/Documentation/linux_tv/media/dvb/fe-dishnetwork-send-legacy-cmd.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_DISHNETWORK_SEND_LEGACY_CMD.rst
rename to Documentation/linux_tv/media/dvb/fe-dishnetwork-send-legacy-cmd.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_GET_EVENT.rst 
b/Documentation/linux_tv/media/dvb/fe-get-event.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_GET_EVENT.rst
rename to Documentation/linux_tv/media/dvb/fe-get-event.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_GET_FRONTEND.rst 
b/Documentation/linux_tv/media/dvb/fe-get-frontend.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_GET_FRONTEND.rst
rename to Documentation/linux_tv/media/dvb/fe-get-frontend.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_READ_BER.rst 
b/Documentation/linux_tv/media/dvb/fe-read-ber.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_READ_BER.rst
rename to Documentation/linux_tv/media/dvb/fe-read-ber.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_READ_SIGNAL_STRENGTH.rst 
b/Documentation/linux_tv/media/dvb/fe-read-signal-strength.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_READ_SIGNAL_STRENGTH.rst
rename to Documentation/linux_tv/media/dvb/fe-read-signal-strength.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_READ_SNR.rst 
b/Documentation/linux_tv/media/dvb/fe-read-snr.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_READ_SNR.rst
rename to Documentation/linux_tv/media/dvb/fe-read-snr.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_READ_UNCORRECTED_BLOCKS.rst 
b/Documentation/linux_tv/media/dvb/fe-read-uncorrected-blocks.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_READ_UNCORRECTED_BLOCKS.rst
rename to Documentation/linux_tv/media/dvb/fe-read-uncorrected-blocks.rst
diff --git a/Documentation/linux_tv/media/dvb/FE_SET_FRONTEND.rst 
b/Documentation/linux_tv/media/dvb/fe-set-frontend.rst
similarity index 100%
rename from Documentation/linux_tv/media/dvb/FE_SET_FRONTEND.rst
rename to Documentation/linux_tv/media/dvb/fe-set-frontend.rst
diff --git a/Documentation/linux_tv/media/dvb/frontend_legacy_api.rst 
b/Documentation/linux_tv/media/dvb/frontend_legacy_api.rst
index fb17766d887e..759833d3eaa4 100644
--- a/Documentation/linux_tv/media/dvb/frontend_legacy_api.rst
+++ b/Documentation/linux_tv/media/dvb/frontend_legacy_api.rst
@@ -28,11 +28,11 @@ recommended
 .. toctree::
 :maxdepth: 1
 
-FE_READ_BER
-FE_READ_SNR
-FE_READ_SIGNAL_STRENGTH
-FE_READ_UNCORRECTED_BLOCKS
-FE_SET_FRONTEND
-FE_GET_FRONTEND
-FE_GET_EVENT
-FE_DISHNETWORK_SEND_LEGACY_CMD
+fe-read-ber
+fe-read-snr
+fe-read-signal-strength
+fe-read-uncorrected-blocks
+fe-set-frontend
+fe-get-frontend
+fe-get-event
+fe-dishnetwork-send-legacy-cmd
-- 
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/54] doc-rst: customize RTD theme, captions & inline literal

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

The layout of (table) captions in the RTD theme is a bit ugly and the
bordered, red colored of inline literals is a bit to gaudy. The
requirements has been discussed in the ML [1].

captions:

  - captions should have 100% (not 85%) font size
  - hide the permalink symbol as long as link is not hovered

inline literal:

  - drop the borderbox and red color

[1] 
http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/101099

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx-static/theme_overrides.css | 25 +
 1 file changed, 25 insertions(+)

diff --git a/Documentation/sphinx-static/theme_overrides.css 
b/Documentation/sphinx-static/theme_overrides.css
index ea06799214fd..c97d8428302d 100644
--- a/Documentation/sphinx-static/theme_overrides.css
+++ b/Documentation/sphinx-static/theme_overrides.css
@@ -25,4 +25,29 @@
 .wy-table-responsive { overflow: auto; }
 .rst-content table.docutils caption { text-align: left; font-size: 100%; }
 
+/* captions:
+ *
+ *   - captions should have 100% (not 85%) font size
+ *   - hide the permalink symbol as long as link is not hovered
+ */
+
+caption, .wy-table caption, .rst-content table.field-list caption {
+font-size: 100%;
+}
+caption a.headerlink { opacity: 0; }
+caption a.headerlink:hover { opacity: 1; }
+
+/* inline literal: drop the borderbox and red color */
+
+code, .rst-content tt, .rst-content code {
+color: inherit;
+border: none;
+background: inherit;
+font-size: 85%;
+}
+
+.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
+color: inherit;
+}
+
 }
-- 
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 04/54] doc-rst: linux_tv: dvb: put return value at the end

2016-07-08 Thread Mauro Carvalho Chehab
On some syscall descriptions, the tables are described after
the return value. Do that inside descriptions.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../linux_tv/media/dvb/audio-set-attributes.rst   |  2 --
 Documentation/linux_tv/media/dvb/audio-set-ext-id.rst |  2 --
 .../linux_tv/media/dvb/audio-set-karaoke.rst  |  2 --
 .../linux_tv/media/dvb/fe-diseqc-recv-slave-reply.rst | 19 ++-
 .../linux_tv/media/dvb/fe-diseqc-send-burst.rst   | 17 +++--
 Documentation/linux_tv/media/dvb/fe-get-info.rst  | 19 ++-
 Documentation/linux_tv/media/dvb/fe-read-ber.rst  |  2 --
 Documentation/linux_tv/media/dvb/fe-read-status.rst   | 15 +++
 Documentation/linux_tv/media/dvb/fe-set-frontend.rst  |  2 --
 Documentation/linux_tv/media/dvb/fe-set-tone.rst  | 17 +++--
 Documentation/linux_tv/media/dvb/video-get-event.rst  |  2 --
 11 files changed, 41 insertions(+), 58 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/audio-set-attributes.rst 
b/Documentation/linux_tv/media/dvb/audio-set-attributes.rst
index ea08cea6aa78..820c8b2e2298 100644
--- a/Documentation/linux_tv/media/dvb/audio-set-attributes.rst
+++ b/Documentation/linux_tv/media/dvb/audio-set-attributes.rst
@@ -58,8 +58,6 @@ On success 0 is returned, on error -1 and the ``errno`` 
variable is set
 appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes ` chapter.
 
-
-
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/linux_tv/media/dvb/audio-set-ext-id.rst 
b/Documentation/linux_tv/media/dvb/audio-set-ext-id.rst
index 456b05267f29..38a255289e8c 100644
--- a/Documentation/linux_tv/media/dvb/audio-set-ext-id.rst
+++ b/Documentation/linux_tv/media/dvb/audio-set-ext-id.rst
@@ -58,8 +58,6 @@ On success 0 is returned, on error -1 and the ``errno`` 
variable is set
 appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes ` chapter.
 
-
-
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/linux_tv/media/dvb/audio-set-karaoke.rst 
b/Documentation/linux_tv/media/dvb/audio-set-karaoke.rst
index 07453ceae40f..28138222582a 100644
--- a/Documentation/linux_tv/media/dvb/audio-set-karaoke.rst
+++ b/Documentation/linux_tv/media/dvb/audio-set-karaoke.rst
@@ -57,8 +57,6 @@ On success 0 is returned, on error -1 and the ``errno`` 
variable is set
 appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes ` chapter.
 
-
-
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/linux_tv/media/dvb/fe-diseqc-recv-slave-reply.rst 
b/Documentation/linux_tv/media/dvb/fe-diseqc-recv-slave-reply.rst
index 60241c6e68a8..7ddbce6bcd7e 100644
--- a/Documentation/linux_tv/media/dvb/fe-diseqc-recv-slave-reply.rst
+++ b/Documentation/linux_tv/media/dvb/fe-diseqc-recv-slave-reply.rst
@@ -36,17 +36,11 @@ DESCRIPTION
 
 Receives reply from a DiSEqC 2.0 command.
 
-
-RETURN VALUE
-
-
-On success 0 is returned, on error -1 and the ``errno`` variable is set
-appropriately. The generic error codes are described at the
-:ref:`Generic Error Codes ` chapter.
-
-
 .. _dvb-diseqc-slave-reply:
 
+struct dvb_diseqc_slave_reply
+-
+
 .. flat-table:: struct dvb_diseqc_slave_reply
 :header-rows:  0
 :stub-columns: 0
@@ -78,3 +72,10 @@ appropriately. The generic error codes are described at the
 
-  Return from ioctl after timeout ms with errorcode when no message
  was received
+
+RETURN VALUE
+
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes ` chapter.
diff --git a/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst 
b/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
index dea9cdff0469..806ee5a9df68 100644
--- a/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
+++ b/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
@@ -40,21 +40,11 @@ read/write permissions.
 It provides support for what's specified at
 `Digital Satellite Equipment Control (DiSEqC) - Simple "ToneBurst" Detection 
Circuit specification. 
`__
 
-
-RETURN VALUE
-
-
-On success 0 is returned, on error -1 and the ``errno`` variable is set
-appropriately. The generic error codes are described at the
-:ref:`Generic Error Codes ` chapter.
-
-
 .. _fe-sec-mini-cmd-t:
 
 enum fe_sec_mini_cmd
 
 
-
 .. _fe-sec-mini-cmd:
 
 .. flat-table:: enum fe_sec_mini_cmd
@@ -83,3 +73,10 @@ enum fe_sec_mini_cmd
  ``SEC_MINI_B``
 
-  Sends a mini-DiSEqC 22kHz '1' Data Burst to select satellite-B
+
+RETURN VALUE
+
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set

[PATCH 48/54] doc-rst: videodev2.h: don't ignore V4L2_STD macros

2016-07-08 Thread Mauro Carvalho Chehab
The content of those macros are all declared at the v4l2-std-id
table. So, point to it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/videodev2.h.rst.exceptions | 94 ---
 1 file changed, 48 insertions(+), 46 deletions(-)

diff --git a/Documentation/linux_tv/videodev2.h.rst.exceptions 
b/Documentation/linux_tv/videodev2.h.rst.exceptions
index 2c49287b6d59..8cad3ba6ba99 100644
--- a/Documentation/linux_tv/videodev2.h.rst.exceptions
+++ b/Documentation/linux_tv/videodev2.h.rst.exceptions
@@ -196,52 +196,6 @@ ignore define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA
 ignore define V4L2_FBUF_FLAG_SRC_CHROMAKEY
 ignore define V4L2_MODE_HIGHQUALITY
 ignore define V4L2_CAP_TIMEPERFRAME
-ignore define V4L2_STD_PAL_B
-ignore define V4L2_STD_PAL_B1
-ignore define V4L2_STD_PAL_G
-ignore define V4L2_STD_PAL_H
-ignore define V4L2_STD_PAL_I
-ignore define V4L2_STD_PAL_D
-ignore define V4L2_STD_PAL_D1
-ignore define V4L2_STD_PAL_K
-ignore define V4L2_STD_PAL_M
-ignore define V4L2_STD_PAL_N
-ignore define V4L2_STD_PAL_Nc
-ignore define V4L2_STD_PAL_60
-ignore define V4L2_STD_NTSC_M
-ignore define V4L2_STD_NTSC_M_JP
-ignore define V4L2_STD_NTSC_443
-ignore define V4L2_STD_NTSC_M_KR
-ignore define V4L2_STD_SECAM_B
-ignore define V4L2_STD_SECAM_D
-ignore define V4L2_STD_SECAM_G
-ignore define V4L2_STD_SECAM_H
-ignore define V4L2_STD_SECAM_K
-ignore define V4L2_STD_SECAM_K1
-ignore define V4L2_STD_SECAM_L
-ignore define V4L2_STD_SECAM_LC
-ignore define V4L2_STD_ATSC_8_VSB
-ignore define V4L2_STD_ATSC_16_VSB
-ignore define V4L2_STD_NTSC
-ignore define V4L2_STD_SECAM_DK
-ignore define V4L2_STD_SECAM
-ignore define V4L2_STD_PAL_BG
-ignore define V4L2_STD_PAL_DK
-ignore define V4L2_STD_PAL
-ignore define V4L2_STD_B
-ignore define V4L2_STD_G
-ignore define V4L2_STD_H
-ignore define V4L2_STD_L
-ignore define V4L2_STD_GH
-ignore define V4L2_STD_DK
-ignore define V4L2_STD_BG
-ignore define V4L2_STD_MN
-ignore define V4L2_STD_MTS
-ignore define V4L2_STD_525_60
-ignore define V4L2_STD_625_50
-ignore define V4L2_STD_ATSC
-ignore define V4L2_STD_UNKNOWN
-ignore define V4L2_STD_ALL
 ignore define V4L2_DV_PROGRESSIVE
 ignore define V4L2_DV_INTERLACED
 ignore define V4L2_DV_VSYNC_POS_POL
@@ -414,6 +368,54 @@ ignore define V4L2_CHIP_FL_READABLE
 ignore define V4L2_CHIP_FL_WRITABLE
 ignore define BASE_VIDIOC_PRIVATE
 
+# The V4L2_STD_foo are all defined at v4l2_std_id table
+replace define V4L2_STD_PAL_B v4l2-std-id
+replace define V4L2_STD_PAL_B1 v4l2-std-id
+replace define V4L2_STD_PAL_G v4l2-std-id
+replace define V4L2_STD_PAL_H v4l2-std-id
+replace define V4L2_STD_PAL_I v4l2-std-id
+replace define V4L2_STD_PAL_D v4l2-std-id
+replace define V4L2_STD_PAL_D1 v4l2-std-id
+replace define V4L2_STD_PAL_K v4l2-std-id
+replace define V4L2_STD_PAL_M v4l2-std-id
+replace define V4L2_STD_PAL_N v4l2-std-id
+replace define V4L2_STD_PAL_Nc v4l2-std-id
+replace define V4L2_STD_PAL_60 v4l2-std-id
+replace define V4L2_STD_NTSC_M v4l2-std-id
+replace define V4L2_STD_NTSC_M_JP v4l2-std-id
+replace define V4L2_STD_NTSC_443 v4l2-std-id
+replace define V4L2_STD_NTSC_M_KR v4l2-std-id
+replace define V4L2_STD_SECAM_B v4l2-std-id
+replace define V4L2_STD_SECAM_D v4l2-std-id
+replace define V4L2_STD_SECAM_G v4l2-std-id
+replace define V4L2_STD_SECAM_H v4l2-std-id
+replace define V4L2_STD_SECAM_K v4l2-std-id
+replace define V4L2_STD_SECAM_K1 v4l2-std-id
+replace define V4L2_STD_SECAM_L v4l2-std-id
+replace define V4L2_STD_SECAM_LC v4l2-std-id
+replace define V4L2_STD_ATSC_8_VSB v4l2-std-id
+replace define V4L2_STD_ATSC_16_VSB v4l2-std-id
+replace define V4L2_STD_NTSC v4l2-std-id
+replace define V4L2_STD_SECAM_DK v4l2-std-id
+replace define V4L2_STD_SECAM v4l2-std-id
+replace define V4L2_STD_PAL_BG v4l2-std-id
+replace define V4L2_STD_PAL_DK v4l2-std-id
+replace define V4L2_STD_PAL v4l2-std-id
+replace define V4L2_STD_B v4l2-std-id
+replace define V4L2_STD_G v4l2-std-id
+replace define V4L2_STD_H v4l2-std-id
+replace define V4L2_STD_L v4l2-std-id
+replace define V4L2_STD_GH v4l2-std-id
+replace define V4L2_STD_DK v4l2-std-id
+replace define V4L2_STD_BG v4l2-std-id
+replace define V4L2_STD_MN v4l2-std-id
+replace define V4L2_STD_MTS v4l2-std-id
+replace define V4L2_STD_525_60 v4l2-std-id
+replace define V4L2_STD_625_50 v4l2-std-id
+replace define V4L2_STD_ATSC v4l2-std-id
+replace define V4L2_STD_UNKNOWN v4l2-std-id
+replace define V4L2_STD_ALL v4l2-std-id
+
 # Ignore reserved ioctl
 ignore ioctl VIDIOC_RESERVED
 
-- 
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 52/54] doc-rst: auto-generate: fixed include "output/*.h.rst" content

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

Include auto-generate reST header files. BTW fixed linux_tv/Makefile.

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile | 7 +--
 Documentation/linux_tv/media/dvb/audio_h.rst| 6 +-
 Documentation/linux_tv/media/dvb/ca_h.rst   | 6 +-
 Documentation/linux_tv/media/dvb/dmx_h.rst  | 6 +-
 Documentation/linux_tv/media/dvb/frontend_h.rst | 6 +-
 Documentation/linux_tv/media/dvb/net_h.rst  | 6 +-
 Documentation/linux_tv/media/dvb/video_h.rst| 6 +-
 Documentation/linux_tv/media/v4l/videodev.rst   | 6 +-
 8 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 639b994a50f6..688e37d7b232 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -9,7 +9,10 @@ FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst 
net.h.rst video.h.rst \
 
 TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
 
-htmldocs: ${TARGETS}
+htmldocs: $(BUILDDIR) ${TARGETS}
+
+$(BUILDDIR):
+   $(Q)mkdir -p $@
 
 # Rule to convert a .h file to inline RST documentation
 
@@ -40,7 +43,7 @@ $(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} 
$(SRC_DIR)/net.h.rst.exceptio
 $(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} 
$(SRC_DIR)/video.h.rst.exceptions
@$($(quiet)gen_rst)
 
-videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} 
$(SRC_DIR)/videodev2.h.rst.exceptions
+$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} 
$(SRC_DIR)/videodev2.h.rst.exceptions
@$($(quiet)gen_rst)
 
 cleandocs:
diff --git a/Documentation/linux_tv/media/dvb/audio_h.rst 
b/Documentation/linux_tv/media/dvb/audio_h.rst
index bdd9a709a125..d87be5e2b022 100644
--- a/Documentation/linux_tv/media/dvb/audio_h.rst
+++ b/Documentation/linux_tv/media/dvb/audio_h.rst
@@ -6,8 +6,4 @@
 DVB Audio Header File
 *
 
-
-.. toctree::
-:maxdepth: 1
-
-../../audio.h
+.. include:: ../../../output/audio.h.rst
diff --git a/Documentation/linux_tv/media/dvb/ca_h.rst 
b/Documentation/linux_tv/media/dvb/ca_h.rst
index a7d22154022b..407f840ae2ee 100644
--- a/Documentation/linux_tv/media/dvb/ca_h.rst
+++ b/Documentation/linux_tv/media/dvb/ca_h.rst
@@ -6,8 +6,4 @@
 DVB Conditional Access Header File
 **
 
-
-.. toctree::
-:maxdepth: 1
-
-../../ca.h
+.. include:: ../../../output/ca.h.rst
diff --git a/Documentation/linux_tv/media/dvb/dmx_h.rst 
b/Documentation/linux_tv/media/dvb/dmx_h.rst
index baf129dd078b..65ee8f095972 100644
--- a/Documentation/linux_tv/media/dvb/dmx_h.rst
+++ b/Documentation/linux_tv/media/dvb/dmx_h.rst
@@ -6,8 +6,4 @@
 DVB Demux Header File
 *
 
-
-.. toctree::
-:maxdepth: 1
-
-../../dmx.h
+.. include:: ../../../output/dmx.h.rst
diff --git a/Documentation/linux_tv/media/dvb/frontend_h.rst 
b/Documentation/linux_tv/media/dvb/frontend_h.rst
index 7101d6ddd916..97735b241f3c 100644
--- a/Documentation/linux_tv/media/dvb/frontend_h.rst
+++ b/Documentation/linux_tv/media/dvb/frontend_h.rst
@@ -6,8 +6,4 @@
 DVB Frontend Header File
 
 
-
-.. toctree::
-:maxdepth: 1
-
-../../frontend.h
+.. include:: ../../../output/frontend.h.rst
diff --git a/Documentation/linux_tv/media/dvb/net_h.rst 
b/Documentation/linux_tv/media/dvb/net_h.rst
index 09560db4e1c0..5a5a797882f2 100644
--- a/Documentation/linux_tv/media/dvb/net_h.rst
+++ b/Documentation/linux_tv/media/dvb/net_h.rst
@@ -6,8 +6,4 @@
 DVB Network Header File
 ***
 
-
-.. toctree::
-:maxdepth: 1
-
-../../net.h
+.. include:: ../../../output/net.h.rst
diff --git a/Documentation/linux_tv/media/dvb/video_h.rst 
b/Documentation/linux_tv/media/dvb/video_h.rst
index 45c12d295523..9d649a7e0f8b 100644
--- a/Documentation/linux_tv/media/dvb/video_h.rst
+++ b/Documentation/linux_tv/media/dvb/video_h.rst
@@ -6,8 +6,4 @@
 DVB Video Header File
 *
 
-
-.. toctree::
-:maxdepth: 1
-
-../../video.h
+.. include:: ../../../output/video.h.rst
diff --git a/Documentation/linux_tv/media/v4l/videodev.rst 
b/Documentation/linux_tv/media/v4l/videodev.rst
index 4826416b2ab4..82bac4a0b760 100644
--- a/Documentation/linux_tv/media/v4l/videodev.rst
+++ b/Documentation/linux_tv/media/v4l/videodev.rst
@@ -6,8 +6,4 @@
 Video For Linux Two Header File
 ***
 
-
-.. toctree::
-:maxdepth: 1
-
-../../videodev2.h
+.. include:: ../../../output/videodev2.h.rst
-- 
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 49/54] doc-rst: document enum symbols

2016-07-08 Thread Mauro Carvalho Chehab
After checking that all enum fields are documented at the
corresponding table on the rst file, let's point to the
table, instead of ignore the symbols.

A few symbols are not meant to be documented, as they're
deprecated stuff. keep ignoring them.

One enum field is not documented. Either it is obsolete
or a documentation gap. So, produce warnings for it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/videodev2.h.rst.exceptions | 206 --
 1 file changed, 116 insertions(+), 90 deletions(-)

diff --git a/Documentation/linux_tv/videodev2.h.rst.exceptions 
b/Documentation/linux_tv/videodev2.h.rst.exceptions
index 8cad3ba6ba99..6231549294c1 100644
--- a/Documentation/linux_tv/videodev2.h.rst.exceptions
+++ b/Documentation/linux_tv/videodev2.h.rst.exceptions
@@ -9,98 +9,124 @@ ignore define _UAPI__LINUX_VIDEODEV2_H
 # having something not documented at the uAPI.
 #
 
-# for now, ignore all enum symbols
+# Those symbols should not be used by uAPI - don't document them
 ignore symbol V4L2_BUF_TYPE_PRIVATE
-ignore symbol V4L2_BUF_TYPE_SDR_CAPTURE
-ignore symbol V4L2_BUF_TYPE_SDR_OUTPUT
-ignore symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
-ignore symbol V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
-ignore symbol V4L2_BUF_TYPE_VBI_CAPTURE
-ignore symbol V4L2_BUF_TYPE_VBI_OUTPUT
-ignore symbol V4L2_BUF_TYPE_VIDEO_CAPTURE
-ignore symbol V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
-ignore symbol V4L2_BUF_TYPE_VIDEO_OUTPUT
-ignore symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
-ignore symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
-ignore symbol V4L2_BUF_TYPE_VIDEO_OVERLAY
-ignore symbol V4L2_COLORSPACE_470_SYSTEM_BG
-ignore symbol V4L2_COLORSPACE_470_SYSTEM_M
-ignore symbol V4L2_COLORSPACE_ADOBERGB
-ignore symbol V4L2_COLORSPACE_BT2020
-ignore symbol V4L2_COLORSPACE_BT878
-ignore symbol V4L2_COLORSPACE_DCI_P3
-ignore symbol V4L2_COLORSPACE_DEFAULT
-ignore symbol V4L2_COLORSPACE_JPEG
-ignore symbol V4L2_COLORSPACE_RAW
-ignore symbol V4L2_COLORSPACE_REC709
-ignore symbol V4L2_COLORSPACE_SMPTE170M
-ignore symbol V4L2_COLORSPACE_SMPTE240M
-ignore symbol V4L2_COLORSPACE_SRGB
-ignore symbol V4L2_CTRL_COMPOUND_TYPES
-ignore symbol V4L2_CTRL_TYPE_BITMASK
-ignore symbol V4L2_CTRL_TYPE_BOOLEAN
-ignore symbol V4L2_CTRL_TYPE_BUTTON
-ignore symbol V4L2_CTRL_TYPE_CTRL_CLASS
-ignore symbol V4L2_CTRL_TYPE_INTEGER
-ignore symbol V4L2_CTRL_TYPE_INTEGER64
-ignore symbol V4L2_CTRL_TYPE_INTEGER_MENU
-ignore symbol V4L2_CTRL_TYPE_MENU
-ignore symbol V4L2_CTRL_TYPE_STRING
-ignore symbol V4L2_CTRL_TYPE_U16
-ignore symbol V4L2_CTRL_TYPE_U32
-ignore symbol V4L2_CTRL_TYPE_U8
-ignore symbol V4L2_FIELD_ALTERNATE
-ignore symbol V4L2_FIELD_ANY
-ignore symbol V4L2_FIELD_BOTTOM
-ignore symbol V4L2_FIELD_INTERLACED
-ignore symbol V4L2_FIELD_INTERLACED_BT
-ignore symbol V4L2_FIELD_INTERLACED_TB
-ignore symbol V4L2_FIELD_NONE
-ignore symbol V4L2_FIELD_SEQ_BT
-ignore symbol V4L2_FIELD_SEQ_TB
-ignore symbol V4L2_FIELD_TOP
-ignore symbol V4L2_FRMIVAL_TYPE_CONTINUOUS
-ignore symbol V4L2_FRMIVAL_TYPE_DISCRETE
-ignore symbol V4L2_FRMIVAL_TYPE_STEPWISE
-ignore symbol V4L2_FRMSIZE_TYPE_CONTINUOUS
-ignore symbol V4L2_FRMSIZE_TYPE_DISCRETE
-ignore symbol V4L2_FRMSIZE_TYPE_STEPWISE
-ignore symbol V4L2_MEMORY_DMABUF
-ignore symbol V4L2_MEMORY_MMAP
-ignore symbol V4L2_MEMORY_OVERLAY
-ignore symbol V4L2_MEMORY_USERPTR
-ignore symbol V4L2_PRIORITY_BACKGROUND
-ignore symbol V4L2_PRIORITY_DEFAULT
-ignore symbol V4L2_PRIORITY_INTERACTIVE
-ignore symbol V4L2_PRIORITY_RECORD
-ignore symbol V4L2_PRIORITY_UNSET
-ignore symbol V4L2_QUANTIZATION_DEFAULT
-ignore symbol V4L2_QUANTIZATION_FULL_RANGE
-ignore symbol V4L2_QUANTIZATION_LIM_RANGE
-ignore symbol V4L2_TUNER_ANALOG_TV
 ignore symbol V4L2_TUNER_DIGITAL_TV
-ignore symbol V4L2_TUNER_RADIO
-ignore symbol V4L2_TUNER_RF
-ignore symbol V4L2_TUNER_SDR
-ignore symbol V4L2_XFER_FUNC_709
-ignore symbol V4L2_XFER_FUNC_ADOBERGB
-ignore symbol V4L2_XFER_FUNC_DCI_P3
-ignore symbol V4L2_XFER_FUNC_DEFAULT
-ignore symbol V4L2_XFER_FUNC_NONE
-ignore symbol V4L2_XFER_FUNC_SMPTE2084
-ignore symbol V4L2_XFER_FUNC_SMPTE240M
-ignore symbol V4L2_XFER_FUNC_SRGB
-ignore symbol V4L2_YCBCR_ENC_601
-ignore symbol V4L2_YCBCR_ENC_709
-ignore symbol V4L2_YCBCR_ENC_BT2020
-ignore symbol V4L2_YCBCR_ENC_BT2020_CONST_LUM
-ignore symbol V4L2_YCBCR_ENC_DEFAULT
-ignore symbol V4L2_YCBCR_ENC_SMPTE240M
-ignore symbol V4L2_YCBCR_ENC_SYCC
-ignore symbol V4L2_YCBCR_ENC_XV601
-ignore symbol V4L2_YCBCR_ENC_XV709
-
-# For now, ignore all defines
+ignore symbol V4L2_COLORSPACE_BT878
+
+# Documented enum v4l2_field
+replace symbol V4L2_FIELD_ALTERNATE v4l2-field
+replace symbol V4L2_FIELD_ANY v4l2-field
+replace symbol V4L2_FIELD_BOTTOM v4l2-field
+replace symbol V4L2_FIELD_INTERLACED v4l2-field
+replace symbol V4L2_FIELD_INTERLACED_BT v4l2-field
+replace symbol V4L2_FIELD_INTERLACED_TB v4l2-field
+replace symbol V4L2_FIELD_NONE v4l2-field
+replace symbol V4L2_FIELD_SEQ_BT v4l2-field
+replace symbol V4L2_FIELD_SEQ_TB v4l2-field
+replace symbol V4L2_FIELD_TOP v4l2-field
+

[PATCH 06/54] doc-rst: remove Documentation/linux_tv/conf.py file

2016-07-08 Thread Mauro Carvalho Chehab
This file is actually not used to build the media uAPI docbook.
So, remove it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/conf.py | 221 -
 1 file changed, 221 deletions(-)
 delete mode 100644 Documentation/linux_tv/conf.py

diff --git a/Documentation/linux_tv/conf.py b/Documentation/linux_tv/conf.py
deleted file mode 100644
index ea5f6ef25d6b..
--- a/Documentation/linux_tv/conf.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# -*- coding: utf-8; mode: python -*-
-#
-# This is the project specific sphinx-build configuration, which is loaded from
-# the base configuration file (``../conf.py``). About config values consult:
-#
-# * http://www.sphinx-doc.org/en/stable/config.html
-#
-# While setting values here, please take care to not overwrite common needed
-# configurations. This means, do not *overwrite* composite values (e.g. the
-# list- or dictionary-value of "latex_elements" resp. "extensions") by
-# thoughtless assignments. Manipulate composite values always by *update*
-# (dict-values) or extend (list-values). Nevertheless, if you know what you are
-# doing, you are free to *overwrite* values to your needs.
-#
-# useful preset names:
-#
-# * BASE_FOLDER: the folder where the top conf.py is located
-# * main_name:   the basename of this project-folder
-
-# Set parser's default kernel-doc mode ``reST|kernel-doc``.
-kernel_doc_mode = "kernel-doc"
-
-# 
--
-# General configuration
-# 
--
-
-project   = u'LINUX MEDIA INFRASTRUCTURE API'
-copyright = u'2009-2016 : LinuxTV Developers'
-author= u'The LinuxTV Developers'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-#version   = 'v4.7'
-# The full version, including alpha/beta/rc tags.
-#release   = 'v4.7-rc2'
-
-# extlinks["man"] = ('http://manpages.ubuntu.com/cgi-bin/search.py?q=%s', ' ')
-
-# intersphinx_mapping['kernel-doc'] = 
('http://return42.github.io/sphkerneldoc/books/kernel-doc-HOWTO/', None)
-
-extensions.extend([
-# 'sphinx.ext.pngmath'
-#, 'sphinx.ext.mathjax'
-])
-
-# 
--
-# Options for HTML output
-# 
--
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# " v documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = pathjoin(BASE_FOLDER, "_tex", "logo.png")
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path.extend([])
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = main_name
-
-# 
--
-# Options for rst2pdf output
-# 
--
-
-# Grouping the document tree into PDF files. List of tuples
-# (source start file, target name, title, author, options).
-#
-# The options element is a dictionary that lets you override
-# this config per-document.
-# For example,
-# ('index', u'MyProject', u'My Project', u'Author Name',
-#  dict(pdf_compressed = True))
-# would mean that specific document would be compressed
-# regardless of the global pdf_compressed setting.
-#
-# further:  http://rst2pdf.ralsina.me/handbook.html#sphinx
-
-# FIXME: at this time, the rst2pdf fails with a bug
-#pdf_documents = [
-#(master_doc, main_name, project, author)
-#, ]
-
-# If false, no index is generated.
-pdf_use_index = False
-
-# How many levels deep should the table of contents be?
-pdf_toc_depth = 3
-
-# Add section number to section references
-pdf_use_numbered_links = False
-
-# Background images fitting mode
-pdf_fit_background_mode = 'scale'
-
-
-# 
--
-# Options for manual page output
-# 
--
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-# man_pages = [
-# (master_doc, 'kernel-doc', u'Kernel-Doc',
-#  [author], 1)
-# ]
-
-# If

[PATCH 54/54] doc-rst: linux_tv/Makefile: Honor quiet make O=dir

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

To honor the:

  make O=dir [targets] Locate all output files in "dir"

* activate kernel-include directive
* export BUILDDIR=$(BUILDDIR)
* linux_tv: replace '.. include::' with '.. kernel-include:: 
$BUILDDIR/'

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx   | 4 ++--
 Documentation/conf.py   | 2 +-
 Documentation/linux_tv/media/dvb/audio_h.rst| 4 +++-
 Documentation/linux_tv/media/dvb/ca_h.rst   | 2 +-
 Documentation/linux_tv/media/dvb/dmx_h.rst  | 2 +-
 Documentation/linux_tv/media/dvb/frontend_h.rst | 2 +-
 Documentation/linux_tv/media/dvb/net_h.rst  | 2 +-
 Documentation/linux_tv/media/dvb/video_h.rst| 2 +-
 Documentation/linux_tv/media/v4l/videodev.rst   | 2 +-
 9 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 6a093e4397b4..5aa2161fc3df 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -32,10 +32,10 @@ ALLSPHINXOPTS   = -D version=$(KERNELVERSION) -D 
release=$(KERNELRELEASE) -d $(B
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
 quiet_cmd_sphinx = SPHINX  $@
-  cmd_sphinx = $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2
+  cmd_sphinx = BUILDDIR=$(BUILDDIR) $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) 
$(BUILDDIR)/$2
 
 htmldocs:
-   $(MAKE) BUILDDIR=$(objtree)/$(BUILDDIR) -f 
$(srctree)/Documentation/linux_tv/Makefile $@
+   $(MAKE) BUILDDIR=$(BUILDDIR) -f 
$(srctree)/Documentation/linux_tv/Makefile $@
$(call cmd,sphinx,html)
 
 pdfdocs:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index f35748b4bc26..224240b5bc50 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,7 +28,7 @@ sys.path.insert(0, os.path.abspath('sphinx'))
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable']
+extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
 
 # Gracefully handle missing rst2pdf.
 try:
diff --git a/Documentation/linux_tv/media/dvb/audio_h.rst 
b/Documentation/linux_tv/media/dvb/audio_h.rst
index d87be5e2b022..0ea0b41b20ae 100644
--- a/Documentation/linux_tv/media/dvb/audio_h.rst
+++ b/Documentation/linux_tv/media/dvb/audio_h.rst
@@ -6,4 +6,6 @@
 DVB Audio Header File
 *
 
-.. include:: ../../../output/audio.h.rst
+.. kernel-include:: $BUILDDIR/audio.h.rst
+
+.. kernel-include:: $BUILDDIR/../../../../etc/adduser.conf
diff --git a/Documentation/linux_tv/media/dvb/ca_h.rst 
b/Documentation/linux_tv/media/dvb/ca_h.rst
index 407f840ae2ee..f513592ef529 100644
--- a/Documentation/linux_tv/media/dvb/ca_h.rst
+++ b/Documentation/linux_tv/media/dvb/ca_h.rst
@@ -6,4 +6,4 @@
 DVB Conditional Access Header File
 **
 
-.. include:: ../../../output/ca.h.rst
+.. kernel-include:: $BUILDDIR/ca.h.rst
diff --git a/Documentation/linux_tv/media/dvb/dmx_h.rst 
b/Documentation/linux_tv/media/dvb/dmx_h.rst
index 65ee8f095972..4fd1704a0833 100644
--- a/Documentation/linux_tv/media/dvb/dmx_h.rst
+++ b/Documentation/linux_tv/media/dvb/dmx_h.rst
@@ -6,4 +6,4 @@
 DVB Demux Header File
 *
 
-.. include:: ../../../output/dmx.h.rst
+.. kernel-include:: $BUILDDIR/dmx.h.rst
diff --git a/Documentation/linux_tv/media/dvb/frontend_h.rst 
b/Documentation/linux_tv/media/dvb/frontend_h.rst
index 97735b241f3c..15fca04d1c32 100644
--- a/Documentation/linux_tv/media/dvb/frontend_h.rst
+++ b/Documentation/linux_tv/media/dvb/frontend_h.rst
@@ -6,4 +6,4 @@
 DVB Frontend Header File
 
 
-.. include:: ../../../output/frontend.h.rst
+.. kernel-include:: $BUILDDIR/frontend.h.rst
diff --git a/Documentation/linux_tv/media/dvb/net_h.rst 
b/Documentation/linux_tv/media/dvb/net_h.rst
index 5a5a797882f2..7bcf5ba9d1eb 100644
--- a/Documentation/linux_tv/media/dvb/net_h.rst
+++ b/Documentation/linux_tv/media/dvb/net_h.rst
@@ -6,4 +6,4 @@
 DVB Network Header File
 ***
 
-.. include:: ../../../output/net.h.rst
+.. kernel-include:: $BUILDDIR/net.h.rst
diff --git a/Documentation/linux_tv/media/dvb/video_h.rst 
b/Documentation/linux_tv/media/dvb/video_h.rst
index 9d649a7e0f8b..3f39b0c4879c 100644
--- a/Documentation/linux_tv/media/dvb/video_h.rst
+++ b/Documentation/linux_tv/media/dvb/video_h.rst
@@ -6,4 +6,4 @@
 DVB Video Header File
 *
 
-.. include:: ../../../output/video.h.rst
+.. kernel-include:: $BUILDDIR/video.h.rst
diff --git a/Documentation/linux_tv/media/v4l/videodev.rst 
b/Documentation/linux_tv/media/v4l/videodev.rst
index 82bac4a0b760..b9ee4672d639 100644
--- a/Documentation/linux_tv/media/v4l/videodev.rst
+++ b/Documentation/linux_tv/media/v4l/videodev.rst
@@ -6,4 +6,4 @@
 Video For Linux Two Header File
 ***
 
-.. include:: ../../../outp

[PATCH 53/54] doc-rst: add kernel-include directive

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

The kernel-include directive is needed to include the auto generated rst
content from a build (pre-) process. E.g. the linux_tv Makefile
generates intermediate reST-files from header files. Since there is a O=
option:

  make O=dir [targets] Locate all output files in "dir"

We need to include intermediate reST files from arbitrary (O=/tmp/foo)
locations:

The 'kernel-include' reST-directive is a replacement for the 'include'
directive. The 'kernel-include' directive expand environment variables
in the path name and allows to include files from arbitrary locations.

.. hint::

  Including files from arbitrary locations (e.g. from '/etc') is a
  security risk for builders. This is why the 'include' directive from
  docutils *prohibit* pathnames pointing to locations *above* the
  filesystem tree where the reST document with the include directive is
  placed.

Substrings of the form $name or ${name} are replaced by the value of
environment variable name. Malformed variable names and references to
non-existing variables are left unchanged.

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/kernel_include.py | 183 +
 1 file changed, 183 insertions(+)
 create mode 100755 Documentation/sphinx/kernel_include.py

diff --git a/Documentation/sphinx/kernel_include.py 
b/Documentation/sphinx/kernel_include.py
new file mode 100755
index ..db5738238733
--- /dev/null
+++ b/Documentation/sphinx/kernel_include.py
@@ -0,0 +1,183 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8; mode: python -*-
+# pylint: disable=R0903, C0330, R0914, R0912, E0401
+
+u"""
+kernel-include
+~~
+
+Implementation of the ``kernel-include`` reST-directive.
+
+:copyright:  Copyright (C) 2016  Markus Heiser
+:license:GPL Version 2, June 1991 see linux/COPYING for details.
+
+The ``kernel-include`` reST-directive is a replacement for the ``include``
+directive. The ``kernel-include`` directive expand environment variables in
+the path name and allows to include files from arbitrary locations.
+
+.. hint::
+
+  Including files from arbitrary locations (e.g. from ``/etc``) is a
+  security risk for builders. This is why the ``include`` directive from
+  docutils *prohibit* pathnames pointing to locations *above* the 
filesystem
+  tree where the reST document with the include directive is placed.
+
+Substrings of the form $name or ${name} are replaced by the value of
+environment variable name. Malformed variable names and references to
+non-existing variables are left unchanged.
+"""
+
+# 
==
+# imports
+# 
==
+
+import os.path
+
+from docutils import io, nodes, statemachine
+from docutils.utils.error_reporting import SafeString, ErrorString
+from docutils.parsers.rst import directives
+from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
+from docutils.parsers.rst.directives.misc import Include
+
+# 
==
+def setup(app):
+# 
==
+
+app.add_directive("kernel-include", KernelInclude)
+
+# 
==
+class KernelInclude(Include):
+# 
==
+
+u"""KernelInclude (``kernel-include``) directive"""
+
+def run(self):
+path = os.path.realpath(
+os.path.expandvars(self.arguments[0]))
+
+# to get a bit security back, prohibit /etc:
+if path.startswith(os.sep + "etc"):
+raise self.severe(
+'Problems with "%s" directive, prohibited path: %s'
+% (self.name, path))
+
+self.arguments[0] = path
+
+#return super(KernelInclude, self).run() # won't work, see HINTs in 
_run()
+return self._run()
+
+def _run(self):
+"""Include a file as part of the content of this reST file."""
+
+# HINT: I had to copy&paste the whole Include.run method. I'am not 
happy
+# with this, but due to security reasons, the Include.run method does
+# not allow absolute or relative pathnames pointing to locations 
*above*
+# the filesystem tree where the reST document is placed.
+
+if not self.state.document.settings.file_insertion_enabled:
+raise self.warning('"%s" directive disabled.' % self.name)
+source = self.state_machine.input_lines.source(
+self.lineno - self.state_machine.input_offset - 1)
+source_dir = os.path.dirname(os.path.abspath(source))
+path = directives.path(self.arguments[0])
+if path.startswith('<') and path.endswith('

[PATCH 15/54] doc-rst: dvb/intro: Better show the needed include blocks

2016-07-08 Thread Mauro Carvalho Chehab
The include blocks were not properly displayed. Fix it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/intro.rst | 18 --
 1 file changed, 18 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/intro.rst 
b/Documentation/linux_tv/media/dvb/intro.rst
index 06b568b80f7a..72992940a057 100644
--- a/Documentation/linux_tv/media/dvb/intro.rst
+++ b/Documentation/linux_tv/media/dvb/intro.rst
@@ -160,34 +160,16 @@ partial path like:
 
#include 
 
-
-.. code-block:: c
-
#include 
 
-
-.. code-block:: c
-
#include 
 
-
-.. code-block:: c
-
#include 
 
-
-.. code-block:: c
-
#include 
 
-
-.. code-block:: c
-
#include 
 
-
-.. code-block:: c
-
#include 
 
 To enable applications to support different API version, an additional
-- 
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/54] doc-rst: dvbapi: Fix conversion issues

2016-07-08 Thread Mauro Carvalho Chehab
The conversion of this file didn't happen too well. We want
the items numbered, and format it just like what we did with
part 1 of the document.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/dvbapi.rst | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/dvbapi.rst 
b/Documentation/linux_tv/media/dvb/dvbapi.rst
index ad800404ae9f..3a7d39e98fa3 100644
--- a/Documentation/linux_tv/media/dvb/dvbapi.rst
+++ b/Documentation/linux_tv/media/dvb/dvbapi.rst
@@ -12,6 +12,7 @@ LINUX DVB API
 
 .. toctree::
 :maxdepth: 1
+:numbered:
 
 intro
 frontend
@@ -32,28 +33,34 @@ LINUX DVB API
 Revision and Copyright
 **
 
+Authors:
 
-:author:Metzler Ralph (*J. K.*)
-:address:   r...@metzlerbros.de
+- J. K. Metzler, Ralph 
 
-:author:Metzler Marcus (*O. C.*)
-:address:   r...@metzlerbros.de
+ - Original author of the DVB API documentation.
 
-:author:Chehab Mauro (*Carvalho*)
-:address:   m.che...@samsung.com
-:contrib:   Ported document to Docbook XML.
+- O. C. Metzler, Marcus 
 
-**Copyright** |copy| 2002, 2003 : Convergence GmbH
+ - Original author of the DVB API documentation.
+
+- Carvalho Chehab, Mauro 
+
+ - Ported document to Docbook XML, addition of DVBv5 API, documentation gaps 
fix.
+
+**Copyright** |copy| 2002-2003 : Convergence GmbH
 
 **Copyright** |copy| 2009-2016 : Mauro Carvalho Chehab
 
+
+Revision History
+
+
 :revision: 2.1.0 / 2015-05-29 (*mcc*)
 
 DocBook improvements and cleanups, in order to document the system calls
 on a more standard way and provide more description about the current
 DVB API.
 
-
 :revision: 2.0.4 / 2011-05-06 (*mcc*)
 
 Add more information about DVB APIv5, better describing the frontend
-- 
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 33/54] doc-rst: fix parsing comments and '{' on a separate line

2016-07-08 Thread Mauro Carvalho Chehab
The dmx.h header has two things that causes the parser to
break while handling enums:
 per-header enums and the '{' starts on a new line

Both makes the parser to get lexical marks to be detected
as if they were symbols.

Fix it.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 59f2c90f6942..bf6f0df895f4 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -29,9 +29,12 @@ my %structs;
 my $is_enum = 0;
 open IN, $file_in or die "Can't open $file_in";
 while () {
+   my $ln = $_;
+   $ln =~ s,/\*.*\*/,,;
+
$data .= $_;
 
-   if ($is_enum && m/^\s*([^\s\}\,\=]+)\s*[\,=]?/) {
+   if ($is_enum && $ln =~ m/^\s*([_A-Z][^\s\}\,\=]+)\s*[\,=]?/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -44,7 +47,7 @@ while () {
}
$is_enum = 0 if ($is_enum && m/\}/);
 
-   if (m/^\s*#\s*define\s+([_A-Z]\S+)\s+_IO/) {
+   if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+_IO/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -53,7 +56,7 @@ while () {
next;
}
 
-   if (m/^\s*#\s*define\s+([_A-Z]\S+)\s+/) {
+   if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -63,7 +66,7 @@ while () {
next;
}
 
-   if (m/^\s*typedef\s+.*\s+([_\w]\S+);/) {
+   if ($ln =~ m/^\s*typedef\s+.*\s+([_\w]\S+);/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -72,7 +75,8 @@ while () {
$typedefs{$s} = $n;
next;
}
-   if (m/^\s*enum\s+(\S+)\s+\{/ || m/^\s*enum\s+(\S+)$/) {
+   if ($ln =~ m/^\s*enum\s+(\S+)\s+\{/
+   || $ln =~ m/^\s*enum\s+(\S+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -83,7 +87,8 @@ while () {
$is_enum = $1;
next;
}
-   if (m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/ || 
m/^\s*struct\s+([A-Za-z_]\S+)$/) {
+   if ($ln =~ m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/
+   || $ln =~ m/^\s*struct\s+([A-Za-z_]\S+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
-- 
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 44/54] doc-rst: parse-headers: don't do substituition references

2016-07-08 Thread Mauro Carvalho Chehab
Add one extra escape character to avoid those warnings:
Documentation/linux_tv/videodev2.h.rst:6: WARNING: Inline 
substitution_reference start-string without end-string.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 16ea28b0d2e1..0a3703bef5eb 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -220,7 +220,7 @@ $data =~ s/\n\s+\n/\n\n/g;
 #
 # Add escape codes for special characters
 #
-$data =~ s,([\_\`\*\<\>\&:\/]),\\$1,g;
+$data =~ s,([\_\`\*\<\>\&:\/\|]),\\$1,g;
 
 $data =~ s,DEPRECATED,**DEPRECATED**,g;
 
-- 
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/54] doc-rst: parse-headers: add an option to ignore enum symbols

2016-07-08 Thread Mauro Carvalho Chehab
At videodev2.h, we have hundreds of symbols that don't
currently have a reference yet. Let's ignore for how, while
we don't improve those cross-refs.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index fc18eac1552c..16ea28b0d2e1 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -163,6 +163,10 @@ if ($file_exceptions) {
delete $structs{$1} if (exists($structs{$1}));
next;
}
+   if (m/^ignore\s+symbol\s+(\S+)/) {
+   delete $enum_symbols{$1} if (exists($enum_symbols{$1}));
+   next;
+   }
 
# Parsers to replace a symbol
 
-- 
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/54] doc-rst: parse-headers: better handle comments at the source code

2016-07-08 Thread Mauro Carvalho Chehab
We should not let comments to mangle with the symbols
parsing. Unfortunately, videodev2.h has lots of those
in the middle of enums and structs. So, we need to improve
our parser to discard them.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index b703f1a7f432..fc18eac1552c 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -27,13 +27,24 @@ my %structs;
 #
 
 my $is_enum = 0;
+my $is_comment = 0;
 open IN, $file_in or die "Can't open $file_in";
 while () {
-   my $ln = $_;
-   $ln =~ s,/\*.*\*/,,;
-
$data .= $_;
 
+   my $ln = $_;
+   if (!$is_comment) {
+   $ln =~ s,/\*.*(\*/),,g;
+
+   $is_comment = 1 if ($ln =~ s,/\*.*,,);
+   } else {
+   if ($ln =~ s,^(.*\*/),,) {
+   $is_comment = 0;
+   } else {
+   next;
+   }
+   }
+
if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
my $s = $1;
my $n = $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 46/54] doc-rst: fix some badly converted references

2016-07-08 Thread Mauro Carvalho Chehab
Several references were not converted right. That's why
so many symbols were lost when parsing videodev2.h header.

Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/dmx_types.rst |   8 +-
 .../linux_tv/media/dvb/fe-bandwidth-t.rst  |  14 +-
 .../linux_tv/media/dvb/fe-diseqc-send-burst.rst|   4 +-
 Documentation/linux_tv/media/dvb/fe-get-info.rst   |  62 +++
 .../linux_tv/media/dvb/fe-read-status.rst  |  14 +-
 Documentation/linux_tv/media/dvb/fe-set-tone.rst   |   4 +-
 Documentation/linux_tv/media/dvb/fe-type-t.rst |   8 +-
 .../linux_tv/media/dvb/fe_property_parameters.rst  | 206 ++---
 Documentation/linux_tv/media/v4l/control.rst   |   6 +-
 .../linux_tv/media/v4l/extended-controls.rst   | 114 ++--
 Documentation/linux_tv/media/v4l/pixfmt-013.rst|  26 +--
 .../linux_tv/media/v4l/pixfmt-indexed.rst  |   2 +-
 .../linux_tv/media/v4l/pixfmt-packed-rgb.rst   |  42 ++---
 .../linux_tv/media/v4l/pixfmt-packed-yuv.rst   |   8 +-
 .../linux_tv/media/v4l/pixfmt-reserved.rst |  66 +++
 .../linux_tv/media/v4l/subdev-formats.rst  | 174 -
 16 files changed, 379 insertions(+), 379 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/dmx_types.rst 
b/Documentation/linux_tv/media/dvb/dmx_types.rst
index 84bf616ff623..7a8900af2680 100644
--- a/Documentation/linux_tv/media/dvb/dmx_types.rst
+++ b/Documentation/linux_tv/media/dvb/dmx_types.rst
@@ -28,7 +28,7 @@ Output for the demux
 
 -  .. row 2
 
-   -  .. _`DMX-OUT-DECODER`:
+   -  .. _DMX-OUT-DECODER:
 
  DMX_OUT_DECODER
 
@@ -36,7 +36,7 @@ Output for the demux
 
 -  .. row 3
 
-   -  .. _`DMX-OUT-TAP`:
+   -  .. _DMX-OUT-TAP:
 
  DMX_OUT_TAP
 
@@ -46,7 +46,7 @@ Output for the demux
 
 -  .. row 4
 
-   -  .. _`DMX-OUT-TS-TAP`:
+   -  .. _DMX-OUT-TS-TAP:
 
  DMX_OUT_TS_TAP
 
@@ -57,7 +57,7 @@ Output for the demux
 
 -  .. row 5
 
-   -  .. _`DMX-OUT-TSDEMUX-TAP`:
+   -  .. _DMX-OUT-TSDEMUX-TAP:
 
  DMX_OUT_TSDEMUX_TAP
 
diff --git a/Documentation/linux_tv/media/dvb/fe-bandwidth-t.rst 
b/Documentation/linux_tv/media/dvb/fe-bandwidth-t.rst
index f614c22355da..8edaf1a8fbc8 100644
--- a/Documentation/linux_tv/media/dvb/fe-bandwidth-t.rst
+++ b/Documentation/linux_tv/media/dvb/fe-bandwidth-t.rst
@@ -22,7 +22,7 @@ Frontend bandwidth
 
 -  .. row 2
 
-   -  .. _`BANDWIDTH-AUTO`:
+   -  .. _BANDWIDTH-AUTO:
 
  ``BANDWIDTH_AUTO``
 
@@ -30,7 +30,7 @@ Frontend bandwidth
 
 -  .. row 3
 
-   -  .. _`BANDWIDTH-1-712-MHZ`:
+   -  .. _BANDWIDTH-1-712-MHZ:
 
  ``BANDWIDTH_1_712_MHZ``
 
@@ -38,7 +38,7 @@ Frontend bandwidth
 
 -  .. row 4
 
-   -  .. _`BANDWIDTH-5-MHZ`:
+   -  .. _BANDWIDTH-5-MHZ:
 
  ``BANDWIDTH_5_MHZ``
 
@@ -46,7 +46,7 @@ Frontend bandwidth
 
 -  .. row 5
 
-   -  .. _`BANDWIDTH-6-MHZ`:
+   -  .. _BANDWIDTH-6-MHZ:
 
  ``BANDWIDTH_6_MHZ``
 
@@ -54,7 +54,7 @@ Frontend bandwidth
 
 -  .. row 6
 
-   -  .. _`BANDWIDTH-7-MHZ`:
+   -  .. _BANDWIDTH-7-MHZ:
 
  ``BANDWIDTH_7_MHZ``
 
@@ -62,7 +62,7 @@ Frontend bandwidth
 
 -  .. row 7
 
-   -  .. _`BANDWIDTH-8-MHZ`:
+   -  .. _BANDWIDTH-8-MHZ:
 
  ``BANDWIDTH_8_MHZ``
 
@@ -70,7 +70,7 @@ Frontend bandwidth
 
 -  .. row 8
 
-   -  .. _`BANDWIDTH-10-MHZ`:
+   -  .. _BANDWIDTH-10-MHZ:
 
  ``BANDWIDTH_10_MHZ``
 
diff --git a/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst 
b/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
index 11d441c6f237..9b476545ef89 100644
--- a/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
+++ b/Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst
@@ -61,7 +61,7 @@ enum fe_sec_mini_cmd
 
 -  .. row 2
 
-   -  .. _`SEC-MINI-A`:
+   -  .. _SEC-MINI-A:
 
  ``SEC_MINI_A``
 
@@ -69,7 +69,7 @@ enum fe_sec_mini_cmd
 
 -  .. row 3
 
-   -  .. _`SEC-MINI-B`:
+   -  .. _SEC-MINI-B:
 
  ``SEC_MINI_B``
 
diff --git a/Documentation/linux_tv/media/dvb/fe-get-info.rst 
b/Documentation/linux_tv/media/dvb/fe-get-info.rst
index 8ef1ed7bbf68..9a9ddbcdb1ec 100644
--- a/Documentation/linux_tv/media/dvb/fe-get-info.rst
+++ b/Documentation/linux_tv/media/dvb/fe-get-info.rst
@@ -172,7 +172,7 @@ supported only on some specific frontend types.
 
 -  .. row 2
 
-   -  .. _`FE-IS-STUPID`:
+   -  .. _FE-IS-STUPID:
 
  ``FE_IS_STUPID``
 
@@ -181,7 +181,7 @@ supported only on some specific frontend types.
 
 -  .. row 3
 
-   -  .. _`FE-CAN-INVERSION-AUTO`:
+   -  .. _FE-CAN-INVERSION-AUTO:
 
  ``FE_CAN_INVERSION_AUTO``
 
@@ -189,7 +189,7 @@ supported only on some specific frontend types.
 
 -  .. row 4
 
-   -  .. _`FE-CAN-FEC-1-2`:
+   -  .. _FE-CAN-FEC-1-2:
 
  ``FE_CAN_FEC_1_2``
 
@@ -197,7 +197,7 @@ supported only on some

[PATCH 47/54] doc-rst: linux_tv: Don't ignore pix formats

2016-07-08 Thread Mauro Carvalho Chehab
Now that the reference problems were solved, let's not
ignore anymore the pix formats, as all of them are already
documented.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/v4l/pixfmt-nv12.rst   |   1 +
 Documentation/linux_tv/media/v4l/pixfmt-nv12m.rst  |   2 +
 Documentation/linux_tv/media/v4l/pixfmt-nv16.rst   |   1 +
 Documentation/linux_tv/media/v4l/pixfmt-nv16m.rst  |   1 +
 Documentation/linux_tv/media/v4l/pixfmt-nv24.rst   |   1 +
 .../linux_tv/media/v4l/pixfmt-sdr-cs08.rst |   2 +-
 .../linux_tv/media/v4l/pixfmt-sdr-cu08.rst |   2 +-
 .../linux_tv/media/v4l/pixfmt-srggb10.rst  |   3 +
 .../linux_tv/media/v4l/pixfmt-srggb10alaw8.rst |   3 +
 .../linux_tv/media/v4l/pixfmt-srggb10dpcm8.rst |   4 +
 .../linux_tv/media/v4l/pixfmt-srggb10p.rst |   3 +
 .../linux_tv/media/v4l/pixfmt-srggb12.rst  |   4 +
 Documentation/linux_tv/media/v4l/pixfmt-yuv410.rst |   1 +
 .../linux_tv/media/v4l/pixfmt-yuv420m.rst  |   1 +
 .../linux_tv/media/v4l/pixfmt-yuv422m.rst  |   1 +
 .../linux_tv/media/v4l/pixfmt-yuv444m.rst  |   1 +
 Documentation/linux_tv/videodev2.h.rst.exceptions  | 142 -
 17 files changed, 29 insertions(+), 144 deletions(-)

diff --git a/Documentation/linux_tv/media/v4l/pixfmt-nv12.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-nv12.rst
index 65ccfb837318..cf59b28f75b7 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-nv12.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-nv12.rst
@@ -1,6 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX-FMT-NV12:
+.. _V4L2-PIX-FMT-NV21:
 
 **
 V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-nv12m.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-nv12m.rst
index f0e0af732949..a4e7eaeccea8 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-nv12m.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-nv12m.rst
@@ -1,6 +1,8 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX-FMT-NV12M:
+.. _v4l2-pix-fmt-nv12mt-16x16:
+.. _V4L2-PIX-FMT-NV21M:
 
 
***
 V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), 
V4L2_PIX_FMT_NV12MT_16X16
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-nv16.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-nv16.rst
index 5a7e89529ce9..88aa7617f7cf 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-nv16.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-nv16.rst
@@ -1,6 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX-FMT-NV16:
+.. _V4L2-PIX-FMT-NV61:
 
 **
 V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-nv16m.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-nv16m.rst
index 9b4c5b09c4b5..b7ee068f491c 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-nv16m.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-nv16m.rst
@@ -1,6 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX-FMT-NV16M:
+.. _v4l2-pix-fmt-nv61m:
 
 
 V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-nv24.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-nv24.rst
index 3f07f9391205..db98f476446e 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-nv24.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-nv24.rst
@@ -1,6 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX-FMT-NV24:
+.. _V4L2-PIX-FMT-NV42:
 
 **
 V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-sdr-cs08.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-sdr-cs08.rst
index a772b6a674d5..2736275d080f 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-sdr-cs08.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-sdr-cs08.rst
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _V4L2-SDR-FMT-CS08:
+.. _v4l2-sdr-fmt-cs8:
 
 *
 V4L2_SDR_FMT_CS8 ('CS08')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-sdr-cu08.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-sdr-cu08.rst
index 9ea92099e7ed..68ad1717f6d7 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-sdr-cu08.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-sdr-cu08.rst
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _V4L2-SDR-FMT-CU08:
+.. _v4l2-sdr-fmt-cu8:
 
 *
 V4L2_SDR_FMT_CU8 ('CU08')
diff --git a/Documentation/linux_tv/media/v4l/pixfmt-srggb10.rst 
b/Documentation/linux_tv/media/v4l/pixfmt-srggb10.rst
index b21d9f01ed35..44a49563917c 100644
--- a/Documentation/linux_tv/media/v4l/pixfmt-srggb10.rst
+++ b/Documentation/linux_tv/media/v4l/pixfmt-srggb10.rst
@@ -1,6 +1,9 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _V4L2-PIX

[PATCH 41/54] doc-rst: auto-generate video.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This file comes from the uAPI definition header, and
should be auto-generated, to be in sync with Kernel changes.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile   |   5 +-
 Documentation/linux_tv/video.h.rst| 280 --
 Documentation/linux_tv/video.h.rst.exceptions |  40 
 3 files changed, 44 insertions(+), 281 deletions(-)
 delete mode 100644 Documentation/linux_tv/video.h.rst
 create mode 100644 Documentation/linux_tv/video.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 4ec743449776..1773132008da 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -2,7 +2,7 @@
 
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
-TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst
+TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst
 
 htmldocs: ${TARGETS}
 
@@ -21,5 +21,8 @@ frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  
frontend.h.rst.exceptions
 net.h.rst: ${PARSER} ${UAPI}/dvb/net.h  net.h.rst.exceptions
${PARSER} ${UAPI}/dvb/net.h $@ net.h.rst.exceptions
 
+video.h.rst: ${PARSER} ${UAPI}/dvb/video.h  video.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/video.h $@ video.h.rst.exceptions
+
 cleandocs:
-rm ${TARGETS}
diff --git a/Documentation/linux_tv/video.h.rst 
b/Documentation/linux_tv/video.h.rst
deleted file mode 100644
index fbbfb89167da..
--- a/Documentation/linux_tv/video.h.rst
+++ /dev/null
@@ -1,280 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: video.h
-=
-
-.. code-block:: c
-
-/*
- * video.h
- *
- * Copyright (C) 2000 Marcus Metzler 
- *  & Ralph  Metzler 
- *for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _UAPI_DVBVIDEO_H_
-#define _UAPI_DVBVIDEO_H_
-
-#include 
-#ifndef __KERNEL__
-#include 
-#endif
-
-typedef enum {
-   VIDEO_FORMAT_4_3, /* Select 4:3 format */
-   VIDEO_FORMAT_16_9,/* Select 16:9 format. */
-   VIDEO_FORMAT_221_1/* 2.21:1 */
-} video_format_t;
-
-
-typedef enum {
-VIDEO_SYSTEM_PAL,
-VIDEO_SYSTEM_NTSC,
-VIDEO_SYSTEM_PALN,
-VIDEO_SYSTEM_PALNc,
-VIDEO_SYSTEM_PALM,
-VIDEO_SYSTEM_NTSC60,
-VIDEO_SYSTEM_PAL60,
-VIDEO_SYSTEM_PALM60
-} video_system_t;
-
-
-typedef enum {
-   VIDEO_PAN_SCAN,   /* use pan and scan format */
-   VIDEO_LETTER_BOX, /* use letterbox format */
-   VIDEO_CENTER_CUT_OUT  /* use center cut out format */
-} video_displayformat_t;
-
-typedef struct {
-   int w;
-   int h;
-   video_format_t aspect_ratio;
-} video_size_t;
-
-typedef enum {
-   VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
-   VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
-  comes from the user through the write
-  system call */
-} video_stream_source_t;
-
-
-typedef enum {
-   VIDEO_STOPPED, /* Video is stopped */
-   VIDEO_PLAYING, /* Video is currently playing */
-   VIDEO_FREEZED  /* Video is freezed */
-} video_play_state_t;
-
-
-/* Decoder commands */
-#define VIDEO_CMD_PLAY(0)
-#define VIDEO_CMD_STOP(1)
-#define VIDEO_CMD_FREEZE  (2)
-#define VIDEO_CMD_CONTINUE(3)
-
-/* Flags for VIDEO_CMD_FREEZE */
-#define VIDEO_CMD_FREEZE_TO_BLACK   (1 << 0)
-
-/* Flags for VIDEO_CMD_STOP */
-#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
-#define VIDEO_CMD_STOP_IMMEDIATELY  (1 << 1)
-
-/* Play input formats: */
-/* The decoder has no special format requirements */
-#define VIDEO_PLAY_FMT_NONE (0)
-/* The decoder requires full GOPs */
-#define VIDEO_PLAY_FMT_GOP  (1)
-
-/* The structure must be zeroed before use by the application
-   This ensures it can be extended safe

[PATCH 32/54] doc-dst: parse-headers: highlight deprecated comments

2016-07-08 Thread Mauro Carvalho Chehab
When something is deprecated, highlight it, as we want it
to be clearer to the reader.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index ec9537ef586f..59f2c90f6942 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -196,6 +196,8 @@ $data =~ s/\n\s+\n/\n\n/g;
 #
 $data =~ s,([\_\`\*\<\>\&:\/]),\\$1,g;
 
+$data =~ s,DEPRECATED,**DEPRECATED**,g;
+
 #
 # Add references
 #
-- 
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/54] doc-rst: media-controller: missing credits

2016-07-08 Thread Mauro Carvalho Chehab
When I wrote the MC next gen patches, I also improved the media
controller documentation and added documentation for
MEDIA_IOC_G_TOPOLOGY, but I forgot to add the credits on that
time.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-controller.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/linux_tv/media/mediactl/media-controller.rst 
b/Documentation/linux_tv/media/mediactl/media-controller.rst
index 8b8af483c5e9..1877d68044b8 100644
--- a/Documentation/linux_tv/media/mediactl/media-controller.rst
+++ b/Documentation/linux_tv/media/mediactl/media-controller.rst
@@ -52,12 +52,19 @@ Authors:
 
  - Initial version.
 
+- Carvalho Chehab, Mauro 
+
+ - MEDIA_IOC_G_TOPOLOGY documentation and documentation improvements.
+
 **Copyright** 2010 : Laurent Pinchart
+**Copyright** 2015-2016 : Mauro Carvalho Chehab
 
 
 Revision History
 
 
+:revision: 1.1.0 / 2015-12-12 (*mcc*)
+
 :revision: 1.0.0 / 2010-11-10 (*lp*)
 
 Initial revision
-- 
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/54] doc-rst: dmabuf: Fix the cross-reference

2016-07-08 Thread Mauro Carvalho Chehab
Fixes this warning:
Documentation/linux_tv/media/v4l/dmabuf.rst:150: WARNING: undefined label: 
vidioc_dqbuf (if the link has no caption the label must precede a section 
header)

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

diff --git a/Documentation/linux_tv/media/v4l/dmabuf.rst 
b/Documentation/linux_tv/media/v4l/dmabuf.rst
index 0b2113778cc9..474d8c021507 100644
--- a/Documentation/linux_tv/media/v4l/dmabuf.rst
+++ b/Documentation/linux_tv/media/v4l/dmabuf.rst
@@ -149,7 +149,7 @@ outputted buffers.
 
 Drivers implementing DMABUF importing I/O must support the
 :ref:`VIDIOC_REQBUFS `, :ref:`VIDIOC_QBUF `,
-:ref:`VIDIOC_DQBUF `, :ref:`VIDIOC_STREAMON
+:ref:`VIDIOC_DQBUF `, :ref:`VIDIOC_STREAMON
 ` and :ref:`VIDIOC_STREAMOFF ` ioctls,
 and the :ref:`select() ` and :ref:`poll() `
 functions.
-- 
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/54] doc-rst: auto-generate net.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This file comes from the uAPI definition header, and
should be auto-generated, to be in sync with Kernel changes.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile | 10 +++--
 Documentation/linux_tv/net.h.rst| 59 -
 Documentation/linux_tv/net.h.rst.exceptions | 11 ++
 3 files changed, 18 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/linux_tv/net.h.rst
 create mode 100644 Documentation/linux_tv/net.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 7ee14195802f..4ec743449776 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -2,8 +2,9 @@
 
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
+TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst
 
-htmldocs: audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst
+htmldocs: ${TARGETS}
 
 audio.h.rst: ${PARSER} ${UAPI}/dvb/audio.h  audio.h.rst.exceptions
${PARSER} ${UAPI}/dvb/audio.h $@ audio.h.rst.exceptions
@@ -17,5 +18,8 @@ dmx.h.rst: ${PARSER} ${UAPI}/dvb/dmx.h  dmx.h.rst.exceptions
 frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
 
-clean:
-   -rm frontend.h.rst
+net.h.rst: ${PARSER} ${UAPI}/dvb/net.h  net.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/net.h $@ net.h.rst.exceptions
+
+cleandocs:
+   -rm ${TARGETS}
diff --git a/Documentation/linux_tv/net.h.rst b/Documentation/linux_tv/net.h.rst
deleted file mode 100644
index 9b0f705c634b..
--- a/Documentation/linux_tv/net.h.rst
+++ /dev/null
@@ -1,59 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: net.h
-===
-
-.. code-block:: c
-
-/*
- * net.h
- *
- * Copyright (C) 2000 Marcus Metzler 
- *  & Ralph  Metzler 
- *for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _DVBNET_H_
-#define _DVBNET_H_
-
-#include 
-
-struct dvb_net_if {
-   __u16 pid;
-   __u16 if_num;
-   __u8  feedtype;
-#define DVB_NET_FEEDTYPE_MPE 0  /* multi protocol encapsulation */
-#define DVB_NET_FEEDTYPE_ULE 1  /* ultra lightweight encapsulation */
-};
-
-
-#define NET_ADD_IF_IOWR('o', 52, struct dvb_net_if)
-#define NET_REMOVE_IF _IO('o', 53)
-#define NET_GET_IF_IOWR('o', 54, struct dvb_net_if)
-
-
-/* binary compatibility cruft: */
-struct __dvb_net_if_old {
-   __u16 pid;
-   __u16 if_num;
-};
-#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
-#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
-
-
-#endif /*_DVBNET_H_*/
diff --git a/Documentation/linux_tv/net.h.rst.exceptions 
b/Documentation/linux_tv/net.h.rst.exceptions
new file mode 100644
index ..30a267483aa9
--- /dev/null
+++ b/Documentation/linux_tv/net.h.rst.exceptions
@@ -0,0 +1,11 @@
+# Ignore header name
+ignore define _DVBNET_H_
+
+# Ignore old ioctls/structs
+ignore ioctl __NET_ADD_IF_OLD
+ignore ioctl __NET_GET_IF_OLD
+ignore struct __dvb_net_if_old
+
+# Macros used at struct dvb_net_if
+replace define DVB_NET_FEEDTYPE_MPE dvb-net-if
+replace define DVB_NET_FEEDTYPE_ULE dvb-net-if
-- 
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 28/54] doc-rst: linux_tv/index: Rename the book name

2016-07-08 Thread Mauro Carvalho Chehab
There's no need for all caps at its name. As the book title is
now showing at the top of each page, let's use Camel Case, to
make it less bold.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/index.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/linux_tv/index.rst b/Documentation/linux_tv/index.rst
index 4815ad6fc6b9..67b3ef6ec3d7 100644
--- a/Documentation/linux_tv/index.rst
+++ b/Documentation/linux_tv/index.rst
@@ -3,7 +3,7 @@
 .. include:: 
 
 ##
-LINUX MEDIA INFRASTRUCTURE API
+Linux Media Infrastructure API
 ##
 
 **Copyright** |copy| 2009-2016 : LinuxTV Developers
-- 
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/54] doc-rst: media-controller: fix conversion issues

2016-07-08 Thread Mauro Carvalho Chehab
Make it look just like v4l and DVB parts.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-controller.rst | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/linux_tv/media/mediactl/media-controller.rst 
b/Documentation/linux_tv/media/mediactl/media-controller.rst
index 49fb76cafcab..8b8af483c5e9 100644
--- a/Documentation/linux_tv/media/mediactl/media-controller.rst
+++ b/Documentation/linux_tv/media/mediactl/media-controller.rst
@@ -15,6 +15,7 @@ Media Controller
 
 .. toctree::
 :maxdepth: 1
+:numbered:
 
 media-controller-intro
 media-controller-model
@@ -45,13 +46,18 @@ Function Reference
 Revision and Copyright
 **
 
+Authors:
 
-:author:Pinchart Laurent
-:address:   laurent.pinch...@ideasonboard.com
-:contrib:   Initial version.
+- Pinchart, Laurent 
+
+ - Initial version.
 
 **Copyright** 2010 : Laurent Pinchart
 
+
+Revision History
+
+
 :revision: 1.0.0 / 2010-11-10 (*lp*)
 
 Initial revision
-- 
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/54] doc-rst: intro: remove obsolete headers

2016-07-08 Thread Mauro Carvalho Chehab
The video, audio and OSD APIs are obsolete. V4L2 should be
used instead. So, remove them from this intro item.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/intro.rst | 5 -
 1 file changed, 5 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/intro.rst 
b/Documentation/linux_tv/media/dvb/intro.rst
index 72992940a057..b61081d00a9f 100644
--- a/Documentation/linux_tv/media/dvb/intro.rst
+++ b/Documentation/linux_tv/media/dvb/intro.rst
@@ -158,8 +158,6 @@ partial path like:
 
 .. code-block:: c
 
-   #include 
-
#include 
 
#include 
@@ -168,9 +166,6 @@ partial path like:
 
#include 
 
-   #include 
-
-   #include 
 
 To enable applications to support different API version, an additional
 include file ``linux/dvb/version.h`` exists, which defines the constant
-- 
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 29/54] doc-rst: add parse-headers.pl script

2016-07-08 Thread Mauro Carvalho Chehab
This script parses a header file and converts it into a
parsed-literal block, creating references for ioctls,
defines, typedefs, enums and structs.

It also allow an external file to modify the rules, in
order to fix the expressions.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 290 ++
 1 file changed, 290 insertions(+)
 create mode 100755 Documentation/sphinx/parse-headers.pl

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
new file mode 100755
index ..287f6459e13a
--- /dev/null
+++ b/Documentation/sphinx/parse-headers.pl
@@ -0,0 +1,290 @@
+#!/usr/bin/perl
+use strict;
+use Text::Tabs;
+
+# Uncomment if debug is needed
+#use Data::Dumper;
+
+# change to 1 to generate some debug prints
+my $debug = 0;
+
+if (scalar @ARGV < 2 || scalar @ARGV > 3) {
+   die "Usage:\n\t$0   []\n";
+}
+
+my ($file_in, $file_out, $file_exceptions) = @ARGV;
+
+my $data;
+my %ioctls;
+my %defines;
+my %typedefs;
+my %enums;
+my %enum_symbols;
+my %structs;
+
+#
+# read the file and get identifiers
+#
+
+my $is_enum = 0;
+open IN, $file_in or die "Can't open $file_in";
+while () {
+   $data .= $_;
+
+   if ($is_enum && m/^\s*([^\s\}\,\=]+)\s*[\,=]?/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $enum_symbols{$s} = $n;
+
+   $is_enum = 0 if ($is_enum && m/\}/);
+   next;
+   }
+   $is_enum = 0 if ($is_enum && m/\}/);
+
+   if (m/^\s*#\s*define\s+([_A-Z]\S+)\s+_IO/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+
+   $ioctls{$s} = $n;
+   next;
+   }
+
+   if (m/^\s*#\s*define\s+([_A-Z]\S+)\s+/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $defines{$s} = $n;
+   next;
+   }
+
+   if (m/^\s*typedef\s+.*\s+([_\w]\S+);/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $typedefs{$s} = $n;
+   next;
+   }
+   if (m/^\s*enum\s+(\S+)\s+\{/ || m/^\s*enum\s+(\S+)$/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $enums{$s} = $n;
+
+   $is_enum = $1;
+   next;
+   }
+   if (m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/ || 
m/^\s*struct\s+([A-Za-z_]\S+)$/) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $structs{$s} = $n;
+   next;
+   }
+}
+close IN;
+
+#
+# Handle multi-line typedefs
+#
+
+my @matches = $data =~ m/typedef\s+struct\s+\S+\s*\{[^\}]+\}\s*(\S+)\s*\;/g;
+foreach my $m (@matches) {
+   my $s = $1;
+   my $n = $1;
+   $n =~ tr/A-Z/a-z/;
+   $n =~ tr/_/-/;
+
+   $typedefs{$s} = $n;
+   next;
+}
+
+#
+# Handle exceptions, if any
+#
+
+if ($file_exceptions) {
+   open IN, $file_exceptions or die "Can't read $file_exceptions";
+   while () {
+   next if (m/^\s*$/ || m/^\s*#/);
+
+   # Parsers to ignore a symbol
+
+   if (m/^ignore\s+ioctl\s+(\S+)/) {
+   delete $ioctls{$1} if (exists($ioctls{$1}));
+   next;
+   }
+   if (m/^ignore\s+define\s+(\S+)/) {
+   delete $defines{$1} if (exists($defines{$1}));
+   next;
+   }
+   if (m/^ignore\s+typedef\s+(\S+)/) {
+   delete $typedefs{$1} if (exists($typedefs{$1}));
+   next;
+   }
+   if (m/^ignore\s+enum\s+(\S+)/) {
+   delete $enums{$1} if (exists($enums{$1}));
+   next;
+   }
+   if (m/^ignore\s+struct\s+(\S+)/) {
+   delete $structs{$1} if (exists($structs{$1}));
+   next;
+   }
+
+   # Parsers to replace a symbol
+
+   if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
+   $ioctls{$1} = $2 if (exists($ioctls{$1}));
+   next;
+   }
+   if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
+   $defines{$1} = $2 if (exists($defines{$1}));
+   next;
+   }
+   if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
+   $typedefs{$1} = $2 if (exists($typedefs{$1}));
+   next;
+   }
+   if (m/^replace\s+enum\s+(\S+)\s+(\S+)/) {
+   $enums{$1} = $2 if (exists($enums{$1}));
+

[PATCH 14/54] doc-rst: fix intro_files/dvbstb.png image

2016-07-08 Thread Mauro Carvalho Chehab
The png image was not base64 decoded correctly.
Fix it.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../linux_tv/media/dvb/intro_files/dvbstb.png   | Bin 22703 -> 22655 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/intro_files/dvbstb.png 
b/Documentation/linux_tv/media/dvb/intro_files/dvbstb.png
index 
5836ea94eba4ec4fd13a83e89ef86b312cc04c02..9b8f372e7afd9d016854973ba705dcdfbd1bbf13
 100644
GIT binary patch
delta 116
zcmZ3#k@5cq#tjYZ%&xwHo7>q}ax=MxZ8j4=%*x{G=H|AUQBspYnXl2LO%FCVBt>

delta 164
zcmeyrfpPst#tjYZ>Ez0rTi#0k+90_5H|`T~{;0http://vger.kernel.org/majordomo-info.html


[PATCH 27/54] doc-rst: v4l2: Rename the V4L2 API title

2016-07-08 Thread Mauro Carvalho Chehab
The V4L2 is the only part of the doc that has the word "Specification"
and mentions its version on the title.

Having the version there was important in the past, while we were
getting rid of V4L version 1. But, as v1 is long gone, all it lasts
is history (with is, btw, covered on the spec). So, no need to keep
the version on its title.

So, rename it, to be more generic and look like the remaining
of the document.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/v4l/v4l2.rst | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/linux_tv/media/v4l/v4l2.rst 
b/Documentation/linux_tv/media/v4l/v4l2.rst
index 9284446e3cfa..301f95b5bdc6 100644
--- a/Documentation/linux_tv/media/v4l/v4l2.rst
+++ b/Documentation/linux_tv/media/v4l/v4l2.rst
@@ -3,9 +3,11 @@
 .. include:: 
 .. _v4l2spec:
 
-#
-Video for Linux Two API Specification
-#
+###
+Video for Linux API
+###
+
+This part describes the Video for Linux API version 2 (V4L2 API) specification.
 
 **Revision 4.5**
 
-- 
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/54] doc-rst: auto-generate audio.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This is an auto-generated header. Remove the hardcoded one
and do the right thing here.

NOTE: this is a deprecated API. So, we won't make any
effort to try identifying the meaning of this obscure
API that is used only on a legacy driver.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile   |   9 +-
 Documentation/linux_tv/audio.h.rst| 142 --
 Documentation/linux_tv/audio.h.rst.exceptions |  20 
 3 files changed, 26 insertions(+), 145 deletions(-)
 delete mode 100644 Documentation/linux_tv/audio.h.rst
 create mode 100644 Documentation/linux_tv/audio.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 2ef624e40bd9..2eb958e91eab 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -3,13 +3,16 @@
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
 
-htmldocs: frontend.h.rst dmx.h.rst
+htmldocs: audio.h.rst dmx.h.rst frontend.h.rst
 
-frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
+audio.h.rst: ${PARSER} ${UAPI}/dvb/audio.h  audio.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/audio.h $@ audio.h.rst.exceptions
 
 dmx.h.rst: ${PARSER} ${UAPI}/dvb/dmx.h  dmx.h.rst.exceptions
${PARSER} ${UAPI}/dvb/dmx.h $@ dmx.h.rst.exceptions
 
+frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
+
 clean:
-rm frontend.h.rst
diff --git a/Documentation/linux_tv/audio.h.rst 
b/Documentation/linux_tv/audio.h.rst
deleted file mode 100644
index 42b7b41ec120..
--- a/Documentation/linux_tv/audio.h.rst
+++ /dev/null
@@ -1,142 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: audio.h
-=
-
-.. code-block:: c
-
-/*
- * audio.h
- *
- * Copyright (C) 2000 Ralph  Metzler 
- *  & Marcus Metzler 
- *for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _DVBAUDIO_H_
-#define _DVBAUDIO_H_
-
-#include 
-
-typedef enum {
-   AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
-   AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
-} audio_stream_source_t;
-
-
-typedef enum {
-   AUDIO_STOPPED,  /* Device is stopped */
-   AUDIO_PLAYING,  /* Device is currently playing */
-   AUDIO_PAUSED/* Device is paused */
-} audio_play_state_t;
-
-
-typedef enum {
-   AUDIO_STEREO,
-   AUDIO_MONO_LEFT,
-   AUDIO_MONO_RIGHT,
-   AUDIO_MONO,
-   AUDIO_STEREO_SWAPPED
-} audio_channel_select_t;
-
-
-typedef struct audio_mixer {
-   unsigned int volume_left;
-   unsigned int volume_right;
-  // what else do we need? bass, pass-through, ...
-} audio_mixer_t;
-
-
-typedef struct audio_status {
-   intAV_sync_state;  /* sync audio and video? */
-   intmute_state; /* audio is muted */
-   audio_play_state_t play_state; /* current playback state */
-   audio_stream_source_t  stream_source;  /* current stream source */
-   audio_channel_select_t channel_select; /* currently selected 
channel */
-   intbypass_mode;/* pass on audio data to */
-   audio_mixer_t  mixer_state;/* current mixer state */
-} audio_status_t;  /* separate decoder 
hardware */
-
-
-typedef
-struct audio_karaoke {  /* if Vocal1 or Vocal2 are non-zero, they get 
mixed  */
-   int vocal1;/* into left and right t at 70% each */
-   int vocal2;/* if both, Vocal1 and Vocal2 are non-zero, Vocal1 
gets*/
-   int melody;/* mixed into the left channel and */
-  /* Vocal2 into the right channel at 100% each. */
-  /* if Melody is non-zero, the melody channel gets 
mixed*/
-} audio_karaoke

[PATCH 45/54] doc-rst: autogenerate videodev2.h.rst file

2016-07-08 Thread Mauro Carvalho Chehab
This file comes from the uAPI definitions for V4L2, with is dynamic
and updated on almost every Kernel version. So, this file
needs to be auto-updated, as otherwise the documentation will
become obsolete too early.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile|6 +-
 Documentation/linux_tv/media/v4l/audio.rst |8 +-
 Documentation/linux_tv/media/v4l/hist-v4l2.rst |4 +-
 .../linux_tv/media/v4l/vidioc-enumaudioout.rst |4 +-
 .../linux_tv/media/v4l/vidioc-g-audioout.rst   |2 +-
 Documentation/linux_tv/videodev2.h.rst | 2300 
 Documentation/linux_tv/videodev2.h.rst.exceptions  |  591 +
 7 files changed, 605 insertions(+), 2310 deletions(-)
 delete mode 100644 Documentation/linux_tv/videodev2.h.rst
 create mode 100644 Documentation/linux_tv/videodev2.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 1773132008da..068e26e0cc6f 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -2,7 +2,8 @@
 
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
-TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst
+TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
+ videodev2.h.rst
 
 htmldocs: ${TARGETS}
 
@@ -24,5 +25,8 @@ net.h.rst: ${PARSER} ${UAPI}/dvb/net.h  net.h.rst.exceptions
 video.h.rst: ${PARSER} ${UAPI}/dvb/video.h  video.h.rst.exceptions
${PARSER} ${UAPI}/dvb/video.h $@ video.h.rst.exceptions
 
+videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} videodev2.h.rst.exceptions
+   ${PARSER} ${UAPI}/videodev2.h $@ videodev2.h.rst.exceptions
+
 cleandocs:
-rm ${TARGETS}
diff --git a/Documentation/linux_tv/media/v4l/audio.rst 
b/Documentation/linux_tv/media/v4l/audio.rst
index b6c41c35a744..71502f0bf8bd 100644
--- a/Documentation/linux_tv/media/v4l/audio.rst
+++ b/Documentation/linux_tv/media/v4l/audio.rst
@@ -28,23 +28,23 @@ number, starting at zero, of one audio input or output.
 To learn about the number and attributes of the available inputs and
 outputs applications can enumerate them with the
 :ref:`VIDIOC_ENUMAUDIO` and
-:ref:`VIDIOC_ENUMAUDOUT ` ioctl, respectively.
+:ref:`VIDIOC_ENUMAUDOUT ` ioctl, respectively.
 The struct :ref:`v4l2_audio ` returned by the
 :ref:`VIDIOC_ENUMAUDIO` ioctl also contains signal
 :status information applicable when the current audio input is queried.
 
 The :ref:`VIDIOC_G_AUDIO ` and
-:ref:`VIDIOC_G_AUDOUT ` ioctls report the current
+:ref:`VIDIOC_G_AUDOUT ` ioctls report the current
 audio input and output, respectively. Note that, unlike
 :ref:`VIDIOC_G_INPUT ` and
 :ref:`VIDIOC_G_OUTPUT ` these ioctls return a
 structure as :ref:`VIDIOC_ENUMAUDIO` and
-:ref:`VIDIOC_ENUMAUDOUT ` do, not just an index.
+:ref:`VIDIOC_ENUMAUDOUT ` do, not just an index.
 
 To select an audio input and change its properties applications call the
 :ref:`VIDIOC_S_AUDIO ` ioctl. To select an audio
 output (which presently has no changeable properties) applications call
-the :ref:`VIDIOC_S_AUDOUT ` ioctl.
+the :ref:`VIDIOC_S_AUDOUT ` ioctl.
 
 Drivers must implement all audio input ioctls when the device has
 multiple selectable audio inputs, all audio output ioctls when the
diff --git a/Documentation/linux_tv/media/v4l/hist-v4l2.rst 
b/Documentation/linux_tv/media/v4l/hist-v4l2.rst
index 7dac98c5dc95..a571e099fde7 100644
--- a/Documentation/linux_tv/media/v4l/hist-v4l2.rst
+++ b/Documentation/linux_tv/media/v4l/hist-v4l2.rst
@@ -727,8 +727,8 @@ V4L2 2003-06-19
audio input.
 
The same changes were made to
-   :ref:`VIDIOC_G_AUDOUT ` and
-   :ref:`VIDIOC_ENUMAUDOUT `.
+   :ref:`VIDIOC_G_AUDOUT ` and
+   :ref:`VIDIOC_ENUMAUDOUT `.
 
Until further the "videodev" module will automatically translate
between the old and new ioctls, but drivers and applications must be
diff --git a/Documentation/linux_tv/media/v4l/vidioc-enumaudioout.rst 
b/Documentation/linux_tv/media/v4l/vidioc-enumaudioout.rst
index 4c1756319c09..15bc5a40f4a6 100644
--- a/Documentation/linux_tv/media/v4l/vidioc-enumaudioout.rst
+++ b/Documentation/linux_tv/media/v4l/vidioc-enumaudioout.rst
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _VIDIOC_ENUMAUDIOOUT:
+.. _VIDIOC_ENUMAUDOUT:
 
 ***
 ioctl VIDIOC_ENUMAUDOUT
@@ -44,7 +44,7 @@ zero, incrementing by one until the driver returns ``EINVAL``.
 Note connectors on a TV card to loop back the received audio signal to a
 sound card are not audio outputs in this sense.
 
-See :ref:`VIDIOC_G_AUDIOout ` for a description of struct
+See :ref:`VIDIOC_G_AUDIOout ` for a description of struct
 :ref:`v4l2_audioout `.
 
 
diff --git a/Documentation/linux_tv/media/v4l/vidioc-g-audioout.rst 
b/Documentation/linux_tv/media/v4l/vidioc-g-audioout.rst
index e36b5a116332..bee5f78ed7c1 100644
--- a/Documentation/linux_tv/media/v4l/vidioc-g-audioout.rst
+++ b/Documenta

[PATCH 39/54] doc-rst: auto-generate ca.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This file comes from the uAPI definition header, and
should be auto-generated, to be in sync with Kernel changes.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile|  5 +-
 Documentation/linux_tv/ca.h.rst| 97 --
 Documentation/linux_tv/ca.h.rst.exceptions | 24 
 3 files changed, 28 insertions(+), 98 deletions(-)
 delete mode 100644 Documentation/linux_tv/ca.h.rst
 create mode 100644 Documentation/linux_tv/ca.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 2eb958e91eab..7ee14195802f 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -3,11 +3,14 @@
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
 
-htmldocs: audio.h.rst dmx.h.rst frontend.h.rst
+htmldocs: audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst
 
 audio.h.rst: ${PARSER} ${UAPI}/dvb/audio.h  audio.h.rst.exceptions
${PARSER} ${UAPI}/dvb/audio.h $@ audio.h.rst.exceptions
 
+ca.h.rst: ${PARSER} ${UAPI}/dvb/ca.h  ca.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/ca.h $@ ca.h.rst.exceptions
+
 dmx.h.rst: ${PARSER} ${UAPI}/dvb/dmx.h  dmx.h.rst.exceptions
${PARSER} ${UAPI}/dvb/dmx.h $@ dmx.h.rst.exceptions
 
diff --git a/Documentation/linux_tv/ca.h.rst b/Documentation/linux_tv/ca.h.rst
deleted file mode 100644
index e86e73510ffc..
--- a/Documentation/linux_tv/ca.h.rst
+++ /dev/null
@@ -1,97 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: ca.h
-==
-
-.. code-block:: c
-
-/*
- * ca.h
- *
- * Copyright (C) 2000 Ralph  Metzler 
- *  & Marcus Metzler 
- *for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _DVBCA_H_
-#define _DVBCA_H_
-
-/* slot interface types and info */
-
-typedef struct ca_slot_info {
-   int num;   /* slot number */
-
-   int type;  /* CA interface this slot supports */
-#define CA_CI1 /* CI high level interface */
-#define CA_CI_LINK   2 /* CI link layer level interface */
-#define CA_CI_PHYS   4 /* CI physical layer level interface */
-#define CA_DESCR 8 /* built-in descrambler */
-#define CA_SC  128 /* simple smart card interface */
-
-   unsigned int flags;
-#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
-#define CA_CI_MODULE_READY   2
-} ca_slot_info_t;
-
-
-/* descrambler types and info */
-
-typedef struct ca_descr_info {
-   unsigned int num;  /* number of available descramblers 
(keys) */
-   unsigned int type; /* type of supported scrambling system */
-#define CA_ECD   1
-#define CA_NDS   2
-#define CA_DSS   4
-} ca_descr_info_t;
-
-typedef struct ca_caps {
-   unsigned int slot_num; /* total number of CA card and module 
slots */
-   unsigned int slot_type;/* OR of all supported types */
-   unsigned int descr_num;/* total number of descrambler slots 
(keys) */
-   unsigned int descr_type;   /* OR of all supported types */
-} ca_caps_t;
-
-/* a message to/from a CI-CAM */
-typedef struct ca_msg {
-   unsigned int index;
-   unsigned int type;
-   unsigned int length;
-   unsigned char msg[256];
-} ca_msg_t;
-
-typedef struct ca_descr {
-   unsigned int index;
-   unsigned int parity;/* 0 == even, 1 == odd */
-   unsigned char cw[8];
-} ca_descr_t;
-
-typedef struct ca_pid {
-   unsigned int pid;
-   int index;  /* -1 == disable*/
-} ca_pid_t;
-
-#define CA_RESET  _IO('o', 128)
-#define CA_GET_CAP_IOR('o', 129, ca_caps_t)
-#define CA_GET_SLOT_INFO  _IOR('o', 130, ca_slot_info_t)
-#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
-#define CA_GET_MSG_IOR('o', 132, ca_msg_t)
-#define CA_SEND_MSG   _IOW('o', 133, ca_msg_t)
-#define CA_SET_DESCR  _IOW('o', 134, ca_desc

[PATCH 24/54] doc-rst: gen-errors: Improve table layout

2016-07-08 Thread Mauro Carvalho Chehab
Add a :widths: at the flat-table, to make it to look nicer.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/gen-errors.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/linux_tv/media/gen-errors.rst 
b/Documentation/linux_tv/media/gen-errors.rst
index 6dc76b2461df..6cd5d26f32ab 100644
--- a/Documentation/linux_tv/media/gen-errors.rst
+++ b/Documentation/linux_tv/media/gen-errors.rst
@@ -12,6 +12,7 @@ Generic Error Codes
 .. flat-table:: Generic error codes
 :header-rows:  0
 :stub-columns: 0
+:widths: 1 16
 
 
 -  .. row 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 37/54] doc-rst: auto-generate dmx.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This file should be auto-generated from the header files,
and not hardcoded.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/Makefile |   5 +-
 Documentation/linux_tv/dmx.h.rst| 162 
 Documentation/linux_tv/dmx.h.rst.exceptions |  63 +++
 3 files changed, 67 insertions(+), 163 deletions(-)
 delete mode 100644 Documentation/linux_tv/dmx.h.rst
 create mode 100644 Documentation/linux_tv/dmx.h.rst.exceptions

diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index d5570193ea30..2ef624e40bd9 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -3,10 +3,13 @@
 PARSER = ../sphinx/parse-headers.pl
 UAPI = ../../include/uapi/linux
 
-htmldocs: frontend.h.rst
+htmldocs: frontend.h.rst dmx.h.rst
 
 frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
 
+dmx.h.rst: ${PARSER} ${UAPI}/dvb/dmx.h  dmx.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/dmx.h $@ dmx.h.rst.exceptions
+
 clean:
-rm frontend.h.rst
diff --git a/Documentation/linux_tv/dmx.h.rst b/Documentation/linux_tv/dmx.h.rst
deleted file mode 100644
index 05686c09aebc..
--- a/Documentation/linux_tv/dmx.h.rst
+++ /dev/null
@@ -1,162 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: dmx.h
-===
-
-.. code-block:: c
-
-/*
- * dmx.h
- *
- * Copyright (C) 2000 Marcus Metzler 
- *  & Ralph  Metzler 
- *for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _UAPI_DVBDMX_H_
-#define _UAPI_DVBDMX_H_
-
-#include 
-#ifndef __KERNEL__
-#include 
-#endif
-
-
-#define DMX_FILTER_SIZE 16
-
-enum dmx_output
-{
-   DMX_OUT_DECODER, /* Streaming directly to decoder. */
-   DMX_OUT_TAP, /* Output going to a memory buffer */
-/* (to be retrieved via the read command).*/
-   DMX_OUT_TS_TAP,  /* Output multiplexed into a new TS  */
-/* (to be retrieved by reading from the */
-/* logical DVR device). */
-   DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX 
device */
-};
-
-typedef enum dmx_output dmx_output_t;
-
-typedef enum dmx_input
-{
-   DMX_IN_FRONTEND, /* Input from a front-end device.  */
-   DMX_IN_DVR   /* Input from the logical DVR device.  */
-} dmx_input_t;
-
-
-typedef enum dmx_ts_pes
-{
-   DMX_PES_AUDIO0,
-   DMX_PES_VIDEO0,
-   DMX_PES_TELETEXT0,
-   DMX_PES_SUBTITLE0,
-   DMX_PES_PCR0,
-
-   DMX_PES_AUDIO1,
-   DMX_PES_VIDEO1,
-   DMX_PES_TELETEXT1,
-   DMX_PES_SUBTITLE1,
-   DMX_PES_PCR1,
-
-   DMX_PES_AUDIO2,
-   DMX_PES_VIDEO2,
-   DMX_PES_TELETEXT2,
-   DMX_PES_SUBTITLE2,
-   DMX_PES_PCR2,
-
-   DMX_PES_AUDIO3,
-   DMX_PES_VIDEO3,
-   DMX_PES_TELETEXT3,
-   DMX_PES_SUBTITLE3,
-   DMX_PES_PCR3,
-
-   DMX_PES_OTHER
-} dmx_pes_type_t;
-
-#define DMX_PES_AUDIODMX_PES_AUDIO0
-#define DMX_PES_VIDEODMX_PES_VIDEO0
-#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
-#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
-#define DMX_PES_PCR  DMX_PES_PCR0
-
-
-typedef struct dmx_filter
-{
-   __u8  filter[DMX_FILTER_SIZE];
-   __u8  mask[DMX_FILTER_SIZE];
-   __u8  mode[DMX_FILTER_SIZE];
-} dmx_filter_t;
-
-
-struct dmx_sct_filter_params
-{
-   __u16  pid;
-   dmx_filter_t   filter;
-   __u32  timeout;
-   __u32  flags;
-#define DMX_CHECK_CRC   1
-#define DMX_ONESHOT 2
-#define DMX_IMMEDIATE_START 4
-#define DMX_KERNEL_CLIENT   0x8000
-};
-
-
-struct dmx_pes_filter_params
-{
-   __u16  pid;
-   dmx_input_tinput;
-   dmx_output_t   output;
-   dmx_pes_type_t pes_ty

[PATCH 26/54] doc-rst: Rename the title of the Digital TV section

2016-07-08 Thread Mauro Carvalho Chehab
The Digital TV section is ackward for two reasons:

  1) it is the only one with everything in upper case;
  2) its name is associated with the European digital TV standard.

Rename the part name, and add a notice that it refers to what's
known as "DVB API".

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/dvbapi.rst | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/dvbapi.rst 
b/Documentation/linux_tv/media/dvb/dvbapi.rst
index 3a7d39e98fa3..60fb3d46b1d6 100644
--- a/Documentation/linux_tv/media/dvb/dvbapi.rst
+++ b/Documentation/linux_tv/media/dvb/dvbapi.rst
@@ -4,9 +4,12 @@
 
 .. _dvbapi:
 
-#
-LINUX DVB API
-#
+##
+Digital TV API
+##
+
+**NOTE:** This API is also known as **DVB API**, although it is generic
+enough to support all digital TV standards.
 
 **Version 5.10**
 
-- 
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/54] doc-rst: remote_controllers: fix conversion issues

2016-07-08 Thread Mauro Carvalho Chehab
Make it look like V4L, DVB and MC docbooks initial page.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/rc/remote_controllers.rst | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/Documentation/linux_tv/media/rc/remote_controllers.rst 
b/Documentation/linux_tv/media/rc/remote_controllers.rst
index 4b36e992f59a..bccceb1e28c3 100644
--- a/Documentation/linux_tv/media/rc/remote_controllers.rst
+++ b/Documentation/linux_tv/media/rc/remote_controllers.rst
@@ -1,5 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
+.. include:: 
+
 .. _remotes:
 
 #
@@ -15,6 +17,7 @@ Remote Controllers
 
 .. toctree::
 :maxdepth: 1
+:numbered:
 
 Remote_controllers_Intro
 remote_controllers_sysfs_nodes
@@ -27,12 +30,17 @@ Remote Controllers
 Revision and Copyright
 **
 
+Authors:
 
-:author:Chehab Mauro (*Carvalho*)
-:address:   m.che...@samsung.com
-:contrib:   Initial version.
+- Carvalho Chehab, Mauro 
 
-**Copyright** 2009-2014 : Mauro Carvalho Chehab
+ - Initial version.
+
+**Copyright** |copy| 2009-2016 : Mauro Carvalho Chehab
+
+
+Revision History
+
 
 :revision: 3.15 / 2014-02-06 (*mcc*)
 
-- 
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 12/54] doc-rst: dev-overlay: fix the last warning

2016-07-08 Thread Mauro Carvalho Chehab
Fixes this warning:

Documentation/linux_tv/media/v4l/dev-overlay.rst:247: WARNING: Title underline 
too short.

struct v4l2_clip [4]_


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

diff --git a/Documentation/linux_tv/media/v4l/dev-overlay.rst 
b/Documentation/linux_tv/media/v4l/dev-overlay.rst
index e481d677aa3f..bed00bf34982 100644
--- a/Documentation/linux_tv/media/v4l/dev-overlay.rst
+++ b/Documentation/linux_tv/media/v4l/dev-overlay.rst
@@ -244,7 +244,7 @@ exceeded are undefined. [3]_
 .. _v4l2-clip:
 
 struct v4l2_clip [4]_
-
+-
 
 ``struct v4l2_rect c``
 Coordinates of the clipping rectangle, relative to the top, left
-- 
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/54] doc-rst: auto-build the frontend.h.rst

2016-07-08 Thread Mauro Carvalho Chehab
This file is auto-generated with DocBook, from the uapi header.

Do the same with Sphinx.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx|   1 +
 Documentation/linux_tv/Makefile  |  12 +
 Documentation/linux_tv/frontend.h.rst| 609 ---
 Documentation/linux_tv/frontend.h.rst.exceptions |  47 ++
 4 files changed, 60 insertions(+), 609 deletions(-)
 create mode 100644 Documentation/linux_tv/Makefile
 delete mode 100644 Documentation/linux_tv/frontend.h.rst
 create mode 100644 Documentation/linux_tv/frontend.h.rst.exceptions

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 810c11f0d37f..37cec114254e 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -35,6 +35,7 @@ quiet_cmd_sphinx = SPHINX  $@
   cmd_sphinx = $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2
 
 htmldocs:
+   $(MAKE) -C $(srctree)/Documentation/linux_tv $@
$(call cmd,sphinx,html)
 
 pdfdocs:
diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
new file mode 100644
index ..d5570193ea30
--- /dev/null
+++ b/Documentation/linux_tv/Makefile
@@ -0,0 +1,12 @@
+# Generate the *.h.rst files from uAPI headers
+
+PARSER = ../sphinx/parse-headers.pl
+UAPI = ../../include/uapi/linux
+
+htmldocs: frontend.h.rst
+
+frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
+   ${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
+
+clean:
+   -rm frontend.h.rst
diff --git a/Documentation/linux_tv/frontend.h.rst 
b/Documentation/linux_tv/frontend.h.rst
deleted file mode 100644
index 51dbf2ab883d..
--- a/Documentation/linux_tv/frontend.h.rst
+++ /dev/null
@@ -1,609 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-file: frontend.h
-
-
-.. code-block:: c
-
-/*
- * frontend.h
- *
- * Copyright (C) 2000 Marcus Metzler 
- *  Ralph  Metzler 
- *  Holger Waechtler 
- *  Andre Draszik 
- *  for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * 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.
- *
- * 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 _DVBFRONTEND_H_
-#define _DVBFRONTEND_H_
-
-#include 
-
-enum fe_type {
-   FE_QPSK,
-   FE_QAM,
-   FE_OFDM,
-   FE_ATSC
-};
-
-enum fe_caps {
-   FE_IS_STUPID= 0,
-   FE_CAN_INVERSION_AUTO   = 0x1,
-   FE_CAN_FEC_1_2  = 0x2,
-   FE_CAN_FEC_2_3  = 0x4,
-   FE_CAN_FEC_3_4  = 0x8,
-   FE_CAN_FEC_4_5  = 0x10,
-   FE_CAN_FEC_5_6  = 0x20,
-   FE_CAN_FEC_6_7  = 0x40,
-   FE_CAN_FEC_7_8  = 0x80,
-   FE_CAN_FEC_8_9  = 0x100,
-   FE_CAN_FEC_AUTO = 0x200,
-   FE_CAN_QPSK = 0x400,
-   FE_CAN_QAM_16   = 0x800,
-   FE_CAN_QAM_32   = 0x1000,
-   FE_CAN_QAM_64   = 0x2000,
-   FE_CAN_QAM_128  = 0x4000,
-   FE_CAN_QAM_256  = 0x8000,
-   FE_CAN_QAM_AUTO = 0x1,
-   FE_CAN_TRANSMISSION_MODE_AUTO   = 0x2,
-   FE_CAN_BANDWIDTH_AUTO   = 0x4,
-   FE_CAN_GUARD_INTERVAL_AUTO  = 0x8,
-   FE_CAN_HIERARCHY_AUTO   = 0x10,
-   FE_CAN_8VSB = 0x20,
-   FE_CAN_16VSB= 0x40,
-   FE_HAS_EXTENDED_CAPS= 0x80,   /* We need more 
bitspace for newer APIs, indicate this. */
-   FE_CAN_MULTISTREAM  = 0x400,  /* frontend supports 
multistream filtering */
-   FE_CAN_TURBO_FEC= 0x800,  /* frontend supports 
"turbo fec modulation" */
-   FE_CAN_2G_MODULATION= 0x1000, /* frontend supports 
"2nd generation modulation" (DVB-S2) */
-   FE_NEEDS_BENDING= 0x2000, /* not supporte

[PATCH 31/54] doc-rst: parse-headers: improve delimiters to detect symbols

2016-07-08 Thread Mauro Carvalho Chehab
As we had to escape the symbols for the ReST markup to not do
the wrong thing, the logic to discover start/end of strings
are not trivial. Improve the end delimiter detection, in order
to highlight more occurrences of the strings.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 287f6459e13a..ec9537ef586f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -200,78 +200,79 @@ $data =~ s,([\_\`\*\<\>\&:\/]),\\$1,g;
 # Add references
 #
 
-my $separators = "[\n \t\,\)\=\:\{\}\;]";
+my $start_delim = "[ \n\t\(\=\*\@]";
+my $end_delim = "(\\s|,|=|:|\\;|\\\)|\\}|\\{)";
 
 foreach my $r (keys %ioctls) {
my $n = $ioctls{$r};
 
-   my $s = ":ref:`$r <$n>`";
+   my $s = "\\ :ref:`$r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/([\s])($r)($separators)/$1$s$3/g;
+   $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
 foreach my $r (keys %defines) {
my $n = $defines{$r};
 
-   my $s = ":ref:`$r <$n>`";
+   my $s = "\\ :ref:`$r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/([\s])($r)($separators)/$1$s$3/g;
+   $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
 foreach my $r (keys %enum_symbols) {
my $n = $enum_symbols{$r};
 
-   my $s = ":ref:`$r <$n>`";
+   my $s = "\\ :ref:`$r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/([\s])($r)($separators)/$1$s$3/g;
+   $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
 foreach my $r (keys %enums) {
my $n = $enums{$r};
 
-   my $s = ":ref:`enum $r <$n>`";
+   my $s = "\\ :ref:`enum $r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/enum\s+($r)($separators)/$s$2/g;
+   $data =~ s/enum\s+($r)$end_delim/$s$2/g;
 }
 
 foreach my $r (keys %structs) {
my $n = $structs{$r};
 
-   my $s = ":ref:`struct $r <$n>`";
+   my $s = "\\ :ref:`struct $r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/struct\s+($r)($separators)/$s$2/g;
+   $data =~ s/struct\s+($r)$end_delim/$s$2/g;
 }
 
 foreach my $r (keys %typedefs) {
my $n = $typedefs{$r};
 
-   my $s = ":ref:`$r <$n>`";
+   my $s = "\\ :ref:`$r <$n>`\\ ";
 
$r =~ s,([\_\`\*\<\>\&:\/]),$1,g;
 
print "$r -> $s\n" if ($debug);
 
-   $data =~ s/([\s\(\,\=])($r)($separators)/$1$s$3/g;
+   $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
 #
-- 
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/54] doc-rst: mediactl: fix some wrong cross references

2016-07-08 Thread Mauro Carvalho Chehab
Those cross references should point to media control syscalls,
and not to V4L ones.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-func-close.rst | 2 +-
 Documentation/linux_tv/media/mediactl/media-func-ioctl.rst | 4 ++--
 Documentation/linux_tv/media/mediactl/media-func-open.rst  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/linux_tv/media/mediactl/media-func-close.rst 
b/Documentation/linux_tv/media/mediactl/media-func-close.rst
index 3f3d9bb1f32a..39ef70ac8656 100644
--- a/Documentation/linux_tv/media/mediactl/media-func-close.rst
+++ b/Documentation/linux_tv/media/mediactl/media-func-close.rst
@@ -40,7 +40,7 @@ are freed. The device configuration remain unchanged.
 Return Value
 
 
-:ref:`close() ` returns 0 on success. On error, -1 is returned, and
+:ref:`close() ` returns 0 on success. On error, -1 is 
returned, and
 ``errno`` is set appropriately. Possible error codes are:
 
 EBADF
diff --git a/Documentation/linux_tv/media/mediactl/media-func-ioctl.rst 
b/Documentation/linux_tv/media/mediactl/media-func-ioctl.rst
index 1b28e2d20de4..9d1b23133edf 100644
--- a/Documentation/linux_tv/media/mediactl/media-func-ioctl.rst
+++ b/Documentation/linux_tv/media/mediactl/media-func-ioctl.rst
@@ -40,8 +40,8 @@ Arguments
 Description
 ===
 
-The :ref:`ioctl() ` function manipulates media device parameters.
-The argument ``fd`` must be an open file descriptor.
+The :ref:`ioctl() ` function manipulates media device
+parameters. The argument ``fd`` must be an open file descriptor.
 
 The ioctl ``request`` code specifies the media function to be called. It
 has encoded in it whether the argument is an input, output or read/write
diff --git a/Documentation/linux_tv/media/mediactl/media-func-open.rst 
b/Documentation/linux_tv/media/mediactl/media-func-open.rst
index 43b9ddc5c38f..2b2ecd85b995 100644
--- a/Documentation/linux_tv/media/mediactl/media-func-open.rst
+++ b/Documentation/linux_tv/media/mediactl/media-func-open.rst
@@ -37,7 +37,7 @@ Arguments
 Description
 ===
 
-To open a media device applications call :ref:`open() ` with the
+To open a media device applications call :ref:`open() ` with 
the
 desired device name. The function has no side effects; the device
 configuration remain unchanged.
 
-- 
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/54] doc-rst: linux_tv: use :cpp:function:: on all syscalls

2016-07-08 Thread Mauro Carvalho Chehab
Now that we have one syscall per page, using :cpp:function::
cleans up almost all warnings, with is a great thing.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/dvb/audio-bilingual-channel-select.rst |  2 +-
 .../linux_tv/media/dvb/audio-channel-select.rst  |  2 +-
 .../linux_tv/media/dvb/audio-clear-buffer.rst|  2 +-
 Documentation/linux_tv/media/dvb/audio-continue.rst  |  2 +-
 Documentation/linux_tv/media/dvb/audio-fclose.rst|  2 +-
 Documentation/linux_tv/media/dvb/audio-fopen.rst |  2 +-
 Documentation/linux_tv/media/dvb/audio-fwrite.rst|  2 +-
 .../linux_tv/media/dvb/audio-get-capabilities.rst|  2 +-
 Documentation/linux_tv/media/dvb/audio-get-pts.rst   |  2 +-
 .../linux_tv/media/dvb/audio-get-status.rst  |  2 +-
 Documentation/linux_tv/media/dvb/audio-pause.rst |  2 +-
 Documentation/linux_tv/media/dvb/audio-play.rst  |  2 +-
 .../linux_tv/media/dvb/audio-select-source.rst   |  2 +-
 .../linux_tv/media/dvb/audio-set-attributes.rst  |  2 +-
 .../linux_tv/media/dvb/audio-set-av-sync.rst |  2 +-
 .../linux_tv/media/dvb/audio-set-bypass-mode.rst |  2 +-
 .../linux_tv/media/dvb/audio-set-ext-id.rst  |  2 +-
 Documentation/linux_tv/media/dvb/audio-set-id.rst|  2 +-
 .../linux_tv/media/dvb/audio-set-karaoke.rst |  2 +-
 Documentation/linux_tv/media/dvb/audio-set-mixer.rst |  2 +-
 Documentation/linux_tv/media/dvb/audio-set-mute.rst  |  2 +-
 .../linux_tv/media/dvb/audio-set-streamtype.rst  |  2 +-
 Documentation/linux_tv/media/dvb/audio-stop.rst  |  2 +-
 Documentation/linux_tv/media/dvb/dmx-add-pid.rst |  2 +-
 Documentation/linux_tv/media/dvb/dmx-fclose.rst  |  2 +-
 Documentation/linux_tv/media/dvb/dmx-fopen.rst   |  2 +-
 Documentation/linux_tv/media/dvb/dmx-fread.rst   |  2 +-
 Documentation/linux_tv/media/dvb/dmx-fwrite.rst  |  2 +-
 Documentation/linux_tv/media/dvb/dmx-get-caps.rst|  2 +-
 Documentation/linux_tv/media/dvb/dmx-get-event.rst   |  2 +-
 .../linux_tv/media/dvb/dmx-get-pes-pids.rst  |  2 +-
 Documentation/linux_tv/media/dvb/dmx-get-stc.rst |  2 +-
 Documentation/linux_tv/media/dvb/dmx-remove-pid.rst  |  2 +-
 .../linux_tv/media/dvb/dmx-set-buffer-size.rst   |  2 +-
 Documentation/linux_tv/media/dvb/dmx-set-filter.rst  |  2 +-
 .../linux_tv/media/dvb/dmx-set-pes-filter.rst|  2 +-
 Documentation/linux_tv/media/dvb/dmx-set-source.rst  |  2 +-
 Documentation/linux_tv/media/dvb/dmx-start.rst   |  2 +-
 Documentation/linux_tv/media/dvb/dmx-stop.rst|  2 +-
 .../linux_tv/media/dvb/fe-diseqc-send-burst.rst  |  2 +-
 .../linux_tv/media/dvb/fe-diseqc-send-master-cmd.rst | 20 +++-
 .../media/dvb/fe-dishnetwork-send-legacy-cmd.rst |  2 +-
 Documentation/linux_tv/media/dvb/fe-get-event.rst|  2 +-
 Documentation/linux_tv/media/dvb/fe-get-frontend.rst |  2 +-
 Documentation/linux_tv/media/dvb/fe-read-ber.rst |  2 +-
 .../linux_tv/media/dvb/fe-read-signal-strength.rst   |  2 +-
 Documentation/linux_tv/media/dvb/fe-read-snr.rst |  2 +-
 .../media/dvb/fe-read-uncorrected-blocks.rst |  2 +-
 Documentation/linux_tv/media/dvb/fe-set-frontend.rst |  2 +-
 Documentation/linux_tv/media/dvb/fe-set-tone.rst |  2 +-
 Documentation/linux_tv/media/dvb/fe-set-voltage.rst  |  2 +-
 .../linux_tv/media/dvb/video-clear-buffer.rst|  2 +-
 Documentation/linux_tv/media/dvb/video-command.rst   |  2 +-
 Documentation/linux_tv/media/dvb/video-continue.rst  |  2 +-
 .../linux_tv/media/dvb/video-fast-forward.rst|  2 +-
 Documentation/linux_tv/media/dvb/video-fclose.rst|  2 +-
 Documentation/linux_tv/media/dvb/video-fopen.rst |  2 +-
 Documentation/linux_tv/media/dvb/video-freeze.rst|  2 +-
 Documentation/linux_tv/media/dvb/video-fwrite.rst|  2 +-
 .../linux_tv/media/dvb/video-get-capabilities.rst|  2 +-
 Documentation/linux_tv/media/dvb/video-get-event.rst |  2 +-
 .../linux_tv/media/dvb/video-get-frame-count.rst |  2 +-
 .../linux_tv/media/dvb/video-get-frame-rate.rst  |  2 +-
 Documentation/linux_tv/media/dvb/video-get-navi.rst  |  2 +-
 Documentation/linux_tv/media/dvb/video-get-pts.rst   |  2 +-
 Documentation/linux_tv/media/dvb/video-get-size.rst  |  2 +-
 .../linux_tv/media/dvb/video-get-status.rst  |  2 +-
 Documentation/linux_tv/media/dvb/video-play.rst  |  2 +-
 .../linux_tv/media/dvb/video-select-source.rst   |  2 +-
 .../linux_tv/media/dvb/video-set-attributes.rst  |  2 +-
 Documentation/linux_tv/media/dvb/video-set-blank.rst |  2 +-
 .../linux_tv/media/dvb/video-set-display-format.rst  |  2 +-
 .../linux_tv/media/dvb/video-set-format.rst  |  2 +-
 .../linux_tv/media/dvb/video-set-highlight.rst   |  2 +-
 Documentation/linux_tv/media/dvb/video-set-id.rst|  2 +-
 .../linux_tv/media/dvb/video-set-spu-palette.rst |  2 +-
 Documentation/linux_tv/media/dvb/video-set-spu.rst   |  2 +-
 .../linux_tv/media/dvb/video-set-streamtype.rst 

[PATCH 22/54] doc-rst: media-ioc-g-topology: Fix tables

2016-07-08 Thread Mauro Carvalho Chehab
The tables were not properly converted. It looked a little
ackward already at DocBook, but the conversion made it worse.

Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/mediactl/media-ioc-g-topology.rst| 63 +++---
 1 file changed, 6 insertions(+), 57 deletions(-)

diff --git a/Documentation/linux_tv/media/mediactl/media-ioc-g-topology.rst 
b/Documentation/linux_tv/media/mediactl/media-ioc-g-topology.rst
index badcdf6133e2..1f2d530aa284 100644
--- a/Documentation/linux_tv/media/mediactl/media-ioc-g-topology.rst
+++ b/Documentation/linux_tv/media/mediactl/media-ioc-g-topology.rst
@@ -54,6 +54,7 @@ desired arrays with the media graph elements.
 .. flat-table:: struct media_v2_topology
 :header-rows:  0
 :stub-columns: 0
+:widths: 1 2 8
 
 
 -  .. row 1
@@ -62,8 +63,6 @@ desired arrays with the media graph elements.
 
-  ``topology_version``
 
-   -
-   -
-  Version of the media graph topology. When the graph is created,
  this field starts with zero. Every time a graph element is added
  or removed, this field is incremented.
@@ -74,8 +73,6 @@ desired arrays with the media graph elements.
 
-  ``num_entities``
 
-   -
-   -
-  Number of entities in the graph
 
 -  .. row 3
@@ -84,8 +81,6 @@ desired arrays with the media graph elements.
 
-  ``ptr_entities``
 
-   -
-   -
-  A pointer to a memory area where the entities array will be
  stored, converted to a 64-bits integer. It can be zero. if zero,
  the ioctl won't store the entities. It will just update
@@ -97,8 +92,6 @@ desired arrays with the media graph elements.
 
-  ``num_interfaces``
 
-   -
-   -
-  Number of interfaces in the graph
 
 -  .. row 5
@@ -107,8 +100,6 @@ desired arrays with the media graph elements.
 
-  ``ptr_interfaces``
 
-   -
-   -
-  A pointer to a memory area where the interfaces array will be
  stored, converted to a 64-bits integer. It can be zero. if zero,
  the ioctl won't store the interfaces. It will just update
@@ -120,8 +111,6 @@ desired arrays with the media graph elements.
 
-  ``num_pads``
 
-   -
-   -
-  Total number of pads in the graph
 
 -  .. row 7
@@ -130,8 +119,6 @@ desired arrays with the media graph elements.
 
-  ``ptr_pads``
 
-   -
-   -
-  A pointer to a memory area where the pads array will be stored,
  converted to a 64-bits integer. It can be zero. if zero, the ioctl
  won't store the pads. It will just update ``num_pads``
@@ -142,8 +129,6 @@ desired arrays with the media graph elements.
 
-  ``num_links``
 
-   -
-   -
-  Total number of data and interface links in the graph
 
 -  .. row 9
@@ -152,8 +137,6 @@ desired arrays with the media graph elements.
 
-  ``ptr_links``
 
-   -
-   -
-  A pointer to a memory area where the links array will be stored,
  converted to a 64-bits integer. It can be zero. if zero, the ioctl
  won't store the links. It will just update ``num_links``
@@ -165,6 +148,7 @@ desired arrays with the media graph elements.
 .. flat-table:: struct media_v2_entity
 :header-rows:  0
 :stub-columns: 0
+:widths: 1 2 8
 
 
 -  .. row 1
@@ -173,8 +157,6 @@ desired arrays with the media graph elements.
 
-  ``id``
 
-   -
-   -
-  Unique ID for the entity.
 
 -  .. row 2
@@ -183,8 +165,6 @@ desired arrays with the media graph elements.
 
-  ``name``\ [64]
 
-   -
-   -
-  Entity name as an UTF-8 NULL-terminated string.
 
 -  .. row 3
@@ -193,8 +173,6 @@ desired arrays with the media graph elements.
 
-  ``function``
 
-   -
-   -
-  Entity main function, see :ref:`media-entity-type` for details.
 
 -  .. row 4
@@ -213,7 +191,7 @@ desired arrays with the media graph elements.
 .. flat-table:: struct media_v2_interface
 :header-rows:  0
 :stub-columns: 0
-
+:widths: 1 2 8
 
 -  .. row 1
 
@@ -221,8 +199,6 @@ desired arrays with the media graph elements.
 
-  ``id``
 
-   -
-   -
-  Unique ID for the interface.
 
 -  .. row 2
@@ -231,8 +207,6 @@ desired arrays with the media graph elements.
 
-  ``intf_type``
 
-   -
-   -
-  Interface type, see :ref:`media-intf-type` for details.
 
 -  .. row 3
@@ -241,8 +215,6 @@ desired arrays with the media graph elements.
 
-  ``flags``
 
-   -
-   -
-  Interface flags. Currently unused.
 
 -  .. row 4
@@ -251,8 +223,6 @@ desired arrays with the media graph elements.
 
-  ``reserved``\ [9]
 
-   -
-   -
-  Reserved for future extensions. Drivers and applications must set
  this array to zero.
 
@@ -262,8 +232,6 @@ desired arrays with the media graph elements.
 
   

[PATCH 36/54] doc-rst: parse-headers: fix multiline typedef handler

2016-07-08 Thread Mauro Carvalho Chehab
The typedef handler should do two things to be generic:
  1) parse typedef enums;
  2) accept both possible syntaxes:
 typedef struct foo { .. } foo_t;
 typedef struct { .. } foo_t;

Unfortunately, this is needed to parse some legacy DVB
files, like dvb/audio.h.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index b657cadb53ae..b703f1a7f432 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -109,10 +109,11 @@ close IN;
 # Handle multi-line typedefs
 #
 
-my @matches = $data =~ m/typedef\s+struct\s+\S+\s*\{[^\}]+\}\s*(\S+)\s*\;/g;
+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 = $1;
-   my $n = $1;
+   my $s = $m;
+   my $n = $m;
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;
 
-- 
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 51/54] doc-rst: linux_tv/Makefile: Honor quiet mode

2016-07-08 Thread Mauro Carvalho Chehab
Cleanup the Makefile and handle the V=1 flag and make it
to work when specifying an output directory with O=dir

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx   |  2 +-
 Documentation/linux_tv/Makefile | 49 +++--
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 37cec114254e..6a093e4397b4 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -35,7 +35,7 @@ quiet_cmd_sphinx = SPHINX  $@
   cmd_sphinx = $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2
 
 htmldocs:
-   $(MAKE) -C $(srctree)/Documentation/linux_tv $@
+   $(MAKE) BUILDDIR=$(objtree)/$(BUILDDIR) -f 
$(srctree)/Documentation/linux_tv/Makefile $@
$(call cmd,sphinx,html)
 
 pdfdocs:
diff --git a/Documentation/linux_tv/Makefile b/Documentation/linux_tv/Makefile
index 068e26e0cc6f..639b994a50f6 100644
--- a/Documentation/linux_tv/Makefile
+++ b/Documentation/linux_tv/Makefile
@@ -1,32 +1,47 @@
 # Generate the *.h.rst files from uAPI headers
 
-PARSER = ../sphinx/parse-headers.pl
-UAPI = ../../include/uapi/linux
-TARGETS = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
+PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
+UAPI = $(srctree)/include/uapi/linux
+SRC_DIR=$(srctree)/Documentation/linux_tv
+
+FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
  videodev2.h.rst
 
+TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
+
 htmldocs: ${TARGETS}
 
-audio.h.rst: ${PARSER} ${UAPI}/dvb/audio.h  audio.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/audio.h $@ audio.h.rst.exceptions
+# Rule to convert a .h file to inline RST documentation
 
-ca.h.rst: ${PARSER} ${UAPI}/dvb/ca.h  ca.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/ca.h $@ ca.h.rst.exceptions
+gen_rst = \
+   echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
+   ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
 
-dmx.h.rst: ${PARSER} ${UAPI}/dvb/dmx.h  dmx.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/dmx.h $@ dmx.h.rst.exceptions
+quiet_gen_rst = echo '  PARSE   $(patsubst $(srctree)/%,%,$<)'; \
+   ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
 
-frontend.h.rst: ${PARSER} ${UAPI}/dvb/frontend.h  frontend.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/frontend.h $@ frontend.h.rst.exceptions
+silent_gen_rst = ${gen_rst}
 
-net.h.rst: ${PARSER} ${UAPI}/dvb/net.h  net.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/net.h $@ net.h.rst.exceptions
+$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} 
$(SRC_DIR)/audio.h.rst.exceptions
+   @$($(quiet)gen_rst)
 
-video.h.rst: ${PARSER} ${UAPI}/dvb/video.h  video.h.rst.exceptions
-   ${PARSER} ${UAPI}/dvb/video.h $@ video.h.rst.exceptions
+$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
+   @$($(quiet)gen_rst)
 
-videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} videodev2.h.rst.exceptions
-   ${PARSER} ${UAPI}/videodev2.h $@ videodev2.h.rst.exceptions
+$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} 
$(SRC_DIR)/dmx.h.rst.exceptions
+   @$($(quiet)gen_rst)
+
+$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} 
$(SRC_DIR)/frontend.h.rst.exceptions
+   @$($(quiet)gen_rst)
+
+$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} 
$(SRC_DIR)/net.h.rst.exceptions
+   @$($(quiet)gen_rst)
+
+$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} 
$(SRC_DIR)/video.h.rst.exceptions
+   @$($(quiet)gen_rst)
+
+videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} 
$(SRC_DIR)/videodev2.h.rst.exceptions
+   @$($(quiet)gen_rst)
 
 cleandocs:
-rm ${TARGETS}
-- 
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 50/54] doc-rst: videodev2.h: add cross-references for defines

2016-07-08 Thread Mauro Carvalho Chehab
Remove most of ignore stuff for defines, pointing them to the
proper tables/sections.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../linux_tv/media/v4l/vidioc-dv-timings-cap.rst   |   8 +-
 .../linux_tv/media/v4l/vidioc-g-dv-timings.rst |  26 +-
 Documentation/linux_tv/videodev2.h.rst.exceptions  | 618 -
 3 files changed, 367 insertions(+), 285 deletions(-)

diff --git a/Documentation/linux_tv/media/v4l/vidioc-dv-timings-cap.rst 
b/Documentation/linux_tv/media/v4l/vidioc-dv-timings-cap.rst
index b56cdef7673e..5a35bb254b4b 100644
--- a/Documentation/linux_tv/media/v4l/vidioc-dv-timings-cap.rst
+++ b/Documentation/linux_tv/media/v4l/vidioc-dv-timings-cap.rst
@@ -217,26 +217,26 @@ that doesn't support them will return an ``EINVAL`` error 
code.
 
 -  .. row 3
 
-   -  V4L2_DV_BT_CAP_INTERLACED
+   -  ``V4L2_DV_BT_CAP_INTERLACED``
 
-  Interlaced formats are supported.
 
 -  .. row 4
 
-   -  V4L2_DV_BT_CAP_PROGRESSIVE
+   -  ``V4L2_DV_BT_CAP_PROGRESSIVE``
 
-  Progressive formats are supported.
 
 -  .. row 5
 
-   -  V4L2_DV_BT_CAP_REDUCED_BLANKING
+   -  ``V4L2_DV_BT_CAP_REDUCED_BLANKING``
 
-  CVT/GTF specific: the timings can make use of reduced blanking
  (CVT) or the 'Secondary GTF' curve (GTF).
 
 -  .. row 6
 
-   -  V4L2_DV_BT_CAP_CUSTOM
+   -  ``V4L2_DV_BT_CAP_CUSTOM``
 
-  Can support non-standard timings, i.e. timings not belonging to
  the standards set in the ``standards`` field.
diff --git a/Documentation/linux_tv/media/v4l/vidioc-g-dv-timings.rst 
b/Documentation/linux_tv/media/v4l/vidioc-g-dv-timings.rst
index 0dd93d1ee284..e19d64e0116a 100644
--- a/Documentation/linux_tv/media/v4l/vidioc-g-dv-timings.rst
+++ b/Documentation/linux_tv/media/v4l/vidioc-g-dv-timings.rst
@@ -109,8 +109,8 @@ EBUSY
-  ``polarities``
 
-  This is a bit mask that defines polarities of sync signals. bit 0
- (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit
- 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If
+ (``V4L2_DV_VSYNC_POS_POL``) is for vertical sync polarity and bit
+ 1 (``V4L2_DV_HSYNC_POS_POL``) is for horizontal sync polarity. If
  the bit is set (1) it is positive polarity and if is cleared (0),
  it is negative polarity.
 
@@ -289,7 +289,7 @@ EBUSY
 
 -  .. row 3
 
-   -  V4L2_DV_BT_656_1120
+   -  ``V4L2_DV_BT_656_1120``
 
-  0
 
@@ -317,25 +317,25 @@ EBUSY
 
 -  .. row 3
 
-   -  V4L2_DV_BT_STD_CEA861
+   -  ``V4L2_DV_BT_STD_CEA861``
 
-  The timings follow the CEA-861 Digital TV Profile standard
 
 -  .. row 4
 
-   -  V4L2_DV_BT_STD_DMT
+   -  ``V4L2_DV_BT_STD_DMT``
 
-  The timings follow the VESA Discrete Monitor Timings standard
 
 -  .. row 5
 
-   -  V4L2_DV_BT_STD_CVT
+   -  ``V4L2_DV_BT_STD_CVT``
 
-  The timings follow the VESA Coordinated Video Timings standard
 
 -  .. row 6
 
-   -  V4L2_DV_BT_STD_GTF
+   -  ``V4L2_DV_BT_STD_GTF``
 
-  The timings follow the VESA Generalized Timings Formula standard
 
@@ -361,7 +361,7 @@ EBUSY
 
 -  .. row 3
 
-   -  V4L2_DV_FL_REDUCED_BLANKING
+   -  ``V4L2_DV_FL_REDUCED_BLANKING``
 
-  CVT/GTF specific: the timings use reduced blanking (CVT) or the
  'Secondary GTF' curve (GTF). In both cases the horizontal and/or
@@ -371,7 +371,7 @@ EBUSY
 
 -  .. row 4
 
-   -  V4L2_DV_FL_CAN_REDUCE_FPS
+   -  ``V4L2_DV_FL_CAN_REDUCE_FPS``
 
-  CEA-861 specific: set for CEA-861 formats with a framerate that is
  a multiple of six. These formats can be optionally played at 1 /
@@ -383,11 +383,11 @@ EBUSY
 
 -  .. row 5
 
-   -  V4L2_DV_FL_REDUCED_FPS
+   -  ``V4L2_DV_FL_REDUCED_FPS``
 
-  CEA-861 specific: only valid for video transmitters, the flag is
  cleared by receivers. It is also only valid for formats with the
- V4L2_DV_FL_CAN_REDUCE_FPS flag set, for other formats the
+ ``V4L2_DV_FL_CAN_REDUCE_FPS`` flag set, for other formats the
  flag will be cleared by the driver. If the application sets this
  flag, then the pixelclock used to set up the transmitter is
  divided by 1.001 to make it compatible with NTSC framerates. If
@@ -396,7 +396,7 @@ EBUSY
 
 -  .. row 6
 
-   -  V4L2_DV_FL_HALF_LINE
+   -  ``V4L2_DV_FL_HALF_LINE``
 
-  Specific to interlaced formats: if set, then the vertical
  frontporch of field 1 (aka the odd field) is really one half-line
@@ -407,7 +407,7 @@ EBUSY
 
 -  .. row 7
 
-   -  V4L2_DV_FL_IS_CE_VIDEO
+   -  ``V4L2_DV_FL_IS_CE_VIDEO``
 
-  If set, then this is a Consumer Electronics (CE) video format.
  Such formats differ from other formats (commonly called IT
diff --git a/Documentation/linux_tv/videodev2.h.rst.exceptions 
b/Documentation/linux_tv/videodev2.h.

[PATCH 23/54] doc-rst: media-ioc-enum-entities: better format the table

2016-07-08 Thread Mauro Carvalho Chehab
Add a :widths: at the flat-table, to improve the visual.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-ioc-enum-entities.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/linux_tv/media/mediactl/media-ioc-enum-entities.rst 
b/Documentation/linux_tv/media/mediactl/media-ioc-enum-entities.rst
index f11c45ad7278..ae88f46b3a9e 100644
--- a/Documentation/linux_tv/media/mediactl/media-ioc-enum-entities.rst
+++ b/Documentation/linux_tv/media/mediactl/media-ioc-enum-entities.rst
@@ -54,6 +54,7 @@ id's until they get an error.
 .. flat-table:: struct media_entity_desc
 :header-rows:  0
 :stub-columns: 0
+:widths: 1 1 1 1 8
 
 
 -  .. row 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 34/54] doc-rst: parse-headers: be more formal about the valid symbols

2016-07-08 Thread Mauro Carvalho Chehab
Be more formal about the valid symbols that are expected by
the parser, to match what c language expects.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index bf6f0df895f4..5e366756084f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -34,7 +34,7 @@ while () {
 
$data .= $_;
 
-   if ($is_enum && $ln =~ m/^\s*([_A-Z][^\s\}\,\=]+)\s*[\,=]?/) {
+   if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -47,7 +47,7 @@ while () {
}
$is_enum = 0 if ($is_enum && m/\}/);
 
-   if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+_IO/) {
+   if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+_IO/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -56,7 +56,7 @@ while () {
next;
}
 
-   if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+/) {
+   if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -66,7 +66,7 @@ while () {
next;
}
 
-   if ($ln =~ m/^\s*typedef\s+.*\s+([_\w]\S+);/) {
+   if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -75,8 +75,8 @@ while () {
$typedefs{$s} = $n;
next;
}
-   if ($ln =~ m/^\s*enum\s+(\S+)\s+\{/
-   || $ln =~ m/^\s*enum\s+(\S+)$/) {
+   if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
+   || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
@@ -87,8 +87,8 @@ while () {
$is_enum = $1;
next;
}
-   if ($ln =~ m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/
-   || $ln =~ m/^\s*struct\s+([A-Za-z_]\S+)$/) {
+   if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
+   || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
-- 
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/54] doc-rst: parse-headers: better handle typedefs

2016-07-08 Thread Mauro Carvalho Chehab
When typedef is used on its multiline format, we need to
also parse enum and struct in the same line.

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

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 5e366756084f..b657cadb53ae 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -76,7 +76,9 @@ while () {
next;
}
if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
-   || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/) {
+   || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/
+   || $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/;
@@ -88,7 +90,10 @@ while () {
next;
}
if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
-   || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/) {
+   || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/
+   || $ln =~ m/^\s*typedef\s*struct\s+([_\w][\w\d_]+)\s+\{/
+   || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
+   ) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
-- 
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/54] doc-rst: media-controller.rst: add missing copy symbol

2016-07-08 Thread Mauro Carvalho Chehab
Just like V4L and DVB parts, add the copyright symbol.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-controller.rst | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/linux_tv/media/mediactl/media-controller.rst 
b/Documentation/linux_tv/media/mediactl/media-controller.rst
index 1877d68044b8..8758308997a7 100644
--- a/Documentation/linux_tv/media/mediactl/media-controller.rst
+++ b/Documentation/linux_tv/media/mediactl/media-controller.rst
@@ -1,5 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
+.. include:: 
+
 .. _media_common:
 
 
@@ -56,8 +58,9 @@ Authors:
 
  - MEDIA_IOC_G_TOPOLOGY documentation and documentation improvements.
 
-**Copyright** 2010 : Laurent Pinchart
-**Copyright** 2015-2016 : Mauro Carvalho Chehab
+**Copyright** |copy| 2010 : Laurent Pinchart
+
+**Copyright** |copy| 2015-2016 : Mauro Carvalho Chehab
 
 
 Revision History
-- 
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] doc-rst: remove an invalid include from the docs

2016-07-08 Thread Mauro Carvalho Chehab
I suspect that this is a left over from Markus tests.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/dvb/audio_h.rst | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Documentation/linux_tv/media/dvb/audio_h.rst 
b/Documentation/linux_tv/media/dvb/audio_h.rst
index 0ea0b41b20ae..e00c3010fdf9 100644
--- a/Documentation/linux_tv/media/dvb/audio_h.rst
+++ b/Documentation/linux_tv/media/dvb/audio_h.rst
@@ -7,5 +7,3 @@ DVB Audio Header File
 *
 
 .. kernel-include:: $BUILDDIR/audio.h.rst
-
-.. kernel-include:: $BUILDDIR/../../../../etc/adduser.conf
-- 
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/54] doc-rst: media-controller-model: fix a typo

2016-07-08 Thread Mauro Carvalho Chehab
Remove a 'm' at the end of the last phrase.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/linux_tv/media/mediactl/media-controller-model.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/linux_tv/media/mediactl/media-controller-model.rst 
b/Documentation/linux_tv/media/mediactl/media-controller-model.rst
index 7be58aecb882..558273cf9570 100644
--- a/Documentation/linux_tv/media/mediactl/media-controller-model.rst
+++ b/Documentation/linux_tv/media/mediactl/media-controller-model.rst
@@ -32,4 +32,4 @@ are:
from a source pad to a sink pad.
 
 -  An **interface link** is a point-to-point bidirectional control
-   connection between a Linux Kernel interface and an entity.m
+   connection between a Linux Kernel interface and an 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 00/54] Second series of ReST convert patches for media

2016-07-08 Thread Hans Verkuil
On 07/08/2016 03:02 PM, Mauro Carvalho Chehab wrote:
> That's the second series of patches related to DocBook to ReST
> conversion. With this patch series, we're ready to merge it
> upstream.
> 
> There are still one thing to do: there are some new updates at
> the DocBook pages on two topic branches (cec and vsp1). Those
> changes should also be converted, in order to be able to remove
> the DocBook pages.
> 
> Visually, I'm more happy with the new pages, as the produced
> layout is more fancy, IMHO, using a modern visual.
> 
> Also, editing ReST pages is a way simpler than editing the
> DocBooks. Also, reviewing documentation patches should be
> simpler, with is a good thing.
> 
> On the bad side, Sphinx doesn't support auto-numberating
> examples, figures or tables. We'll need some extension for
> that. For now, the only impact is on the examples, that were
> manually numerated. So, patches adding new examples will need
> to check and manually renumerate other examples.
> 
> I hope we'll have soon some Sphinx extension to support
> auto-numbering.
> 
> I'll soon change linux.org documentation page to show the
> Sphinx-generated documenation. I intend to keep the old
> one for a while, for people to be able to compare both.
> I'll post an email once I do this at both linux-media and
> linux-doc mailing lists.
> 
> I did a review on all pages, but, as I'm not a Vulcan,
> I'm pretty sure I missed some things. So, feel free to
> review the final document and send me patches with any
> needed fixes or improvements.
> 
> Finally, you'll see some warnings produced by generating
> the documentation.
> 
> There are actually two types of warnings there:
> 
> 1) At least here where I sit, I'm getting those warnings:
> 
> Documentation/linux_tv/media/dvb/fe-diseqc-send-burst.rst:18: WARNING: Error 
> when parsing function declaration:

Can we please put this in Documentation/media instead of linux_tv? That's a 
really
bad name, and not logical at all since the drivers are all in drivers/media.

Someone looking for the drivers/media documentation won't be able to find it.
I know I had to look in the actual patches to discover that it ended up in 
linux_tv!

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


[ANN] Media documentation converted to ReST markup language

2016-07-08 Thread Mauro Carvalho Chehab
As commented on the patch series I just submitted, we finished the conversion
of the Media uAPI book from DocBook to ReST.

For now, I'm placing the new documentation, after parsed by Sphinx, at this
place:
https://mchehab.fedorapeople.org/media_API_book/

There are some instructions there about how to use Sphinx too, with can be
useful for the ones writing patches. Those are part of the docs-next that
will be sent to Kernel 4.8, thanks to Jani Nikula an Jonathan Corbet.

The media docbook itself is located at:
https://mchehab.fedorapeople.org/media_API_book/linux_tv/index.html

And the patches are already at the media tree, under the "docs-next"
branch:
https://git.linuxtv.org/media_tree.git/log/?h=docs-next

If you find anything inconsistent, wrong or incomplete, feel free to
submit patches to it. My plan is to merge this branch on Kernel 4.8-rc1
and then remove the Documentation/DocBook/media stuff from the Kernel.

PS.: I'll soon be adding one extra patch there renaming the media
directory. "linux_tv" is not the best name for the media contents,
but, on the other hand, having a "media/media" directory also doesn't
make sense. So, I need to think for a better name before doing the
change. Pehaps I'll go for:
Documentation/media - for all media documentation, were we
should also store things that are now under 
/video4linux and under /dvb;

and:
Documentation/media/uapi - for the above book that were just
converted from DocBook.

Enjoy!

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


Re: [ANN] Media documentation converted to ReST markup language

2016-07-08 Thread Hans Verkuil
On 07/08/2016 03:34 PM, Mauro Carvalho Chehab wrote:
> As commented on the patch series I just submitted, we finished the conversion
> of the Media uAPI book from DocBook to ReST.
> 
> For now, I'm placing the new documentation, after parsed by Sphinx, at this
> place:
>   https://mchehab.fedorapeople.org/media_API_book/
> 
> There are some instructions there about how to use Sphinx too, with can be
> useful for the ones writing patches. Those are part of the docs-next that
> will be sent to Kernel 4.8, thanks to Jani Nikula an Jonathan Corbet.
> 
> The media docbook itself is located at:
>   https://mchehab.fedorapeople.org/media_API_book/linux_tv/index.html
> 
> And the patches are already at the media tree, under the "docs-next"
> branch:
>   https://git.linuxtv.org/media_tree.git/log/?h=docs-next
> 
> If you find anything inconsistent, wrong or incomplete, feel free to
> submit patches to it. My plan is to merge this branch on Kernel 4.8-rc1
> and then remove the Documentation/DocBook/media stuff from the Kernel.
> 
> PS.: I'll soon be adding one extra patch there renaming the media
> directory. "linux_tv" is not the best name for the media contents,
> but, on the other hand, having a "media/media" directory also doesn't
> make sense. So, I need to think for a better name before doing the
> change. Pehaps I'll go for:
>   Documentation/media - for all media documentation, were we
>   should also store things that are now under 
>   /video4linux and under /dvb;
> 
> and:
>   Documentation/media/uapi - for the above book that were just
>   converted from DocBook.

Sounds good to me!

Regards,

Hans

> 
> Enjoy!
> 
> 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
> 
--
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: A potential race

2016-07-08 Thread Pavel Andrianov

Hi!

We have no hardware to test possible fixes. If somebody has it and 
agrees to check our patches, we will prepare them.


Best regards,
Pavel

01.07.2016 20:17, Hans Verkuil пишет:

On 07/01/2016 05:02 PM, Pavel Andrianov wrote:

01.07.2016 19:53, Hans Verkuil пишет:

On 07/01/2016 04:39 PM, Pavel Andrianov wrote:

   Hi!

There is a potential race condition between usbvision_v4l2_close and 
usbvision_disconnect. The possible scenario may be the following. 
usbvision_disconnect starts execution, assigns usbvision->remove_pending = 1, 
and is interrupted
(rescheduled) after mutex_unlock. After that usbvision_v4l2_close is executed, 
decrease usbvision->user-- , checks usbvision->remove_pending, executes 
usbvision_release and finishes. Then usbvision_disconnect continues its execution. It 
checks
usbversion->user (it is already 0) and also execute usbvision_release. Thus, 
release is executed twice. The same situation may
occur if usbvision_v4l2_close is interrupted by usbvision_disconnect. Moreover, 
the same problem is in usbvision_radio_close. In all these cases the check 
before call usbvision_release under mutex_lock protection does not solve the 
problem, because  there may occur an open() after the check and the race takes 
place again. The question is: why the usbvision_release
is called from close() (usbvision_v4l2_close and usbvision_radio_close)? 
Usually release functions are called from
disconnect.

Please don't use html mail, mailinglists will silently reject this.

The usbvision driver is old and unloved and known to be very bad code. It needs 
a huge amount of work to make all this work correctly.

I don't see anyone picking this up...

Regards,

Hans

If you know the driver, could you, please, explain me, why
usbvision_release is called from close functions (usbvision_v4l2_close
and usbvision_radio_close) and not only from disconnect? Thanks!


Because the author didn't know what he was doing. Although, to be fair, we have 
much better
solutions for this. But who is willing to put in the time to fix this properly?

The basic idea was: if someone still has a video/radio node open when 
disconnect happens, then
we leave it to the last close to call release, otherwise we can call release 
right away.

It needs to be rewritten.

If you're volunteering to clean this up, then I can give pointers.

Regards,

Hans



--
Pavel Andrianov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: andria...@ispras.ru

--
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: Doc s5p-mfc add missing fields to s5p_mfc_dev structure definition

2016-07-08 Thread Shuah Khan
Add missing documentation for s5p_mfc_dev structure definition.

Signed-off-by: Shuah Khan 
---
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 9eb2481..1d06d6a 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -291,7 +291,9 @@ struct s5p_mfc_priv_buf {
  * @warn_start:hardware error code from which warnings start
  * @mfc_ops:   ops structure holding HW operation function pointers
  * @mfc_cmds:  cmd structure holding HW commands function pointers
+ * @mfc_regs:  structure holding MFC registers
  * @fw_ver:loaded firmware sub-version
+ * risc_on:flag indicates RISC is on or off
  *
  */
 struct s5p_mfc_dev {
-- 
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 v5 0/2] OV5645 camera sensor driver

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

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   |   50 +
 drivers/media/i2c/Kconfig  |   12 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/ov5645.c | 1371 
 4 files changed, 1434 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


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

2016-07-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 | 1371 
 3 files changed, 1384 insertions(+)
 create mode 100644 drivers/media/i2c/ov5645.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 993dc50..0cee05b 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -500,6 +500,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..ec96d10
--- /dev/null
+++ b/drivers/media/i2c/ov5645.c
@@ -0,0 +1,1371 @@
+/*
+ * 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_XCLK2388
+
+#define OV5645_SYSTEM_CTRL00x3008
+#defineOV5645_SYSTEM_CTRL0_START   0x02
+#defineOV5645_SYSTEM_CTRL0_STOP0x42
+#define OV5645_CHIP_ID_HIGH_REG0x300A
+#defineOV5645_CHIP_ID_HIGH 0x56
+#define OV5645_CHIP_ID_LOW_REG 0x300B
+#defineOV5645_CHIP_ID_LOW  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 v5 1/2] media: i2c/ov5645: add the device tree binding document

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

Signed-off-by: Todor Tomov 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/media/i2c/ov5645.txt   | 50 ++
 1 file changed, 50 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..468cf83
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov5645.txt
@@ -0,0 +1,50 @@
+* 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".
+- 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:
+
+   &i2c1 {
+   ...
+
+   ov5645: ov5645@78 {
+   compatible = "ovti,ov5645";
+   reg = <0x78>;
+
+   enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
+   reset-gpios = <&gpio5 20 GPIO_ACTIVE_LOW>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&camera_rear_default>;
+
+   clocks = <&clks 200>;
+   clock-names = "xclk";
+
+   vdddo-supply = <&camera_dovdd_1v8>;
+   vdda-supply = <&camera_avdd_2v8>;
+   vddd-supply = <&camera_dvdd_1v2>;
+
+   port {
+   ov5645_ep: endpoint {
+   clock-lanes = <1>;
+   data-lanes = <0 2>;
+   remote-endpoint = <&csi0_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


Re: [ANN] Media documentation converted to ReST markup language

2016-07-08 Thread Mauro Carvalho Chehab
Em Fri, 8 Jul 2016 15:45:52 +0200
Hans Verkuil  escreveu:

> On 07/08/2016 03:34 PM, Mauro Carvalho Chehab wrote:
> > As commented on the patch series I just submitted, we finished the 
> > conversion
> > of the Media uAPI book from DocBook to ReST.
> > 
> > For now, I'm placing the new documentation, after parsed by Sphinx, at this
> > place:
> > https://mchehab.fedorapeople.org/media_API_book/
> > 
> > There are some instructions there about how to use Sphinx too, with can be
> > useful for the ones writing patches. Those are part of the docs-next that
> > will be sent to Kernel 4.8, thanks to Jani Nikula an Jonathan Corbet.
> > 
> > The media docbook itself is located at:
> > https://mchehab.fedorapeople.org/media_API_book/linux_tv/index.html
> > 
> > And the patches are already at the media tree, under the "docs-next"
> > branch:
> > https://git.linuxtv.org/media_tree.git/log/?h=docs-next
> > 
> > If you find anything inconsistent, wrong or incomplete, feel free to
> > submit patches to it. My plan is to merge this branch on Kernel 4.8-rc1
> > and then remove the Documentation/DocBook/media stuff from the Kernel.
> > 
> > PS.: I'll soon be adding one extra patch there renaming the media
> > directory. "linux_tv" is not the best name for the media contents,
> > but, on the other hand, having a "media/media" directory also doesn't
> > make sense. So, I need to think for a better name before doing the
> > change. Pehaps I'll go for:
> > Documentation/media - for all media documentation, were we
> > should also store things that are now under 
> > /video4linux and under /dvb;
> > 
> > and:
> > Documentation/media/uapi - for the above book that were just
> > converted from DocBook.  
> 
> Sounds good to me!

Done. Patch applied.

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


Re: [PATCH] media: Doc s5p-mfc add missing fields to s5p_mfc_dev structure definition

2016-07-08 Thread Javier Martinez Canillas
Hello Shuah,

On 07/08/2016 10:12 AM, Shuah Khan wrote:
> Add missing documentation for s5p_mfc_dev structure definition.
> 
> Signed-off-by: Shuah Khan 
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> index 9eb2481..1d06d6a 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> @@ -291,7 +291,9 @@ struct s5p_mfc_priv_buf {
>   * @warn_start:  hardware error code from which warnings start
>   * @mfc_ops: ops structure holding HW operation function pointers
>   * @mfc_cmds:cmd structure holding HW commands function 
> pointers
> + * @mfc_regs:structure holding MFC registers
>   * @fw_ver:  loaded firmware sub-version
> + * risc_on:  flag indicates RISC is on or off
>   *
>   */
>  struct s5p_mfc_dev {
> 

Patch looks good to me.

Reviewed-by: Javier Martinez Canillas 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
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] doc-rst: add dmabuf as streaming I/O in VIDIOC_REQBUFS description

2016-07-08 Thread Mauro Carvalho Chehab
Commit 707e65831d3b("[media] DocBook: add dmabuf as streaming I/O
in VIDIOC_REQBUFS description") added DMABUF to reqbufs description,
but, as we're migrating to ReST markup, we need to keep it in sync
with the change.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-reqbufs.rst 
b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst
index c25b0719c2ff..5d0bc6d31c07 100644
--- a/Documentation/media/uapi/v4l/vidioc-reqbufs.rst
+++ b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst
@@ -9,7 +9,7 @@ ioctl VIDIOC_REQBUFS
 Name
 
 
-VIDIOC_REQBUFS - Initiate Memory Mapping or User Pointer I/O
+VIDIOC_REQBUFS - Initiate Memory Mapping, User Pointer I/O or DMA buffer I/O
 
 
 Synopsis
-- 
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] doc-rst: mention the memory type to be set for all streaming I/O

2016-07-08 Thread Mauro Carvalho Chehab
Changeset 8c9f46095176 ("[media] DocBook: mention the memory type to
be set for all streaming I/O") updated the media DocBook to mention
the need of filling the memory types. We need to keep the ReST
doc updated to such change.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/mmap.rst  | 4 ++--
 Documentation/media/uapi/v4l/userp.rst | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/uapi/v4l/mmap.rst 
b/Documentation/media/uapi/v4l/mmap.rst
index 2171b18c1aab..f7fe26e7ca43 100644
--- a/Documentation/media/uapi/v4l/mmap.rst
+++ b/Documentation/media/uapi/v4l/mmap.rst
@@ -11,8 +11,8 @@ Input and output devices support this I/O method when the
 :ref:`v4l2_capability ` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl is set. There are two
 streaming methods, to determine if the memory mapping flavor is
-supported applications must call the
-:ref:`VIDIOC_REQBUFS` ioctl.
+supported applications must call the :ref:`VIDIOC_REQBUFS` ioctl
+with the memory type set to ``V4L2_MEMORY_MMAP``.
 
 Streaming is an I/O method where only pointers to buffers are exchanged
 between application and driver, the data itself is not copied. Memory
diff --git a/Documentation/media/uapi/v4l/userp.rst 
b/Documentation/media/uapi/v4l/userp.rst
index 0ecf7a13a7af..2f0002bfbc3f 100644
--- a/Documentation/media/uapi/v4l/userp.rst
+++ b/Documentation/media/uapi/v4l/userp.rst
@@ -11,8 +11,8 @@ Input and output devices support this I/O method when the
 :ref:`v4l2_capability ` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl is set. If the
 particular user pointer method (not only memory mapping) is supported
-must be determined by calling the
-:ref:`VIDIOC_REQBUFS` ioctl.
+must be determined by calling the :ref:`VIDIOC_REQBUFS` ioctl
+with the memory type set to ``V4L2_MEMORY_USERPTR``.
 
 This I/O method combines advantages of the read/write and memory mapping
 methods. Buffers (planes) are allocated by the application itself, and
-- 
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 2/2] drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency

2016-07-08 Thread Hans Verkuil
From: Hans Verkuil 

Allow VIDEO_MEDIATEK_VCODEC to build when COMPILE_TEST is set (even
without MTK_IOMMU).

Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 3231b25..2c2670c 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -168,7 +168,7 @@ config VIDEO_MEDIATEK_VPU
 
 config VIDEO_MEDIATEK_VCODEC
tristate "Mediatek Video Codec driver"
-   depends on MTK_IOMMU
+   depends on MTK_IOMMU || COMPILE_TEST
depends on VIDEO_DEV && VIDEO_V4L2
depends on ARCH_MEDIATEK || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG
-- 
2.8.1

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


[PATCH 1/2] mtk-vcodec: convert driver to use the new vb2_queue dev field

2016-07-08 Thread Hans Verkuil
From: Hans Verkuil 

The patch dropping the vb2_dma_contig_init_ctx() and _cleanup_ctx()
functions was already applied before this driver was added. So convert
this driver as well.

Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |  3 ---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 13 ++---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 12 
 3 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
index 78eee50..94f0a42 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
@@ -265,8 +265,6 @@ struct mtk_vcodec_ctx {
  * @m2m_dev_enc: m2m device for encoder.
  * @plat_dev: platform device
  * @vpu_plat_dev: mtk vpu platform device
- * @alloc_ctx: VB2 allocator context
- *(for allocations without kernel mapping).
  * @ctx_list: list of struct mtk_vcodec_ctx
  * @irqlock: protect data access by irq handler and work thread
  * @curr_ctx: The context that is waiting for codec hardware
@@ -299,7 +297,6 @@ struct mtk_vcodec_dev {
struct v4l2_m2m_dev *m2m_dev_enc;
struct platform_device *plat_dev;
struct platform_device *vpu_plat_dev;
-   struct vb2_alloc_ctx *alloc_ctx;
struct list_head ctx_list;
spinlock_t irqlock;
struct mtk_vcodec_ctx *curr_ctx;
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 6e72d73..6dcae0a 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -693,7 +693,8 @@ const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = {
 static int vb2ops_venc_queue_setup(struct vb2_queue *vq,
   unsigned int *nbuffers,
   unsigned int *nplanes,
-  unsigned int sizes[], void *alloc_ctxs[])
+  unsigned int sizes[],
+  struct device *alloc_devs[])
 {
struct mtk_vcodec_ctx *ctx = vb2_get_drv_priv(vq);
struct mtk_q_data *q_data;
@@ -705,17 +706,13 @@ static int vb2ops_venc_queue_setup(struct vb2_queue *vq,
return -EINVAL;
 
if (*nplanes) {
-   for (i = 0; i < *nplanes; i++) {
+   for (i = 0; i < *nplanes; i++)
if (sizes[i] < q_data->sizeimage[i])
return -EINVAL;
-   alloc_ctxs[i] = ctx->dev->alloc_ctx;
-   }
} else {
*nplanes = q_data->fmt->num_planes;
-   for (i = 0; i < *nplanes; i++) {
+   for (i = 0; i < *nplanes; i++)
sizes[i] = q_data->sizeimage[i];
-   alloc_ctxs[i] = ctx->dev->alloc_ctx;
-   }
}
 
return 0;
@@ -1249,6 +1246,7 @@ int mtk_vcodec_enc_queue_init(void *priv, struct 
vb2_queue *src_vq,
src_vq->mem_ops = &vb2_dma_contig_memops;
src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
src_vq->lock= &ctx->dev->dev_mutex;
+   src_vq->dev = &ctx->dev->plat_dev->dev;
 
ret = vb2_queue_init(src_vq);
if (ret)
@@ -1262,6 +1260,7 @@ int mtk_vcodec_enc_queue_init(void *priv, struct 
vb2_queue *src_vq,
dst_vq->mem_ops = &vb2_dma_contig_memops;
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
dst_vq->lock= &ctx->dev->dev_mutex;
+   dst_vq->dev = &ctx->dev->plat_dev->dev;
 
return vb2_queue_init(dst_vq);
 }
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index 06105e9..9c10cc2 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -357,14 +357,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
dev->vfd_enc = vfd_enc;
platform_set_drvdata(pdev, dev);
 
-   dev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
-   if (IS_ERR((__force void *)dev->alloc_ctx)) {
-   mtk_v4l2_err("Failed to alloc vb2 dma context 0");
-   ret = PTR_ERR((__force void *)dev->alloc_ctx);
-   dev->alloc_ctx = NULL;
-   goto err_vb2_ctx_init;
-   }
-
dev->m2m_dev_enc = v4l2_m2m_init(&mtk_venc_m2m_ops);
if (IS_ERR((__force void *)dev->m2m_dev_enc)) {
mtk_v4l2_err("Failed to init mem2mem enc device");
@@ -401,8 +393,6 @@ err_enc_reg:
 err_event_workq:
v4l2_m2m_release(dev->m2m_dev_enc);
 err_enc_mem_init:
-   vb2_dma_contig_cleanup_ctx(dev->alloc_ctx);
-err_vb2_ctx_init:
video_unregister_device(vfd_enc);
 err_enc_alloc:
 

[PATCH 0/2] mtk-vcodec fixups

2016-07-08 Thread Hans Verkuil
From: Hans Verkuil 

Two patches: the first converts the driver to use the new vb2_queue dev
field (this came in after the pull request of this driver was posted).

The second allows this driver to be built when COMPILE_TEST is set and
MTK_IOMMU is not set.

Regards,

Hans

Hans Verkuil (2):
  mtk-vcodec: convert driver to use the new vb2_queue dev field
  drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency

 drivers/media/platform/Kconfig |  2 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |  3 ---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 13 ++---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 12 
 4 files changed, 7 insertions(+), 23 deletions(-)

-- 
2.8.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] [media] doc-rst: mention the memory type to be set for all streaming I/O

2016-07-08 Thread Javier Martinez Canillas
Hello Mauro,

On Fri, Jul 8, 2016 at 3:05 PM, Mauro Carvalho Chehab
 wrote:
> Changeset 8c9f46095176 ("[media] DocBook: mention the memory type to
> be set for all streaming I/O") updated the media DocBook to mention
> the need of filling the memory types. We need to keep the ReST
> doc updated to such change.
>
> Signed-off-by: Mauro Carvalho Chehab 
> ---

Patch looks good to me.

Reviewed-by: Javier Martinez Canillas 

Best regards,
Javier
--
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] doc-rst: add dmabuf as streaming I/O in VIDIOC_REQBUFS description

2016-07-08 Thread Javier Martinez Canillas
Hello Mauro,

On Fri, Jul 8, 2016 at 2:41 PM, Mauro Carvalho Chehab
 wrote:
> Commit 707e65831d3b("[media] DocBook: add dmabuf as streaming I/O
> in VIDIOC_REQBUFS description") added DMABUF to reqbufs description,
> but, as we're migrating to ReST markup, we need to keep it in sync
> with the change.
>
> Signed-off-by: Mauro Carvalho Chehab 
> ---

Reviewed-by: Javier Martinez Canillas 

Best regards,
Javier
--
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] doc-rst: fix the Z16 format definition

2016-07-08 Thread Mauro Carvalho Chehab
Changeset 811c6d6a4243 ("[media] V4L: fix the Z16 format definition")
fixed the definition for DocBook, but we need to replicate it
also to ReST.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/pixfmt-z16.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-z16.rst 
b/Documentation/media/uapi/v4l/pixfmt-z16.rst
index c5cce2db78b6..4ebc561d0480 100644
--- a/Documentation/media/uapi/v4l/pixfmt-z16.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-z16.rst
@@ -8,7 +8,7 @@ V4L2_PIX_FMT_Z16 ('Z16 ')
 
 *man V4L2_PIX_FMT_Z16(2)*
 
-Interleaved grey-scale image, e.g. from a stereo-pair
+16-bit depth data with distance values at each pixel
 
 
 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


doc-rst: too much space around ``foo`` text

2016-07-08 Thread Hans Verkuil
Hi Markus,

First of all a big 'Thank you!' for working on this, very much appreciated.

And I also am very grateful that you could convert the CEC docs so quickly for 
me.

That said, can you take a look at this:

https://mchehab.fedorapeople.org/media_API_book/linux_tv/media/v4l/vidioc-enum-fmt.html

As you can see, every text written as ``foo`` in the rst file has a bit too 
much space
around it. It's especially clear in the description of the 'type' field: the 
commas
after each V4L2_BUF_TYPE_ constant should be right after the last character, 
and now
it looks as if there is a space in front.

It's jarring when you read it, but it is probably easy to fix for someone who 
knows
this stuff.

Thanks!

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 3/4] [media] doc-dst: visually improve the CEC pages

2016-07-08 Thread Mauro Carvalho Chehab
Adjust the widths and show error codes as constants.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-close.rst   |  2 +-
 Documentation/media/uapi/cec/cec-func-open.rst| 10 +-
 Documentation/media/uapi/cec/cec-func-poll.rst|  8 
 Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst  |  4 ++--
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst |  4 ++--
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst  | 10 +-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst   |  5 +++--
 Documentation/media/uapi/cec/cec-ioc-receive.rst  |  6 +++---
 8 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-close.rst 
b/Documentation/media/uapi/cec/cec-func-close.rst
index 11f083602792..ae55e55ab84a 100644
--- a/Documentation/media/uapi/cec/cec-func-close.rst
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -45,5 +45,5 @@ Return Value
 :c:func:`close()` returns 0 on success. On error, -1 is returned, and
 ``errno`` is set appropriately. Possible error codes are:
 
-EBADF
+``EBADF``
 ``fd`` is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/cec/cec-func-open.rst 
b/Documentation/media/uapi/cec/cec-func-open.rst
index 53ffc091e2c0..95db9d1dc6b5 100644
--- a/Documentation/media/uapi/cec/cec-func-open.rst
+++ b/Documentation/media/uapi/cec/cec-func-open.rst
@@ -64,17 +64,17 @@ Return Value
 -1 is returned, and ``errno`` is set appropriately. Possible error codes
 include:
 
-EACCES
+``EACCES``
 The requested access to the file is not allowed.
 
-EMFILE
+``EMFILE``
 The process already has the maximum number of files open.
 
-ENFILE
+``ENFILE``
 The system limit on the total number of open files has been reached.
 
-ENOMEM
+``ENOMEM``
 Insufficient kernel memory was available.
 
-ENXIO
+``ENXIO``
 No device corresponding to this device special file exists.
diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst 
b/Documentation/media/uapi/cec/cec-func-poll.rst
index ff5175fbf62f..eacc164558a5 100644
--- a/Documentation/media/uapi/cec/cec-func-poll.rst
+++ b/Documentation/media/uapi/cec/cec-func-poll.rst
@@ -56,15 +56,15 @@ On success, :c:func:`poll()` returns the number structures 
which have
 non-zero ``revents`` fields, or zero if the call timed out. On error -1
 is returned, and the ``errno`` variable is set appropriately:
 
-EBADF
+``EBADF``
 One or more of the ``ufds`` members specify an invalid file
 descriptor.
 
-EFAULT
+``EFAULT``
 ``ufds`` references an inaccessible memory area.
 
-EINTR
+``EINTR``
 The call was interrupted by a signal.
 
-EINVAL
+``EINVAL``
 The ``nfds`` argument is greater than ``OPEN_MAX``.
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
index 4544b6f86ae0..eefec7b4f6bb 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
@@ -45,7 +45,7 @@ returns the information to the application. The ioctl never 
fails.
 .. flat-table:: struct cec_caps
 :header-rows:  0
 :stub-columns: 0
-:widths:   1 1 2
+:widths:   1 1 16
 
 
 -  .. row 1
@@ -90,7 +90,7 @@ returns the information to the application. The ioctl never 
fails.
 .. flat-table:: CEC Capabilities Flags
 :header-rows:  0
 :stub-columns: 0
-:widths:   3 1 4
+:widths:   3 1 8
 
 
 -  .. _`CEC_CAP_PHYS_ADDR`:
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 f6c294fe119e..28955d20652f 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
@@ -58,7 +58,7 @@ by a file handle in initiator mode (see
 .. flat-table:: struct cec_log_addrs
 :header-rows:  0
 :stub-columns: 0
-:widths:   1 1 2
+:widths:   1 1 16
 
 
 -  .. row 1
@@ -292,7 +292,7 @@ by a file handle in initiator mode (see
 .. flat-table:: CEC Logical Address Types
 :header-rows:  0
 :stub-columns: 0
-:widths:   3 1 4
+:widths:   3 1 16
 
 
 -  .. _`CEC_LOG_ADDR_TYPE_TV`:
diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 79f779a9bd6c..07f22cec5762 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -55,7 +55,7 @@ state did change in between the two events.
 .. flat-table:: struct cec_event_state_change
 :header-rows:  0
 :stub-columns: 0
-:widths:   1 1 2
+:widths:   1 1 8
 
 
 -  .. row 1
@@ -81,7 +81,7 @@ state did change in between the two events.
 .. flat-table:: struct cec_event_lost_msgs
 :header-rows:  0
 :stub-columns: 0
-:widths:   1 1 2
+:wi

[PATCH 1/4] [media] doc-rst: linux_tv CEC part, DocBook to reST migration

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

This is the reST migration of media's CEC part.  The migration is based
on media_tree's cec branch:

 https://git.linuxtv.org/media_tree.git

 c7169ad * cec media_tree/cec [media] DocBook/media: add CEC documentation

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/media_uapi.rst |  13 +-
 Documentation/media/uapi/cec/cec-api.rst   |  94 +
 Documentation/media/uapi/cec/cec-func-close.rst|  57 +++
 Documentation/media/uapi/cec/cec-func-ioctl.rst|  77 
 Documentation/media/uapi/cec/cec-func-open.rst |  88 +
 Documentation/media/uapi/cec/cec-func-poll.rst |  74 
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst | 174 +
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst| 427 +
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst|  78 
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   | 237 
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst| 311 +++
 Documentation/media/uapi/cec/cec-ioc-receive.rst   | 329 
 Documentation/media/uapi/v4l/biblio.rst|  10 +
 13 files changed, 1964 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/media/uapi/cec/cec-api.rst
 create mode 100644 Documentation/media/uapi/cec/cec-func-close.rst
 create mode 100644 Documentation/media/uapi/cec/cec-func-ioctl.rst
 create mode 100644 Documentation/media/uapi/cec/cec-func-open.rst
 create mode 100644 Documentation/media/uapi/cec/cec-func-poll.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-dqevent.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-g-mode.rst
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-receive.rst

diff --git a/Documentation/media/media_uapi.rst 
b/Documentation/media/media_uapi.rst
index 8211cc963b56..49f5cb5ed825 100644
--- a/Documentation/media/media_uapi.rst
+++ b/Documentation/media/media_uapi.rst
@@ -37,21 +37,23 @@ A typical media device hardware is shown at
 Typical Media Device
 
 The media infrastructure API was designed to control such devices. It is
-divided into four parts.
+divided into five parts.
 
-The :Ref:`first part ` covers radio, video capture and output,
+The :ref:`first part ` covers radio, video capture and output,
 cameras, analog TV devices and codecs.
 
-The :Ref:`second part ` covers the API used for digital TV and
+The :ref:`second part ` covers the API used for digital TV and
 Internet reception via one of the several digital tv standards. While it
 is called as DVB API, in fact it covers several different video
 standards including DVB-T/T2, DVB-S/S2, DVB-C, ATSC, ISDB-T, ISDB-S,
 DTMB, etc. The complete list of supported standards can be found at
 :ref:`fe-delivery-system-t`.
 
-The :Ref:`third part ` covers the Remote Controller API.
+The :ref:`third part ` covers the Remote Controller API.
 
-The :Ref:`fourth part ` covers the Media Controller API.
+The :ref:`fourth part ` covers the Media Controller API.
+
+The :ref:`fifth part ` covers the CEC (Consumer Electronics Control) API.
 
 It should also be noted that a media device may also have audio
 components, like mixers, PCM capture, PCM playback, etc, which are
@@ -72,6 +74,7 @@ etc, please mail to:
 uapi/dvb/dvbapi
 uapi/rc/remote_controllers
 uapi/mediactl/media-controller
+uapi/cec/cec-api
 uapi/gen-errors
 uapi/fdl-appendix
 
diff --git a/Documentation/media/uapi/cec/cec-api.rst 
b/Documentation/media/uapi/cec/cec-api.rst
new file mode 100644
index ..2aa0c50e60b3
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-api.rst
@@ -0,0 +1,94 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _cec:
+
+###
+CEC API
+###
+
+.. _cec-api:
+
+*
+CEC: Consumer Electronics Control
+*
+
+
+.. _cec-intro:
+
+Introduction
+
+
+Note: this documents the proposed CEC API. This API is not yet finalized
+and is currently only available as a staging kernel module.
+
+HDMI connectors provide a single pin for use by the Consumer Electronics
+Control protocol. This protocol allows different devices connected by an
+HDMI cable to communicate. The protocol for CEC version 1.4 is defined
+in supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return
+Channel) of the HDMI 1.4a (:ref:`hdmi`) specification and the
+extensions added to CEC version 2.0 are defined in chapter 11 of the
+HDMI 2.0 (:ref:`hdmi2`) specification.
+
+The bitrate is very slow (effectively no more than 36 bytes per second)
+and is based on the ancient AV.link protocol used in old SCART
+connectors. The protocol closely resembles a crazy Rube Goldberg
+contraption and is an unholy mi

[PATCH 2/4] [media] doc-rst: linux_tc CEC enhanced markup

2016-07-08 Thread Mauro Carvalho Chehab
From: Markus Heiser 

leaved content unchanged, only improved markup and references

* more man-like sections (add Name section)
* defined target for each stuct field description
* replace constant with ":ref:" to (field) description

Signed-off-by: Markus Heiser 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-api.rst   | 11 +--
 Documentation/media/uapi/cec/cec-func-close.rst| 16 +---
 Documentation/media/uapi/cec/cec-func-ioctl.rst| 17 +---
 Documentation/media/uapi/cec/cec-func-open.rst | 26 ++
 Documentation/media/uapi/cec/cec-func-poll.rst | 20 ++---
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst | 41 --
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst| 87 ++--
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst| 31 +++
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   | 30 +++
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst| 95 ++
 Documentation/media/uapi/cec/cec-ioc-receive.rst   | 74 -
 11 files changed, 181 insertions(+), 267 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-api.rst 
b/Documentation/media/uapi/cec/cec-api.rst
index 2aa0c50e60b3..ffee32e0f906 100644
--- a/Documentation/media/uapi/cec/cec-api.rst
+++ b/Documentation/media/uapi/cec/cec-api.rst
@@ -43,7 +43,7 @@ control just the CEC pin.
 
 Drivers that support CEC will create a CEC device node (/dev/cecX) to
 give userspace access to the CEC adapter. The
-:ref:`CEC_ADAP_G_CAPS ` ioctl will tell
+:ref:`CEC_ADAP_G_CAPS` ioctl will tell
 userspace what it is allowed to do.
 
 
@@ -83,12 +83,3 @@ Revision and Copyright
 :revision: 1.0.0 / 2016-03-17 (*hv*)
 
 Initial revision
-
-
-.. 
--
-.. This file was automatically converted from DocBook-XML with the dbxml
-.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
-.. from the linux kernel, refer to:
-..
-.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
-.. 
--
diff --git a/Documentation/media/uapi/cec/cec-func-close.rst 
b/Documentation/media/uapi/cec/cec-func-close.rst
index 68e47e2aa068..11f083602792 100644
--- a/Documentation/media/uapi/cec/cec-func-close.rst
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -6,9 +6,10 @@
 cec close()
 ***
 
-*man cec-close(2)*
+Name
+
 
-Close a cec device
+cec-close - Close a cec device
 
 
 Synopsis
@@ -19,7 +20,7 @@ Synopsis
 #include 
 
 
-.. c:function:: int close( int fd )
+.. cpp:function:: int close( int fd )
 
 Arguments
 =
@@ -46,12 +47,3 @@ Return Value
 
 EBADF
 ``fd`` is not a valid open file descriptor.
-
-
-.. 
--
-.. This file was automatically converted from DocBook-XML with the dbxml
-.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
-.. from the linux kernel, refer to:
-..
-.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
-.. 
--
diff --git a/Documentation/media/uapi/cec/cec-func-ioctl.rst 
b/Documentation/media/uapi/cec/cec-func-ioctl.rst
index 9d37591e3ef4..69510ac5088a 100644
--- a/Documentation/media/uapi/cec/cec-func-ioctl.rst
+++ b/Documentation/media/uapi/cec/cec-func-ioctl.rst
@@ -6,10 +6,10 @@
 cec ioctl()
 ***
 
-*man cec-ioctl(2)*
-
-Control a cec device
+Name
+
 
+cec-ioctl - Control a cec device
 
 Synopsis
 
@@ -19,7 +19,7 @@ Synopsis
 #include 
 
 
-.. c:function:: int ioctl( int fd, int request, void *argp )
+.. cpp:function:: int ioctl( int fd, int request, void *argp )
 
 Arguments
 =
@@ -66,12 +66,3 @@ descriptions.
 
 When an ioctl that takes an output or read/write parameter fails, the
 parameter remains unmodified.
-
-
-.. 
--
-.. This file was automatically converted from DocBook-XML with the dbxml
-.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
-.. from the linux kernel, refer to:
-..
-.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
-.. 
--
diff --git a/Documentation/media/uapi/cec/cec-func-open.rst 
b/Documentation/media/uapi/cec/cec-func-open.rst
index 4691194ee795..53ffc091e2c0 100644
--- a/Documentation/media/uapi/cec/cec-func-open.rst
+++ b/Documentation/media/uapi/cec/cec-func-open.rst
@@ -6,10 +6,10 @@
 cec open()
 **
 
-*man cec-open(2)*
-
-Open a cec device
+Name
+
 
+cec-open - Open a cec device
 
 Synopsis
 
@@ -19,7 +19,8 @@ Synopsis
 #include 
 
 
-.. c:function:: int open( const char *device_name, int flags )
+.. cpp:function:: int open( const char *device_nam

[PATCH 4/4] [media] doc-rst: reformat cec-api.rst

2016-07-08 Thread Mauro Carvalho Chehab
Use the same format as the other parts.

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

diff --git a/Documentation/media/uapi/cec/cec-api.rst 
b/Documentation/media/uapi/cec/cec-api.rst
index ffee32e0f906..7b7942281a60 100644
--- a/Documentation/media/uapi/cec/cec-api.rst
+++ b/Documentation/media/uapi/cec/cec-api.rst
@@ -1,5 +1,7 @@
 .. -*- coding: utf-8; mode: rst -*-
 
+.. include:: 
+
 .. _cec:
 
 ###
@@ -72,13 +74,17 @@ Function Reference
 **
 Revision and Copyright
 **
+Authors:
 
+- Verkuil, Hans 
 
-:author:Verkuil Hans
-:address:   hans.verk...@cisco.com
-:contrib:   Initial version.
+ - Initial version.
 
-**Copyright** 2016 : Hans Verkuil
+**Copyright** |copy| 2016 : Hans Verkuil
+
+
+Revision History
+
 
 :revision: 1.0.0 / 2016-03-17 (*hv*)
 
-- 
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


  1   2   >