color box, display box, corrugated box, color card, blister card, color sleeve, hang tag, label

2014-04-04 Thread Jinghao Printing - CHINA
Hi, this is David Wu from Shanghai, China.
We are a printing company, we can print color box, corrugated box,
label, hang tag etc.
Please let me know if you need these.

I will send you the website then.

Best regards,
David Wu
--
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] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-04 Thread Hugh Dickins
get_user_pages(write=1, force=1) has always had odd behaviour on write-
protected shared mappings: although it demands FMODE_WRITE-access to the
underlying object (do_mmap_pgoff sets neither VM_SHARED nor VM_MAYWRITE
without that), it ends up with do_wp_page substituting private anonymous
Copied-On-Write pages for the shared file pages in the area.

That was long ago intentional, as a safety measure to prevent ptrace
setting a breakpoint (or POKETEXT or POKEDATA) from inadvertently
corrupting the underlying executable.  Yet exec and dynamic loaders
open the file read-only, and use MAP_PRIVATE rather than MAP_SHARED.

The traditional odd behaviour still causes surprises and bugs in mm,
and is probably not what any caller wants - even the comment on the flag
says You do not want this (although it's undoubtedly necessary for
overriding userspace protections in some contexts, and good when !write).

Let's stop doing that.  But it would be dangerous to remove the long-
standing safety at this stage, so just make get_user_pages(write,force)
fail with EFAULT when applied to a write-protected shared area.
Infiniband may in future want to force write through to underlying
object: we can add another FOLL_flag later to enable that if required.

Odd though the old behaviour was, there is no doubt that we may turn
out to break userspace with this change, and have to revert it quickly.
Issue a WARN_ON_ONCE to help debug the changed case (easily triggered
by userspace, so only once to prevent spamming the logs); and delay a
few associated cleanups until this change is proved.

get_user_pages callers who might see trouble from this change:
  ptrace poking, or writing to /proc/pid/mem
  drivers/infiniband/
  drivers/media/v4l2-core/
  drivers/gpu/drm/exynos/exynos_drm_gem.c
  drivers/staging/tidspbridge/core/tiomap3430.c
if they ever apply get_user_pages to write-protected shared mappings
of an object which was opened for writing.

I went to apply the same change to mm/nommu.c, but retreated.  NOMMU
has no place for COW, and its VM_flags conventions are not the same:
I'd be more likely to screw up NOMMU than make an improvement there.

Suggested-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Hugh Dickins hu...@google.com
---

You suggested something like this in the LKML discussion of 887843961c4b
and bad rss-counter message in 3.14rc5 on March 18th, and I agreed to
remind you early in the 3.15 merge window.

Sorry, this comes a few days later than intended: and it's the first
time I've posted it, so it's not seen exposure in mmotm or linux-next;
nor any approval from those Cc'ed, though I did mention it to a few.
Up to you: you may prefer to hold it over, or give it exposure soonest;
I've seen no problem from it, but then I'm not likely to.

I may have exaggerated the accounting difficulties of the present
behaviour: even with this change, write-force still violates the
Committed_AS accounting which Konstantin had patches to fix; but
I hope we can do that more simply now, with some kind of cmpxchg
setting VM_ACCOUNT here in vm_flags, without mmap_sem for writing.

 mm/memory.c |   66 ++
 1 file changed, 45 insertions(+), 21 deletions(-)

