Re: [PATCH v3] Add tw5864 driver

2016-07-10 Thread Hans Verkuil
Hi Andrey,

Thanks for this driver. Some review comments below:

On 07/09/2016 09:46 PM, Andrey Utkin wrote:
> From: Andrey Utkin 
> 
> 
> Changes in v3 since v2:
>  - Kconfig: select VIDEOBUF2_DMA_CONTIG, not SG
>  - drop i2c code as unused
>  - Dropped num_buffers check in queue_setup as suggested by Hans
>  - Drop std autodetect on streaming start as suggested by Hans
>  - Cleanup buf queue on enable_input() failure
>  - Change container_of() to list_entry() where applicable
>  - Changed V4L2_FIELD_NONE to V4L2_FIELD_INTERLACED as suggested
>  - frameinterval rework suggested by Hans
>  - Add enum_framesizes
>  - Report framesize based on std, not input w/h
>  - Add printed warning about known video quality issues
>  - MAINTAINERS: fix path
>  - request_mem_region() -> pci_request_regions()
>  - Rebase onto Hans' "for-v4.8i" branch
>  - Follow changes from patchset "vb2: replace allocation context by device 
> pointer"
> 
> Below log is produced by today's v4l2-compliance from v4l-utils git, and this
> patch based on branch "for-v4.8i" of 
> git://linuxtv.org/hverkuil/media_tree.git .
> Compliance test runs fine.
> 
> checkpatch.pl is happy with this patch except for artifacts_warning which
> produces a bunch of such warnings:
> 
> WARNING: quoted string split across lines
> #155: FILE: drivers/media/pci/tw5864/tw5864-core.c:44:
> +"This driver was developed by Bluecherry LLC by deducing behaviour of 
> original"
> +" manufacturer's driver, from both source code and execution traces.\n"
> 
> I believe I'd better not join all the lines to avoid them looking like
> 
> "Paragraph one.\Paragraph two.\Paragraph three.\n"
> 
>  # v4l2-compliance -d 6 -s
> v4l2-compliance SHA   : 5e74f6a15aa14c01d8319e086d98f33d96a6a04d
> 
> Driver Info:
> Driver name   : tw5864
> Card type : TW5864 Encoder 2
> Bus info  : PCI::06:05.0
> Driver version: 4.7.0
> Capabilities  : 0x8521
> Video Capture
> Read/Write
> Streaming
> Extended Pix Format
> Device Capabilities
> Device Caps   : 0x0521
> Video Capture
> Read/Write
> Streaming
> Extended Pix Format
> 
> Compliance test for device /dev/video6 (not using libv4l2):
> 
> Required ioctls:
> test VIDIOC_QUERYCAP: OK
> 
> Allow for multiple opens:
> test second video open: OK
> test VIDIOC_QUERYCAP: OK
> test VIDIOC_G/S_PRIORITY: OK
> 
> Debug ioctls:
> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> test VIDIOC_LOG_STATUS: OK
> 
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 1 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK
> 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)
> 
> Test input 0:
> 
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> test VIDIOC_QUERYCTRL: OK
> test VIDIOC_G/S_CTRL: OK
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 11 Private Controls: 0
> 
> Format ioctls:
> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> test VIDIOC_G/S_PARM: OK
> test VIDIOC_G_FBUF: OK (Not Supported)
> test VIDIOC_G_FMT: OK
> test VIDIOC_TRY_FMT: OK
> test VIDIOC_S_FMT: OK
> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> test Cropping: OK (Not Supported)
> test Composing: OK (Not Supported)
> test Scaling: OK (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
> 

[GIT PULL FOR v4.8] Various fixes

2016-07-10 Thread Hans Verkuil
The following changes since commit a4d020e97d8e65d57061677c15c89e99609d0b37:

  [media] Convert Wideview WT220 DVB USB driver to rc-core (2016-07-09 12:10:33 
-0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v4.8i

for you to fetch changes up to 2c8a580725db08a7639f449a43b05328810c7bcb:

  cx23885: Add support for Hauppauge WinTV quadHD DVB version (2016-07-11 
07:09:05 +0200)


Andrey Utkin (1):
  media: solo6x10: increase FRAME_BUF_SIZE

Fengguang Wu (1):
  mtk-vcodec: fix platform_no_drv_owner.cocci warnings

Hans Verkuil (10):
  vivid: set V4L2_CAP_TIMEPERFRAME
  af9033: fix compiler warnings
  adv7511: drop adv7511_set_IT_content_AVI_InfoFrame
  adv7511: fix quantization range handling
  adv7604/adv7842: fix quantization range handling
  ezkit/cobalt: drop unused op_656_range setting
  adv7604/adv7842: drop unused op_656_range and alt_data_sat fields.
  v4l2-ioctl: zero the v4l2_bt_timings reserved field
  adv7511: the h/vsync polarities were always positive
  cec: add check if adapter is unregistered.

Matthew Leach (1):
  media: usbtv: prevent access to free'd resources

Stephen Backway (1):
  cx23885: Add support for Hauppauge WinTV quadHD DVB version

Tiffany Lin (1):
  mtk-vcodec: fix sparse warning

 Documentation/video4linux/CARDLIST.cx23885 |   1 +
 arch/blackfin/mach-bf609/boards/ezkit.c|   2 -
 drivers/media/dvb-frontends/af9033.c   |   4 +-
 drivers/media/i2c/adv7511.c|  44 
+---
 drivers/media/i2c/adv7604.c|  27 +++-
 drivers/media/i2c/adv7842.c|  26 
 drivers/media/pci/cobalt/cobalt-driver.c   |   2 -
 drivers/media/pci/cx23885/cx23885-cards.c  |  59 
--
 drivers/media/pci/cx23885/cx23885-dvb.c| 100 
-
 drivers/media/pci/cx23885/cx23885.h|   1 +
 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c |   2 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |   1 -
 drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c   |   7 +++-
 drivers/media/platform/vivid/vivid-vid-cap.c   |   1 +
 drivers/media/usb/usbtv/usbtv-audio.c  |   5 +++
 drivers/media/v4l2-core/v4l2-ioctl.c   |   4 +-
 drivers/staging/media/cec/cec-adap.c   |   5 ++-
 include/media/i2c/adv7604.h|   2 -
 include/media/i2c/adv7842.h|   2 -
 19 files changed, 220 insertions(+), 75 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] vcodec: mediatek: Add g/s_selection support for V4L2 Encoder

2016-07-10 Thread Hans Verkuil
Hi Tiffany,

My apologies for the delay, but here is my review at last:

On 05/30/2016 09:52 AM, Tiffany Lin wrote:
> This patch add g/s_selection support for MT8173
> 
> Signed-off-by: Tiffany Lin 
> ---
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   74 
> 
>  1 file changed, 74 insertions(+)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
> b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 6e72d73..23ef9a1 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -630,6 +630,77 @@ static int vidioc_try_fmt_vid_out_mplane(struct file 
> *file, void *priv,
>   return vidioc_try_fmt(f, fmt);
>  }
>  
> +static int vidioc_venc_g_selection(struct file *file, void *priv,
> +  struct v4l2_selection *s)
> +{
> + struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
> + struct mtk_q_data *q_data;
> +
> + /* crop means compose for output devices */
> + switch (s->target) {
> + case V4L2_SEL_TGT_CROP_DEFAULT:
> + case V4L2_SEL_TGT_CROP_BOUNDS:
> + case V4L2_SEL_TGT_CROP:
> + case V4L2_SEL_TGT_COMPOSE_DEFAULT:
> + case V4L2_SEL_TGT_COMPOSE_BOUNDS:
> + case V4L2_SEL_TGT_COMPOSE:
> + if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
> + mtk_v4l2_err("Invalid s->type = %d", s->type);
> + return -EINVAL;
> + }
> + break;
> + default:
> + mtk_v4l2_err("Invalid s->target = %d", s->target);
> + return -EINVAL;
> + }
> +
> + q_data = mtk_venc_get_q_data(ctx, s->type);
> + if (!q_data)
> + return -EINVAL;
> +
> + s->r.top = 0;
> + s->r.left = 0;
> + s->r.width = q_data->visible_width;
> + s->r.height = q_data->visible_height;
> +
> + return 0;
> +}
> +
> +static int vidioc_venc_s_selection(struct file *file, void *priv,
> +  struct v4l2_selection *s)
> +{
> + struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
> + struct mtk_q_data *q_data;
> +
> + switch (s->target) {
> + case V4L2_SEL_TGT_CROP_DEFAULT:
> + case V4L2_SEL_TGT_CROP_BOUNDS:
> + case V4L2_SEL_TGT_CROP:
> + case V4L2_SEL_TGT_COMPOSE_DEFAULT:
> + case V4L2_SEL_TGT_COMPOSE_BOUNDS:
> + case V4L2_SEL_TGT_COMPOSE:
> + if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
> + mtk_v4l2_err("Invalid s->type = %d", s->type);
> + return -EINVAL;
> + }
> + break;
> + default:
> + mtk_v4l2_err("Invalid s->target = %d", s->target);
> + return -EINVAL;
> + }
> +
> + q_data = mtk_venc_get_q_data(ctx, s->type);
> + if (!q_data)
> + return -EINVAL;
> +
> + s->r.top = 0;
> + s->r.left = 0;
> + q_data->visible_width = s->r.width;
> + q_data->visible_height = s->r.height;

This makes no sense.

See this page:

https://hverkuil.home.xs4all.nl/spec/media.html#selection-api

For the video output direction (memory -> HW encoder) the data source is
the memory, the data sink is the HW encoder. For the video capture direction
(HW encoder -> memory) the data source is the HW encoder and the data sink
is the memory.

Usually for m2m devices the video output direction may support cropping and
the video capture direction may support composing.

It's not clear what you intend here, especially since you set left and right
to 0. That's not what the selection operation is supposed to do.

Regards,

Hans

> +
> + return 0;
> +}
> +
>  static int vidioc_venc_qbuf(struct file *file, void *priv,
>   struct v4l2_buffer *buf)
>  {
> @@ -688,6 +759,9 @@ const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = {
>  
>   .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs,
>   .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf,
> +
> + .vidioc_g_selection = vidioc_venc_g_selection,
> + .vidioc_s_selection = vidioc_venc_s_selection,
>  };
>  
>  static int vb2ops_venc_queue_setup(struct vb2_queue *vq,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-07-10 Thread Hans Verkuil
On 07/11/2016 05:48 AM, tiffany lin wrote:
> 
> reviewed-by: Tiffany Lin 
> 
> 
> May I know why and how we use struct device *alloc_devs[] in queue_setup
> callback function?

That's only needed if the hardware has to allocate each plane buffer from a
different memory bank. That's important for the exynos4 SoCs. All other devices
just need a single device struct which you set in the vb2_queue dev field.

The alloc_devs array is prefilled with that dev pointer and drivers can override
it here is they need to (as mentioned, currently only exynos4 needs that).

Regards,

Hans

> 
> 
> best regards,
> Tiffany
> 
> On Fri, 2016-07-08 at 21:11 +0200, Hans Verkuil wrote:
>> 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 = _dma_contig_memops;
>>  src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>>  src_vq->lock= >dev->dev_mutex;
>> +src_vq->dev = >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 = _dma_contig_memops;
>>  dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>>  dst_vq->lock= >dev->dev_mutex;
>> +dst_vq->dev = >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 

Re: [PATCH v3 0/9] Add MT8173 Video Decoder Driver

2016-07-10 Thread tiffany lin
Hi Hans,

On Fri, 2016-07-08 at 13:44 +0200, Hans Verkuil wrote:
> 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.
> 
Got it. We will return 0 as the value instead EAGAIN.

> > 
> >>> 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.
> 
Got it. I will rerun using latest v4l2-compliance test check this.

> >>> 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.
> 
Got it. I will rerun using master branch to check this.

best regards,
Tiffany

> 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 

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

2016-07-10 Thread tiffany lin

reviewed-by: Tiffany Lin 


May I know why and how we use struct device *alloc_devs[] in queue_setup
callback function?


best regards,
Tiffany

On Fri, 2016-07-08 at 21:11 +0200, Hans Verkuil wrote:
> 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 = _dma_contig_memops;
>   src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>   src_vq->lock= >dev->dev_mutex;
> + src_vq->dev = >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 = _dma_contig_memops;
>   dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>   dst_vq->lock= >dev->dev_mutex;
> + dst_vq->dev = >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(>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(_venc_m2m_ops);
>   if 

af9033: fix compiler warnings

2016-07-10 Thread Hans Verkuil
Fix two warnings:

af9033.c: In function 'af9033_read_status':
af9033.c:883:25: warning: 'snr_lut' may be used uninitialized in this function 
[-Wmaybe-uninitialized]
   const struct val_snr *snr_lut;
 ^
af9033.c:952:25: warning: 'tmp' may be used uninitialized in this function 
[-Wmaybe-uninitialized]
   c->cnr.stat[0].svalue = tmp;
 ^

Signed-off-by: Hans Verkuil 

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index 6c2f9b8..9a8157a 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -816,7 +816,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum 
fe_status *status)
 {
struct af9033_dev *dev = fe->demodulator_priv;
struct dtv_frontend_properties *c = >dtv_property_cache;
-   int ret, i, tmp;
+   int ret, i, tmp = 0;
u8 u8tmp, buf[7];

dev_dbg(>client->dev, "\n");
@@ -880,7 +880,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum 
fe_status *status)
/* CNR */
if (dev->fe_status & FE_HAS_VITERBI) {
u32 snr_val, snr_lut_size;
-   const struct val_snr *snr_lut;
+   const struct val_snr *snr_lut = NULL;

/* read value */
ret = af9033_rd_regs(dev, 0x80002c, buf, 3);
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: WARNINGS

2016-07-10 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Mon Jul 11 04:00:30 CEST 2016
git branch: test
git hash:   a4d020e97d8e65d57061677c15c89e99609d0b37
gcc version:i686-linux-gcc (GCC) 5.3.0
sparse version: v0.5.0-56-g7647c77
smatch version: v0.5.0-3428-gdfe27cf
host hardware:  x86_64
host os:4.6.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mtk: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-pxa: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16.7-i686: OK
linux-3.17.8-i686: OK
linux-3.18.7-i686: OK
linux-3.19-i686: OK
linux-4.0-i686: OK
linux-4.1.1-i686: OK
linux-4.2-i686: OK
linux-4.3-i686: OK
linux-4.4-i686: OK
linux-4.5-i686: OK
linux-4.6-i686: OK
linux-4.7-rc1-i686: OK
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16.7-x86_64: OK
linux-3.17.8-x86_64: OK
linux-3.18.7-x86_64: OK
linux-3.19-x86_64: OK
linux-4.0-x86_64: OK
linux-4.1.1-x86_64: OK
linux-4.2-x86_64: OK
linux-4.3-x86_64: OK
linux-4.4-x86_64: OK
linux-4.5-x86_64: OK
linux-4.6-x86_64: OK
linux-4.7-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: WARNINGS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Monday.tar.bz2

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH 2/2] drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency

2016-07-10 Thread tiffany lin
On Fri, 2016-07-08 at 21:11 +0200, Hans Verkuil wrote:
> 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

reviewed-by: Tiffany Lin 


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


Re: [PATCH 1/2] mtk-vcodec: fix two compiler warnings

2016-07-10 Thread tiffany lin
On Sat, 2016-07-09 at 09:32 +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> mtk-vcodec/mtk_vcodec_enc.c: In function 'mtk_venc_worker':
> mtk-vcodec/mtk_vcodec_enc.c:1030:43: warning: format '%lx' expects argument 
> of type 'long unsigned int', but argument 7 has type 'size_t {aka unsigned 
> int}' [-Wformat=]
> mtk-vcodec/mtk_vcodec_enc.c:1030:43: warning: format '%lx' expects argument 
> of type 'long unsigned int', but argument 10 has type 'size_t {aka unsigned 
> int}' [-Wformat=]
> 
> Signed-off-by: Hans Verkuil 
> ---
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
> b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 6dcae0a..907a6d1 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -1028,7 +1028,7 @@ static void mtk_venc_worker(struct work_struct *work)
>   bs_buf.size = (size_t)dst_buf->planes[0].length;
>  
>   mtk_v4l2_debug(2,
> - "Framebuf VA=%p PA=%llx Size=0x%lx;VA=%p PA=0x%llx 
> Size=0x%lx;VA=%p PA=0x%llx Size=%zu",
> + "Framebuf VA=%p PA=%llx Size=0x%zx;VA=%p PA=0x%llx 
> Size=0x%zx;VA=%p PA=0x%llx Size=%zu",
>   frm_buf.fb_addr[0].va,
>   (u64)frm_buf.fb_addr[0].dma_addr,
>   frm_buf.fb_addr[0].size,

reviewed-by: Tiffany Lin 

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


Re: [PATCH 2/2] mtk-vcodec: fix compiler warning

2016-07-10 Thread tiffany lin
On Sat, 2016-07-09 at 09:32 +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> mtk-vcodec/venc_vpu_if.c:40:30: warning: cast to pointer from integer of 
> different size [-Wint-to-pointer-cast]
>   struct venc_vpu_inst *vpu = (struct venc_vpu_inst *)msg->venc_inst;
>   ^
> 
> Note: venc_inst is u64.
> 
> Signed-off-by: Hans Verkuil 
> ---
>  drivers/media/platform/mtk-vcodec/venc_vpu_if.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c 
> b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> index b92c6d2..a01c759 100644
> --- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> +++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> @@ -37,7 +37,8 @@ static void handle_enc_encode_msg(struct venc_vpu_inst 
> *vpu, void *data)
>  static void vpu_enc_ipi_handler(void *data, unsigned int len, void *priv)
>  {
>   struct venc_vpu_ipi_msg_common *msg = data;
> - struct venc_vpu_inst *vpu = (struct venc_vpu_inst *)msg->venc_inst;
> + struct venc_vpu_inst *vpu =
> + (struct venc_vpu_inst *)(unsigned long)msg->venc_inst;
>  
reviewed-by: Tiffany Lin 

>   mtk_vcodec_debug(vpu, "msg_id %x inst %p status %d",
>msg->msg_id, vpu, msg->status);


--
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-10 Thread tiffany lin
Hi Hans,

On Fri, 2016-07-08 at 12:23 +0200, Hans Verkuil wrote:
> 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?
> 

It can be as input format for encoder, MDP and display drivers in our
platform.
This private format is only available in our platform.
So I put it in "Reserved Format Identifiers" sections.


best regards,
Tiffany

> Regards,
> 
>   Hans
> 
> > + 
> > 
> >
> >  
> > 


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


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

2016-07-10 Thread tiffany lin
Hi Hans,

On Fri, 2016-07-08 at 12:18 +0200, Hans Verkuil wrote:
> 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.
> 
Got it. I will fix this.

best regards,
Tiffany

> 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 06/11] media: adv7180: add bt.656-4 OF property

2016-07-10 Thread Steve Longerbeam



On 07/10/2016 07:30 AM, Hans Verkuil wrote:

On 07/10/2016 04:17 PM, Ian Arkver wrote:

On 10/07/16 13:55, Hans Verkuil wrote:

On 07/10/2016 02:10 PM, Lars-Peter Clausen wrote:

On 07/09/2016 11:36 PM, Steve Longerbeam wrote:

On 07/09/2016 02:10 PM, Steve Longerbeam wrote:

On 07/09/2016 11:59 AM, Steve Longerbeam wrote:

On 07/07/2016 07:52 AM, Lars-Peter Clausen wrote:

On 07/07/2016 12:59 AM, Steve Longerbeam wrote:

Add a device tree boolean property "bt656-4" to allow setting
the ITU-R BT.656-4 compatible bit.

Signed-off-by: Steve Longerbeam 

+/* select ITU-R BT.656-4 compatible? */

Please don't use the '-4': BT.656 is sufficient. The -4 is just the version
number of the standard (and 5 is the latest anyway).

  From the ADV7180 DS [1]:

BT.656-4, ITU-R BT.656-4 Enable, Address 0x04[7]

Between Revision 3 and Revision 4 of the ITU-R BT.656 standards, the ITU
has changed the toggling position for the V bit within the SAV EAV codes
for NTSC. The ITU-R BT.656-4 standard bit allows the user to select an
output mode that is compliant with either the previous or new standard.
For further information, visit the International Telecommunication Union
website.

Note that the standard change only affects NTSC and has no bearing on PAL.

When ITU-R BT.656-4 is 0 (default), the ITU-R BT.656-3 specification is
used. The V bit goes low at EAV of Line 10 and Line 273.

When ITU-R BT.656-4 is 1, the ITU-R BT.656-4 specification is used. The
V bit goes low at EAV of Line 20 and Line 283.

[1]www.analog.com/media/en/technical-documentation/data-sheets/*ADV7180*.pdf

Rev 4 came in in 1998. I would say that that is the default. We have had any
problems with this and I would need some proof that this is really needed.


Hi Hans, yeah I agree with you that new capture drivers should not
expect BT.656-3 compatible buss' any longer. The problem with i.MX6
however, is that the IPU CSI CCIR_CODE registers, which inform the IPU
about the AV code positions, are very poorly documented. In order for
i.MX6 to support BT.656-4 it would require very time-consuming reverse
engineering to find the right values to plug into those registers to conform
to the BT.656-4 AV code positions.

Steve

--
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/5] [media] redrat3: fix timeout handling

2016-07-10 Thread Sean Young
The redrat3 sends an usb packet to the host either when the minimum pause
or the timeout occurs, so we can always add a trailing space in our
processing.

Signed-off-by: Sean Young 
---
 drivers/media/rc/redrat3.c | 48 +++---
 1 file changed, 11 insertions(+), 37 deletions(-)

diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 6adea78..1e65f7a 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -188,8 +188,7 @@ struct redrat3_dev {
/* usb dma */
dma_addr_t dma_in;
 
-   /* rx signal timeout timer */
-   struct timer_list rx_timeout;
+   /* rx signal timeout */
u32 hw_timeout;
 
/* Is the device currently transmitting?*/
@@ -330,22 +329,11 @@ static u32 redrat3_us_to_len(u32 microsec)
return result ? result : 1;
 }
 
-/* timer callback to send reset event */
-static void redrat3_rx_timeout(unsigned long data)
-{
-   struct redrat3_dev *rr3 = (struct redrat3_dev *)data;
-
-   dev_dbg(rr3->dev, "calling ir_raw_event_reset\n");
-   ir_raw_event_reset(rr3->rc);
-}
-
 static void redrat3_process_ir_data(struct redrat3_dev *rr3)
 {
DEFINE_IR_RAW_EVENT(rawir);
struct device *dev;
-   unsigned i, trailer = 0;
-   unsigned sig_size, single_len, offset, val;
-   unsigned long delay;
+   unsigned int i, sig_size, single_len, offset, val;
u32 mod_freq;
 
if (!rr3) {
@@ -355,10 +343,6 @@ static void redrat3_process_ir_data(struct redrat3_dev 
*rr3)
 
dev = rr3->dev;
 
-   /* Make sure we reset the IR kfifo after a bit of inactivity */
-   delay = usecs_to_jiffies(rr3->hw_timeout);
-   mod_timer(>rx_timeout, jiffies + delay);
-
mod_freq = redrat3_val_to_mod_freq(>irdata);
dev_dbg(dev, "Got mod_freq of %u\n", mod_freq);
 
@@ -376,9 +360,6 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3)
rawir.pulse = true;
 
rawir.duration = US_TO_NS(single_len);
-   /* Save initial pulse length to fudge trailer */
-   if (i == 0)
-   trailer = rawir.duration;
/* cap the value to IR_MAX_DURATION */
rawir.duration = (rawir.duration > IR_MAX_DURATION) ?
 IR_MAX_DURATION : rawir.duration;
@@ -388,18 +369,13 @@ static void redrat3_process_ir_data(struct redrat3_dev 
*rr3)
ir_raw_event_store_with_filter(rr3->rc, );
}
 
-   /* add a trailing space, if need be */
-   if (i % 2) {
-   rawir.pulse = false;
-   /* this duration is made up, and may not be ideal... */
-   if (trailer < US_TO_NS(1000))
-   rawir.duration = US_TO_NS(2800);
-   else
-   rawir.duration = trailer;
-   dev_dbg(dev, "storing trailing space with duration %d\n",
-   rawir.duration);
-   ir_raw_event_store_with_filter(rr3->rc, );
-   }
+   /* add a trailing space */
+   rawir.pulse = false;
+   rawir.timeout = true;
+   rawir.duration = US_TO_NS(rr3->hw_timeout);
+   dev_dbg(dev, "storing trailing timeout with duration %d\n",
+   rawir.duration);
+   ir_raw_event_store_with_filter(rr3->rc, );
 
dev_dbg(dev, "calling ir_raw_event_handle\n");
ir_raw_event_handle(rr3->rc);
@@ -880,7 +856,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct 
redrat3_dev *rr3)
rc->priv = rr3;
rc->driver_type = RC_DRIVER_IR_RAW;
rc->allowed_protocols = RC_BIT_ALL;
-   rc->timeout = US_TO_NS(2750);
+   rc->timeout = US_TO_NS(rr3->hw_timeout);
rc->tx_ir = redrat3_transmit_ir;
rc->s_tx_carrier = redrat3_set_tx_carrier;
rc->driver_name = DRIVER_NAME;
@@ -990,7 +966,7 @@ static int redrat3_dev_probe(struct usb_interface *intf,
if (retval < 0)
goto error;
 
-   /* store current hardware timeout, in us, will use for kfifo resets */
+   /* store current hardware timeout, in µs */
rr3->hw_timeout = redrat3_get_timeout(rr3);
 
/* default.. will get overridden by any sends with a freq defined */
@@ -1026,7 +1002,6 @@ static int redrat3_dev_probe(struct usb_interface *intf,
retval = -ENOMEM;
goto led_free_error;
}
-   setup_timer(>rx_timeout, redrat3_rx_timeout, (unsigned long)rr3);
 
/* we can register the device now, as it is ready */
usb_set_intfdata(intf, rr3);
@@ -1055,7 +1030,6 @@ static void redrat3_dev_disconnect(struct usb_interface 
*intf)
usb_set_intfdata(intf, NULL);
rc_unregister_device(rr3->rc);
led_classdev_unregister(>led);
-   del_timer_sync(>rx_timeout);
redrat3_delete(rr3, udev);
 }
 
-- 
2.7.4

--
To unsubscribe from this list: send 

[PATCH 4/5] [media] redrat3: make hardware timeout configurable

2016-07-10 Thread Sean Young
Signed-off-by: Sean Young 
---
 drivers/media/rc/ir-lirc-codec.c |  5 -
 drivers/media/rc/redrat3.c   | 34 ++
 include/media/rc-core.h  |  3 +++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 5effc65..c327730 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -292,7 +292,10 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int 