--- 3.14/mm/memory.c2014-03-30 20:40:15.0 -0700
+++ linux/mm/memory.c   2014-04-03 15:26:41.884372480 -0700
@@ -1705,15 +1705,6 @@ long __get_user_pages(struct task_struct
 
VM_BUG_ON(!!pages != !!(gup_flags  FOLL_GET));
 
-   /* 
-* Require read or write permissions.
-* If FOLL_FORCE is set, we only require the MAY flags.
-*/
-   vm_flags  = (gup_flags  FOLL_WRITE) ?
-   (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);
-   vm_flags = (gup_flags  FOLL_FORCE) ?
-   (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
-
/*
 * If FOLL_FORCE and FOLL_NUMA are both set, handle_mm_fault
 * would be called on PROT_NONE ranges. We must never invoke
@@ -1741,7 +1732,7 @@ long __get_user_pages(struct task_struct
 
/* user gate pages are read-only */
if (gup_flags  FOLL_WRITE)
-   return i ? : -EFAULT;
+   goto efault;
if (pg  TASK_SIZE)
pgd = pgd_offset_k(pg);
else
@@ -1751,12 +1742,12 @@ long __get_user_pages(struct task_struct
BUG_ON(pud_none(*pud));
pmd = pmd_offset(pud, pg);
if (pmd_none(*pmd))
-   return i ? : -EFAULT;
+   goto efault;
VM_BUG_ON(pmd_trans_huge(*pmd));
pte = pte_offset_map(pmd, pg);
if (pte_none(*pte)) {
pte_unmap(pte);
-   return i ? : -EFAULT;
+  

Re: [PATCH v2 1/2] media: davinci: vpif capture: upgrade the driver with v4l offerings

2014-04-04 Thread Hans Verkuil
Hi Prabhakar,

Some review comments below. I'm going through the code quite carefully since
this very nice cleanup is a good opportunity to check for correct behavior in
this driver.

On 04/04/2014 07:17 AM, Lad, Prabhakar wrote:
 From: Lad, Prabhakar prabhakar.cse...@gmail.com
 
 This patch upgrades the vpif display driver with
 v4l helpers, this patch does the following,
 
 1: initialize the vb2 queue and context at the time of probe
 and removes context at remove() callback.
 2: uses vb2_ioctl_*() helpers.
 3: uses vb2_fop_*() helpers.
 4: uses SIMPLE_DEV_PM_OPS.
 5: uses vb2_ioctl_*() helpers.
 6: vidioc_g/s_priority is now handled by v4l core.
 7: removed driver specific fh and now using one provided by v4l.
 8: fixes checkpatch warnings.
 
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  drivers/media/platform/davinci/vpif_capture.c |  931 
 +++--
  drivers/media/platform/davinci/vpif_capture.h |   32 +-
  2 files changed, 234 insertions(+), 729 deletions(-)
 
 diff --git a/drivers/media/platform/davinci/vpif_capture.c 
 b/drivers/media/platform/davinci/vpif_capture.c
 index 8dea0b8..e4046f5 100644
 --- a/drivers/media/platform/davinci/vpif_capture.c
 +++ b/drivers/media/platform/davinci/vpif_capture.c
 @@ -1,5 +1,6 @@
  /*
   * Copyright (C) 2009 Texas Instruments Inc
 + * Copyright (C) 2014 Lad, Prabhakar prabhakar.cse...@gmail.com
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
 @@ -37,6 +38,8 @@ MODULE_VERSION(VPIF_CAPTURE_VERSION);
  #define vpif_dbg(level, debug, fmt, arg...)  \
   v4l2_dbg(level, debug, vpif_obj.v4l2_dev, fmt, ## arg)
  
 +#define VPIF_DRIVER_NAME vpif_capture
 +
  static int debug = 1;
  static u32 ch0_numbuffers = 3;
  static u32 ch1_numbuffers = 3;
 @@ -65,11 +68,25 @@ static struct vpif_config_params config_params = {
   .channel_bufsize[1] = 720 * 576 * 2,
  };
  
 +static u8 channel_first_int[VPIF_NUMBER_OF_OBJECTS][2] = { {1, 1} };
 +
  /* global variables */
  static struct vpif_device vpif_obj = { {NULL} };
  static struct device *vpif_dev;
  static void vpif_calculate_offsets(struct channel_obj *ch);
  static void vpif_config_addr(struct channel_obj *ch, int muxmode);
 +static int vpif_check_format(struct channel_obj *ch,
 +  struct v4l2_pix_format *pixfmt, int update);
 +
 +/*
 + * Is set to 1 in case of SDTV formats, 2 in case of HDTV formats.
 + */
 +static int ycmux_mode;
 +
 +static inline struct vpif_cap_buffer *to_vpif_buffer(struct vb2_buffer *vb)
 +{
 + return container_of(vb, struct vpif_cap_buffer, vb);
 +}
  
  /**
   * buffer_prepare :  callback function for buffer prepare
 @@ -81,10 +98,8 @@ static void vpif_config_addr(struct channel_obj *ch, int 
 muxmode);
   */
  static int vpif_buffer_prepare(struct vb2_buffer *vb)
  {
 - /* Get the file handle object and channel object */
 - struct vpif_fh *fh = vb2_get_drv_priv(vb-vb2_queue);
   struct vb2_queue *q = vb-vb2_queue;
 - struct channel_obj *ch = fh-channel;
 + struct channel_obj *ch = vb2_get_drv_priv(q);
   struct common_obj *common;
   unsigned long addr;
  
 @@ -100,7 +115,7 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb)
   goto exit;
   addr = vb2_dma_contig_plane_dma_addr(vb, 0);
  
 - if (q-streaming) {
 + if (vb2_is_streaming(q)) {
   if (!IS_ALIGNED((addr + common-ytop_off), 8) ||
   !IS_ALIGNED((addr + common-ybtm_off), 8) ||
   !IS_ALIGNED((addr + common-ctop_off), 8) ||

Why would you do this check only when streaming? Usually apps queued all
buffers before calling S_STREAMON, so vb2_is_streaming(q) will still be
false.

The problem is that vpif_calculate_offsets() is called in start_streaming,
but it should be called earlier in queue_setup. After queue_setup is called
the application is no longer allowed to change the format, so that's a good
place to do it. And then you can drop the vb2_is_streaming() check here
since the offsets will always be valid.

Also the 'if (vb-state != VB2_BUF_STATE_ACTIVE  vb-state != 
VB2_BUF_STATE_PREPARED)'
can be droppedd. It will never be called in an invalid state.

This check:

 if (vb2_plane_vaddr(vb, 0) 
vb2_get_plane_payload(vb, 0)  vb2_plane_size(vb, 0))
goto exit;

can also be improved: drop the vb2_plane_vaddr(vb, 0) since the payload check
should be done unconditionally. The 'goto exit' should be replaced with a
proper vpif_dbg since the message printed in the 'exit' is for the alignment
check.

 @@ -131,9 +146,7 @@ static int vpif_buffer_queue_setup(struct vb2_queue *vq,
   unsigned int *nbuffers, unsigned int *nplanes,
   unsigned int sizes[], void *alloc_ctxs[])
  {
 - /* Get the file 

Issue with sound recording

2014-04-04 Thread Vitālijs Čistovskis
Hi!

We have an Osprey 210 video capture card, which we want to use with Matterhorn 
platform for lecture recording purposes. The problem is in the following, 
osprey card records audio in the “fast” mode. So, when you play the recorded 
track, speech sounds unnatural and accelerated. The card is installed on the 
Linux machine (Ubuntu Server 12.04 64-bit). As far as I understand, 
installation of the additional drivers is not required. All drivers are already 
included in the Linux kernel. I have tried to record the sound with Ubuntu 
Sound Recorder tool and gstreamer using different settings of the pipeline, the 
result was the same.  Despite of the problem with the audio, video records 
normally. That’s why we record sound separately using the default mainboard 
audio input, but it is not a good solution. The default mainboard audio input 
records sound with noises (I have tried to change the alsamixer settings, but 
it not helped much) and sound is a little behind video, too.  I think that if 
we will resolve the problem with osprey card, then a problem with the audio and 
video synchronization would disappear and the level of noise would be reduced. 

What could be the reason of issue related to audio recording in accelerated 
mode? Maybe some advice related to the noise reducing, too? Thanks!


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


[GIT PULL FOR v3.15] Bug fixes for 3.15

2014-04-04 Thread Hans Verkuil
Hi Mauro,

A bunch of fixes for the davinci driver (found with the new vb2 instrumentation
and kmemleak) and a vb2 fix: the finish memop wasn't called for prepared or
queued buffers. Found with v4l2-compliance and the vb2 instrumentation.

This happens in the corner case where you call QBUF and/or PREPARE_BUF without
ever calling STREAMON, and then the vb2 queue is canceled either by calling
REQBUFS or closing the filehandle.

Regards,

Hans

The following changes since commit 8432164ddf7bfe40748ac49995356ab4dfda43b7:

  [media] Sensoray 2255 uses videobuf2 (2014-03-24 17:23:43 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v3.15g

for you to fetch changes up to cb49f006c756c5fefe94d4e892d902f44bbfc54d:

  vb2: call finish() memop for prepared/queued buffers (2014-03-28 12:38:38 
+0100)


Hans Verkuil (1):
  vb2: call finish() memop for prepared/queued buffers

Lad, Prabhakar (5):
  media: davinci: vpif_capture: fix releasing of active buffers
  media: davinci: vpif_display: fix releasing of active buffers
  media: davinci: vpbe_display: fix releasing of active buffers
  staging: media: davinci: vpfe: make sure all the buffers are released
  media: davinci: vpfe: make sure all the buffers unmapped and released

 drivers/media/platform/davinci/vpbe_display.c   | 16 +++-
 drivers/media/platform/davinci/vpfe_capture.c   |  2 ++
 drivers/media/platform/davinci/vpif_capture.c   | 34 
+++---
 drivers/media/platform/davinci/vpif_display.c   | 35 
+++
 drivers/media/v4l2-core/videobuf2-core.c| 16 +---
 drivers/staging/media/davinci_vpfe/vpfe_video.c | 13 +++--
 6 files changed, 87 insertions(+), 29 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: vb2: various small fixes/improvements

2014-04-04 Thread Hans Verkuil
Can someone review this? That would be much appreciated!

Regards,

Hans

On 03/10/2014 10:20 PM, Hans Verkuil wrote:
 This patch series contains a list of various vb2 fixes and improvements.
 
 These patches were originally part of this RFC patch series:
 
 http://www.spinics.net/lists/linux-media/msg73391.html
 
 They are now rebased and reordered a bit. It's little stuff for the
 most part, although the first patch touches on more drivers since it
 changes the return type of stop_streaming to void. The return value was
 always ignored by vb2 and you really cannot do anything sensible with it.
 In general resource allocations can return an error, but freeing up resources
 should not. That should always succeed.
 
 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: [media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface

2014-04-04 Thread Dan Carpenter
Whatever happened with this btw?  Also are you sure we don't need a
second check after line 457?

regards,
dan carpenter

On Tue, Aug 27, 2013 at 04:26:07PM +0200, Sylwester Nawrocki wrote:
 On 08/27/2013 04:19 PM, Dan Carpenter wrote:
  On Sun, Aug 25, 2013 at 02:23:18PM +0200, Sylwester Nawrocki wrote:
  On 08/23/2013 11:46 AM, Dan Carpenter wrote:
  [ Going through some old warnings... ]
 
  Hello Sylwester Nawrocki,
 
  This is a semi-automatic email about new static checker warnings.
 
  The patch babde1c243b2: [media] V4L: Add driver for S3C24XX/S3C64XX
  SoC series camera interface from Aug 22, 2012, leads to the
  following Smatch complaint:
 
  drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
 warn: variable dereferenced before check 'fmt' (see line 460)
 
  drivers/media/platform/s3c-camif/camif-capture.c
 455  if (pfmt) {
 456  pix =pfmt-fmt.pix;
 457  fmt = s3c_camif_find_format(vp,pix-pixelformat, 
  -1);
 458  size = (pix-width * pix-height * fmt-depth) / 
  8;
 ^^
  Dereference.
 
 459} else {
 460size = (frame-f_width * frame-f_height * 
  fmt-depth) / 8;
 
  ^^
  Dereference.
 
 461}
 462
 463if (fmt == NULL)
  ^^^
  Check.
 
  Thanks for the bug report. This check of course should be before line 455.
  Would you like to sent a patch for this or should I handle that ?
  
  Could you handle it and give me the Reported-by tag?
 
 Sure, will do.
 
 --
 Regards,
 Sylwester
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-04 Thread Kirill A. Shutemov
On Fri, Apr 04, 2014 at 01:28:22AM -0700, Hugh Dickins wrote:
 get_user_pages(write=1, force=1) has always had odd behaviour on write-
 protected shared mappings: although it demands FMODE_WRITE-access to the
 underlying object (do_mmap_pgoff sets neither VM_SHARED nor VM_MAYWRITE
 without that), it ends up with do_wp_page substituting private anonymous
 Copied-On-Write pages for the shared file pages in the area.
 
 That was long ago intentional, as a safety measure to prevent ptrace
 setting a breakpoint (or POKETEXT or POKEDATA) from inadvertently
 corrupting the underlying executable.  Yet exec and dynamic loaders
 open the file read-only, and use MAP_PRIVATE rather than MAP_SHARED.
 
 The traditional odd behaviour still causes surprises and bugs in mm,
 and is probably not what any caller wants - even the comment on the flag
 says You do not want this (although it's undoubtedly necessary for
 overriding userspace protections in some contexts, and good when !write).
 
 Let's stop doing that.  But it would be dangerous to remove the long-
 standing safety at this stage, so just make get_user_pages(write,force)
 fail with EFAULT when applied to a write-protected shared area.
 Infiniband may in future want to force write through to underlying
 object: we can add another FOLL_flag later to enable that if required.
 
 Odd though the old behaviour was, there is no doubt that we may turn
 out to break userspace with this change, and have to revert it quickly.
 Issue a WARN_ON_ONCE to help debug the changed case (easily triggered
 by userspace, so only once to prevent spamming the logs); and delay a
 few associated cleanups until this change is proved.
 
 get_user_pages callers who might see trouble from this change:
   ptrace poking, or writing to /proc/pid/mem
   drivers/infiniband/
   drivers/media/v4l2-core/
   drivers/gpu/drm/exynos/exynos_drm_gem.c
   drivers/staging/tidspbridge/core/tiomap3430.c
 if they ever apply get_user_pages to write-protected shared mappings
 of an object which was opened for writing.
 
 I went to apply the same change to mm/nommu.c, but retreated.  NOMMU
 has no place for COW, and its VM_flags conventions are not the same:
 I'd be more likely to screw up NOMMU than make an improvement there.
 
 Suggested-by: Linus Torvalds torva...@linux-foundation.org
 Signed-off-by: Hugh Dickins hu...@google.com

There's comment in do_wp_page() which is not true anymore with patch
applied. It should be fixed.

Otherwise, looks good to me:

Acked-by: Kirill A. Shutemov kirill.shute...@linux.intel.com

-- 
 Kirill A. Shutemov
--
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 05/49] rc-core: split dev-s_filter

2014-04-04 Thread James Hogan
Hi David,

On 4 April 2014 00:31, David Härdeman da...@hardeman.nu wrote:
 Overloading dev-s_filter to do two different functions (set wakeup filters
 and generic hardware filters) makes it impossible to tell what the
 hardware actually supports, so create a separate dev-s_wakeup_filter and
 make the distinction explicit.

 Signed-off-by: David Härdeman da...@hardeman.nu
 ---
  drivers/media/rc/img-ir/img-ir-hw.c |   15 ++-

I think we crossed emails. My comments on your earlier submission of
this patch about the removal of generic scancode filter code that has
crept in to the patch apply here too (sorry I didn't spot that when I
first looked at it!).

But if you fix that you're welcome to my:
Acked-by: James Hogan james.ho...@imgtec.com

Cheers
James

  drivers/media/rc/rc-main.c  |   31 +++
  include/media/rc-core.h |6 --
  3 files changed, 37 insertions(+), 15 deletions(-)

 diff --git a/drivers/media/rc/img-ir/img-ir-hw.c 
 b/drivers/media/rc/img-ir/img-ir-hw.c
 index aec79f7..871a9b3 100644
 --- a/drivers/media/rc/img-ir/img-ir-hw.c
 +++ b/drivers/media/rc/img-ir/img-ir-hw.c
 @@ -504,6 +504,18 @@ unlock:
 return ret;
  }

 +static int img_ir_set_normal_filter(struct rc_dev *dev,
 +   struct rc_scancode_filter *sc_filter)
 +{
 +   return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter);
 +}
 +
 +static int img_ir_set_wakeup_filter(struct rc_dev *dev,
 +   struct rc_scancode_filter *sc_filter)
 +{
 +   return img_ir_set_filter(dev, RC_FILTER_WAKEUP, sc_filter);
 +}
 +
  /**
   * img_ir_set_decoder() - Set the current decoder.
   * @priv:  IR private data.
 @@ -988,7 +1000,8 @@ int img_ir_probe_hw(struct img_ir_priv *priv)
 rdev-map_name = RC_MAP_EMPTY;
 rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv));
 rdev-input_name = IMG Infrared Decoder;
 -   rdev-s_filter = img_ir_set_filter;
 +   rdev-s_filter = img_ir_set_normal_filter;
 +   rdev-s_wakeup_filter = img_ir_set_wakeup_filter;

 /* Register hardware decoder */
 error = rc_register_device(rdev);
 diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
 index c0bfd50..ba955ac 100644
 --- a/drivers/media/rc/rc-main.c
 +++ b/drivers/media/rc/rc-main.c
 @@ -929,6 +929,7 @@ static ssize_t store_protocols(struct device *device,
 int rc, i, count = 0;
 ssize_t ret;
 int (*change_protocol)(struct rc_dev *dev, u64 *rc_type);
 +   int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
 *filter);
 struct rc_scancode_filter local_filter, *filter;

 /* Device is being removed */
 @@ -1013,24 +1014,27 @@ static ssize_t store_protocols(struct device *device,
  * Fall back to clearing the filter.
  */
 filter = dev-scancode_filters[fattr-type];
 +   set_filter = (fattr-type == RC_FILTER_NORMAL)
 +   ? dev-s_filter : dev-s_wakeup_filter;
 +
 if (old_type != type  filter-mask) {
 local_filter = *filter;
 if (!type) {
 /* no protocol = clear filter */
 ret = -1;
 -   } else if (!dev-s_filter) {
 +   } else if (!set_filter) {
 /* generic filtering = accept any filter */
 ret = 0;
 } else {
 /* hardware filtering = try setting, otherwise clear 
 */
 -   ret = dev-s_filter(dev, fattr-type, local_filter);
 +   ret = set_filter(dev, local_filter);
 }
 if (ret  0) {
 /* clear the filter */
 local_filter.data = 0;
 local_filter.mask = 0;
 -   if (dev-s_filter)
 -   dev-s_filter(dev, fattr-type, 
 local_filter);
 +   if (set_filter)
 +   set_filter(dev, local_filter);
 }

 /* commit the new filter */
 @@ -1112,6 +1116,7 @@ static ssize_t store_filter(struct device *device,
 struct rc_scancode_filter local_filter, *filter;
 int ret;
 unsigned long val;
 +   int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
 *filter);

 /* Device is being removed */
 if (!dev)
 @@ -1121,9 +1126,11 @@ static ssize_t store_filter(struct device *device,
 if (ret  0)
 return ret;

 -   /* Scancode filter not supported (but still accept 0) */
 -   if (!dev-s_filter  fattr-type != RC_FILTER_NORMAL)
 -   return val ? -EINVAL : count;
 +   /* Can the scancode filter be set? */
 +   set_filter = (fattr-type == RC_FILTER_NORMAL)
 +   ? dev-s_filter : dev-s_wakeup_filter;
 +   if (!set_filter)
 +

Re: [PATCH 04/49] rc-core: do not change 32bit NEC scancode format for now

2014-04-04 Thread James Hogan
Hi David,

On 4 April 2014 00:31, David Härdeman da...@hardeman.nu wrote:
 diff --git a/drivers/media/rc/img-ir/img-ir-nec.c 
 b/drivers/media/rc/img-ir/img-ir-nec.c
 index c0111d6..ee45795 100644
 --- a/drivers/media/rc/img-ir/img-ir-nec.c
 +++ b/drivers/media/rc/img-ir/img-ir-nec.c

  /* Convert NEC data to a scancode */
  static int img_ir_nec_scancode(int len, u64 raw, enum rc_type *protocol,
 @@ -23,11 +24,11 @@ static int img_ir_nec_scancode(int len, u64 raw, enum 
 rc_type *protocol,
 data_inv = (raw  24)  0xff;
 if ((data_inv ^ data) != 0xff) {
 /* 32-bit NEC (used by Apple and TiVo remotes) */
 -   /* scan encoding: aaAAddDD */
 -   *scancode = addr_inv  24 |
 -   addr  16 |
 -   data_inv   8 |
 -   data;
 +   /* scan encoding: AAaaDDdd (LSBit first) */

This scan encoding of NEC32 interprets the  raw data MSBit first (i.e.
the MSBit of scancode is the first bit received), so this comment is
wrong.

 +   *scancode = bitrev8(addr)  24 |
 +   bitrev8(addr_inv)  16 |
 +   bitrev8(data)   8 |
 +   bitrev8(data_inv);
 } else if ((addr_inv ^ addr) != 0xff) {
 /* Extended NEC */
 /* scan encoding: AAaaDD */
 @@ -56,13 +57,15 @@ static int img_ir_nec_filter(const struct 
 rc_scancode_filter *in,

 if ((in-data | in-mask)  0xff00) {
 /* 32-bit NEC (used by Apple and TiVo remotes) */
 -   /* scan encoding: aaAAddDD */
 -   addr_inv   = (in-data  24)  0xff;
 -   addr_inv_m = (in-mask  24)  0xff;
 -   addr   = (in-data  16)  0xff;
 -   addr_m = (in-mask  16)  0xff;
 -   data_inv   = (in-data   8)  0xff;
 -   data_inv_m = (in-mask   8)  0xff;
 +   /* scan encoding: AAaaDDdd (LSBit first) */

same here

The actual code looks fine now though. If you fix those two comments:
Acked-by: James Hogan james.ho...@imgtec.com

Cheers
James

 +   addr   = bitrev8(in-data  24);
 +   addr_m = bitrev8(in-mask  24);
 +   addr_inv   = bitrev8(in-data  16);
 +   addr_inv_m = bitrev8(in-mask  16);
 +   data   = bitrev8(in-data   8);
 +   data_m = bitrev8(in-mask   8);
 +   data_inv   = bitrev8(in-data   0);
 +   data_inv_m = bitrev8(in-mask   0);
 } else if ((in-data | in-mask)  0x00ff) {
 /* Extended NEC */
 /* scan encoding AAaaDD */
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] media: v4l: Remove documentation for nonexistend input field in v4l2_buffer

2014-04-04 Thread Sakari Ailus
The input field in struct v4l2_buffer no longer exists but has been replaced
by a reserved field. Remove the field documentation.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 include/uapi/linux/videodev2.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index ea468ee..db4aebd 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -649,7 +649,6 @@ struct v4l2_plane {
  * @length:size in bytes of the buffer (NOT its payload) for single-plane
  * buffers (when type != *_MPLANE); number of elements in the
  * planes array for multi-plane buffers
- * @input: input number from which the video data has has been captured
  *
  * Contains data exchanged by application and driver using one of the Streaming
  * I/O methods.
-- 
1.8.3.2

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


[PATCH 1/2] media: v4l: V4L2_MBUS_FRAME_DESC_FL_BLOB is about 1D DMA

2014-04-04 Thread Sakari Ailus
V4L2_MBUS_FRAME_DESC_FL_BLOB intends to say the receiver must use 1D DMA to
receive the image, as the format does not have line offsets. This typically
includes all compressed formats.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
Cc: Sylwester Nawrocki s.nawro...@samsung.com
---
 include/media/v4l2-subdev.h | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 28f4d8c..00f5d2b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -234,15 +234,18 @@ struct v4l2_subdev_audio_ops {
 
 /* Indicates the @length field specifies maximum data length. */
 #define V4L2_MBUS_FRAME_DESC_FL_LEN_MAX(1U  0)
-/* Indicates user defined data format, i.e. non standard frame format. */
+/*
+ * Indicates that the format does not have line offsets, i.e. the
+ * receiver should use 1D DMA.
+ */
 #define V4L2_MBUS_FRAME_DESC_FL_BLOB   (1U  1)
 
 /**
  * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
  * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags
  * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set
- * @length: number of octets per frame, valid for compressed or unspecified
- *  formats
+ * @length: number of octets per frame, valid if V4L2_MBUS_FRAME_DESC_FL_BLOB
+ * is set
  */
 struct v4l2_mbus_frame_desc_entry {
u16 flags;
-- 
1.8.3.2

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


[PATCH 0/2] Trivial in-kernel API documentation fixes

2014-04-04 Thread Sakari Ailus
Hi,

Two trivial fixes. The first one perhaps is worth a thought. This was anyway
my original intention. I'm not sure we'll ever want to have user defined
(i.e. undocumented) media bus formats anyway. Hopefully not at least. :-)

-- 
Kind regards,
Sakari

--
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/49] rc-core: remove generic scancode filter

2014-04-04 Thread James Hogan
Hi David,

On 4 April 2014 00:31, David Härdeman da...@hardeman.nu wrote:
 The generic scancode filtering has questionable value and makes it
 impossible to determine from userspace if there is an actual
 scancode hw filter present or not.

 So revert the generic parts.

I've already mentioned in a different email that reverting the last
two hunks of b8c7d915087c97a21fa415fa0e860e59739da202 should be in
this patch rather than combined into patch 5.

But if you fix that you're welcome to my:
Reviewed-by: James Hogan james.ho...@imgtec.com

Thanks
James


 Based on a patch from James Hogan james.ho...@imgtec.com, but this
 version also makes sure that only the valid sysfs files are created
 in the first place.

 v2: correct dev-s_filter check

 Signed-off-by: David Härdeman da...@hardeman.nu
 ---
  drivers/media/rc/rc-main.c |   67 
 +---
  include/media/rc-core.h|2 +
  2 files changed, 46 insertions(+), 23 deletions(-)

 diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
 index ba955ac..26c266b 100644
 --- a/drivers/media/rc/rc-main.c
 +++ b/drivers/media/rc/rc-main.c
 @@ -634,7 +634,6 @@ EXPORT_SYMBOL_GPL(rc_repeat);
  static void ir_do_keydown(struct rc_dev *dev, enum rc_type protocol,
   u32 scancode, u32 keycode, u8 toggle)
  {
 -   struct rc_scancode_filter *filter;
 bool new_event = (!dev-keypressed   ||
   dev-last_protocol != protocol ||
   dev-last_scancode != scancode ||
 @@ -643,11 +642,6 @@ static void ir_do_keydown(struct rc_dev *dev, enum 
 rc_type protocol,
 if (new_event  dev-keypressed)
 ir_do_keyup(dev, false);

 -   /* Generic scancode filtering */
 -   filter = dev-scancode_filters[RC_FILTER_NORMAL];
 -   if (filter-mask  ((scancode ^ filter-data)  filter-mask))
 -   return;
 -
 input_event(dev-input_dev, EV_MSC, MSC_SCAN, scancode);

 if (new_event  keycode != KEY_RESERVED) {
 @@ -1017,14 +1011,11 @@ static ssize_t store_protocols(struct device *device,
 set_filter = (fattr-type == RC_FILTER_NORMAL)
 ? dev-s_filter : dev-s_wakeup_filter;

 -   if (old_type != type  filter-mask) {
 +   if (set_filter  old_type != type  filter-mask) {
 local_filter = *filter;
 if (!type) {
 /* no protocol = clear filter */
 ret = -1;
 -   } else if (!set_filter) {
 -   /* generic filtering = accept any filter */
 -   ret = 0;
 } else {
 /* hardware filtering = try setting, otherwise clear 
 */
 ret = set_filter(dev, local_filter);
 @@ -1033,8 +1024,7 @@ static ssize_t store_protocols(struct device *device,
 /* clear the filter */
 local_filter.data = 0;
 local_filter.mask = 0;
 -   if (set_filter)
 -   set_filter(dev, local_filter);
 +   set_filter(dev, local_filter);
 }

 /* commit the new filter */
 @@ -1078,7 +1068,10 @@ static ssize_t show_filter(struct device *device,
 return -EINVAL;

 mutex_lock(dev-lock);
 -   if (fattr-mask)
 +   if ((fattr-type == RC_FILTER_NORMAL  !dev-s_filter) ||
 +   (fattr-type == RC_FILTER_WAKEUP  !dev-s_wakeup_filter))
 +   val = 0;
 +   else if (fattr-mask)
 val = dev-scancode_filters[fattr-type].mask;
 else
 val = dev-scancode_filters[fattr-type].data;
 @@ -1202,27 +1195,45 @@ static RC_FILTER_ATTR(wakeup_filter, S_IRUGO|S_IWUSR,
  static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR,
   show_filter, store_filter, RC_FILTER_WAKEUP, true);

 -static struct attribute *rc_dev_attrs[] = {
 +static struct attribute *rc_dev_protocol_attrs[] = {
 dev_attr_protocols.attr.attr,
 +   NULL,
 +};
 +
 +static struct attribute_group rc_dev_protocol_attr_grp = {
 +   .attrs  = rc_dev_protocol_attrs,
 +};
 +
 +static struct attribute *rc_dev_wakeup_protocol_attrs[] = {
 dev_attr_wakeup_protocols.attr.attr,
 +   NULL,
 +};
 +
 +static struct attribute_group rc_dev_wakeup_protocol_attr_grp = {
 +   .attrs  = rc_dev_wakeup_protocol_attrs,
 +};
 +
 +static struct attribute *rc_dev_filter_attrs[] = {
 dev_attr_filter.attr.attr,
 dev_attr_filter_mask.attr.attr,
 -   dev_attr_wakeup_filter.attr.attr,
 -   dev_attr_wakeup_filter_mask.attr.attr,
 NULL,
  };

 -static struct attribute_group rc_dev_attr_grp = {
 -   .attrs  = rc_dev_attrs,
 +static struct attribute_group rc_dev_filter_attr_grp = {
 +   .attrs  = rc_dev_filter_attrs,
 +};
 +
 +static struct attribute 

Re: [PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-04 Thread Hugh Dickins
On Fri, 4 Apr 2014, Kirill A. Shutemov wrote:
 
 There's comment in do_wp_page() which is not true anymore with patch
 applied. It should be fixed.

The * Only catch write-faults on shared writable pages,
* read-only shared pages can get COWed by
* get_user_pages(.write=1, .force=1).

Yes, I went back and forth on that: I found it difficult to remove that
comment without also simplifying the VM_WRITE|VM_SHARED test immediately
above it, possibly even looking again at the ordering of those tests.

In the end I decided to leave changing it to when we do the other
little cleanups outside get_user_pages(), after it's become clear
whether the new EFAULT is troublesome or not.  Most of my testing
had been without any change in do_wp_page(), so I left that out.

 
 Otherwise, looks good to me:
 
 Acked-by: Kirill A. Shutemov kirill.shute...@linux.intel.com

Thanks,
Hugh
--
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: [GIT PULL for v3.15-rc1] media updates

2014-04-04 Thread Linus Torvalds
On Thu, Apr 3, 2014 at 9:11 AM, Mauro Carvalho Chehab
m.che...@samsung.com wrote:

 PS.: You'll find some minor conflicts between this changeset and upstream,
 mainly due to some code that moved from V4L2 to OF subsystem.

That conflict was not at all minor, unless I were willing to do the
merge incorrectly and just drop all changes from one side. Which is
not how I do merges if I can at all avoid it.

The *trivial* merge would be to just take the
of_graph_get_next_endpoint() function as it existed in its new
location of drivers/of/base.c.

However, there were to clashing changes to that function (one in the
original location, one in the new moved location). They were:

 - b9db140c1e46: [media] v4l: of: Support empty port nodes
 - 4329b93b283c: of: Reduce indentation in of_graph_get_next_endpoint

and quite frankly, I think that the second commit was the much less
interesting of the two, so *that* was the one I felt I should drop.
But that made the merge a lot more interesting than just picking the
new location (because the new location didn't have the important
change). And those two changes clash to the point of being basically
mutually exclusive.

So I did the complex merge that I think is the right thing by hand.

However, I feel a bit bad about that more merge, because I have
absolutely no way to test my result. So I'm including here all the
relevant people wrt those two commits, and my note from my merge
message:

  NOTE! This merge effective drops commit 4329b93b283c (of: Reduce
  indentation in of_graph_get_next_endpoint).

  The of_graph_get_next_endpoint() function was moved and renamed by
  commit fd9fdb78a9bf ([media] of: move graph helpers from
  drivers/media/v4l2-core to drivers/of).  It was originally called
  v4l2_of_get_next_endpoint() and lived in the file
  drivers/media/v4l2-core/v4l2-of.c.

  In that original location, it was then fixed to support empty port
  nodes by commit b9db140c1e46 ([media] v4l: of: Support empty port
  nodes), and that commit clashes badly with the dropped Reduce
  intendation commit.  I had to choose one or the other, and decided
  that the Support empty port nodes commit was more important

So guys, can you please verify the end result? It looks sane to me,
but there's no good way for me to do even basic compile testing of the
OF code, so this was all done entirely blind. And hey, maybe you
disagree about the empty port nodes being the important case anyway.

Maybe I should have done the wrong merge just to avoid this issue,
but I do hate doing that.

  Linus
--
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: [GIT PULL for v3.15-rc1] media updates

2014-04-04 Thread Laurent Pinchart
Hi Linus,

On Friday 04 April 2014 10:26:42 Linus Torvalds wrote:
 On Thu, Apr 3, 2014 at 9:11 AM, Mauro Carvalho Chehab wrote:
  PS.: You'll find some minor conflicts between this changeset and upstream,
  mainly due to some code that moved from V4L2 to OF subsystem.
 
 That conflict was not at all minor, unless I were willing to do the
 merge incorrectly and just drop all changes from one side. Which is
 not how I do merges if I can at all avoid it.
 
 The *trivial* merge would be to just take the
 of_graph_get_next_endpoint() function as it existed in its new
 location of drivers/of/base.c.
 
 However, there were to clashing changes to that function (one in the
 original location, one in the new moved location). They were:
 
  - b9db140c1e46: [media] v4l: of: Support empty port nodes
  - 4329b93b283c: of: Reduce indentation in of_graph_get_next_endpoint
 
 and quite frankly, I think that the second commit was the much less
 interesting of the two, so *that* was the one I felt I should drop.
 But that made the merge a lot more interesting than just picking the
 new location (because the new location didn't have the important
 change). And those two changes clash to the point of being basically
 mutually exclusive.
 
 So I did the complex merge that I think is the right thing by hand.
 
 However, I feel a bit bad about that more merge, because I have
 absolutely no way to test my result. So I'm including here all the
 relevant people wrt those two commits, and my note from my merge
 message:
 
   NOTE! This merge effective drops commit 4329b93b283c (of: Reduce
   indentation in of_graph_get_next_endpoint).
 
   The of_graph_get_next_endpoint() function was moved and renamed by
   commit fd9fdb78a9bf ([media] of: move graph helpers from
   drivers/media/v4l2-core to drivers/of).  It was originally called
   v4l2_of_get_next_endpoint() and lived in the file
   drivers/media/v4l2-core/v4l2-of.c.
 
   In that original location, it was then fixed to support empty port
   nodes by commit b9db140c1e46 ([media] v4l: of: Support empty port
   nodes), and that commit clashes badly with the dropped Reduce
   intendation commit.  I had to choose one or the other, and decided
   that the Support empty port nodes commit was more important
 
 So guys, can you please verify the end result? It looks sane to me,
 but there's no good way for me to do even basic compile testing of the
 OF code, so this was all done entirely blind. And hey, maybe you
 disagree about the empty port nodes being the important case anyway.
 
 Maybe I should have done the wrong merge just to avoid this issue,
 but I do hate doing that.

I've reviewed the merge and tested it, and all looks good. Thank you for not 
dropping my patch :-)

-- 
Regards,

Laurent Pinchart

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


[GIT PULL for v3.15-rc1] exynos patches

2014-04-04 Thread Mauro Carvalho Chehab
Hi Linus,

That's the remaining patches I have for the merge windows. It basically
adds a new sensor and adds the needed DT bits for it to work.

-

PS.: This patch also have some conflicts with the code that got moved
to drivers/of, but this conflict is just function rename:

-   node = v4l2_of_get_next_endpoint(node, NULL);
+   node = of_graph_get_next_endpoint(node, NULL);

-   node = v4l2_of_get_remote_port(node);
+   node = of_graph_get_remote_port(node);

-

The following changes since commit ba35ca07080268af1badeb47de0f9eff28126339:

  [media] em28xx-audio: make sure audio is unmuted on open() (2014-03-14 
10:17:18 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media topic/exynos

for you to fetch changes up to 97e9858ed5525af5355769cd98b25b5ec94c0c85:

  [media] s5p-fimc: Remove reference to outdated macro (2014-03-14 10:37:43 
-0300)


Jacek Anaszewski (1):
  [media] s5p-jpeg: Fix broken indentation in jpeg-regs.h

Paul Bolle (1):
  [media] s5p-fimc: Remove reference to outdated macro

Sylwester Nawrocki (9):
  [media] Documentation: dt: Add binding documentation for S5K6A3 image 
sensor
  [media] Documentation: dt: Add binding documentation for S5C73M3 camera
  [media] Documentation: devicetree: Update Samsung FIMC DT binding
  [media] V4L: Add driver for s5k6a3 image sensor
  [media] V4L: s5c73m3: Add device tree support
  [media] exynos4-is: Use external s5k6a3 sensor driver
  [media] exynos4-is: Add clock provider for the SCLK_CAM clock outputs
  [media] exynos4-is: Add support for asynchronous subdevices registration
  [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver

 .../devicetree/bindings/media/samsung-fimc.txt |  44 +-
 .../devicetree/bindings/media/samsung-s5c73m3.txt  |  97 +++
 .../devicetree/bindings/media/samsung-s5k6a3.txt   |  33 ++
 Documentation/video4linux/fimc.txt |   5 +-
 drivers/media/i2c/Kconfig  |   8 +
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/s5c73m3/s5c73m3-core.c   | 207 +--
 drivers/media/i2c/s5c73m3/s5c73m3-spi.c|   6 +
 drivers/media/i2c/s5c73m3/s5c73m3.h|   4 +
 drivers/media/i2c/s5k6a3.c | 389 
 drivers/media/platform/exynos4-is/Kconfig  |   9 +
 drivers/media/platform/exynos4-is/Makefile |   4 +
 drivers/media/platform/exynos4-is/fimc-is-param.c  |   2 +-
 drivers/media/platform/exynos4-is/fimc-is-param.h  |   5 +
 drivers/media/platform/exynos4-is/fimc-is-regs.c   |  16 +-
 drivers/media/platform/exynos4-is/fimc-is-regs.h   |   1 +
 drivers/media/platform/exynos4-is/fimc-is-sensor.c | 285 +
 drivers/media/platform/exynos4-is/fimc-is-sensor.h |  49 +-
 drivers/media/platform/exynos4-is/fimc-is.c|  98 ++-
 drivers/media/platform/exynos4-is/fimc-is.h|   9 +-
 drivers/media/platform/exynos4-is/fimc-isp-video.c | 660 +
 drivers/media/platform/exynos4-is/fimc-isp-video.h |  44 ++
 drivers/media/platform/exynos4-is/fimc-isp.c   |  29 +-
 drivers/media/platform/exynos4-is/fimc-isp.h   |  27 +-
 drivers/media/platform/exynos4-is/media-dev.c  | 363 +---
 drivers/media/platform/exynos4-is/media-dev.h  |  32 +-
 drivers/media/platform/s5p-jpeg/jpeg-regs.h|  24 +-
 27 files changed, 1886 insertions(+), 565 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5c73m3.txt
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5k6a3.txt
 create mode 100644 drivers/media/i2c/s5k6a3.c
 create mode 100644 drivers/media/platform/exynos4-is/fimc-isp-video.c
 create mode 100644 drivers/media/platform/exynos4-is/fimc-isp-video.h


This is the diff for the trivial merge conflict solve.

diff --cc drivers/media/platform/exynos4-is/fimc-is.c
index 9bdfa4599bc3,c289d5a69d09..
--- a/drivers/media/platform/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/exynos4-is/fimc-is.c
@@@ -167,11 -168,19 +168,18 @@@ static int fimc_is_parse_sensor_config(
u32 tmp = 0;
int ret;
  
+   sensor-drvdata = fimc_is_sensor_get_drvdata(node);
+   if (!sensor-drvdata) {
+   dev_err(is-pdev-dev, no driver data found for: %s\n,
+node-full_name);
+   return -EINVAL;
+   }
+ 
 -  node = v4l2_of_get_next_endpoint(node, NULL);
 -  if (!node)
 +  np = of_graph_get_next_endpoint(np, NULL);
 +  if (!np)
return -ENXIO;
 -
 -  node = v4l2_of_get_remote_port(node);
 -  if (!node)
 +  np = of_graph_get_remote_port(np);
 +  if (!np)
return -ENXIO;
  
/* Use MIPI-CSIS channel id to determine the ISP I2C bus index. */


-- 

Regards,
Mauro
--
To 

AW: AW: v4l2_buffer with PBO mapped memory

2014-04-04 Thread Scheuermann, Mail
Hi Laurent,

I've done the following:

echo 3 /sys/module/videobuf2_core/parameters/debug

and found in /var/log/kern.log after starting my program:

Apr  4 21:53:48 x240 kernel: [239432.535077] vb2: Buffer 0, plane 0 offset 
0x
Apr  4 21:53:48 x240 kernel: [239432.535080] vb2: Buffer 1, plane 0 offset 
0x001c2000
Apr  4 21:53:48 x240 kernel: [239432.535082] vb2: Buffer 2, plane 0 offset 
0x00384000
Apr  4 21:53:48 x240 kernel: [239432.535083] vb2: Allocated 3 buffers, 1 
plane(s) each
Apr  4 21:53:48 x240 kernel: [239432.535085] vb2: qbuf: userspace address for 
plane 0 changed, reacquiring memory
Apr  4 21:53:48 x240 kernel: [239432.535087] vb2: qbuf: failed acquiring 
userspace memory for plane 0
Apr  4 21:53:48 x240 kernel: [239432.535088] vb2: qbuf: buffer preparation 
failed: -22
Apr  4 21:53:48 x240 kernel: [239432.535128] vb2: streamoff: not streaming

Regards,

Thomas


Von: Laurent Pinchart [laurent.pinch...@ideasonboard.com]
Gesendet: Freitag, 4. April 2014 01:16
An: Scheuermann, Mail
Cc: linux-media@vger.kernel.org
Betreff: Re: AW: v4l2_buffer with PBO mapped memory

Hi Thomas,

On Thursday 03 April 2014 16:52:19 Scheuermann, Mail wrote:
 Hi Laurent,

 the driver my device uses is the uvcvideo. I have the kernel 3.11.0-18 from
 Ubuntu 13.10 running. It is built in in a Thinkpad X240 notebook.

OK. A bit of debugging will then be needed. Could you set the videobuf2-core
debug parameter to 3, retry your test case and send us the kernel log ?

--
Regards,

Laurent Pinchart

This message is subject to the following terms and conditions: MAIL 
DISCLAIMERhttp://www.barco.com/en/maildisclaimer
--
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: [GIT PULL for v3.15-rc1] media updates

2014-04-04 Thread Linus Torvalds
On Thu, Apr 3, 2014 at 9:11 AM, Mauro Carvalho Chehab
m.che...@samsung.com wrote:

 Please pull from:
   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
 v4l_for_linus

Oh, just noticed that this seems to be the cause of a new annoying warning:

   usr/include/linux/v4l2-common.h:72: found __[us]{8,16,32,64} type
without #include linux/types.h

which seems to have come in through commits 777f4f85b75f1 and 254a47770163f.

I think the proper fix is to just add that

  #include linux/types.h

to include/uapi/linux/v4l2-common.h. Assuming that really is supposed
to be a user-visible API at all?

  Linus
--
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/3] 3.15 fixes

2014-04-04 Thread David Härdeman
The following three patches are the quickfixes that we (Mauro, James, me)
seemed to agree to. I've updated the patches to apply cleanly without 
the preceeding patches from my previous patchbomb and I've hopefully fixed
the comments that James provided (I'll let him reply with separate Acked-by
lines if he agrees to each patch).

---

David Härdeman (3):
  rc-core: do not change 32bit NEC scancode format for now
  rc-core: split dev-s_filter
  rc-core: remove generic scancode filter


 drivers/media/rc/img-ir/img-ir-hw.c  |   15 +
 drivers/media/rc/img-ir/img-ir-nec.c |   27 +
 drivers/media/rc/ir-nec-decoder.c|5 --
 drivers/media/rc/keymaps/rc-tivo.c   |   86 +++---
 drivers/media/rc/rc-main.c   |   98 ++
 include/media/rc-core.h  |8 ++-
 6 files changed, 142 insertions(+), 97 deletions(-)

--
David Härdeman
--
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] rc-core: do not change 32bit NEC scancode format for now

2014-04-04 Thread David Härdeman
This reverts 18bc17448147e93f31cc9b1a83be49f1224657b2

The patch ignores the fact that NEC32 scancodes are generated not only in the
NEC raw decoder but also directly in some drivers. Whichever approach is chosen
it should be consistent across drivers and this patch needs more discussion.

Furthermore, I'm convinced that we have to stop playing games trying to
decipher the meaning of NEC scancodes (what's the customer/vendor/address,
which byte is the MSB, etc).

This patch is in preparation for the next few patches in this series.

v2: make sure img-ir scancodes are bitrev8():ed as well

v3: update comments

Signed-off-by: David Härdeman da...@hardeman.nu
---
 drivers/media/rc/img-ir/img-ir-nec.c |   27 ++-
 drivers/media/rc/ir-nec-decoder.c|5 --
 drivers/media/rc/keymaps/rc-tivo.c   |   86 +-
 3 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/drivers/media/rc/img-ir/img-ir-nec.c 
b/drivers/media/rc/img-ir/img-ir-nec.c
index e7a731b..751d9d9 100644
--- a/drivers/media/rc/img-ir/img-ir-nec.c
+++ b/drivers/media/rc/img-ir/img-ir-nec.c
@@ -5,6 +5,7 @@
  */
 
 #include img-ir-hw.h
+#include linux/bitrev.h
 
 /* Convert NEC data to a scancode */
 static int img_ir_nec_scancode(int len, u64 raw, int *scancode, u64 protocols)
@@ -22,11 +23,11 @@ static int img_ir_nec_scancode(int len, u64 raw, int 
*scancode, u64 protocols)
data_inv = (raw  24)  0xff;
if ((data_inv ^ data) != 0xff) {
/* 32-bit NEC (used by Apple and TiVo remotes) */
-   /* scan encoding: aaAAddDD */
-   *scancode = addr_inv  24 |
-   addr  16 |
-   data_inv   8 |
-   data;
+   /* scan encoding: as transmitted, MSBit = first received bit */
+   *scancode = bitrev8(addr)  24 |
+   bitrev8(addr_inv)  16 |
+   bitrev8(data)   8 |
+   bitrev8(data_inv);
} else if ((addr_inv ^ addr) != 0xff) {
/* Extended NEC */
/* scan encoding: AAaaDD */
@@ -54,13 +55,15 @@ static int img_ir_nec_filter(const struct 
rc_scancode_filter *in,
 
if ((in-data | in-mask)  0xff00) {
/* 32-bit NEC (used by Apple and TiVo remotes) */
-   /* scan encoding: aaAAddDD */
-   addr_inv   = (in-data  24)  0xff;
-   addr_inv_m = (in-mask  24)  0xff;
-   addr   = (in-data  16)  0xff;
-   addr_m = (in-mask  16)  0xff;
-   data_inv   = (in-data   8)  0xff;
-   data_inv_m = (in-mask   8)  0xff;
+   /* scan encoding: as transmitted, MSBit = first received bit */
+   addr   = bitrev8(in-data  24);
+   addr_m = bitrev8(in-mask  24);
+   addr_inv   = bitrev8(in-data  16);
+   addr_inv_m = bitrev8(in-mask  16);
+   data   = bitrev8(in-data   8);
+   data_m = bitrev8(in-mask   8);
+   data_inv   = bitrev8(in-data   0);
+   data_inv_m = bitrev8(in-mask   0);
} else if ((in-data | in-mask)  0x00ff) {
/* Extended NEC */
/* scan encoding AAaaDD */
diff --git a/drivers/media/rc/ir-nec-decoder.c 
b/drivers/media/rc/ir-nec-decoder.c
index 9de1791..35c42e5 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -172,10 +172,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct 
ir_raw_event ev)
if (send_32bits) {
/* NEC transport, but modified protocol, used by at
 * least Apple and TiVo remotes */
-   scancode = not_address  24 |
-  address  16 |
-  not_command   8 |
-  command;
+   scancode = data-bits;
IR_dprintk(1, NEC (modified) scancode 0x%08x\n, 
scancode);
} else if ((address ^ not_address) != 0xff) {
/* Extended NEC */
diff --git a/drivers/media/rc/keymaps/rc-tivo.c 
b/drivers/media/rc/keymaps/rc-tivo.c
index 5cc1b45..454e062 100644
--- a/drivers/media/rc/keymaps/rc-tivo.c
+++ b/drivers/media/rc/keymaps/rc-tivo.c
@@ -15,62 +15,62 @@
  * Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle,
  * which also ships with a TiVo-branded IR transceiver, supported by the mceusb
  * driver. Note that the remote uses an NEC-ish protocol, but instead of having
- * a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the
+ * a command/not_command pair, it has a vendor ID of 0xa10c, but some keys, the
  * NEC extended checksums do pass, so the table presently has the intended
  * values and the checksum-passed versions for those keys.
  */
 static 

[PATCH 2/3] rc-core: split dev-s_filter

2014-04-04 Thread David Härdeman
Overloading dev-s_filter to do two different functions (set wakeup filters
and generic hardware filters) makes it impossible to tell what the
hardware actually supports, so create a separate dev-s_wakeup_filter and
make the distinction explicit.

v2: hopefully address James' comments on what should be moved from this to the
next patch.

Signed-off-by: David Härdeman da...@hardeman.nu
---
 drivers/media/rc/img-ir/img-ir-hw.c |   15 ++-
 drivers/media/rc/rc-main.c  |   24 +---
 include/media/rc-core.h |6 --
 3 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/drivers/media/rc/img-ir/img-ir-hw.c 
b/drivers/media/rc/img-ir/img-ir-hw.c
index 579a52b..0127dd2 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.c
+++ b/drivers/media/rc/img-ir/img-ir-hw.c
@@ -504,6 +504,18 @@ unlock:
return ret;
 }
 
+static int img_ir_set_normal_filter(struct rc_dev *dev,
+   struct rc_scancode_filter *sc_filter)
+{
+   return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter); 
+}
+
+static int img_ir_set_wakeup_filter(struct rc_dev *dev,
+   struct rc_scancode_filter *sc_filter)
+{
+   return img_ir_set_filter(dev, RC_FILTER_WAKEUP, sc_filter);
+}
+
 /**
  * img_ir_set_decoder() - Set the current decoder.
  * @priv:  IR private data.
@@ -986,7 +998,8 @@ int img_ir_probe_hw(struct img_ir_priv *priv)
rdev-map_name = RC_MAP_EMPTY;
rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv));
rdev-input_name = IMG Infrared Decoder;
-   rdev-s_filter = img_ir_set_filter;
+   rdev-s_filter = img_ir_set_normal_filter;
+   rdev-s_wakeup_filter = img_ir_set_wakeup_filter;
 
/* Register hardware decoder */
error = rc_register_device(rdev);
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 99697aa..ecbc20c 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -923,6 +923,7 @@ static ssize_t store_protocols(struct device *device,
int rc, i, count = 0;
ssize_t ret;
int (*change_protocol)(struct rc_dev *dev, u64 *rc_type);
+   int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
*filter);
struct rc_scancode_filter local_filter, *filter;
 
/* Device is being removed */
@@ -1007,24 +1008,27 @@ static ssize_t store_protocols(struct device *device,
 * Fall back to clearing the filter.
 */
filter = dev-scancode_filters[fattr-type];
+   set_filter = (fattr-type == RC_FILTER_NORMAL)
+   ? dev-s_filter : dev-s_wakeup_filter;
+
if (old_type != type  filter-mask) {
local_filter = *filter;
if (!type) {
/* no protocol = clear filter */
ret = -1;
-   } else if (!dev-s_filter) {
+   } else if (!set_filter) {
/* generic filtering = accept any filter */
ret = 0;
} else {
/* hardware filtering = try setting, otherwise clear */
-   ret = dev-s_filter(dev, fattr-type, local_filter);
+   ret = set_filter(dev, local_filter);
}
if (ret  0) {
/* clear the filter */
local_filter.data = 0;
local_filter.mask = 0;
-   if (dev-s_filter)
-   dev-s_filter(dev, fattr-type, local_filter);
+   if (set_filter)
+   set_filter(dev, local_filter);
}
 
/* commit the new filter */
@@ -1106,6 +1110,7 @@ static ssize_t store_filter(struct device *device,
struct rc_scancode_filter local_filter, *filter;
int ret;
unsigned long val;
+   int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
*filter);
 
/* Device is being removed */
if (!dev)
@@ -1115,8 +1120,11 @@ static ssize_t store_filter(struct device *device,
if (ret  0)
return ret;
 
+   set_filter = (fattr-type == RC_FILTER_NORMAL) ? dev-s_filter :
+dev-s_wakeup_filter;
+
/* Scancode filter not supported (but still accept 0) */
-   if (!dev-s_filter  fattr-type != RC_FILTER_NORMAL)
+   if (!set_filter  fattr-type == RC_FILTER_WAKEUP)
return val ? -EINVAL : count;
 
mutex_lock(dev-lock);
@@ -1128,13 +1136,15 @@ static ssize_t store_filter(struct device *device,
local_filter.mask = val;
else
local_filter.data = val;
+
if (!dev-enabled_protocols[fattr-type]  local_filter.mask) {
/* refuse to set a filter unless a protocol is enabled */
ret = -EINVAL;
goto 

[PATCH 3/3] rc-core: remove generic scancode filter

2014-04-04 Thread David Härdeman
The generic scancode filtering has questionable value and makes it
impossible to determine from userspace if there is an actual
scancode hw filter present or not.

So revert the generic parts.

Based on a patch from James Hogan james.ho...@imgtec.com, but this
version also makes sure that only the valid sysfs files are created
in the first place.

v2: correct dev-s_filter check

v3: move some parts over from the previous patch

Signed-off-by: David Härdeman da...@hardeman.nu
---
 drivers/media/rc/rc-main.c |   88 +++-
 include/media/rc-core.h|2 +
 2 files changed, 55 insertions(+), 35 deletions(-)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index ecbc20c..970b93d 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -633,19 +633,13 @@ EXPORT_SYMBOL_GPL(rc_repeat);
 static void ir_do_keydown(struct rc_dev *dev, int scancode,
  u32 keycode, u8 toggle)
 {
-   struct rc_scancode_filter *filter;
-   bool new_event = !dev-keypressed ||
-dev-last_scancode != scancode ||
-dev-last_toggle != toggle;
+   bool new_event = (!dev-keypressed   ||
+ dev-last_scancode != scancode ||
+ dev-last_toggle != toggle);
 
if (new_event  dev-keypressed)
ir_do_keyup(dev, false);
 
-   /* Generic scancode filtering */
-   filter = dev-scancode_filters[RC_FILTER_NORMAL];
-   if (filter-mask  ((scancode ^ filter-data)  filter-mask))
-   return;
-
input_event(dev-input_dev, EV_MSC, MSC_SCAN, scancode);
 
if (new_event  keycode != KEY_RESERVED) {
@@ -1011,14 +1005,11 @@ static ssize_t store_protocols(struct device *device,
set_filter = (fattr-type == RC_FILTER_NORMAL)
? dev-s_filter : dev-s_wakeup_filter;
 
-   if (old_type != type  filter-mask) {
+   if (set_filter  old_type != type  filter-mask) {
local_filter = *filter;
if (!type) {
/* no protocol = clear filter */
ret = -1;
-   } else if (!set_filter) {
-   /* generic filtering = accept any filter */
-   ret = 0;
} else {
/* hardware filtering = try setting, otherwise clear */
ret = set_filter(dev, local_filter);
@@ -1027,8 +1018,7 @@ static ssize_t store_protocols(struct device *device,
/* clear the filter */
local_filter.data = 0;
local_filter.mask = 0;
-   if (set_filter)
-   set_filter(dev, local_filter);
+   set_filter(dev, local_filter);
}
 
/* commit the new filter */
@@ -1072,7 +1062,10 @@ static ssize_t show_filter(struct device *device,
return -EINVAL;
 
mutex_lock(dev-lock);
-   if (fattr-mask)
+   if ((fattr-type == RC_FILTER_NORMAL  !dev-s_filter) ||
+   (fattr-type == RC_FILTER_WAKEUP  !dev-s_wakeup_filter))
+   val = 0;
+   else if (fattr-mask)
val = dev-scancode_filters[fattr-type].mask;
else
val = dev-scancode_filters[fattr-type].data;
@@ -1120,12 +1113,11 @@ static ssize_t store_filter(struct device *device,
if (ret  0)
return ret;
 
+   /* Can the scancode filter be set? */
set_filter = (fattr-type == RC_FILTER_NORMAL) ? dev-s_filter :
 dev-s_wakeup_filter;
-
-   /* Scancode filter not supported (but still accept 0) */
-   if (!set_filter  fattr-type == RC_FILTER_WAKEUP)
-   return val ? -EINVAL : count;
+   if (!set_filter)
+   return -EINVAL;
 
mutex_lock(dev-lock);
 
@@ -1143,11 +1135,9 @@ static ssize_t store_filter(struct device *device,
goto unlock;
}
 
-   if (set_filter) {
-   ret = set_filter(dev, local_filter);
-   if (ret  0)
-   goto unlock;
-   }
+   ret = set_filter(dev, local_filter);
+   if (ret  0)
+   goto unlock;
 
/* Success, commit the new filter */
*filter = local_filter;
@@ -1199,27 +1189,45 @@ static RC_FILTER_ATTR(wakeup_filter, S_IRUGO|S_IWUSR,
 static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR,
  show_filter, store_filter, RC_FILTER_WAKEUP, true);
 
-static struct attribute *rc_dev_attrs[] = {
+static struct attribute *rc_dev_protocol_attrs[] = {
dev_attr_protocols.attr.attr,
+   NULL,
+};
+
+static struct attribute_group rc_dev_protocol_attr_grp = {
+   .attrs  = rc_dev_protocol_attrs,
+};
+
+static struct attribute *rc_dev_wakeup_protocol_attrs[] = {

Re: [PATCH 1/3] rc-core: do not change 32bit NEC scancode format for now

2014-04-04 Thread James Hogan
On Saturday 05 April 2014 00:05:56 David Härdeman wrote:
 This reverts 18bc17448147e93f31cc9b1a83be49f1224657b2
 
 The patch ignores the fact that NEC32 scancodes are generated not only in
 the NEC raw decoder but also directly in some drivers. Whichever approach
 is chosen it should be consistent across drivers and this patch needs more
 discussion.
 
 Furthermore, I'm convinced that we have to stop playing games trying to
 decipher the meaning of NEC scancodes (what's the customer/vendor/address,
 which byte is the MSB, etc).
 
 This patch is in preparation for the next few patches in this series.
 
 v2: make sure img-ir scancodes are bitrev8():ed as well
 
 v3: update comments
 
 Signed-off-by: David Härdeman da...@hardeman.nu

Acked-by: James Hogan james.ho...@imgtec.com

Thanks
James

 ---
  drivers/media/rc/img-ir/img-ir-nec.c |   27 ++-
  drivers/media/rc/ir-nec-decoder.c|5 --
  drivers/media/rc/keymaps/rc-tivo.c   |   86
 +- 3 files changed, 59 insertions(+), 59
 deletions(-)
 
 diff --git a/drivers/media/rc/img-ir/img-ir-nec.c
 b/drivers/media/rc/img-ir/img-ir-nec.c index e7a731b..751d9d9 100644
 --- a/drivers/media/rc/img-ir/img-ir-nec.c
 +++ b/drivers/media/rc/img-ir/img-ir-nec.c
 @@ -5,6 +5,7 @@
   */
 
  #include img-ir-hw.h
 +#include linux/bitrev.h
 
  /* Convert NEC data to a scancode */
  static int img_ir_nec_scancode(int len, u64 raw, int *scancode, u64
 protocols) @@ -22,11 +23,11 @@ static int img_ir_nec_scancode(int len, u64
 raw, int *scancode, u64 protocols) data_inv = (raw  24)  0xff;
   if ((data_inv ^ data) != 0xff) {
   /* 32-bit NEC (used by Apple and TiVo remotes) */
 - /* scan encoding: aaAAddDD */
 - *scancode = addr_inv  24 |
 - addr  16 |
 - data_inv   8 |
 - data;
 + /* scan encoding: as transmitted, MSBit = first received bit */
 + *scancode = bitrev8(addr)  24 |
 + bitrev8(addr_inv)  16 |
 + bitrev8(data)   8 |
 + bitrev8(data_inv);
   } else if ((addr_inv ^ addr) != 0xff) {
   /* Extended NEC */
   /* scan encoding: AAaaDD */
 @@ -54,13 +55,15 @@ static int img_ir_nec_filter(const struct
 rc_scancode_filter *in,
 
   if ((in-data | in-mask)  0xff00) {
   /* 32-bit NEC (used by Apple and TiVo remotes) */
 - /* scan encoding: aaAAddDD */
 - addr_inv   = (in-data  24)  0xff;
 - addr_inv_m = (in-mask  24)  0xff;
 - addr   = (in-data  16)  0xff;
 - addr_m = (in-mask  16)  0xff;
 - data_inv   = (in-data   8)  0xff;
 - data_inv_m = (in-mask   8)  0xff;
 + /* scan encoding: as transmitted, MSBit = first received bit */
 + addr   = bitrev8(in-data  24);
 + addr_m = bitrev8(in-mask  24);
 + addr_inv   = bitrev8(in-data  16);
 + addr_inv_m = bitrev8(in-mask  16);
 + data   = bitrev8(in-data   8);
 + data_m = bitrev8(in-mask   8);
 + data_inv   = bitrev8(in-data   0);
 + data_inv_m = bitrev8(in-mask   0);
   } else if ((in-data | in-mask)  0x00ff) {
   /* Extended NEC */
   /* scan encoding AAaaDD */
 diff --git a/drivers/media/rc/ir-nec-decoder.c
 b/drivers/media/rc/ir-nec-decoder.c index 9de1791..35c42e5 100644
 --- a/drivers/media/rc/ir-nec-decoder.c
 +++ b/drivers/media/rc/ir-nec-decoder.c
 @@ -172,10 +172,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct
 ir_raw_event ev) if (send_32bits) {
   /* NEC transport, but modified protocol, used by at
* least Apple and TiVo remotes */
 - scancode = not_address  24 |
 -address  16 |
 -not_command   8 |
 -command;
 + scancode = data-bits;
   IR_dprintk(1, NEC (modified) scancode 0x%08x\n, 
 scancode);
   } else if ((address ^ not_address) != 0xff) {
   /* Extended NEC */
 diff --git a/drivers/media/rc/keymaps/rc-tivo.c
 b/drivers/media/rc/keymaps/rc-tivo.c index 5cc1b45..454e062 100644
 --- a/drivers/media/rc/keymaps/rc-tivo.c
 +++ b/drivers/media/rc/keymaps/rc-tivo.c
 @@ -15,62 +15,62 @@
   * Initial mapping is for the TiVo remote included in the Nero LiquidTV
 bundle, * which also ships with a TiVo-branded IR transceiver, supported by
 the mceusb * driver. Note that the remote uses an NEC-ish protocol, but
 instead of having - * a command/not_command pair, it has a vendor ID of
 0x3085, but some keys, the + * a command/not_command pair, it has a vendor
 ID of 0xa10c, but some keys, the * NEC extended checksums do pass, so the
 table 

Re: [PATCH 2/3] rc-core: split dev-s_filter

2014-04-04 Thread James Hogan
On Saturday 05 April 2014 00:06:01 David Härdeman wrote:
 Overloading dev-s_filter to do two different functions (set wakeup filters
 and generic hardware filters) makes it impossible to tell what the
 hardware actually supports, so create a separate dev-s_wakeup_filter and
 make the distinction explicit.
 
 v2: hopefully address James' comments on what should be moved from this to
 the next patch.
 
 Signed-off-by: David Härdeman da...@hardeman.nu

Acked-by: James Hogan james.ho...@imgtec.com

Thanks
James

 ---
  drivers/media/rc/img-ir/img-ir-hw.c |   15 ++-
  drivers/media/rc/rc-main.c  |   24 +---
  include/media/rc-core.h |6 --
  3 files changed, 35 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/media/rc/img-ir/img-ir-hw.c
 b/drivers/media/rc/img-ir/img-ir-hw.c index 579a52b..0127dd2 100644
 --- a/drivers/media/rc/img-ir/img-ir-hw.c
 +++ b/drivers/media/rc/img-ir/img-ir-hw.c
 @@ -504,6 +504,18 @@ unlock:
   return ret;
  }
 
 +static int img_ir_set_normal_filter(struct rc_dev *dev,
 + struct rc_scancode_filter *sc_filter)
 +{
 + return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter);
 +}
 +
 +static int img_ir_set_wakeup_filter(struct rc_dev *dev,
 + struct rc_scancode_filter *sc_filter)
 +{
 + return img_ir_set_filter(dev, RC_FILTER_WAKEUP, sc_filter);
 +}
 +
  /**
   * img_ir_set_decoder() - Set the current decoder.
   * @priv:IR private data.
 @@ -986,7 +998,8 @@ int img_ir_probe_hw(struct img_ir_priv *priv)
   rdev-map_name = RC_MAP_EMPTY;
   rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv));
   rdev-input_name = IMG Infrared Decoder;
 - rdev-s_filter = img_ir_set_filter;
 + rdev-s_filter = img_ir_set_normal_filter;
 + rdev-s_wakeup_filter = img_ir_set_wakeup_filter;
 
   /* Register hardware decoder */
   error = rc_register_device(rdev);
 diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
 index 99697aa..ecbc20c 100644
 --- a/drivers/media/rc/rc-main.c
 +++ b/drivers/media/rc/rc-main.c
 @@ -923,6 +923,7 @@ static ssize_t store_protocols(struct device *device,
   int rc, i, count = 0;
   ssize_t ret;
   int (*change_protocol)(struct rc_dev *dev, u64 *rc_type);
 + int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
 *filter);
   struct rc_scancode_filter local_filter, *filter;
 
   /* Device is being removed */
 @@ -1007,24 +1008,27 @@ static ssize_t store_protocols(struct device
 *device, * Fall back to clearing the filter.
*/
   filter = dev-scancode_filters[fattr-type];
 + set_filter = (fattr-type == RC_FILTER_NORMAL)
 + ? dev-s_filter : dev-s_wakeup_filter;
 +
   if (old_type != type  filter-mask) {
   local_filter = *filter;
   if (!type) {
   /* no protocol = clear filter */
   ret = -1;
 - } else if (!dev-s_filter) {
 + } else if (!set_filter) {
   /* generic filtering = accept any filter */
   ret = 0;
   } else {
   /* hardware filtering = try setting, otherwise clear */
 - ret = dev-s_filter(dev, fattr-type, local_filter);
 + ret = set_filter(dev, local_filter);
   }
   if (ret  0) {
   /* clear the filter */
   local_filter.data = 0;
   local_filter.mask = 0;
 - if (dev-s_filter)
 - dev-s_filter(dev, fattr-type, local_filter);
 + if (set_filter)
 + set_filter(dev, local_filter);
   }
 
   /* commit the new filter */
 @@ -1106,6 +1110,7 @@ static ssize_t store_filter(struct device *device,
   struct rc_scancode_filter local_filter, *filter;
   int ret;
   unsigned long val;
 + int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter 
 *filter);
 
   /* Device is being removed */
   if (!dev)
 @@ -1115,8 +1120,11 @@ static ssize_t store_filter(struct device *device,
   if (ret  0)
   return ret;
 
 + set_filter = (fattr-type == RC_FILTER_NORMAL) ? dev-s_filter :
 +  dev-s_wakeup_filter;
 +
   /* Scancode filter not supported (but still accept 0) */
 - if (!dev-s_filter  fattr-type != RC_FILTER_NORMAL)
 + if (!set_filter  fattr-type == RC_FILTER_WAKEUP)
   return val ? -EINVAL : count;
 
   mutex_lock(dev-lock);
 @@ -1128,13 +1136,15 @@ static ssize_t store_filter(struct device *device,
   local_filter.mask = val;
   else
   local_filter.data = val;
 +
   if (!dev-enabled_protocols[fattr-type]  local_filter.mask) {
   /* refuse to set a filter 

Re: [PATCH 3/3] rc-core: remove generic scancode filter

2014-04-04 Thread James Hogan
On Saturday 05 April 2014 00:06:06 David Härdeman wrote:
 The generic scancode filtering has questionable value and makes it
 impossible to determine from userspace if there is an actual
 scancode hw filter present or not.
 
 So revert the generic parts.
 
 Based on a patch from James Hogan james.ho...@imgtec.com, but this
 version also makes sure that only the valid sysfs files are created
 in the first place.
 
 v2: correct dev-s_filter check
 
 v3: move some parts over from the previous patch
 
 Signed-off-by: David Härdeman da...@hardeman.nu

Acked-by: James Hogan james.ho...@imgtec.com

Thanks
James

 ---
  drivers/media/rc/rc-main.c |   88
 +++- include/media/rc-core.h|  
  2 +
  2 files changed, 55 insertions(+), 35 deletions(-)
 
 diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
 index ecbc20c..970b93d 100644
 --- a/drivers/media/rc/rc-main.c
 +++ b/drivers/media/rc/rc-main.c
 @@ -633,19 +633,13 @@ EXPORT_SYMBOL_GPL(rc_repeat);
  static void ir_do_keydown(struct rc_dev *dev, int scancode,
 u32 keycode, u8 toggle)
  {
 - struct rc_scancode_filter *filter;
 - bool new_event = !dev-keypressed ||
 -  dev-last_scancode != scancode ||
 -  dev-last_toggle != toggle;
 + bool new_event = (!dev-keypressed   ||
 +   dev-last_scancode != scancode ||
 +   dev-last_toggle != toggle);
 
   if (new_event  dev-keypressed)
   ir_do_keyup(dev, false);
 
 - /* Generic scancode filtering */
 - filter = dev-scancode_filters[RC_FILTER_NORMAL];
 - if (filter-mask  ((scancode ^ filter-data)  filter-mask))
 - return;
 -
   input_event(dev-input_dev, EV_MSC, MSC_SCAN, scancode);
 
   if (new_event  keycode != KEY_RESERVED) {
 @@ -1011,14 +1005,11 @@ static ssize_t store_protocols(struct device
 *device, set_filter = (fattr-type == RC_FILTER_NORMAL)
   ? dev-s_filter : dev-s_wakeup_filter;
 
 - if (old_type != type  filter-mask) {
 + if (set_filter  old_type != type  filter-mask) {
   local_filter = *filter;
   if (!type) {
   /* no protocol = clear filter */
   ret = -1;
 - } else if (!set_filter) {
 - /* generic filtering = accept any filter */
 - ret = 0;
   } else {
   /* hardware filtering = try setting, otherwise clear */
   ret = set_filter(dev, local_filter);
 @@ -1027,8 +1018,7 @@ static ssize_t store_protocols(struct device *device,
   /* clear the filter */
   local_filter.data = 0;
   local_filter.mask = 0;
 - if (set_filter)
 - set_filter(dev, local_filter);
 + set_filter(dev, local_filter);
   }
 
   /* commit the new filter */
 @@ -1072,7 +1062,10 @@ static ssize_t show_filter(struct device *device,
   return -EINVAL;
 
   mutex_lock(dev-lock);
 - if (fattr-mask)
 + if ((fattr-type == RC_FILTER_NORMAL  !dev-s_filter) ||
 + (fattr-type == RC_FILTER_WAKEUP  !dev-s_wakeup_filter))
 + val = 0;
 + else if (fattr-mask)
   val = dev-scancode_filters[fattr-type].mask;
   else
   val = dev-scancode_filters[fattr-type].data;
 @@ -1120,12 +1113,11 @@ static ssize_t store_filter(struct device *device,
   if (ret  0)
   return ret;
 
 + /* Can the scancode filter be set? */
   set_filter = (fattr-type == RC_FILTER_NORMAL) ? dev-s_filter :
dev-s_wakeup_filter;
 -
 - /* Scancode filter not supported (but still accept 0) */
 - if (!set_filter  fattr-type == RC_FILTER_WAKEUP)
 - return val ? -EINVAL : count;
 + if (!set_filter)
 + return -EINVAL;
 
   mutex_lock(dev-lock);
 
 @@ -1143,11 +1135,9 @@ static ssize_t store_filter(struct device *device,
   goto unlock;
   }
 
 - if (set_filter) {
 - ret = set_filter(dev, local_filter);
 - if (ret  0)
 - goto unlock;
 - }
 + ret = set_filter(dev, local_filter);
 + if (ret  0)
 + goto unlock;
 
   /* Success, commit the new filter */
   *filter = local_filter;
 @@ -1199,27 +1189,45 @@ static RC_FILTER_ATTR(wakeup_filter,
 S_IRUGO|S_IWUSR, static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR,
 show_filter, store_filter, RC_FILTER_WAKEUP, true);
 
 -static struct attribute *rc_dev_attrs[] = {
 +static struct attribute *rc_dev_protocol_attrs[] = {
   dev_attr_protocols.attr.attr,
 + NULL,
 +};
 +
 +static struct attribute_group rc_dev_protocol_attr_grp = {
 + .attrs  = rc_dev_protocol_attrs,
 

cron job: media_tree daily build: OK

2014-04-04 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:   Sat Apr  5 04:00:42 CEST 2014
git branch: test
git hash:   a83b93a7480441a47856dc9104bea970e84cda87
gcc version:i686-linux-gcc (GCC) 4.8.2
sparse version: v0.5.0-11-g38d1124
host hardware:  x86_64
host os:3.13-7.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12-i686: OK
linux-3.13-i686: OK
linux-3.14-i686: OK
linux-2.6.31.14-x86_64: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12-x86_64: OK
linux-3.13-x86_64: OK
linux-3.14-x86_64: OK
apps: OK
spec-git: OK
sparse version: v0.5.0-11-g38d1124
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.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] Full DVB driver package for Earthsoft PT3 (ISDB-S/T) cards

2014-04-04 Thread Akihiro TSUKADA
Hi Bud,

It seems that the tuner modules use fe-ops.write()
for i2c communications, which is set by parent module.
but I'm afraid fe-ops.write() is not for the purpose.
Shouldn't they use i2c_adapters passed from _attach() etc. instead?

regards,
akihiro

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