cmd,
tmp > dev->max_timeout)
return -EINVAL;
 
-   dev->timeout = tmp;
+   if (dev->s_timeout)
+   ret = dev->s_timeout(dev, tmp);
+   if (!ret)
+   dev->timeout = tmp;
break;
 
case LIRC_SET_REC_TIMEOUT_REPORTS:
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 1e65f7a..399f44d 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -475,6 +475,37 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3)
return timeout;
 }
 
+static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns)
+{
+   struct redrat3_dev *rr3 = rc_dev->priv;
+   struct usb_device *udev = rr3->udev;
+   struct device *dev = rr3->dev;
+   u32 *timeout;
+   int ret;
+
+   timeout = kmalloc(sizeof(*timeout), GFP_KERNEL);
+   if (!timeout)
+   return -ENOMEM;
+
+   *timeout = cpu_to_be32(redrat3_us_to_len(timeoutns / 1000));
+   ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), RR3_SET_IR_PARAM,
+USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
+RR3_IR_IO_SIG_TIMEOUT, 0, timeout, sizeof(*timeout),
+HZ * 25);
+   dev_dbg(dev, "set ir parm timeout %d ret 0x%02x\n",
+   be32_to_cpu(*timeout), ret);
+
+   if (ret == sizeof(*timeout)) {
+   rr3->hw_timeout = timeoutns / 1000;
+   ret = 0;
+   } else if (ret >= 0)
+   ret = -EIO;
+
+   kfree(timeout);
+
+   return ret;
+}
+
 static void redrat3_reset(struct redrat3_dev *rr3)
 {
struct usb_device *udev = rr3->udev;
@@ -856,7 +887,10 @@ static struct rc_dev *redrat3_init_rc_dev(struct 
redrat3_dev *rr3)
rc->priv = rr3;
rc->driver_type = RC_DRIVER_IR_RAW;
rc->allowed_protocols = RC_BIT_ALL;
+   rc->min_timeout = MS_TO_NS(RR3_RX_MIN_TIMEOUT);
+   rc->max_timeout = MS_TO_NS(RR3_RX_MAX_TIMEOUT);
rc->timeout = US_TO_NS(rr3->hw_timeout);
+   rc->s_timeout = redrat3_set_timeout;
rc->tx_ir = redrat3_transmit_ir;
rc->s_tx_carrier = redrat3_set_tx_carrier;
rc->driver_name = DRIVER_NAME;
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 0f77b3d..b69d946 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -119,6 +119,7 @@ enum rc_filter_type {
  * @s_carrier_report: enable carrier reports
  * @s_filter: set the scancode filter
  * @s_wakeup_filter: set the wakeup scancode filter
+ * @s_timeout: set hardware timeout in ns
  */
 struct rc_dev {
struct device   dev;
@@ -174,6 +175,8 @@ struct rc_dev {
struct rc_scancode_filter 
*filter);
int (*s_wakeup_filter)(struct rc_dev *dev,
   struct 
rc_scancode_filter *filter);
+   int (*s_timeout)(struct rc_dev *dev,
+unsigned int timeout);
 };
 
 #define to_rc_dev(d) container_of(d, struct rc_dev, 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 5/5] [media] redrat3: add sysfs attributes for hardware specific options

2016-07-10 Thread Sean Young
Signed-off-by: Sean Young 
---
 Documentation/ABI/testing/sysfs-class-rc-redrat3 |  33 
 drivers/media/rc/redrat3.c   | 200 +++
 2 files changed, 233 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-rc-redrat3

diff --git a/Documentation/ABI/testing/sysfs-class-rc-redrat3 
b/Documentation/ABI/testing/sysfs-class-rc-redrat3
new file mode 100644
index 000..33a24fa
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-rc-redrat3
@@ -0,0 +1,33 @@
+What:  /sys/class/rc/rcN/length_fuzz
+Date:  Jul 2016
+KernelVersion: 4.8
+Contact:   Mauro Carvalho Chehab 
+Description:
+   The redrat3 encodes an IR signal as set of different lengths
+   and a set of indices into those lengths. Writing this file
+   sets how much two lengths must differ before they are
+   considered distinct, the value is specified in microseconds.
+   Default 5, value 0 to 127.
+
+What:  /sys/class/rc/rcN/min_pause
+Date:  Jul 2016
+KernelVersion: 4.8
+Contact:   Mauro Carvalho Chehab 
+Description:
+   When receiving a continuous ir stream (for example when a user
+   is holding a button down on a remote), this specifies the
+   minimum size of a space when the redrat3 sends a irdata packet
+   to the host. Specified in miliseconds. Default value 18ms.
+   The value can be between 2 and 30 inclusive.
+
+What:  /sys/class/rc/rcN/periods_measure_carrier
+Date:  Jul 2016
+KernelVersion: 4.8
+Contact:   Mauro Carvalho Chehab 
+Description:
+   The carrier frequency is measured during the first pulse of
+   the IR signal. The larger the number of periods used To
+   measure, the more accurate the result is likely to be, however
+   some signals have short initial pulses, so in some case it
+   may be necessary for applications to reduce this value.
+   Default 8, value 1 to 255.
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 399f44d..8365547 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -860,6 +860,195 @@ static void redrat3_led_complete(struct urb *urb)
atomic_dec(>flash);
 }
 
+static ssize_t min_pause_store(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t len)
+{
+   struct rc_dev *rc_dev = to_rc_dev(dev);
+   struct redrat3_dev *rr3 = rc_dev->priv;
+   struct usb_device *udev = rr3->udev;
+   long value;
+   u8 *pause;
+   int rc;
+
+   rc = kstrtol(buf, 0, );
+   if (rc)
+   return rc;
+
+   if (value < 2 || value > 30)
+   return -EINVAL;
+
+   pause = kmalloc(sizeof(*pause), GFP_KERNEL);
+   if (!pause)
+   return -ENOMEM;
+
+   *pause = (65536 - (value * 2000)) / 256;
+   rc = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), RR3_SET_IR_PARAM,
+USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
+RR3_IR_IO_MIN_PAUSE, 0, pause, sizeof(*pause), HZ * 25);
+   dev_dbg(dev, "set ir parm min pause %d rc 0x%02x\n", *pause, rc);
+   if (rc == sizeof(*pause))
+   rc = len;
+
+   kfree(pause);
+
+   return rc;
+}
+
+static ssize_t min_pause_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct rc_dev *rc_dev = to_rc_dev(dev);
+   struct redrat3_dev *rr3 = rc_dev->priv;
+   struct usb_device *udev = rr3->udev;
+   int rc;
+   u8 *pause;
+
+   pause = kmalloc(sizeof(*pause), GFP_KERNEL);
+   if (!pause)
+   return -ENOMEM;
+
+   rc = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), RR3_GET_IR_PARAM,
+USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+RR3_IR_IO_MIN_PAUSE, 0, pause, sizeof(*pause), HZ * 25);
+   dev_dbg(dev, "get ir parm len pause %d rc 0x%02x\n", *pause, rc);
+   if (rc == sizeof(*pause))
+   rc = sprintf(buf, "%d\n", (65536 - 256 * *pause) / 2000);
+
+   kfree(pause);
+
+   return rc;
+}
+
+static ssize_t length_fuzz_store(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t len)
+{
+   struct rc_dev *rc_dev = to_rc_dev(dev);
+   struct redrat3_dev *rr3 = rc_dev->priv;
+   struct usb_device *udev = rr3->udev;
+   long value;
+   u8 *fuzz;
+   int rc;
+
+   rc = kstrtol(buf, 0, );
+   if (rc)
+   return rc;
+
+   if (value < 0 || value > 127)
+   return -EINVAL;
+
+   fuzz = kmalloc(sizeof(*fuzz), GFP_KERNEL);
+ 

[PATCH] [V4L-UTILS] ir-ctl: add new tool for sending & receiving raw IR

2016-07-10 Thread Sean Young
Currently v4l-utils has no tooling provided for receiving and sending
raw IR using the lirc interface. Some of this can be done using various
tools from the user-space lirc package, but not everything is covered.

We want to be able to do the following:
 - List all the features that a lirc device provides
 - Set all possible receiving and sending parameters
 - Send raw IR, formatted as a text file
 - Record raw IR, with output in the same format as for sending
 - Testbed for lirc drivers. Driver misbehaviour is reported

The need for this is not new. The manufacturer of the IguanaWorks IR
device have a similar tool which is IguanaIR specific:

http://www.iguanaworks.net/2012/igclient-examples/

Also RedRat3 provide a similar tools but this uses a signal database
for sending IR, and is redrat specific.

http://www.redrat.co.uk/software/redrat-linux-ir-tools/

Lirc provides a tool for reading raw IR but no method of sending it.

http://www.lirc.org/html/mode2.html

None of these provides full coverage of the basic raw IR lirc interface,
hence v4l-utils seems like logical place to provide this functionality. It
can be used as a tool for testing features of lirc drivers.

Signed-off-by: Sean Young 
---
 configure.ac |   2 +
 include/media/lirc.h | 168 +++
 utils/Makefile.am|   1 +
 utils/ir-ctl/.gitignore  |   2 +
 utils/ir-ctl/Makefile.am |   6 +
 utils/ir-ctl/ir-ctl.1.in | 192 
 utils/ir-ctl/ir-ctl.c| 759 +++
 v4l-utils.spec.in|   6 +-
 8 files changed, 1134 insertions(+), 2 deletions(-)
 create mode 100644 include/media/lirc.h
 create mode 100644 utils/ir-ctl/.gitignore
 create mode 100644 utils/ir-ctl/Makefile.am
 create mode 100644 utils/ir-ctl/ir-ctl.1.in
 create mode 100644 utils/ir-ctl/ir-ctl.c

diff --git a/configure.ac b/configure.ac
index 2616f92..41ab97b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,7 @@ AC_CONFIG_FILES([Makefile
utils/decode_tm6000/Makefile
utils/dvb/Makefile
utils/keytable/Makefile
+   utils/ir-ctl/Makefile
utils/cx18-ctl/Makefile
utils/ivtv-ctl/Makefile
utils/media-ctl/Makefile
@@ -59,6 +60,7 @@ AC_CONFIG_FILES([Makefile
utils/v4l2-compliance/v4l2-compliance.1
utils/v4l2-ctl/v4l2-ctl.1
utils/keytable/ir-keytable.1
+   utils/ir-ctl/ir-ctl.1
utils/dvb/dvb-fe-tool.1
utils/dvb/dvbv5-scan.1
utils/dvb/dvb-format-convert.1
diff --git a/include/media/lirc.h b/include/media/lirc.h
new file mode 100644
index 000..4b3ab29
--- /dev/null
+++ b/include/media/lirc.h
@@ -0,0 +1,168 @@
+/*
+ * lirc.h - linux infrared remote control header file
+ * last modified 2010/07/13 by Jarod Wilson
+ */
+
+#ifndef _LINUX_LIRC_H
+#define _LINUX_LIRC_H
+
+#include 
+#include 
+
+#define PULSE_BIT   0x0100
+#define PULSE_MASK  0x00FF
+
+#define LIRC_MODE2_SPACE 0x
+#define LIRC_MODE2_PULSE 0x0100
+#define LIRC_MODE2_FREQUENCY 0x0200
+#define LIRC_MODE2_TIMEOUT   0x0300
+
+#define LIRC_VALUE_MASK  0x00FF
+#define LIRC_MODE2_MASK  0xFF00
+
+#define LIRC_SPACE(val) (((val)_VALUE_MASK) | LIRC_MODE2_SPACE)
+#define LIRC_PULSE(val) (((val)_VALUE_MASK) | LIRC_MODE2_PULSE)
+#define LIRC_FREQUENCY(val) (((val)_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
+#define LIRC_TIMEOUT(val) (((val)_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
+
+#define LIRC_VALUE(val) ((val)_VALUE_MASK)
+#define LIRC_MODE2(val) ((val)_MODE2_MASK)
+
+#define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE)
+#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
+#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
+#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
+
+/* used heavily by lirc userspace */
+#define lirc_t int
+
+/*** lirc compatible hardware features ***/
+
+#define LIRC_MODE2SEND(x) (x)
+#define LIRC_SEND2MODE(x) (x)
+#define LIRC_MODE2REC(x) ((x) << 16)
+#define LIRC_REC2MODE(x) ((x) >> 16)
+
+#define LIRC_MODE_RAW  0x0001
+#define LIRC_MODE_PULSE0x0002
+#define LIRC_MODE_MODE20x0004
+#define LIRC_MODE_LIRCCODE 0x0010
+
+
+#define LIRC_CAN_SEND_RAW  LIRC_MODE2SEND(LIRC_MODE_RAW)
+#define LIRC_CAN_SEND_PULSELIRC_MODE2SEND(LIRC_MODE_PULSE)
+#define LIRC_CAN_SEND_MODE2LIRC_MODE2SEND(LIRC_MODE_MODE2)
+#define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE)
+
+#define LIRC_CAN_SEND_MASK 0x003f
+
+#define LIRC_CAN_SET_SEND_CARRIER  0x0100
+#define LIRC_CAN_SET_SEND_DUTY_CYCLE   0x0200
+#define LIRC_CAN_SET_TRANSMITTER_MASK  0x0400
+
+#define LIRC_CAN_REC_RAW   LIRC_MODE2REC(LIRC_MODE_RAW)
+#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE)
+#define LIRC_CAN_REC_MODE2 

[PATCH 2/5] [media] rc: make s_tx_carrier consistent

2016-07-10 Thread Sean Young
LIRC_SET_SEND_CARRIER should return 0 on success or -errno.

Signed-off-by: Sean Young 
---
 Documentation/DocBook/media/v4l/lirc_device_interface.xml | 2 +-
 drivers/media/rc/ene_ir.c | 2 +-
 drivers/media/rc/iguanair.c   | 2 +-
 drivers/media/rc/mceusb.c | 2 +-
 drivers/media/rc/redrat3.c| 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/lirc_device_interface.xml 
b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
index 34cada2..71f9dbb 100644
--- a/Documentation/DocBook/media/v4l/lirc_device_interface.xml
+++ b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
@@ -157,7 +157,7 @@ on working with the default settings initially.
   
 LIRC_SET_{SEND,REC}_CARRIER
 
-  Set send/receive carrier (in Hz).
+  Set send/receive carrier (in Hz). Return 0 on success.
 
   
   
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 8d77e1c..d1c61cd 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -904,7 +904,7 @@ static int ene_set_tx_carrier(struct rc_dev *rdev, u32 
carrier)
 
dbg("TX: out of range %d-%d kHz carrier",
2000 / ENE_CIRMOD_PRD_MIN, 2000 / ENE_CIRMOD_PRD_MAX);
-   return -1;
+   return -EINVAL;
}
 
dev->tx_period = period;
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index ee60e17..5f63454 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -330,7 +330,7 @@ static int iguanair_set_tx_carrier(struct rc_dev *dev, 
uint32_t carrier)
 
mutex_unlock(>lock);
 
-   return carrier;
+   return 0;
 }
 
 static int iguanair_set_tx_mask(struct rc_dev *dev, uint32_t mask)
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 0d1da2c..c6d3325 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -936,7 +936,7 @@ static int mceusb_set_tx_carrier(struct rc_dev *dev, u32 
carrier)
 
}
 
-   return carrier;
+   return 0;
 }
 
 /*
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index ec74244..6adea78 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -708,7 +708,7 @@ static int redrat3_set_tx_carrier(struct rc_dev *rcdev, u32 
carrier)
 
rr3->carrier = carrier;
 
-   return carrier;
+   return 0;
 }
 
 static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf,
-- 
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 1/5] [media] rc: make s_tx_mask consistent

2016-07-10 Thread Sean Young
When s_tx_mask is given an invalid bitmask, the number of transmitters
should be returned. See the LIRC_SET_TRANSMITTER_MASK lirc ioctl
documentation.

Signed-off-by: Sean Young 
---
 drivers/media/rc/mceusb.c  | 6 ++
 drivers/media/rc/winbond-cir.c | 4 
 2 files changed, 10 insertions(+)

diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 35155ae..0d1da2c 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -881,6 +881,12 @@ static int mceusb_set_tx_mask(struct rc_dev *dev, u32 mask)
 {
struct mceusb_dev *ir = dev->priv;
 
+   /* return number of transmitters */
+   int emitters = ir->num_txports ? ir->num_txports : 2;
+
+   if (mask >= (1 << emitters))
+   return emitters;
+
if (ir->flags.tx_mask_normal)
ir->tx_mask = mask;
else
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index d839f73..95ae60e 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -615,6 +615,10 @@ wbcir_txmask(struct rc_dev *dev, u32 mask)
unsigned long flags;
u8 val;
 
+   /* return the number of transmitters */
+   if (mask > 15)
+   return 4;
+
/* Four outputs, only one output can be enabled at a time */
switch (mask) {
case 0x1:
-- 
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 28/54] MAINTAINERS: Add file patterns for media device tree bindings

2016-07-10 Thread Mauro Carvalho Chehab
Em Sun, 22 May 2016 11:06:05 +0200
Geert Uytterhoeven  escreveu:

> Submitters of device tree binding documentation may forget to CC
> the subsystem maintainer if this is missing.

I'm assuming that this patch will go via DT git tree, so:
> 
> Signed-off-by: Geert Uytterhoeven 
> Cc: Mauro Carvalho Chehab 

Acked-by: Mauro Carvalho Chehab 

> Cc: linux-media@vger.kernel.org
> ---
> Please apply this patch directly if you want to be involved in device
> tree binding documentation for your subsystem.
> ---
>  MAINTAINERS | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7acb65bb2590a321..c230cd9ec8aefe45 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7376,6 +7376,7 @@ W:  https://linuxtv.org
>  Q:   http://patchwork.kernel.org/project/linux-media/list/
>  T:   git git://linuxtv.org/media_tree.git
>  S:   Maintained
> +F:   Documentation/devicetree/bindings/media/
>  F:   Documentation/dvb/
>  F:   Documentation/video4linux/
>  F:   Documentation/DocBook/media/


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


[PATCH 1/3] [media] doc-rst: improve documentation for DTV_FREQUENCY

2016-07-10 Thread Mauro Carvalho Chehab
Make the note better formatted and documented.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/dvb/fe_property_parameters.rst  | 26 +-
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst 
b/Documentation/media/uapi/dvb/fe_property_parameters.rst
index 47eb29350717..1b0b1171602d 100644
--- a/Documentation/media/uapi/dvb/fe_property_parameters.rst
+++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst
@@ -39,20 +39,26 @@ effect hardware.
 DTV_FREQUENCY
 =
 
-Central frequency of the channel.
+Frequency of the digital TV transponder/channel.
 
-Notes:
+.. note::
 
-1)For satellite delivery systems, it is measured in kHz. For the other
-ones, it is measured in Hz.
+  #. For satellite delivery systems, the frequency is in kHz.
 
-2)For ISDB-T, the channels are usually transmitted with an offset of
-143kHz. E.g. a valid frequency could be 474143 kHz. The stepping is
-bound to the bandwidth of the channel which is 6MHz.
+  #. For cable and terrestrial delivery systems, the frequency is in
+ Hz.
 
-3)As in ISDB-Tsb the channel consists of only one or three segments the
-frequency step is 429kHz, 3*429 respectively. As for ISDB-T the central
-frequency of the channel is expected.
+  #. On most delivery systems, the frequency is the center frequency
+ of the transponder/channel. The exception is for ISDB-T, where
+ the main carrier has a 1/7 offset from the center.
+
+  #. For ISDB-T, the channels are usually transmitted with an offset of
+ about 143kHz. E.g. a valid frequency could be 474,143 kHz. The
+ stepping is  bound to the bandwidth of the channel which is
+ typically 6MHz.
+
+  #. In ISDB-Tsb, the channel consists of only one or three segments the
+ frequency step is 429kHz, 3*429 respectively.
 
 
 .. _DTV-MODULATION:
-- 
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 3/3] [media] doc-rst: improve display of notes and warnings

2016-07-10 Thread Mauro Carvalho Chehab
There are several notes and warning mesages in the middle of
the media docbook. Use the ReST tags for that, as it makes
them visually better and hightlights them.

While here, modify a few ones to make them clearer.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-close.rst|   4 +-
 Documentation/media/uapi/cec/cec-func-ioctl.rst|   4 +-
 Documentation/media/uapi/cec/cec-func-open.rst |   4 +-
 Documentation/media/uapi/cec/cec-func-poll.rst |   4 +-
 Documentation/media/uapi/cec/cec-intro.rst |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |  38 +++
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|  80 +++---
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst|   4 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |  36 +++---
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst| 122 ++---
 Documentation/media/uapi/cec/cec-ioc-receive.rst   | 114 +--
 .../media/uapi/dvb/dvb-fe-read-status.rst  |  11 +-
 Documentation/media/uapi/dvb/dvbapi.rst|   4 +-
 Documentation/media/uapi/dvb/dvbproperty.rst   |  26 ++---
 Documentation/media/uapi/dvb/examples.rst  |   8 +-
 .../uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst|   5 +-
 Documentation/media/uapi/dvb/fe-get-info.rst   |   4 +-
 Documentation/media/uapi/dvb/fe-read-status.rst|   6 +-
 Documentation/media/uapi/dvb/fe-set-tone.rst   |   8 +-
 Documentation/media/uapi/dvb/fe-set-voltage.rst|  10 +-
 Documentation/media/uapi/dvb/frontend.rst  |   4 +-
 Documentation/media/uapi/gen-errors.rst|  12 +-
 Documentation/media/uapi/rc/lirc_ioctl.rst |  12 +-
 Documentation/media/uapi/v4l/audio.rst |  11 +-
 Documentation/media/uapi/v4l/buffer.rst|  25 +++--
 Documentation/media/uapi/v4l/crop.rst  |  20 ++--
 Documentation/media/uapi/v4l/dev-capture.rst   |   4 +-
 Documentation/media/uapi/v4l/dev-codec.rst |   6 +-
 Documentation/media/uapi/v4l/dev-effect.rst|   9 +-
 Documentation/media/uapi/v4l/dev-osd.rst   |   9 +-
 Documentation/media/uapi/v4l/dev-output.rst|   4 +-
 Documentation/media/uapi/v4l/dev-overlay.rst   |  17 +--
 Documentation/media/uapi/v4l/dev-rds.rst   |   8 +-
 Documentation/media/uapi/v4l/dev-subdev.rst|   6 +-
 Documentation/media/uapi/v4l/dmabuf.rst|  17 +--
 Documentation/media/uapi/v4l/extended-controls.rst |  63 ++-
 Documentation/media/uapi/v4l/func-mmap.rst |  35 +++---
 Documentation/media/uapi/v4l/mmap.rst  |  14 ++-
 Documentation/media/uapi/v4l/pixfmt-006.rst|   8 +-
 Documentation/media/uapi/v4l/pixfmt-007.rst|  32 +++---
 Documentation/media/uapi/v4l/pixfmt-sbggr16.rst|   7 +-
 Documentation/media/uapi/v4l/pixfmt-y16-be.rst |   7 +-
 Documentation/media/uapi/v4l/pixfmt-y16.rst|   5 +-
 Documentation/media/uapi/v4l/standard.rst  |  11 +-
 Documentation/media/uapi/v4l/tuner.rst |  15 +--
 Documentation/media/uapi/v4l/userp.rst |  15 +--
 .../media/uapi/v4l/vidioc-dbg-g-chip-info.rst  |   2 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst   |   2 +-
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst   |   6 +-
 .../media/uapi/v4l/vidioc-enum-dv-timings.rst  |   6 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |  10 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |  14 +--
 .../media/uapi/v4l/vidioc-enum-framesizes.rst  |   6 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |  14 ++-
 .../media/uapi/v4l/vidioc-enumaudioout.rst |   4 +-
 Documentation/media/uapi/v4l/vidioc-enuminput.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst |   6 +-
 .../media/uapi/v4l/vidioc-g-ext-ctrls.rst  |  16 ++-
 .../media/uapi/v4l/vidioc-g-modulator.rst  |  14 ++-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|  22 ++--
 Documentation/media/uapi/v4l/vidioc-qbuf.rst   |  17 +--
 .../media/uapi/v4l/vidioc-query-dv-timings.rst |  20 ++--
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |  35 +++---
 Documentation/media/uapi/v4l/vidioc-querystd.rst   |  20 ++--
 Documentation/media/uapi/v4l/vidioc-streamon.rst   |   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst|   2 +-
 .../media/uapi/v4l/vidioc-subscribe-event.rst  |   8 +-
 69 files changed, 591 insertions(+), 525 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-close.rst 
b/Documentation/media/uapi/cec/cec-func-close.rst
index ae55e55ab84a..bb94e4358910 100644
--- a/Documentation/media/uapi/cec/cec-func-close.rst
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -32,8 +32,8 @@ Arguments
 Description
 ===
 
-Note: this documents the 

[PATCH 2/3] [media] doc-rst: improve DTV_BANDWIDTH_HZ notes

2016-07-10 Thread Mauro Carvalho Chehab
There are several notes for this DTV property. Some are
outdated, so take some care of it, making it updated.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/dvb/fe_property_parameters.rst  | 28 +-
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst 
b/Documentation/media/uapi/dvb/fe_property_parameters.rst
index 1b0b1171602d..f776d62523da 100644
--- a/Documentation/media/uapi/dvb/fe_property_parameters.rst
+++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst
@@ -219,23 +219,29 @@ Bandwidth for the channel, in HZ.
 Possible values: ``1712000``, ``500``, ``600``, ``700``,
 ``800``, ``1000``.
 
-Notes:
+.. note::
 
-1) For ISDB-T it should be always 600Hz (6MHz)
+  #. DVB-T supports 6, 7 and 8MHz.
 
-2) For ISDB-Tsb it can vary depending on the number of connected
-segments
+  #. DVB-T2 supports 1.172, 5, 6, 7, 8 and 10MHz.
 
-3) Bandwidth doesn't apply for DVB-C transmissions, as the bandwidth for
-DVB-C depends on the symbol rate
+  #. ISDB-T supports 5MHz, 6MHz, 7MHz and 8MHz, although most
+ places use 6MHz.
 
-4) Bandwidth in ISDB-T is fixed (6MHz) or can be easily derived from
-other parameters (DTV_ISDBT_SB_SEGMENT_IDX,
-DTV_ISDBT_SB_SEGMENT_COUNT).
+  #. On DVB-C and DVB-S/S2, the bandwidth depends on the symbol rate.
+ So, the Kernel will silently ignore setting :ref:`DTV-BANDWIDTH-HZ`.
 
-5) DVB-T supports 6, 7 and 8MHz.
+  #. For DVB-C and DVB-S/S2, the Kernel will return an estimation of the
+ bandwidth, calculated from :ref:`DTV-SYMBOL-RATE` and from
+ the rolloff, with is fixed for DVB-C and DVB-S.
 
-6) In addition, DVB-T2 supports 1.172, 5 and 10MHz.
+  #. For DVB-S2, the bandwidth estimation will use :ref:`DTV-ROLLOFF`.
+
+  #. For ISDB-Tsb, it can vary depending on the number of connected
+ segments.
+
+  #. Bandwidth in ISDB-Tsb can be easily derived from other parameters
+ (DTV_ISDBT_SB_SEGMENT_IDX, DTV_ISDBT_SB_SEGMENT_COUNT).
 
 
 .. _DTV-INVERSION:
-- 
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 06/11] media: adv7180: add bt.656-4 OF property

2016-07-10 Thread Hans Verkuil
On 07/10/2016 04:17 PM, Ian Arkver wrote:
> On 10/07/16 13:55, Hans Verkuil wrote:
>> On 07/10/2016 02:10 PM, Lars-Peter Clausen wrote:
>>> On 07/09/2016 11:36 PM, Steve Longerbeam wrote:

 On 07/09/2016 02:10 PM, Steve Longerbeam wrote:
>
> On 07/09/2016 11:59 AM, Steve Longerbeam wrote:
>>
>> On 07/07/2016 07:52 AM, Lars-Peter Clausen wrote:
>>> On 07/07/2016 12:59 AM, Steve Longerbeam wrote:
 Add a device tree boolean property "bt656-4" to allow setting
 the ITU-R BT.656-4 compatible bit.

 Signed-off-by: Steve Longerbeam 
>>> +/* select ITU-R BT.656-4 compatible? */
>> Please don't use the '-4': BT.656 is sufficient. The -4 is just the version
>> number of the standard (and 5 is the latest anyway).
>  From the ADV7180 DS [1]:
> 
> BT.656-4, ITU-R BT.656-4 Enable, Address 0x04[7]
> 
> Between Revision 3 and Revision 4 of the ITU-R BT.656 standards, the ITU 
> has changed the toggling position for the V bit within the SAV EAV codes 
> for NTSC. The ITU-R BT.656-4 standard bit allows the user to select an 
> output mode that is compliant with either the previous or new standard. 
> For further information, visit the International Telecommunication Union 
> website.
> 
> Note that the standard change only affects NTSC and has no bearing on PAL.
> 
> When ITU-R BT.656-4 is 0 (default), the ITU-R BT.656-3 specification is 
> used. The V bit goes low at EAV of Line 10 and Line 273.
> 
> When ITU-R BT.656-4 is 1, the ITU-R BT.656-4 specification is used. The 
> V bit goes low at EAV of Line 20 and Line 283.
> 
> [1]www.analog.com/media/en/technical-documentation/data-sheets/*ADV7180*.pdf 

Rev 4 came in in 1998. I would say that that is the default. We have had any
problems with this and I would need some proof that this is really needed.

Regards,

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


Re: [PATCH 06/11] media: adv7180: add bt.656-4 OF property

2016-07-10 Thread Ian Arkver

On 10/07/16 13:55, Hans Verkuil wrote:

On 07/10/2016 02:10 PM, Lars-Peter Clausen wrote:

On 07/09/2016 11:36 PM, Steve Longerbeam wrote:


On 07/09/2016 02:10 PM, Steve Longerbeam wrote:


On 07/09/2016 11:59 AM, Steve Longerbeam wrote:


On 07/07/2016 07:52 AM, Lars-Peter Clausen wrote:

On 07/07/2016 12:59 AM, Steve Longerbeam wrote:

Add a device tree boolean property "bt656-4" to allow setting
the ITU-R BT.656-4 compatible bit.

Signed-off-by: Steve Longerbeam 

+/* select ITU-R BT.656-4 compatible? */

Please don't use the '-4': BT.656 is sufficient. The -4 is just the version
number of the standard (and 5 is the latest anyway).

From the ADV7180 DS [1]:

BT.656-4, ITU-R BT.656-4 Enable, Address 0x04[7]

Between Revision 3 and Revision 4 of the ITU-R BT.656 standards, the ITU 
has changed the toggling position for the V bit within the SAV EAV codes 
for NTSC. The ITU-R BT.656-4 standard bit allows the user to select an 
output mode that is compliant with either the previous or new standard. 
For further information, visit the International Telecommunication Union 
website.


Note that the standard change only affects NTSC and has no bearing on PAL.

When ITU-R BT.656-4 is 0 (default), the ITU-R BT.656-3 specification is 
used. The V bit goes low at EAV of Line 10 and Line 273.


When ITU-R BT.656-4 is 1, the ITU-R BT.656-4 specification is used. The 
V bit goes low at EAV of Line 20 and Line 283.


[1]www.analog.com/media/en/technical-documentation/data-sheets/*ADV7180*.pdf 




+if (of_property_read_bool(client->dev.of_node, "bt656-4"))
+state->bt656_4 = true;
This property needs to be documented. In my opinion it should also be a
property of the endpoint sub-node rather than the toplevel device node
since
this is a configuration of the endpoint format.

Agreed, it's really a config of the backend capture endpoint. I'll move it
there and also document it in
Documentation/devicetree/bindings/media/i2c/adv7180.txt.

er, scratch that. ITU-R BT.656 compatibility is really a property of the
bt.656 bus. It
should be added to v4l2 endpoints and parsed by v4l2_of_parse_endpoint().
I've created
a patch to add a "bt656-mode" property to v4l2 endpoints and will copy all
the maintainers.

But I'm going back and forth on whether this property should be added to the
adv7180's
local endpoint, or to the remote endpoint. I'm leaning towards the remote
endpoint, since
this is more about how the backend wants the bus configured.

I think it should be set for both, as both endpoints need to agree on the
format.

Is it needed at all? Setting the polarity flags to H/VSYNC_ACTIVE_HIGH/LOW
will already signal BT.656 mode. See include/media/v4l2-mediabus.h and
v4l2-of.c.

I haven't looked in detail at adv7180, so I may have missed something, but this
looks strange.

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


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


Re: [PATCH 2/5] serio.h: add new define for the Pulse-Eight USB-CEC Adapter

2016-07-10 Thread Hans Verkuil
Added linux-input to the Cc list.

Dmitry, it probably makes the most sense if this goes through the media
tree with your Ack, unless you know there will be a conflict.

Regards,

Hans

On 07/10/2016 03:11 PM, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> This is for the new pulse8-cec staging driver.
> 
> Signed-off-by: Hans Verkuil 
> Cc: Dmitry Torokhov 
> ---
>  include/uapi/linux/serio.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/serio.h b/include/uapi/linux/serio.h
> index c2ea169..f2447a8 100644
> --- a/include/uapi/linux/serio.h
> +++ b/include/uapi/linux/serio.h
> @@ -78,5 +78,6 @@
>  #define SERIO_TSC40  0x3d
>  #define SERIO_WACOM_IV   0x3e
>  #define SERIO_EGALAX 0x3f
> +#define SERIO_PULSE8_CEC 0x40
>  
>  #endif /* _UAPI_SERIO_H */
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/5] serio.h: add new define for the Pulse-Eight USB-CEC Adapter

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

This is for the new pulse8-cec staging driver.

Signed-off-by: Hans Verkuil 
Cc: Dmitry Torokhov 
---
 include/uapi/linux/serio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/serio.h b/include/uapi/linux/serio.h
index c2ea169..f2447a8 100644
--- a/include/uapi/linux/serio.h
+++ b/include/uapi/linux/serio.h
@@ -78,5 +78,6 @@
 #define SERIO_TSC400x3d
 #define SERIO_WACOM_IV 0x3e
 #define SERIO_EGALAX   0x3f
+#define SERIO_PULSE8_CEC   0x40
 
 #endif /* _UAPI_SERIO_H */
-- 
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 4/5] MAINTAINERS: add entry for the pulse8-cec driver

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

Add entry for the pulse8-cec driver.

Signed-off-by: Hans Verkuil 
---
 MAINTAINERS | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a975b8e..7486757 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9258,6 +9258,13 @@ F:   include/linux/tracehook.h
 F: include/uapi/linux/ptrace.h
 F: kernel/ptrace.c
 
+PULSE8-CEC DRIVER
+M: Hans Verkuil 
+L: linux-media@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+S: Maintained
+F: drivers/staging/media/pulse8-cec
+
 PVRUSB2 VIDEO4LINUX DRIVER
 M: Mike Isely 
 L: pvru...@isely.net   (subscribers-only)
-- 
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 5/5] pulse8-cec: add TODO file

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

Explain what needs to be done to move this driver out of staging.

Signed-off-by: Hans Verkuil 
---
 drivers/staging/media/pulse8-cec/TODO | 35 +++
 1 file changed, 35 insertions(+)
 create mode 100644 drivers/staging/media/pulse8-cec/TODO

diff --git a/drivers/staging/media/pulse8-cec/TODO 
b/drivers/staging/media/pulse8-cec/TODO
new file mode 100644
index 000..6860a33
--- /dev/null
+++ b/drivers/staging/media/pulse8-cec/TODO
@@ -0,0 +1,35 @@
+This driver needs to mature a bit more and another round of
+code cleanups.
+
+Otherwise it looks to be in good shape. And of course the fact
+that the CEC framework is in staging at the moment also prevents
+this driver from being mainlined.
+
+To use this driver you also need to patch the inputattach utility,
+this patch will be submitted once this driver is moved out of staging.
+
+diff -urN linuxconsoletools-1.4.9/utils/inputattach.c 
linuxconsoletools-1.4.9.new/utils/inputattach.c
+--- linuxconsoletools-1.4.9/utils/inputattach.c2016-01-09 
16:27:02.0 +0100
 linuxconsoletools-1.4.9.new/utils/inputattach.c2016-03-20 
11:35:31.707788967 +0100
+@@ -861,6 +861,9 @@
+ { "--wacom_iv",   "-wacom_iv","Wacom protocol IV tablet",
+   B9600, CS8 | CRTSCTS,
+   SERIO_WACOM_IV, 0x00,   0x00,   0,  wacom_iv_init },
++{ "--pulse8-cec", "-pulse8-cec",  "Pulse Eight HDMI CEC dongle",
++  B9600, CS8,
++  SERIO_PULSE8_CEC,   0x00,   0x00,   0,  NULL },
+ { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL }
+ };
+ 
+diff -urN linuxconsoletools-1.4.9/utils/serio-ids.h 
linuxconsoletools-1.4.9.new/utils/serio-ids.h
+--- linuxconsoletools-1.4.9/utils/serio-ids.h  2015-04-26 18:29:42.0 
+0200
 linuxconsoletools-1.4.9.new/utils/serio-ids.h  2016-03-20 
11:41:00.153558539 +0100
+@@ -131,5 +131,8 @@
+ #ifndef SERIO_EASYPEN
+ # define SERIO_EASYPEN0x3f
+ #endif
++#ifndef SERIO_PULSE8_CEC
++# define SERIO_PULSE8_CEC 0x40
++#endif
+ 
+ #endif
-- 
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/5] cec: add check if adapter is unregistered.

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

CEC USB dongles can be unplugged at any time, and at that point they will
be unregistered. Make sure that any attempt afterwards to set the physical
or logical addresses will be ignored.

Signed-off-by: Hans Verkuil 
---
 drivers/staging/media/cec/cec-adap.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index 7df6187..2cd656b 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -1104,7 +1104,7 @@ static void cec_claim_log_addrs(struct cec_adapter *adap, 
bool block)
  */
 void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
 {
-   if (phys_addr == adap->phys_addr)
+   if (phys_addr == adap->phys_addr || adap->devnode.unregistered)
return;
 
if (phys_addr == CEC_PHYS_ADDR_INVALID ||
@@ -1158,6 +1158,9 @@ int __cec_s_log_addrs(struct cec_adapter *adap,
u16 type_mask = 0;
int i;
 
+   if (adap->devnode.unregistered)
+   return -ENODEV;
+
if (!log_addrs || log_addrs->num_log_addrs == 0) {
adap->log_addrs.num_log_addrs = 0;
cec_adap_unconfigure(adap);
-- 
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 0/5] Pulse-Eight USB CEC driver

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

This adds support for the Pulse-Eight USB CEC dongle. It has been tested
with both v4 and v5 firmware.

It is still in staging because 1) the CEC framework it depends on is still in 
staging, 2) the code needs to be refactored a bit and 3) it needs more testing.

That said, it's in pretty decent shape. It's pretty neat, but I do wish it
would support a CEC bus snooping mode: that would make it an ideal CEC bus
sniffer. But I don't see any support for it, unfortunately.

If anyone knows how this can be achieved then please let me know!

Please note that this needs support from inputattach (part of 
linuxconsoletools),
a patch is included in the TODO file.

Regards,

Hans

Hans Verkuil (5):
  cec: add check if adapter is unregistered.
  serio.h: add new define for the Pulse-Eight USB-CEC Adapter
  pulse8-cec: new driver for the Pulse-Eight USB-CEC Adapter
  MAINTAINERS: add entry for the pulse8-cec driver
  pulse8-cec: add TODO file

 MAINTAINERS   |   7 +
 drivers/staging/media/Kconfig |   2 +
 drivers/staging/media/Makefile|   1 +
 drivers/staging/media/cec/cec-adap.c  |   5 +-
 drivers/staging/media/pulse8-cec/Kconfig  |  10 +
 drivers/staging/media/pulse8-cec/Makefile |   1 +
 drivers/staging/media/pulse8-cec/TODO |  35 ++
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 502 ++
 include/uapi/linux/serio.h|   1 +
 9 files changed, 563 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/media/pulse8-cec/Kconfig
 create mode 100644 drivers/staging/media/pulse8-cec/Makefile
 create mode 100644 drivers/staging/media/pulse8-cec/TODO
 create mode 100644 drivers/staging/media/pulse8-cec/pulse8-cec.c

-- 
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 3/5] pulse8-cec: new driver for the Pulse-Eight USB-CEC Adapter

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

This supports the Pulse-Eight USB-CEC Adapter.

It has been tested with firmware versions 4 and 5, but it should
hopefully work fine with older firmwares as well.

Signed-off-by: Hans Verkuil 
---
 drivers/staging/media/Kconfig |   2 +
 drivers/staging/media/Makefile|   1 +
 drivers/staging/media/pulse8-cec/Kconfig  |  10 +
 drivers/staging/media/pulse8-cec/Makefile |   1 +
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 502 ++
 5 files changed, 516 insertions(+)
 create mode 100644 drivers/staging/media/pulse8-cec/Kconfig
 create mode 100644 drivers/staging/media/pulse8-cec/Makefile
 create mode 100644 drivers/staging/media/pulse8-cec/pulse8-cec.c

diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index 5670789..cae42e5 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -29,6 +29,8 @@ source "drivers/staging/media/davinci_vpfe/Kconfig"
 
 source "drivers/staging/media/omap4iss/Kconfig"
 
+source "drivers/staging/media/pulse8-cec/Kconfig"
+
 source "drivers/staging/media/tw686x-kh/Kconfig"
 
 source "drivers/staging/media/s5p-cec/Kconfig"
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 989c844..87ce8ad 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -5,4 +5,5 @@ obj-$(CONFIG_DVB_CXD2099)   += cxd2099/
 obj-$(CONFIG_LIRC_STAGING) += lirc/
 obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
 obj-$(CONFIG_VIDEO_OMAP4)  += omap4iss/
+obj-$(CONFIG_USB_PULSE8_CEC)+= pulse8-cec/
 obj-$(CONFIG_VIDEO_TW686X_KH)  += tw686x-kh/
diff --git a/drivers/staging/media/pulse8-cec/Kconfig 
b/drivers/staging/media/pulse8-cec/Kconfig
new file mode 100644
index 000..c6aa2d1
--- /dev/null
+++ b/drivers/staging/media/pulse8-cec/Kconfig
@@ -0,0 +1,10 @@
+config USB_PULSE8_CEC
+   tristate "Pulse Eight HDMI CEC"
+   depends on USB_ACM && MEDIA_CEC
+   select SERIO
+   select SERIO_SERPORT
+   ---help---
+ This is a cec driver for the Pulse Eight HDMI CEC device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called pulse8-cec.
diff --git a/drivers/staging/media/pulse8-cec/Makefile 
b/drivers/staging/media/pulse8-cec/Makefile
new file mode 100644
index 000..9800690
--- /dev/null
+++ b/drivers/staging/media/pulse8-cec/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_USB_PULSE8_CEC) += pulse8-cec.o
diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c 
b/drivers/staging/media/pulse8-cec/pulse8-cec.c
new file mode 100644
index 000..e07d2ff
--- /dev/null
+++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c
@@ -0,0 +1,502 @@
+/*
+ * Pulse Eight HDMI CEC driver
+ *
+ * Copyright 2016 Hans Verkuil ");
+MODULE_DESCRIPTION("Pulse Eight HDMI CEC driver");
+MODULE_LICENSE("GPL");
+
+static int debug;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "debug level (0-1)");
+
+enum pulse8_msgcodes {
+   MSGCODE_NOTHING = 0,
+   MSGCODE_PING,
+   MSGCODE_TIMEOUT_ERROR,
+   MSGCODE_HIGH_ERROR,
+   MSGCODE_LOW_ERROR,
+   MSGCODE_FRAME_START,
+   MSGCODE_FRAME_DATA,
+   MSGCODE_RECEIVE_FAILED,
+   MSGCODE_COMMAND_ACCEPTED,   /* 0x08 */
+   MSGCODE_COMMAND_REJECTED,
+   MSGCODE_SET_ACK_MASK,
+   MSGCODE_TRANSMIT,
+   MSGCODE_TRANSMIT_EOM,
+   MSGCODE_TRANSMIT_IDLETIME,
+   MSGCODE_TRANSMIT_ACK_POLARITY,
+   MSGCODE_TRANSMIT_LINE_TIMEOUT,
+   MSGCODE_TRANSMIT_SUCCEEDED, /* 0x10 */
+   MSGCODE_TRANSMIT_FAILED_LINE,
+   MSGCODE_TRANSMIT_FAILED_ACK,
+   MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA,
+   MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE,
+   MSGCODE_FIRMWARE_VERSION,
+   MSGCODE_START_BOOTLOADER,
+   MSGCODE_GET_BUILDDATE,
+   MSGCODE_SET_CONTROLLED, /* 0x18 */
+   MSGCODE_GET_AUTO_ENABLED,
+   MSGCODE_SET_AUTO_ENABLED,
+   MSGCODE_GET_DEFAULT_LOGICAL_ADDRESS,
+   MSGCODE_SET_DEFAULT_LOGICAL_ADDRESS,
+   MSGCODE_GET_LOGICAL_ADDRESS_MASK,
+   MSGCODE_SET_LOGICAL_ADDRESS_MASK,
+   MSGCODE_GET_PHYSICAL_ADDRESS,
+   MSGCODE_SET_PHYSICAL_ADDRESS,   /* 0x20 */
+   MSGCODE_GET_DEVICE_TYPE,
+   MSGCODE_SET_DEVICE_TYPE,
+   MSGCODE_GET_HDMI_VERSION,
+   MSGCODE_SET_HDMI_VERSION,
+   MSGCODE_GET_OSD_NAME,
+   

Re: [PATCH 06/11] media: adv7180: add bt.656-4 OF property

2016-07-10 Thread Hans Verkuil
On 07/10/2016 02:10 PM, Lars-Peter Clausen wrote:
> On 07/09/2016 11:36 PM, Steve Longerbeam wrote:
>>
>>
>> On 07/09/2016 02:10 PM, Steve Longerbeam wrote:
>>>
>>>
>>> On 07/09/2016 11:59 AM, Steve Longerbeam wrote:


 On 07/07/2016 07:52 AM, Lars-Peter Clausen wrote:
> On 07/07/2016 12:59 AM, Steve Longerbeam wrote:
>> Add a device tree boolean property "bt656-4" to allow setting
>> the ITU-R BT.656-4 compatible bit.
>>
>> Signed-off-by: Steve Longerbeam 
>
> +/* select ITU-R BT.656-4 compatible? */

Please don't use the '-4': BT.656 is sufficient. The -4 is just the version
number of the standard (and 5 is the latest anyway).

> +if (of_property_read_bool(client->dev.of_node, "bt656-4"))
> +state->bt656_4 = true;
> This property needs to be documented. In my opinion it should also be a
> property of the endpoint sub-node rather than the toplevel device node
> since
> this is a configuration of the endpoint format.

 Agreed, it's really a config of the backend capture endpoint. I'll move it
 there and also document it in
 Documentation/devicetree/bindings/media/i2c/adv7180.txt.
>>>
>>> er, scratch that. ITU-R BT.656 compatibility is really a property of the
>>> bt.656 bus. It
>>> should be added to v4l2 endpoints and parsed by v4l2_of_parse_endpoint().
>>> I've created
>>> a patch to add a "bt656-mode" property to v4l2 endpoints and will copy all
>>> the maintainers.
>>
>> But I'm going back and forth on whether this property should be added to the
>> adv7180's
>> local endpoint, or to the remote endpoint. I'm leaning towards the remote
>> endpoint, since
>> this is more about how the backend wants the bus configured.
> 
> I think it should be set for both, as both endpoints need to agree on the
> format.

Is it needed at all? Setting the polarity flags to H/VSYNC_ACTIVE_HIGH/LOW
will already signal BT.656 mode. See include/media/v4l2-mediabus.h and
v4l2-of.c.

I haven't looked in detail at adv7180, so I may have missed something, but this
looks strange.

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 v2] [media] doc-rst: Don't use captions for examples

2016-07-10 Thread Mauro Carvalho Chehab
Unfortunately, captions are new on Sphinx for c blocks: it was
added only on version 1.3. Also, it were already bad enough
not being able to auto-numerate them.

So, let's give up and use, instead, titles before the examples.
Not much is lost, and, as a side track, we don't need to
numerate them anymore.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/dvbproperty.rst   |  7 ++-
 Documentation/media/uapi/dvb/examples.rst  |  8 
 Documentation/media/uapi/v4l/audio.rst |  8 ++--
 Documentation/media/uapi/v4l/control.rst   | 11 ---
 Documentation/media/uapi/v4l/crop.rst  | 17 +
 Documentation/media/uapi/v4l/dev-osd.rst   |  3 ++-
 Documentation/media/uapi/v4l/dmabuf.rst| 10 +++---
 Documentation/media/uapi/v4l/mmap.rst  |  7 +--
 Documentation/media/uapi/v4l/selection-api-006.rst |  9 ++---
 Documentation/media/uapi/v4l/standard.rst  |  9 ++---
 Documentation/media/uapi/v4l/userp.rst |  3 ++-
 Documentation/media/uapi/v4l/video.rst |  8 ++--
 12 files changed, 71 insertions(+), 29 deletions(-)

diff --git a/Documentation/media/uapi/dvb/dvbproperty.rst 
b/Documentation/media/uapi/dvb/dvbproperty.rst
index 9b3782c5bb44..3c348e585729 100644
--- a/Documentation/media/uapi/dvb/dvbproperty.rst
+++ b/Documentation/media/uapi/dvb/dvbproperty.rst
@@ -48,8 +48,13 @@ symbol rate of 5.217 Mbauds, those properties should be sent 
to
 
 -  :ref:`DTV_TUNE `
 
-The code that would do the above is:
+The code that would that would do the above is show in
+:ref:`dtv-prop-example`.
 
+.. _dtv-prop-example:
+
+Example: Setting digital TV frontend properties
+===
 
 .. code-block:: c
 
diff --git a/Documentation/media/uapi/dvb/examples.rst 
b/Documentation/media/uapi/dvb/examples.rst
index 64e029ecd047..ead3ddf764c0 100644
--- a/Documentation/media/uapi/dvb/examples.rst
+++ b/Documentation/media/uapi/dvb/examples.rst
@@ -17,8 +17,8 @@ updated/recommended examples.
 
 .. _tuning:
 
-Tuning
-==
+Example: Tuning
+===
 
 We will start with a generic tuning subroutine that uses the frontend
 and SEC, as well as the demux devices. The example is given for QPSK
@@ -238,8 +238,8 @@ switch, and weather conditions this may be necessary.
 
 .. _the_dvr_device:
 
-The DVR device
-==
+Example: The DVR device
+
 
 The following program code shows how to use the DVR device for
 recording.
diff --git a/Documentation/media/uapi/v4l/audio.rst 
b/Documentation/media/uapi/v4l/audio.rst
index 71502f0bf8bd..47f8334f071e 100644
--- a/Documentation/media/uapi/v4l/audio.rst
+++ b/Documentation/media/uapi/v4l/audio.rst
@@ -54,8 +54,10 @@ in the struct :ref:`v4l2_capability ` 
returned by
 the :ref:`VIDIOC_QUERYCAP` ioctl.
 
 
+Example: Information about the current audio input
+==
+
 .. code-block:: c
-:caption: Example 1.3. Information about the current audio input
 
 struct v4l2_audio audio;
 
@@ -69,8 +71,10 @@ the :ref:`VIDIOC_QUERYCAP` ioctl.
 printf("Current input: %s\\n", audio.name);
 
 
+Example: Switching to the first audio input
+===
+
 .. code-block:: c
-:caption: Example 1.4. Switching to the first audio input
 
 struct v4l2_audio audio;
 
diff --git a/Documentation/media/uapi/v4l/control.rst 
b/Documentation/media/uapi/v4l/control.rst
index 6cf218ab36fb..feb55ac14377 100644
--- a/Documentation/media/uapi/v4l/control.rst
+++ b/Documentation/media/uapi/v4l/control.rst
@@ -373,8 +373,10 @@ more menu type controls.
 
 .. _enum_all_controls:
 
+Example: Enumerating all user controls
+==
+
 .. code-block:: c
-:caption: Example 1.8. Enumerating all user controls
 
 
 struct v4l2_queryctrl queryctrl;
@@ -438,8 +440,10 @@ more menu type controls.
 }
 
 
+Example: Enumerating all user controls (alternative)
+
+
 .. code-block:: c
-:caption: Example 1.9. Enumerating all user controls (alternative)
 
 memset(, 0, sizeof(queryctrl));
 
@@ -462,9 +466,10 @@ more menu type controls.
exit(EXIT_FAILURE);
 }
 
+Example: Changing controls
+==
 
 .. code-block:: c
-:caption: Example 1.10. Changing controls
 
 struct v4l2_queryctrl queryctrl;
 struct v4l2_control control;
diff --git a/Documentation/media/uapi/v4l/crop.rst 
b/Documentation/media/uapi/v4l/crop.rst
index ed43b36c51d8..51b19491c302 100644
--- a/Documentation/media/uapi/v4l/crop.rst
+++ b/Documentation/media/uapi/v4l/crop.rst
@@ -147,8 +147,10 @@ ensure the parameters are suitable before starting I/O.
 **NOTE:** on the next two examples, a video capture device is assumed;
 change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of 

Re: [PATCH 06/11] media: adv7180: add bt.656-4 OF property

2016-07-10 Thread Lars-Peter Clausen
On 07/09/2016 11:36 PM, Steve Longerbeam wrote:
> 
> 
> On 07/09/2016 02:10 PM, Steve Longerbeam wrote:
>>
>>
>> On 07/09/2016 11:59 AM, Steve Longerbeam wrote:
>>>
>>>
>>> On 07/07/2016 07:52 AM, Lars-Peter Clausen wrote:
 On 07/07/2016 12:59 AM, Steve Longerbeam wrote:
> Add a device tree boolean property "bt656-4" to allow setting
> the ITU-R BT.656-4 compatible bit.
>
> Signed-off-by: Steve Longerbeam 

 +/* select ITU-R BT.656-4 compatible? */
 +if (of_property_read_bool(client->dev.of_node, "bt656-4"))
 +state->bt656_4 = true;
 This property needs to be documented. In my opinion it should also be a
 property of the endpoint sub-node rather than the toplevel device node
 since
 this is a configuration of the endpoint format.
>>>
>>> Agreed, it's really a config of the backend capture endpoint. I'll move it
>>> there and also document it in
>>> Documentation/devicetree/bindings/media/i2c/adv7180.txt.
>>
>> er, scratch that. ITU-R BT.656 compatibility is really a property of the
>> bt.656 bus. It
>> should be added to v4l2 endpoints and parsed by v4l2_of_parse_endpoint().
>> I've created
>> a patch to add a "bt656-mode" property to v4l2 endpoints and will copy all
>> the maintainers.
> 
> But I'm going back and forth on whether this property should be added to the
> adv7180's
> local endpoint, or to the remote endpoint. I'm leaning towards the remote
> endpoint, since
> this is more about how the backend wants the bus configured.

I think it should be set for both, as both endpoints need to agree on the
format.

--
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: Don't use captions for examples

2016-07-10 Thread Mauro Carvalho Chehab
Unfortunately, captions are new on Sphinx for c blocks: it was
added only on version 1.3. Also, it were already bad enough
not being able to auto-numerate them.

So, let's give up and use, instead, titles before the examples.
Not much is lost, and, as a side track, we don't need to
numerate them anymore.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/dvbproperty.rst   |  7 ++-
 Documentation/media/uapi/dvb/examples.rst  |  8 
 Documentation/media/uapi/v4l/audio.rst |  8 ++--
 Documentation/media/uapi/v4l/control.rst   | 11 ---
 Documentation/media/uapi/v4l/crop.rst  |  9 +++--
 Documentation/media/uapi/v4l/dev-osd.rst   |  3 ++-
 Documentation/media/uapi/v4l/dmabuf.rst| 10 +++---
 Documentation/media/uapi/v4l/mmap.rst  |  7 +--
 Documentation/media/uapi/v4l/selection-api-006.rst |  9 ++---
 Documentation/media/uapi/v4l/standard.rst  |  9 ++---
 Documentation/media/uapi/v4l/userp.rst |  3 ++-
 Documentation/media/uapi/v4l/video.rst |  8 ++--
 12 files changed, 65 insertions(+), 27 deletions(-)

diff --git a/Documentation/media/uapi/dvb/dvbproperty.rst 
b/Documentation/media/uapi/dvb/dvbproperty.rst
index 9b3782c5bb44..3c348e585729 100644
--- a/Documentation/media/uapi/dvb/dvbproperty.rst
+++ b/Documentation/media/uapi/dvb/dvbproperty.rst
@@ -48,8 +48,13 @@ symbol rate of 5.217 Mbauds, those properties should be sent 
to
 
 -  :ref:`DTV_TUNE `
 
-The code that would do the above is:
+The code that would that would do the above is show in
+:ref:`dtv-prop-example`.
 
+.. _dtv-prop-example:
+
+Example: Setting digital TV frontend properties
+===
 
 .. code-block:: c
 
diff --git a/Documentation/media/uapi/dvb/examples.rst 
b/Documentation/media/uapi/dvb/examples.rst
index 64e029ecd047..ead3ddf764c0 100644
--- a/Documentation/media/uapi/dvb/examples.rst
+++ b/Documentation/media/uapi/dvb/examples.rst
@@ -17,8 +17,8 @@ updated/recommended examples.
 
 .. _tuning:
 
-Tuning
-==
+Example: Tuning
+===
 
 We will start with a generic tuning subroutine that uses the frontend
 and SEC, as well as the demux devices. The example is given for QPSK
@@ -238,8 +238,8 @@ switch, and weather conditions this may be necessary.
 
 .. _the_dvr_device:
 
-The DVR device
-==
+Example: The DVR device
+
 
 The following program code shows how to use the DVR device for
 recording.
diff --git a/Documentation/media/uapi/v4l/audio.rst 
b/Documentation/media/uapi/v4l/audio.rst
index 71502f0bf8bd..47f8334f071e 100644
--- a/Documentation/media/uapi/v4l/audio.rst
+++ b/Documentation/media/uapi/v4l/audio.rst
@@ -54,8 +54,10 @@ in the struct :ref:`v4l2_capability ` 
returned by
 the :ref:`VIDIOC_QUERYCAP` ioctl.
 
 
+Example: Information about the current audio input
+==
+
 .. code-block:: c
-:caption: Example 1.3. Information about the current audio input
 
 struct v4l2_audio audio;
 
@@ -69,8 +71,10 @@ the :ref:`VIDIOC_QUERYCAP` ioctl.
 printf("Current input: %s\\n", audio.name);
 
 
+Example: Switching to the first audio input
+===
+
 .. code-block:: c
-:caption: Example 1.4. Switching to the first audio input
 
 struct v4l2_audio audio;
 
diff --git a/Documentation/media/uapi/v4l/control.rst 
b/Documentation/media/uapi/v4l/control.rst
index 6cf218ab36fb..feb55ac14377 100644
--- a/Documentation/media/uapi/v4l/control.rst
+++ b/Documentation/media/uapi/v4l/control.rst
@@ -373,8 +373,10 @@ more menu type controls.
 
 .. _enum_all_controls:
 
+Example: Enumerating all user controls
+==
+
 .. code-block:: c
-:caption: Example 1.8. Enumerating all user controls
 
 
 struct v4l2_queryctrl queryctrl;
@@ -438,8 +440,10 @@ more menu type controls.
 }
 
 
+Example: Enumerating all user controls (alternative)
+
+
 .. code-block:: c
-:caption: Example 1.9. Enumerating all user controls (alternative)
 
 memset(, 0, sizeof(queryctrl));
 
@@ -462,9 +466,10 @@ more menu type controls.
exit(EXIT_FAILURE);
 }
 
+Example: Changing controls
+==
 
 .. code-block:: c
-:caption: Example 1.10. Changing controls
 
 struct v4l2_queryctrl queryctrl;
 struct v4l2_control control;
diff --git a/Documentation/media/uapi/v4l/crop.rst 
b/Documentation/media/uapi/v4l/crop.rst
index ed43b36c51d8..bf1f487250fe 100644
--- a/Documentation/media/uapi/v4l/crop.rst
+++ b/Documentation/media/uapi/v4l/crop.rst
@@ -147,8 +147,10 @@ ensure the parameters are suitable before starting I/O.
 **NOTE:** on the next two examples, a video capture device is assumed;
 change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
 

[PATCH 4/6] [media] doc-rst: improve LIRC syscall documentation

2016-07-10 Thread Mauro Carvalho Chehab
The lirc syscall documentation uses a very different and
simplified way than the rest of the media book. make it
closer. Still, there's just one page for all ioctls.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/rc/lirc_ioctl.rst | 187 +++--
 Documentation/media/uapi/rc/lirc_read.rst  |  49 +++-
 Documentation/media/uapi/rc/lirc_write.rst |  50 +++-
 3 files changed, 240 insertions(+), 46 deletions(-)

diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst 
b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 916d064476f1..c4c34db61a96 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -2,9 +2,35 @@
 
 .. _lirc_ioctl:
 
-**
-LIRC ioctl fop
-**
+
+LIRC ioctl()
+
+
+
+Name
+
+
+LIRC ioctl - Sends a I/O control command to a LIRC device
+
+Synopsis
+
+
+.. cpp:function:: int ioctl( int fd, int request, struct v4l2_capability *argp 
)
+
+
+Arguments
+=
+
+``fd``
+File descriptor returned by ``open()``.
+
+``request``
+The type of I/O control that will be used. See table :ref:`lirc-request`
+for details.
+
+``argp``
+Arguments for the I/O control. They're specific to each request.
+
 
 The LIRC device's ioctl definition is bound by the ioctl function
 definition of struct file_operations, leaving us with an unsigned int
@@ -12,45 +38,79 @@ for the ioctl command and an unsigned long for the arg. For 
the purposes
 of ioctl portability across 32-bit and 64-bit, these values are capped
 to their 32-bit sizes.
 
-The following ioctls can be used to change specific hardware settings.
+The ioctls can be used to change specific hardware settings.
 In general each driver should have a default set of settings. The driver
 implementation is expected to re-apply the default settings when the
 device is closed by user-space, so that every application opening the
 device can rely on working with the default settings initially.
 
-LIRC_GET_FEATURES
+.. _lirc-request:
+
+I/O control requests
+
+
+
+.. _LIRC_GET_FEATURES:
+
+``LIRC_GET_FEATURES``
+
 Obviously, get the underlying hardware device's features. If a
 driver does not announce support of certain features, calling of the
 corresponding ioctls is undefined.
 
-LIRC_GET_SEND_MODE
-Get supported transmit mode. Only LIRC_MODE_PULSE is supported by
+.. _LIRC_GET_SEND_MODE:
+
+``LIRC_GET_SEND_MODE``
+
+Get supported transmit mode. Only ``LIRC_MODE_PULSE`` is supported by
 lircd.
 
-LIRC_GET_REC_MODE
-Get supported receive modes. Only LIRC_MODE_MODE2 and
-LIRC_MODE_LIRCCODE are supported by lircd.
+.. _LIRC_GET_REC_MODE:
+
+``LIRC_GET_REC_MODE``
+
+Get supported receive modes. Only ``LIRC_MODE_MODE2`` and
+``LIRC_MODE_LIRCCODE`` are supported by lircd.
+
+.. _LIRC_GET_SEND_CARRIER:
+
+``LIRC_GET_SEND_CARRIER``
 
-LIRC_GET_SEND_CARRIER
 Get carrier frequency (in Hz) currently used for transmit.
 
-LIRC_GET_REC_CARRIER
+.. _LIRC_GET_REC_CARRIER:
+
+``LIRC_GET_REC_CARRIER``
+
 Get carrier frequency (in Hz) currently used for IR reception.
 
-LIRC_{G,S}ET_{SEND,REC}_DUTY_CYCLE
+.. _LIRC_GET_SEND_DUTY_CYCLE:
+.. _LIRC_GET_REC_DUTY_CYCLE:
+.. _LIRC_SET_SEND_DUTY_CYCLE:
+.. _LIRC_SET_REC_DUTY_CYCLE:
+
+``LIRC_{G,S}ET_{SEND,REC}_DUTY_CYCLE``
+
 Get/set the duty cycle (from 0 to 100) of the carrier signal.
 Currently, no special meaning is defined for 0 or 100, but this
 could be used to switch off carrier generation in the future, so
 these values should be reserved.
 
-LIRC_GET_REC_RESOLUTION
+.. _LIRC_GET_REC_RESOLUTION:
+
+``LIRC_GET_REC_RESOLUTION``
+
 Some receiver have maximum resolution which is defined by internal
 sample rate or data format limitations. E.g. it's common that
 signals can only be reported in 50 microsecond steps. This integer
 value is used by lircd to automatically adjust the aeps tolerance
 value in the lircd config file.
 
-LIRC_GET_M{IN,AX}_TIMEOUT
+.. _LIRC_GET_MIN_TIMEOUT:
+.. _LIRC_GET_MAX_TIMEOUT:
+
+``LIRC_GET_M{IN,AX}_TIMEOUT``
+
 Some devices have internal timers that can be used to detect when
 there's no IR activity for a long time. This can help lircd in
 detecting that a IR signal is finished and can speed up the decoding
@@ -59,7 +119,13 @@ LIRC_GET_M{IN,AX}_TIMEOUT
 both ioctls will return the same value even though the timeout
 cannot be changed.
 
-LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE}
+.. _LIRC_GET_MIN_FILTER_PULSE:
+.. _LIRC_GET_MIN_FILTER_PULSE:
+.. _LIRC_GET_MAX_FILTER_SPACE:
+.. _LIRC_GET_MAX_FILTER_SPACE:
+
+``LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE}``
+
 Some devices are able to filter out spikes in the incoming signal
 using given filter rules. These ioctls return the hardware
 capabilities that describe the bounds of the possible filters.
@@ -67,72 +133,113 @@ 

[PATCH 5/6] [media] doc-rst: add LIRC header to the book

2016-07-10 Thread Mauro Carvalho Chehab
Just like the other parts of the document, let's add the LIRC
header, as it is part of the API.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/Makefile   | 5 -
 Documentation/media/lirc.h.rst.exceptions  | 2 ++
 Documentation/media/uapi/rc/remote_controllers.rst | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/media/lirc.h.rst.exceptions

diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
index bcb9eb5921aa..39e2d766dbe3 100644
--- a/Documentation/media/Makefile
+++ b/Documentation/media/Makefile
@@ -6,7 +6,7 @@ KAPI = $(srctree)/include/linux
 SRC_DIR=$(srctree)/Documentation/media
 
 FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
- videodev2.h.rst media.h.rst cec.h.rst
+ videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
 
 TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
 
@@ -53,5 +53,8 @@ $(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} 
$(SRC_DIR)/media.h.rst.except
 $(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
@$($(quiet)gen_rst)
 
+$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} 
$(SRC_DIR)/lirc.h.rst.exceptions
+   @$($(quiet)gen_rst)
+
 cleandocs:
-rm ${TARGETS}
diff --git a/Documentation/media/lirc.h.rst.exceptions 
b/Documentation/media/lirc.h.rst.exceptions
new file mode 100644
index ..efdcb59f3002
--- /dev/null
+++ b/Documentation/media/lirc.h.rst.exceptions
@@ -0,0 +1,2 @@
+# Ignore header name
+ignore define _LINUX_LIRC_H
diff --git a/Documentation/media/uapi/rc/remote_controllers.rst 
b/Documentation/media/uapi/rc/remote_controllers.rst
index 82e64e7acbe3..3e9731afedd9 100644
--- a/Documentation/media/uapi/rc/remote_controllers.rst
+++ b/Documentation/media/uapi/rc/remote_controllers.rst
@@ -24,6 +24,7 @@ Remote Controllers
 rc-tables
 rc-table-change
 lirc_device_interface
+lirc-header
 
 
 **
-- 
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 1/6] [media] doc-rst: Group function references together for MC

2016-07-10 Thread Mauro Carvalho Chehab
Just like the other parts of the media book, group the MC
functions together on one chapter.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/mediactl/media-controller.rst | 20 +---
 Documentation/media/uapi/mediactl/media-funcs.rst| 18 ++
 2 files changed, 19 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/media/uapi/mediactl/media-funcs.rst

diff --git a/Documentation/media/uapi/mediactl/media-controller.rst 
b/Documentation/media/uapi/mediactl/media-controller.rst
index 0c1296c59571..7e08c93a15ab 100644
--- a/Documentation/media/uapi/mediactl/media-controller.rst
+++ b/Documentation/media/uapi/mediactl/media-controller.rst
@@ -22,27 +22,9 @@ Media Controller
 media-controller-intro
 media-controller-model
 media-types
+media-funcs
 media-header
 
-.. _media-user-func:
-
-**
-Function Reference
-**
-
-
-.. toctree::
-:maxdepth: 1
-
-media-func-open
-media-func-close
-media-func-ioctl
-media-ioc-device-info
-media-ioc-g-topology
-media-ioc-enum-entities
-media-ioc-enum-links
-media-ioc-setup-link
-
 
 **
 Revision and Copyright
diff --git a/Documentation/media/uapi/mediactl/media-funcs.rst 
b/Documentation/media/uapi/mediactl/media-funcs.rst
new file mode 100644
index ..076856501cdb
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-funcs.rst
@@ -0,0 +1,18 @@
+.. _media-user-func:
+
+**
+Function Reference
+**
+
+
+.. toctree::
+:maxdepth: 1
+
+media-func-open
+media-func-close
+media-func-ioctl
+media-ioc-device-info
+media-ioc-g-topology
+media-ioc-enum-entities
+media-ioc-enum-links
+media-ioc-setup-link
-- 
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 3/6] [media] doc-rst: rename some RC files

2016-07-10 Thread Mauro Carvalho Chehab
Some files start with an upper letter. Also, they have big
names. rename them.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/rc/{Remote_controllers_Intro.rst => rc-intro.rst}  | 0
 .../rc/{remote_controllers_sysfs_nodes.rst => rc-sysfs-nodes.rst} | 0
 .../{Remote_controllers_table_change.rst => rc-table-change.rst}  | 0
 .../uapi/rc/{Remote_controllers_tables.rst => rc-tables.rst}  | 0
 Documentation/media/uapi/rc/remote_controllers.rst| 8 
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename Documentation/media/uapi/rc/{Remote_controllers_Intro.rst => 
rc-intro.rst} (100%)
 rename Documentation/media/uapi/rc/{remote_controllers_sysfs_nodes.rst => 
rc-sysfs-nodes.rst} (100%)
 rename Documentation/media/uapi/rc/{Remote_controllers_table_change.rst => 
rc-table-change.rst} (100%)
 rename Documentation/media/uapi/rc/{Remote_controllers_tables.rst => 
rc-tables.rst} (100%)

diff --git a/Documentation/media/uapi/rc/Remote_controllers_Intro.rst 
b/Documentation/media/uapi/rc/rc-intro.rst
similarity index 100%
rename from Documentation/media/uapi/rc/Remote_controllers_Intro.rst
rename to Documentation/media/uapi/rc/rc-intro.rst
diff --git a/Documentation/media/uapi/rc/remote_controllers_sysfs_nodes.rst 
b/Documentation/media/uapi/rc/rc-sysfs-nodes.rst
similarity index 100%
rename from Documentation/media/uapi/rc/remote_controllers_sysfs_nodes.rst
rename to Documentation/media/uapi/rc/rc-sysfs-nodes.rst
diff --git a/Documentation/media/uapi/rc/Remote_controllers_table_change.rst 
b/Documentation/media/uapi/rc/rc-table-change.rst
similarity index 100%
rename from Documentation/media/uapi/rc/Remote_controllers_table_change.rst
rename to Documentation/media/uapi/rc/rc-table-change.rst
diff --git a/Documentation/media/uapi/rc/Remote_controllers_tables.rst 
b/Documentation/media/uapi/rc/rc-tables.rst
similarity index 100%
rename from Documentation/media/uapi/rc/Remote_controllers_tables.rst
rename to Documentation/media/uapi/rc/rc-tables.rst
diff --git a/Documentation/media/uapi/rc/remote_controllers.rst 
b/Documentation/media/uapi/rc/remote_controllers.rst
index bccceb1e28c3..82e64e7acbe3 100644
--- a/Documentation/media/uapi/rc/remote_controllers.rst
+++ b/Documentation/media/uapi/rc/remote_controllers.rst
@@ -19,10 +19,10 @@ Remote Controllers
 :maxdepth: 1
 :numbered:
 
-Remote_controllers_Intro
-remote_controllers_sysfs_nodes
-Remote_controllers_tables
-Remote_controllers_table_change
+rc-intro
+rc-sysfs-nodes
+rc-tables
+rc-table-change
 lirc_device_interface
 
 
-- 
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/6] [media] doc-rst: remove an extra label on V4L2 and CEC parts

2016-07-10 Thread Mauro Carvalho Chehab
There's no need to say: Table of Contents there. Also, this
generates a duplicated caption xref. So, remove, to use the
same format on every part.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-api.rst | 1 -
 Documentation/media/uapi/v4l/v4l2.rst| 1 -
 2 files changed, 2 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-api.rst 
b/Documentation/media/uapi/cec/cec-api.rst
index e7dc8253f1e2..246fbae2e079 100644
--- a/Documentation/media/uapi/cec/cec-api.rst
+++ b/Documentation/media/uapi/cec/cec-api.rst
@@ -15,7 +15,6 @@ This part describes the CEC: Consumer Electronics Control
 .. toctree::
 :maxdepth: 1
 :numbered:
-:caption: Table of Contents
 
 cec-intro
 cec-funcs
diff --git a/Documentation/media/uapi/v4l/v4l2.rst 
b/Documentation/media/uapi/v4l/v4l2.rst
index 301f95b5bdc6..c0859ebc88ee 100644
--- a/Documentation/media/uapi/v4l/v4l2.rst
+++ b/Documentation/media/uapi/v4l/v4l2.rst
@@ -14,7 +14,6 @@ This part describes the Video for Linux API version 2 (V4L2 
API) specification.
 .. toctree::
 :numbered:
 :maxdepth: 1
-:caption: Table of Contents
 
 common
 pixfmt
-- 
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 6/6] [media] doc-rst: do cross-references between header and the doc

2016-07-10 Thread Mauro Carvalho Chehab
Now that the LIRC header was added, we can cross-reference it
and identify the documentation gaps.

There are lots of stuff missing there, but at least now we
can avoid the gap to increase.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/lirc.h.rst.exceptions  | 72 ++
 Documentation/media/uapi/rc/lirc_ioctl.rst |  9 +++-
 2 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/lirc.h.rst.exceptions 
b/Documentation/media/lirc.h.rst.exceptions
index efdcb59f3002..58439ef3b9d7 100644
--- a/Documentation/media/lirc.h.rst.exceptions
+++ b/Documentation/media/lirc.h.rst.exceptions
@@ -1,2 +1,74 @@
 # Ignore header name
 ignore define _LINUX_LIRC_H
+
+# Ignore helper macros
+
+ignore define lirc_t
+
+ignore define LIRC_SPACE
+ignore define LIRC_PULSE
+ignore define LIRC_FREQUENCY
+ignore define LIRC_TIMEOUT
+ignore define LIRC_VALUE
+ignore define LIRC_MODE2
+ignore define LIRC_IS_SPACE
+ignore define LIRC_IS_PULSE
+ignore define LIRC_IS_FREQUENCY
+ignore define LIRC_IS_TIMEOUT
+
+ignore define LIRC_MODE2SEND
+ignore define LIRC_SEND2MODE
+ignore define LIRC_MODE2REC
+ignore define LIRC_REC2MODE
+
+ignore define LIRC_CAN_SEND
+ignore define LIRC_CAN_REC
+
+# Undocumented macros
+
+ignore define PULSE_BIT
+ignore define PULSE_MASK
+
+ignore define LIRC_MODE2_SPACE
+ignore define LIRC_MODE2_PULSE
+ignore define LIRC_MODE2_TIMEOUT
+
+ignore define LIRC_VALUE_MASK
+ignore define LIRC_MODE2_MASK
+
+ignore define LIRC_MODE_RAW
+
+ignore define LIRC_CAN_SEND_RAW
+ignore define LIRC_CAN_SEND_PULSE
+ignore define LIRC_CAN_SEND_MODE2
+ignore define LIRC_CAN_SEND_LIRCCODE
+
+ignore define LIRC_CAN_SEND_MASK
+
+ignore define LIRC_CAN_SET_SEND_CARRIER
+ignore define LIRC_CAN_SET_SEND_DUTY_CYCLE
+ignore define LIRC_CAN_SET_TRANSMITTER_MASK
+
+ignore define LIRC_CAN_REC_RAW
+ignore define LIRC_CAN_REC_PULSE
+ignore define LIRC_CAN_REC_MODE2
+ignore define LIRC_CAN_REC_LIRCCODE
+
+ignore define LIRC_CAN_REC_MASK
+
+ignore define LIRC_CAN_SET_REC_CARRIER
+ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
+
+ignore define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE
+ignore define LIRC_CAN_SET_REC_CARRIER_RANGE
+ignore define LIRC_CAN_GET_REC_RESOLUTION
+ignore define LIRC_CAN_SET_REC_TIMEOUT
+ignore define LIRC_CAN_SET_REC_FILTER
+
+ignore define LIRC_CAN_MEASURE_CARRIER
+ignore define LIRC_CAN_USE_WIDEBAND_RECEIVER
+
+ignore define LIRC_CAN_SEND(x)
+ignore define LIRC_CAN_REC(x)
+
+ignore define LIRC_CAN_NOTIFY_DECODE
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst 
b/Documentation/media/uapi/rc/lirc_ioctl.rst
index c4c34db61a96..c1c7163ba2f7 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -59,6 +59,7 @@ I/O control requests
 corresponding ioctls is undefined.
 
 .. _LIRC_GET_SEND_MODE:
+.. _lirc-mode-pulse:
 
 ``LIRC_GET_SEND_MODE``
 
@@ -66,6 +67,8 @@ I/O control requests
 lircd.
 
 .. _LIRC_GET_REC_MODE:
+.. _lirc-mode-mode2:
+.. _lirc-mode-lirccode:
 
 ``LIRC_GET_REC_MODE``
 
@@ -120,8 +123,8 @@ I/O control requests
 cannot be changed.
 
 .. _LIRC_GET_MIN_FILTER_PULSE:
-.. _LIRC_GET_MIN_FILTER_PULSE:
-.. _LIRC_GET_MAX_FILTER_SPACE:
+.. _LIRC_GET_MAX_FILTER_PULSE:
+.. _LIRC_GET_MIN_FILTER_SPACE:
 .. _LIRC_GET_MAX_FILTER_SPACE:
 
 ``LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE}``
@@ -186,6 +189,7 @@ I/O control requests
 
 .. _LIRC_SET_REC_FILTER_PULSE:
 .. _LIRC_SET_REC_FILTER_SPACE:
+.. _LIRC_SET_REC_FILTER:
 
 ``LIRC_SET_REC_FILTER_{PULSE,SPACE}``
 
@@ -195,6 +199,7 @@ I/O control requests
 shall be used instead.
 
 .. _LIRC_SET_MEASURE_CARRIER_MODE:
+.. _lirc-mode2-frequency:
 
 ``LIRC_SET_MEASURE_CARRIER_MODE``
 
-- 
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