Re: [omapdss] fault in dispc_write_irqenable [was: Re: [omap3isp] xclk deadlock]

2013-07-29 Thread Tomi Valkeinen
On 26/07/13 18:37, Jakub Piotr Cłapa wrote:

 Using omapfb, or...? I hope not
 omap_vout, because that's rather unmaintained =).
 
 Laurent's live application is using the V4L2 API for video output (to
 get free YUV conversion and DMA) so I guess this unfortunatelly counts
 as using omap_vout. Are there any alternatives I should look into? IIUC

Ok. Do you have a call trace for the dispc_write_irqenable crash? Maybe
it's something simple to fix.

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: [PATCH 1/2] tea575x: Move header from sound to media

2013-07-29 Thread Hans Verkuil
Hi Ondrej!

On 07/28/2013 10:01 PM, Ondrej Zary wrote:
 Move include/sound/tea575x-tuner.h to include/media/tea575x.h and update 
 files that include it.
 
 Signed-off-by: Ondrej Zary li...@rainbow-software.org

Acked-by: Hans Verkuil hans.verk...@cisco.com

If this can be acked by an alsa maintainer, then I can merge it into the media 
tree.

Regards,

Hans

 ---
  drivers/media/radio/radio-maxiradio.c |2 +-
  drivers/media/radio/radio-sf16fmr2.c  |2 +-
  drivers/media/radio/radio-shark.c |2 +-
  include/media/tea575x.h   |   79 
 +
  include/sound/tea575x-tuner.h |   79 
 -
  sound/i2c/other/tea575x-tuner.c   |2 +-
  sound/pci/es1968.c|2 +-
  sound/pci/fm801.c |2 +-
  8 files changed, 85 insertions(+), 85 deletions(-)
  create mode 100644 include/media/tea575x.h
  delete mode 100644 include/sound/tea575x-tuner.h
 
 diff --git a/drivers/media/radio/radio-maxiradio.c 
 b/drivers/media/radio/radio-maxiradio.c
 index 1d1c9e1..5236035 100644
 --- a/drivers/media/radio/radio-maxiradio.c
 +++ b/drivers/media/radio/radio-maxiradio.c
 @@ -42,7 +42,7 @@
  #include linux/videodev2.h
  #include linux/io.h
  #include linux/slab.h
 -#include sound/tea575x-tuner.h
 +#include media/tea575x.h
  #include media/v4l2-device.h
  #include media/v4l2-ioctl.h
  #include media/v4l2-fh.h
 diff --git a/drivers/media/radio/radio-sf16fmr2.c 
 b/drivers/media/radio/radio-sf16fmr2.c
 index 9c09904..f1e3714 100644
 --- a/drivers/media/radio/radio-sf16fmr2.c
 +++ b/drivers/media/radio/radio-sf16fmr2.c
 @@ -14,7 +14,7 @@
  #include linux/io.h/* outb, outb_p */
  #include linux/isa.h
  #include linux/pnp.h
 -#include sound/tea575x-tuner.h
 +#include media/tea575x.h
  
  MODULE_AUTHOR(Ondrej Zary);
  MODULE_DESCRIPTION(MediaForte SF16-FMR2 and SF16-FMD2 FM radio card 
 driver);
 diff --git a/drivers/media/radio/radio-shark.c 
 b/drivers/media/radio/radio-shark.c
 index 8fa18ab..b914772 100644
 --- a/drivers/media/radio/radio-shark.c
 +++ b/drivers/media/radio/radio-shark.c
 @@ -33,7 +33,7 @@
  #include linux/usb.h
  #include linux/workqueue.h
  #include media/v4l2-device.h
 -#include sound/tea575x-tuner.h
 +#include media/tea575x.h
  
  #if defined(CONFIG_LEDS_CLASS) || \
  (defined(CONFIG_LEDS_CLASS_MODULE)  defined(CONFIG_RADIO_SHARK_MODULE))
 diff --git a/include/media/tea575x.h b/include/media/tea575x.h
 new file mode 100644
 index 000..2d4fa59
 --- /dev/null
 +++ b/include/media/tea575x.h
 @@ -0,0 +1,79 @@
 +#ifndef __SOUND_TEA575X_TUNER_H
 +#define __SOUND_TEA575X_TUNER_H
 +
 +/*
 + *   ALSA driver for TEA5757/5759 Philips AM/FM tuner chips
 + *
 + *   Copyright (c) 2004 Jaroslav Kysela pe...@perex.cz
 + *
 + *   This program is free software; you can redistribute it and/or modify
 + *   it under the terms of the GNU General Public License as published by
 + *   the Free Software Foundation; either version 2 of the License, or
 + *   (at your option) any later version.
 + *
 + *   This program is distributed in the hope that it will be useful,
 + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + *   GNU General Public License for more details.
 + *
 + *   You should have received a copy of the GNU General Public License
 + *   along with this program; if not, write to the Free Software
 + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 + *
 + */
 +
 +#include linux/videodev2.h
 +#include media/v4l2-ctrls.h
 +#include media/v4l2-dev.h
 +#include media/v4l2-device.h
 +
 +#define TEA575X_FMIF 10700
 +#define TEA575X_AMIF   450
 +
 +#define TEA575X_DATA (1  0)
 +#define TEA575X_CLK  (1  1)
 +#define TEA575X_WREN (1  2)
 +#define TEA575X_MOST (1  3)
 +
 +struct snd_tea575x;
 +
 +struct snd_tea575x_ops {
 + /* Drivers using snd_tea575x must either define read_ and write_val */
 + void (*write_val)(struct snd_tea575x *tea, u32 val);
 + u32 (*read_val)(struct snd_tea575x *tea);
 + /* Or define the 3 pin functions */
 + void (*set_pins)(struct snd_tea575x *tea, u8 pins);
 + u8 (*get_pins)(struct snd_tea575x *tea);
 + void (*set_direction)(struct snd_tea575x *tea, bool output);
 +};
 +
 +struct snd_tea575x {
 + struct v4l2_device *v4l2_dev;
 + struct v4l2_file_operations fops;
 + struct video_device vd; /* video device */
 + int radio_nr;   /* radio_nr */
 + bool tea5759;   /* 5759 chip is present */
 + bool has_am;/* Device can tune to AM freqs */
 + bool cannot_read_data;  /* Device cannot read the data pin */
 + bool cannot_mute;   /* Device cannot mute */
 + bool mute;  /* Device is muted? */
 + bool stereo;/* receiving stereo */
 + 

Re: [PATCH 2/2] tea575x: Move from sound to media

2013-07-29 Thread Hans Verkuil
Hi Ondrej!

On 07/28/2013 10:01 PM, Ondrej Zary wrote:
 Move tea575x from sound/i2c/other to drivers/media/radio
 Includes Kconfig changes by Hans Verkuil.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Signed-off-by: Ondrej Zary li...@rainbow-software.org

Acked-by: Hans Verkuil hans.verk...@cisco.com

If this can be acked by an alsa maintainer, then I can merge it into the media 
tree.

I really like these changes: the Kconfig part is simplified and it makes much 
more
sense to have this driver in drivers/media.

Regards,

Hans

 ---
  drivers/media/radio/Kconfig |   12 +-
  drivers/media/radio/Makefile|1 +
  drivers/media/radio/tea575x.c   |  584 
 +++
  sound/i2c/other/Makefile|2 -
  sound/i2c/other/tea575x-tuner.c |  584 
 ---
  sound/pci/Kconfig   |9 +-
  6 files changed, 598 insertions(+), 594 deletions(-)
  create mode 100644 drivers/media/radio/tea575x.c
  delete mode 100644 sound/i2c/other/tea575x-tuner.c
 
 diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
 index d529ba7..39882dd 100644
 --- a/drivers/media/radio/Kconfig
 +++ b/drivers/media/radio/Kconfig
 @@ -12,6 +12,9 @@ menuconfig RADIO_ADAPTERS
  
  if RADIO_ADAPTERS  VIDEO_V4L2
  
 +config RADIO_TEA575X
 + tristate
 +
  config RADIO_SI470X
   bool Silicon Labs Si470x FM Radio Receiver support
   depends on VIDEO_V4L2
 @@ -61,7 +64,8 @@ config USB_DSBR
  
  config RADIO_MAXIRADIO
   tristate Guillemot MAXI Radio FM 2000 radio
 - depends on VIDEO_V4L2  PCI  SND
 + depends on VIDEO_V4L2  PCI
 + select RADIO_TEA575X
   ---help---
 Choose Y here if you have this radio card.  This card may also be
 found as Gemtek PCI FM.
 @@ -76,7 +80,8 @@ config RADIO_MAXIRADIO
  
  config RADIO_SHARK
   tristate Griffin radioSHARK USB radio receiver
 - depends on USB  SND
 + depends on USB
 + select RADIO_TEA575X
   ---help---
 Choose Y here if you have this radio receiver.
  
 @@ -393,7 +398,8 @@ config RADIO_SF16FMI
  
  config RADIO_SF16FMR2
   tristate SF16-FMR2/SF16-FMD2 Radio
 - depends on ISA  VIDEO_V4L2  SND
 + depends on ISA  VIDEO_V4L2
 + select RADIO_TEA575X
   ---help---
 Choose Y here if you have one of these FM radio cards.
  
 diff --git a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile
 index 0dcdb32..3b64560 100644
 --- a/drivers/media/radio/Makefile
 +++ b/drivers/media/radio/Makefile
 @@ -32,6 +32,7 @@ obj-$(CONFIG_RADIO_TEF6862) += tef6862.o
  obj-$(CONFIG_RADIO_TIMBERDALE) += radio-timb.o
  obj-$(CONFIG_RADIO_WL1273) += radio-wl1273.o
  obj-$(CONFIG_RADIO_WL128X) += wl128x/
 +obj-$(CONFIG_RADIO_TEA575X) += tea575x.o
  
  shark2-objs := radio-shark2.o radio-tea5777.o
  
 diff --git a/drivers/media/radio/tea575x.c b/drivers/media/radio/tea575x.c
 new file mode 100644
 index 000..cef0698
 --- /dev/null
 +++ b/drivers/media/radio/tea575x.c
 @@ -0,0 +1,584 @@
 +/*
 + *   ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips
 + *
 + *   Copyright (c) 2004 Jaroslav Kysela pe...@perex.cz
 + *
 + *
 + *   This program is free software; you can redistribute it and/or modify
 + *   it under the terms of the GNU General Public License as published by
 + *   the Free Software Foundation; either version 2 of the License, or
 + *   (at your option) any later version.
 + *
 + *   This program is distributed in the hope that it will be useful,
 + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + *   GNU General Public License for more details.
 + *
 + *   You should have received a copy of the GNU General Public License
 + *   along with this program; if not, write to the Free Software
 + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 + *
 + */
 +
 +#include asm/io.h
 +#include linux/delay.h
 +#include linux/module.h
 +#include linux/init.h
 +#include linux/slab.h
 +#include linux/sched.h
 +#include media/v4l2-device.h
 +#include media/v4l2-dev.h
 +#include media/v4l2-fh.h
 +#include media/v4l2-ioctl.h
 +#include media/v4l2-event.h
 +#include media/tea575x.h
 +
 +MODULE_AUTHOR(Jaroslav Kysela pe...@perex.cz);
 +MODULE_DESCRIPTION(Routines for control of TEA5757/5759 Philips AM/FM radio 
 tuner chips);
 +MODULE_LICENSE(GPL);
 +
 +/*
 + * definitions
 + */
 +
 +#define TEA575X_BIT_SEARCH   (124) /* 1 = search action, 0 = tuned 
 */
 +#define TEA575X_BIT_UPDOWN   (123) /* 0 = search down, 1 = search 
 up */
 +#define TEA575X_BIT_MONO (122) /* 0 = stereo, 1 = mono */
 +#define TEA575X_BIT_BAND_MASK(320)
 +#define TEA575X_BIT_BAND_FM  (020)
 +#define TEA575X_BIT_BAND_MW  (120)
 +#define TEA575X_BIT_BAND_LW  (220)
 +#define TEA575X_BIT_BAND_SW  (320)
 +#define TEA575X_BIT_PORT_0   (119) /* user bit */
 +#define 

Re: [PATCH v3] ov10635: Add OmniVision ov10635 SoC camera driver

2013-07-29 Thread phil . edworthy
Hi Guennadi,

  Ok, now I see. My comment about the sensor output size changing is 
wrong. 
  The sensor doesn't do any scaling, so we are cropping it.
 
 Ah, ok, then you shouldn't change video sizes in your .s_fmt(), just 
 return the current cropping rectangle.

I'm reworking the code but realised that the sensor _does_ do both scaling 
and cropping. Though scaling is only possible by dropping every other scan 
line when required height is = 400 pixels. So does that mean .s_fmt() 
should select the appropriate mode?

Thanks
Phil
--
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] ov10635: Add OmniVision ov10635 SoC camera driver

2013-07-29 Thread Guennadi Liakhovetski
Hi Phil,

On Mon, 29 Jul 2013, phil.edwor...@renesas.com wrote:

 Hi Guennadi,
 
   Ok, now I see. My comment about the sensor output size changing is 
 wrong. 
   The sensor doesn't do any scaling, so we are cropping it.
  
  Ah, ok, then you shouldn't change video sizes in your .s_fmt(), just 
  return the current cropping rectangle.
 
 I'm reworking the code but realised that the sensor _does_ do both scaling 
 and cropping. Though scaling is only possible by dropping every other scan 
 line when required height is = 400 pixels.

Right, the so called skipping.

 So does that mean .s_fmt() should select the appropriate mode?

You can use skipping to implement scaling, yes. But you don't have to. 
Drivers don't have to support all hardware capabilities, but what they do 
support they better do correctly :) So, it's up to you actually whether to 
add it now or later. Maybe it would be easier to get a basic version in 
the kernel now with no scaling support and add it later as an incremental 
patch.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] exynos-gsc: Register v4l2 device

2013-07-29 Thread Sylwester Nawrocki
Hi Arun,

On 07/26/2013 01:28 PM, Arun Kumar K wrote:
 Gscaler video device registration was happening without
 reference to a parent v4l2_dev causing probe to fail.
 The patch creates a parent v4l2 device and uses it for
 gsc m2m video device registration.


I've queued this patch for v3.11-rc as a regression fix, adding
the following to the changelog:

This fixes regression introduced with comit commit 1c1d86a1ea07506
[media] v4l2: always require v4l2_dev, rename parent to dev_parent

But please note that this patch will likely need to be reverted once
capture support is added the GScaler. Then a top level media device
would register struct v4l2_device, instead of the video M2M device
device driver.


Thanks,
Sylwester

 Signed-off-by: Arun Kumar K arun...@samsung.com

 ---
  drivers/media/platform/exynos-gsc/gsc-core.c |9 -
  drivers/media/platform/exynos-gsc/gsc-core.h |1 +
  drivers/media/platform/exynos-gsc/gsc-m2m.c  |1 +
  3 files changed, 10 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
 b/drivers/media/platform/exynos-gsc/gsc-core.c
 index 559fab2..1ec60264 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
 @@ -1122,10 +1122,14 @@ static int gsc_probe(struct platform_device *pdev)
   goto err_clk;
   }
  
 - ret = gsc_register_m2m_device(gsc);
 + ret = v4l2_device_register(dev, gsc-v4l2_dev);
   if (ret)
   goto err_clk;
  
 + ret = gsc_register_m2m_device(gsc);
 + if (ret)
 + goto err_v4l2;
 +
   platform_set_drvdata(pdev, gsc);
   pm_runtime_enable(dev);
   ret = pm_runtime_get_sync(pdev-dev);
 @@ -1147,6 +1151,8 @@ err_pm:
   pm_runtime_put(dev);
  err_m2m:
   gsc_unregister_m2m_device(gsc);
 +err_v4l2:
 + v4l2_device_unregister(gsc-v4l2_dev);
  err_clk:
   gsc_clk_put(gsc);
   return ret;
 @@ -1157,6 +1163,7 @@ static int gsc_remove(struct platform_device *pdev)
   struct gsc_dev *gsc = platform_get_drvdata(pdev);
  
   gsc_unregister_m2m_device(gsc);
 + v4l2_device_unregister(gsc-v4l2_dev);
  
   vb2_dma_contig_cleanup_ctx(gsc-alloc_ctx);
   pm_runtime_disable(pdev-dev);
 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h 
 b/drivers/media/platform/exynos-gsc/gsc-core.h
 index cc19bba..76435d3 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.h
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.h
 @@ -343,6 +343,7 @@ struct gsc_dev {
   unsigned long   state;
   struct vb2_alloc_ctx*alloc_ctx;
   struct video_device vdev;
 + struct v4l2_device  v4l2_dev;
  };
  
  /**
 diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c 
 b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 index 40a73f7..e576ff2 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 @@ -751,6 +751,7 @@ int gsc_register_m2m_device(struct gsc_dev *gsc)
   gsc-vdev.release   = video_device_release_empty;
   gsc-vdev.lock  = gsc-lock;
   gsc-vdev.vfl_dir   = VFL_DIR_M2M;
 + gsc-vdev.v4l2_dev  = gsc-v4l2_dev;
   snprintf(gsc-vdev.name, sizeof(gsc-vdev.name), %s.%d:m2m,
   GSC_MODULE_NAME, gsc-id);

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


Re: [REVIEW PATCH 4/6] exynos4-is: Add clock provider for the external clocks

2013-07-29 Thread Sylwester Nawrocki
Hi Arun,

On 07/29/2013 07:52 AM, Arun Kumar K wrote:
 Hi Sylwester,
 
 On Wed, Jul 24, 2013 at 12:09 AM, Sylwester Nawrocki
 s.nawro...@samsung.com wrote:
 This patch adds clock provider to expose the sclk_cam0/1 clocks
 for image sensor subdevs.

 Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  .../devicetree/bindings/media/samsung-fimc.txt |   17 +++-
  drivers/media/platform/exynos4-is/media-dev.c  |   92 
 
  drivers/media/platform/exynos4-is/media-dev.h  |   19 +++-
  3 files changed, 125 insertions(+), 3 deletions(-)

 diff --git a/Documentation/devicetree/bindings/media/samsung-fimc.txt 
 b/Documentation/devicetree/bindings/media/samsung-fimc.txt
 index 96312f6..04a2b87 100644
 --- a/Documentation/devicetree/bindings/media/samsung-fimc.txt
 +++ b/Documentation/devicetree/bindings/media/samsung-fimc.txt
 @@ -91,6 +91,15 @@ Optional properties
  - samsung,camclk-out : specifies clock output for remote sensor,
0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT;

 +'clock-controller' node (optional)
 +--
 +
 +The purpose of this node is to define a clock provider for external image
 +sensors and link any of the CAM_?_CLKOUT clock outputs with related external
 +clock consumer device. Properties specific to this node are described in
 +../clock/clock-bindings.txt.
 +
 +
  Image sensor nodes
  --

 @@ -114,7 +123,7 @@ Example:
 vddio-supply = ...;

 clock-frequency = 2400;
 -   clocks = ...;
 +   clocks = camclk 1;
 clock-names = mclk;

 port {
 @@ -135,7 +144,7 @@ Example:
 vddio-supply = ...;

 clock-frequency = 2400;
 -   clocks = ...;
 +   clocks = camclk 0;
 clock-names = mclk;

 port {
 @@ -156,6 +165,10 @@ Example:
 pinctrl-names = default;
 pinctrl-0 = cam_port_a_clk_active;

 +   camclk: clock-controller {
 +  #clock-cells = 1;
 
 Isn't it
   #clock-cells = 1;
 ?

Yes, indeed. Thanks for spotting this!

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


[Regression 3.5-3.6, bisected] gspca_ov534: kernel oops when connecting Hercules Blog Webcam

2013-07-29 Thread Yaroslav Zakharuk

Hi!

After update from 3.5 kernel to newer version I got kernel oops when I 
connect my Hercules Blog Webcam. The full error stacktrace is at the end 
of this e-mail.


Commit bisect revealed the regression at:
-
1bd7d6adc691993206cf7dd69f1aaf8dccb06677 is the first bad commit
commit 1bd7d6adc691993206cf7dd69f1aaf8dccb06677
Author: Antonio Ospite ospite@
Date: Wed May 16 18:42:46 2012 -0300

[media] gspca_ov534: Convert to the control framework

Signed-off-by: Antonio Ospite ospite@
Signed-off-by: Hans de Goede hdegoede@
Signed-off-by: Mauro Carvalho Chehab mchehab@

:04 04 81bb6d86a59d2fca15fea4d43a8abe34354cf69e 
6b7c2077ae5d8bdea32864841b5cd14149c6a44a M drivers

-

I also try to change the gspca_ov534 module source (ov534.c) from the 
3.8 kernel and added some additional null checks in sd_start function 
and add the extensive logging to it. With those changes my webcam is 
working OK. As far as I can see, sd_start function is called couple of 
times, but when it is called the first time (when a usb cable was 
inserted), sd struct is almost empty and without null check this leads 
to kernel oops. Here is the part of test version log when sd_start was 
called first time:


sd_start: NO sd-hue!
sd_start: NO sd-saturation!
sd_start: NO sd-autogain!
sd_start: NO sd-autowhitebalance!
sd_start: NO sd-autoexposure!
sd_start: NO sd-gain!
sd_start: NO sd-exposure!
sd_start: NO sd-brightness!
sd_start: NO sd-contrast!
sd_start: NO sd-sharpness!
sd_start: NO sd-hflip and sd-vflip!
sd_start: NO sd-plfreq!

Additional info can be found here: 
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1173723/



Here is the error stacktrace:
kernel: [   52.679705] usb 3-2: new high-speed USB device number 2 using 
xhci_hcd
kernel: [   52.697906] usb 3-2: New USB device found, idVendor=06f8, 
idProduct=3002
kernel: [   52.697910] usb 3-2: New USB device strings: Mfr=1, 
Product=2, SerialNumber=0

kernel: [   52.697912] usb 3-2: Product: Hercules Blog Microphone
kernel: [   52.697914] usb 3-2: Manufacturer: Hercules Blog Webcam
kernel: [   52.708983] Linux video capture interface: v2.00
kernel: [   52.710778] gspca_main: v2.14.0 registered
kernel: [   52.712210] gspca_main: ov534-2.14.0 probing 06f8:3002
kernel: [   55.506311] BUG: unable to handle kernel NULL pointer 
dereference at 0050
kernel: [   55.506367] IP: [a03c1b01] 
v4l2_ctrl_g_ctrl+0x11/0x60 [videodev]

kernel: [   55.506414] PGD 0
kernel: [   55.506429] Oops:  [#1] SMP
kernel: [   55.506453] Modules linked in: gspca_ov534(+) gspca_main 
videodev rfcomm bnep ppdev bluetooth binfmt_misc snd_hda_codec_hdmi 
snd_hda_codec_realtek stir4200 irda crc_ccitt usblp snd_hda_intel 
snd_hda_codec snd_hwdep snd_pcm hid_generic snd_page_alloc snd_seq_midi 
snd_seq_midi_event usbhid snd_rawmidi snd_seq snd_seq_device snd_timer 
hid i915 snd psmouse drm_kms_helper serio_raw mei_me drm mei soundcore 
video i2c_algo_bit lpc_ich mac_hid coretemp lp parport firewire_ohci 
firewire_core crc_itu_t ahci libahci alx mdio r8169 mii [last unloaded: 
parport_pc]
kernel: [   55.506819] CPU: 3 PID: 4352 Comm: modprobe Not tainted 
3.11.0-031100rc2-generic #201307211535
kernel: [   55.506864] Hardware name: Gigabyte Technology Co., Ltd. To 
be filled by O.E.M./Z77-DS3H, BIOS F9 09/19/2012
kernel: [   55.506913] task: 8801c20f9770 ti: 8801ceaa 
task.ti: 8801ceaa
kernel: [   55.506952] RIP: 0010:[a03c1b01] 
[a03c1b01] v4l2_ctrl_g_ctrl+0x11/0x60 [videodev]

kernel: [   55.507005] RSP: 0018:8801ceaa1af8  EFLAGS: 00010292
kernel: [   55.507033] RAX: 0001 RBX:  RCX: 
0001988b
kernel: [   55.507069] RDX: 0001988a RSI: a032745a RDI: 

kernel: [   55.507106] RBP: 8801ceaa1b28 R08: 00017380 R09: 
ea0008419d80
kernel: [   55.507142] R10: 81538f5a R11: 0002 R12: 
a03273dc
kernel: [   55.507178] R13: a03273dc R14:  R15: 
a03270a0
kernel: [   55.507215] FS:  7f72d564a740() 
GS:88021f38() knlGS:

kernel: [   55.507256] CS:  0010 DS:  ES:  CR0: 80050033
kernel: [   55.507286] CR2: 0050 CR3: 0001bd1f CR4: 
001407e0

kernel: [   55.507323] Stack:
kernel: [   55.507335]  8801ceaa1b28 a0325cff 
880101f4 8801ceb44000
kernel: [   55.507380]  a03273dc 8801ceb44000 
8801ceaa1b58 a032688e
kernel: [   55.507426]  8801ceb44000 a03274f0 
a03274f0 8801ceb44380

kernel: [   55.507471] Call Trace:
kernel: [   55.507490]  [a0325cff] ? sccb_w_array+0x3f/0x80 
[gspca_ov534]
kernel: [   55.507527]  [a032688e] sd_start+0xce/0x2b0 
[gspca_ov534]
kernel: [   55.507561]  [a0326bf9] sd_init+0x189/0x1e8 
[gspca_ov534]
kernel: [   

[PATCH] exynos4-is: Fix entity unregistration on error path

2013-07-29 Thread Sylwester Nawrocki
This patch corrects media entities unregistration order to make sure
the fimc.N.capture and fimc-lite video nodes are unregistered with
fimc-lock mutex held. This prevents races between video device open()
and defered probing and NULL pointer dereference in open() callback
as follows:

[   77.645000] Unable to handle kernel NULL pointer dereference at virtual 
address 0290t
[   77.655000] pgd = ee7a8000
[   77.66] [0290] *pgd=6e13c831, *pte=, *ppte=
[   77.665000] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[   77.67] Modules linked in: s5p_fimc ipv6 exynos_fimc_is exynos_fimc_lite
 s5p_csis v4l2_mem2mem videobuf2_dma_contig videobuf2_memops exynos4_is_common 
videobuf2_core [last unloaded: s5p_fimc]
[   77.685000] CPU: 0 PID : 2998 Comm: v4l_id Tainted: GW   
3.10.0-next-20130709-00039-g39f491b-dirty #1548
[   77.695000] task: ee084000 ti: ee46e000 task.ti: ee46e000
[   77.70] PC is at __mutex_lock_slowpath+0x54/0x368
[   77.705000] LR is at __mutex_lock_slowpath+0x24/0x368
[   77.71] pc : [c038dc10]lr : [c038dbe0]psr: 6093
[   77.71] sp : ee46fd70  ip : 08c8  fp : c054e34c
[   77.725000] r10: ee084000  r9 :   r8 : ee439480
[   77.73] r7 : ee46e000  r6 : 6013  r5 : 0290  r4 : 028c
[   77.735000] r3 :   r2 :   r1 : 2093  r0 : 0001
[   77.74] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM Segment user
[   77.75] Control: 10c5387d  Table: 6e7a804a  DAC: 0015
[   77.755000] Process v4l_id (pid: 2998, stack limit = 0xee46e238)
[   77.76] Stack: (0xee46fd70 to 0xee47)
   ...
[   77.935000] [c038dc10] (__mutex_lock_slowpath+0x54/0x368) from 
[c038df30] (mutex_lock+0xc/0x24)
[   77.945000] [c038df30] (mutex_lock+0xc/0x24) from [bf03fa90] 
(fimc_lite_open+0x12c/0x2bc [exynos_fimc_lite])
[   77.955000] [bf03fa90] (fimc_lite_open+0x12c/0x2bc [exynos_fimc_lite]) 
from [c02ab11c] (v4l2_open+0xa0/0xe0)
[   77.965000] [c02ab11c] (v4l2_open+0xa0/0xe0) from [c00b1de4] 
(chrdev_open+0x88/0x170)
[   77.975000] [c00b1de4] (chrdev_open+0x88/0x170) from [c00ac710] 
(do_dentry_open.isra.14+0x1d8/0x258)
[   77.985000] [c00ac710] (do_dentry_open.isra.14+0x1d8/0x258) from 
[c00ac860] (finish_open+0x20/0x38)
[   77.995000] [c00ac860] (finish_open+0x20/0x38) from [c00ba658] 
(do_last.isra.43+0x538/0xb1c)
[   78.00] [c00ba658] (do_last.isra.43+0x538/0xb1c) from [c00bacf0] 
(path_openat+0xb4/0x5c4)
[   78.01] [c00bacf0] (path_openat+0xb4/0x5c4) from [c00bb4b4] 
(do_filp_open+0x2c/0x80)
[   78.02] [c00bb4b4] (do_filp_open+0x2c/0x80) from [c00ad744] 
(do_sys_open+0xf4/0x1a8)
[   78.025000] [c00ad744] (do_sys_open+0xf4/0x1a8) from [c000e320] 
(ret_fast_syscall+0x0/0x30)
[   78.035000] Code: 1a93 e10f6000 f10c0080 e2845004 (e1953f9f)

Reported-by: Andrzej Hajda a.ha...@samsung.com
Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/platform/exynos4-is/media-dev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/media-dev.c 
b/drivers/media/platform/exynos4-is/media-dev.c
index 19f556c..91f21e2 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -1530,9 +1530,9 @@ static int fimc_md_probe(struct platform_device *pdev)
 err_unlock:
mutex_unlock(fmd-media_dev.graph_mutex);
 err_clk:
-   media_device_unregister(fmd-media_dev);
fimc_md_put_clocks(fmd);
fimc_md_unregister_entities(fmd);
+   media_device_unregister(fmd-media_dev);
 err_md:
v4l2_device_unregister(fmd-v4l2_dev);
return ret;
--
1.7.9.5

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


Re: [PATCH 1/2] videobuf2-dma-sg: Allocate pages as contiguous as possible

2013-07-29 Thread Marek Szyprowski

Hello,

On 7/19/2013 10:16 PM, Jonathan Corbet wrote:

On Fri, 19 Jul 2013 19:02:33 +0200
Ricardo Ribalda Delgado ricardo.riba...@gmail.com wrote:

 Most DMA engines have limitations regarding the number of DMA segments
 (sg-buffers) that they can handle. Videobuffers can easily spread
 through houndreds of pages.

 In the previous aproach, the pages were allocated individually, this
 could led to the creation houndreds of dma segments (sg-buffers) that
 could not be handled by some DMA engines.

 This patch tries to minimize the number of DMA segments by using
 alloc_pages. In the worst case it will behave as before, but most
 of the times it will reduce the number of dma segments

So I looked this over and I have a few questions...

 diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c 
b/drivers/media/v4l2-core/videobuf2-dma-sg.c
 index 16ae3dc..c053605 100644
 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
 +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
 @@ -42,10 +42,55 @@ struct vb2_dma_sg_buf {

  static void vb2_dma_sg_put(void *buf_priv);

 +static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf,
 +  gfp_t gfp_flags)
 +{
 +  unsigned int last_page = 0;
 +  int size = buf-sg_desc.size;
 +
 +  while (size  0) {
 +  struct page *pages;
 +  int order;
 +  int i;
 +
 +  order = get_order(size);
 +  /* Dont over allocate*/
 +  if ((PAGE_SIZE  order)  size)
 +  order--;

Terrible things will happen if size  PAGE_SIZE.  Presumably that should
never happen, or perhaps one could say any caller who does that will get
what they deserve.


I think that page size alignment for requested buffer size should be added
at vb2 core. V4L2 buffer API is page oriented and it really makes no sense
to allocate buffers which are not a multiple of page size.



Have you considered alloc_pages_exact(), though?  That might result in
fewer segments overall.

 +  pages = NULL;
 +  while (!pages) {
 +  pages = alloc_pages(GFP_KERNEL | __GFP_ZERO |
 +  __GFP_NOWARN | gfp_flags, order);
 +  if (pages)
 +  break;
 +
 +  if (order == 0)
 +  while (last_page--) {
 +  __free_page(buf-pages[last_page]);

If I understand things, this is wrong; you relly need free_pages() with the
correct order.  Or, at least, that would be the case if you kept the pages
together, but that leads to my biggest question...

 +  return -ENOMEM;
 +  }
 +  order--;
 +  }
 +
 +  split_page(pages, order);
 +  for (i = 0; i  (1order); i++) {
 +  buf-pages[last_page] = pages[i];
 +  sg_set_page(buf-sg_desc.sglist[last_page],
 +  buf-pages[last_page], PAGE_SIZE, 0);
 +  last_page++;
 +  }

You've gone to all this trouble to get a higher-order allocation so you'd
have fewer segments, then you undo it all by splitting things apart into
individual pages.  Why?  Clearly I'm missing something, this seems to
defeat the purpose of the whole exercise?


Individual zero-order pages are required to get them mapped to userspace in
mmap callback.

Best regards
--
Marek Szyprowski
Samsung RD Institute Poland


--
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/3] include: Convert ethernet mac address declarations to use ETH_ALEN

2013-07-29 Thread Rafael J. Wysocki
On Sunday, July 28, 2013 10:29:04 PM Joe Perches wrote:
 It's convenient to have ethernet mac addresses use
 ETH_ALEN to be able to grep for them a bit easier and
 also to ensure that the addresses are __aligned(2).
 
 Add #include linux/if_ether.h as necessary.
 
 Signed-off-by: Joe Perches j...@perches.com
 ---
  include/acpi/actbl2.h   |  4 ++-
  include/linux/dm9000.h  |  4 ++-
  include/linux/fs_enet_pd.h  |  3 ++-
  include/linux/ieee80211.h   | 59 
 +
  include/linux/mlx4/device.h | 11 
  include/linux/mlx4/qp.h |  5 ++--
  include/linux/mv643xx_eth.h |  3 ++-
  include/linux/sh_eth.h  |  3 ++-
  include/linux/smsc911x.h|  3 ++-
  include/linux/uwb/spec.h|  5 ++--
  include/media/tveeprom.h|  4 ++-
  include/net/irda/irlan_common.h |  3 ++-
  12 files changed, 61 insertions(+), 46 deletions(-)
 
 diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
 index ffaac0e..3f0f11c 100644
 --- a/include/acpi/actbl2.h
 +++ b/include/acpi/actbl2.h
 @@ -44,6 +44,8 @@
  #ifndef __ACTBL2_H__
  #define __ACTBL2_H__
  
 +#include linux/if_ether.h
 +
  
 /***
   *
   * Additional ACPI Tables (2)
 @@ -605,7 +607,7 @@ struct acpi_ibft_nic {
   u8 secondary_dns[16];
   u8 dhcp[16];
   u16 vlan;
 - u8 mac_address[6];
 + u8 mac_address[ETH_ALEN];
   u16 pci_address;
   u16 name_length;
   u16 name_offset;

Please don't touch this file.

It comes from a code base outside of the kernel and should be kept in sync with
the upstream.

Thanks,
Rafael


 diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
 index 96e8769..841925f 100644
 --- a/include/linux/dm9000.h
 +++ b/include/linux/dm9000.h
 @@ -14,6 +14,8 @@
  #ifndef __DM9000_PLATFORM_DATA
  #define __DM9000_PLATFORM_DATA __FILE__
  
 +#include linux/if_ether.h
 +
  /* IO control flags */
  
  #define DM9000_PLATF_8BITONLY(0x0001)
 @@ -27,7 +29,7 @@
  
  struct dm9000_plat_data {
   unsigned intflags;
 - unsigned char   dev_addr[6];
 + unsigned char   dev_addr[ETH_ALEN];
  
   /* allow replacement IO routines */
  
 diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
 index 51b7934..343d82a 100644
 --- a/include/linux/fs_enet_pd.h
 +++ b/include/linux/fs_enet_pd.h
 @@ -18,6 +18,7 @@
  
  #include linux/string.h
  #include linux/of_mdio.h
 +#include linux/if_ether.h
  #include asm/types.h
  
  #define FS_ENET_NAME fs_enet
 @@ -135,7 +136,7 @@ struct fs_platform_info {
   const struct fs_mii_bus_info *bus_info;
  
   int rx_ring, tx_ring;   /* number of buffers on rx */
 - __u8 macaddr[6];/* mac address */
 + __u8 macaddr[ETH_ALEN]; /* mac address */
   int rx_copybreak;   /* limit we copy small frames  */
   int use_napi;   /* use NAPI*/
   int napi_weight;/* NAPI weight */
 diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
 index b0dc87a..4e101af 100644
 --- a/include/linux/ieee80211.h
 +++ b/include/linux/ieee80211.h
 @@ -16,6 +16,7 @@
  #define LINUX_IEEE80211_H
  
  #include linux/types.h
 +#include linux/if_ether.h
  #include asm/byteorder.h
  
  /*
 @@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
  struct ieee80211_hdr {
   __le16 frame_control;
   __le16 duration_id;
 - u8 addr1[6];
 - u8 addr2[6];
 - u8 addr3[6];
 + u8 addr1[ETH_ALEN];
 + u8 addr2[ETH_ALEN];
 + u8 addr3[ETH_ALEN];
   __le16 seq_ctrl;
 - u8 addr4[6];
 + u8 addr4[ETH_ALEN];
  } __packed __aligned(2);
  
  struct ieee80211_hdr_3addr {
   __le16 frame_control;
   __le16 duration_id;
 - u8 addr1[6];
 - u8 addr2[6];
 - u8 addr3[6];
 + u8 addr1[ETH_ALEN];
 + u8 addr2[ETH_ALEN];
 + u8 addr3[ETH_ALEN];
   __le16 seq_ctrl;
  } __packed __aligned(2);
  
  struct ieee80211_qos_hdr {
   __le16 frame_control;
   __le16 duration_id;
 - u8 addr1[6];
 - u8 addr2[6];
 - u8 addr3[6];
 + u8 addr1[ETH_ALEN];
 + u8 addr2[ETH_ALEN];
 + u8 addr3[ETH_ALEN];
   __le16 seq_ctrl;
   __le16 qos_ctrl;
  } __packed __aligned(2);
 @@ -608,8 +609,8 @@ struct ieee80211s_hdr {
   u8 flags;
   u8 ttl;
   __le32 seqnum;
 - u8 eaddr1[6];
 - u8 eaddr2[6];
 + u8 eaddr1[ETH_ALEN];
 + u8 eaddr2[ETH_ALEN];
  } __packed __aligned(2);
  
  /* Mesh flags */
 @@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
   u8 rann_flags;
   u8 rann_hopcount;
   u8 rann_ttl;
 - u8 rann_addr[6];
 + u8 rann_addr[ETH_ALEN];
   __le32 rann_seq;
   __le32 rann_interval;
   __le32 rann_metric;
 @@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
  struct ieee80211_mgmt {
   __le16 frame_control;
   __le16 duration;
 - u8 

[GIT PULL] v4l2-async API updates

2013-07-29 Thread Sylwester Nawrocki
Hi Mauro,

This includes a couple updates to the v4l2-async API: an addition
of a method of matching subdevs by device tree node pointer, some
cleanups and a typo fix for the JPEG controls documentation.

The following changes since commit 51dd4d70fc59564454a4dcb90d6d46d39a4a97ef:

  [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance (2013-07-26 13:35:02
-0300)

are available in the git repository at:

  git://linuxtv.org/snawrocki/samsung.git for-v3.12

for you to fetch changes up to 3d7d76fe1bf5b9f64ea3f718aec51a75e856a463:

  DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference (2013-07-29
13:44:54 +0200)


Sylwester Nawrocki (6):
  V4L: Drop bus_type check in v4l2-async match functions
  V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
  V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type
  V4L: Rename subdev field of struct v4l2_async_notifier
  V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev
  DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference

 .../DocBook/media/v4l/vidioc-g-jpegcomp.xml|4 +-
 drivers/media/platform/davinci/vpif_capture.c  |2 +-
 drivers/media/platform/davinci/vpif_display.c  |2 +-
 drivers/media/platform/soc_camera/soc_camera.c |4 +-
 drivers/media/v4l2-core/v4l2-async.c   |  106 ++--
 include/media/v4l2-async.h |   36 +++
 include/media/v4l2-subdev.h|   13 ++-
 7 files changed, 78 insertions(+), 89 deletions(-)

--
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 v2 6/8] [media] coda: dynamic IRAM setup for decoder

2013-07-29 Thread Philipp Zabel
Hi Mauro,

Am Freitag, den 26.07.2013, 12:18 -0300 schrieb Mauro Carvalho Chehab:
 Em Fri, 21 Jun 2013 09:55:32 +0200
 Philipp Zabel p.za...@pengutronix.de escreveu:
 
  Signed-off-by: Philipp Zabel p.za...@pengutronix.de
 
 Please add a description for the patch.

Sorry I missed this, description is the same as for the encoder IRAM
setup:

This sets up IRAM areas used as temporary memory for the different
 hardware units depending on the frame size.

regards
Philipp

 Thanks!
 Mauro
 
  ---
   drivers/media/platform/coda.c | 50 
  +--
   1 file changed, 48 insertions(+), 2 deletions(-)
  
  diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
  index 1f3bd43..856a93e 100644
  --- a/drivers/media/platform/coda.c
  +++ b/drivers/media/platform/coda.c
  @@ -1212,6 +1212,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
  int ipacdc_size;
  int bitram_size;
  int dbk_size;
  +   int ovl_size;
  int mb_width;
  int me_size;
  int size;
  @@ -1273,7 +1274,47 @@ static void coda_setup_iram(struct coda_ctx *ctx)
  size -= ipacdc_size;
  }
   
  -   /* OVL disabled for encoder */
  +   /* OVL and BTP disabled for encoder */
  +   } else if (ctx-inst_type == CODA_INST_DECODER) {
  +   struct coda_q_data *q_data_dst;
  +   int mb_height;
  +
  +   q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
  +   mb_width = DIV_ROUND_UP(q_data_dst-width, 16);
  +   mb_height = DIV_ROUND_UP(q_data_dst-height, 16);
  +
  +   dbk_size = round_up(256 * mb_width, 1024);
  +   if (size = dbk_size) {
  +   iram_info-axi_sram_use |= CODA7_USE_HOST_DBK_ENABLE;
  +   iram_info-buf_dbk_y_use = dev-iram_paddr;
  +   iram_info-buf_dbk_c_use = dev-iram_paddr +
  +  dbk_size / 2;
  +   size -= dbk_size;
  +   } else {
  +   goto out;
  +   }
  +
  +   bitram_size = round_up(128 * mb_width, 1024);
  +   if (size = bitram_size) {
  +   iram_info-axi_sram_use |= CODA7_USE_HOST_BIT_ENABLE;
  +   iram_info-buf_bit_use = iram_info-buf_dbk_c_use +
  +dbk_size / 2;
  +   size -= bitram_size;
  +   } else {
  +   goto out;
  +   }
  +
  +   ipacdc_size = round_up(128 * mb_width, 1024);
  +   if (size = ipacdc_size) {
  +   iram_info-axi_sram_use |= CODA7_USE_HOST_IP_ENABLE;
  +   iram_info-buf_ip_ac_dc_use = iram_info-buf_bit_use +
  + bitram_size;
  +   size -= ipacdc_size;
  +   } else {
  +   goto out;
  +   }
  +
  +   ovl_size = round_up(80 * mb_width, 1024);
  }
   
   out:
  @@ -1300,7 +1341,12 @@ out:
   
  if (dev-devtype-product == CODA_7541) {
  /* TODO - Enabling these causes picture errors on CODA7541 */
  -   if (ctx-inst_type == CODA_INST_ENCODER) {
  +   if (ctx-inst_type == CODA_INST_DECODER) {
  +   /* fw 1.4.50 */
  +   iram_info-axi_sram_use = ~(CODA7_USE_HOST_IP_ENABLE |
  +CODA7_USE_IP_ENABLE);
  +   } else {
  +   /* fw 13.4.29 */
  iram_info-axi_sram_use = ~(CODA7_USE_HOST_IP_ENABLE |
   CODA7_USE_HOST_DBK_ENABLE |
   CODA7_USE_IP_ENABLE |
 
 


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


[RFC PATCH 0/8] dv-timings improvements, cleanups and fixes

2013-07-29 Thread Hans Verkuil
This patch series collects all dv-timings helper code into a new
v4l2-dv-timings module. There aren't that many drivers that use HDTV
timings, so it makes no sense to have a lot of HDTV related code in
v4l2-common.

It also fixes a few bugs (Prabhakar: please check patch 7/8!) and it
adds new helper functions that allows drivers to select timings based
on their hardware capabilities.

This reorganization will also make it easier in the near future to add
functionality that uses VIC codes to retrieve the corresponding CEA-861
timing.

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


[RFC PATCH 5/8] videodev2.h: defines to calculate blanking and frame sizes

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

It is very common to have to calculate the total width and height of the
blanking and the full frame, so add a few defines that deal with that.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 include/uapi/linux/videodev2.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 95ef455..547ef45 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1055,6 +1055,16 @@ struct v4l2_bt_timings {
or used depends on the hardware. */
 #define V4L2_DV_FL_HALF_LINE   (1  3)
 
+/* A few useful defines to calculate the total blanking and frame sizes */
+#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
+   (bt-hfrontporch + bt-hsync + bt-hbackporch)
+#define V4L2_DV_BT_FRAME_WIDTH(bt) \
+   (bt-width + V4L2_DV_BT_BLANKING_WIDTH(bt))
+#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
+   (bt-vfrontporch + bt-vsync + bt-vbackporch + \
+bt-il_vfrontporch + bt-il_vsync + bt-il_vbackporch)
+#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
+   (bt-height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
 
 /** struct v4l2_dv_timings - DV timings
  * @type:  the type of the timings
-- 
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


[RFC PATCH 8/8] ths8200/ad9389b: use new dv_timings helpers.

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 drivers/media/i2c/ad9389b.c | 108 +++-
 drivers/media/i2c/ths8200.c |  55 ++
 2 files changed, 31 insertions(+), 132 deletions(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 5295234..7e68d8f 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -635,95 +635,34 @@ static int ad9389b_s_stream(struct v4l2_subdev *sd, int 
enable)
return 0;
 }
 
-static const struct v4l2_dv_timings ad9389b_timings[] = {
-   V4L2_DV_BT_CEA_720X480P59_94,
-   V4L2_DV_BT_CEA_720X576P50,
-   V4L2_DV_BT_CEA_1280X720P24,
-   V4L2_DV_BT_CEA_1280X720P25,
-   V4L2_DV_BT_CEA_1280X720P30,
-   V4L2_DV_BT_CEA_1280X720P50,
-   V4L2_DV_BT_CEA_1280X720P60,
-   V4L2_DV_BT_CEA_1920X1080P24,
-   V4L2_DV_BT_CEA_1920X1080P25,
-   V4L2_DV_BT_CEA_1920X1080P30,
-   V4L2_DV_BT_CEA_1920X1080P50,
-   V4L2_DV_BT_CEA_1920X1080P60,
-
-   V4L2_DV_BT_DMT_640X350P85,
-   V4L2_DV_BT_DMT_640X400P85,
-   V4L2_DV_BT_DMT_720X400P85,
-   V4L2_DV_BT_DMT_640X480P60,
-   V4L2_DV_BT_DMT_640X480P72,
-   V4L2_DV_BT_DMT_640X480P75,
-   V4L2_DV_BT_DMT_640X480P85,
-   V4L2_DV_BT_DMT_800X600P56,
-   V4L2_DV_BT_DMT_800X600P60,
-   V4L2_DV_BT_DMT_800X600P72,
-   V4L2_DV_BT_DMT_800X600P75,
-   V4L2_DV_BT_DMT_800X600P85,
-   V4L2_DV_BT_DMT_848X480P60,
-   V4L2_DV_BT_DMT_1024X768P60,
-   V4L2_DV_BT_DMT_1024X768P70,
-   V4L2_DV_BT_DMT_1024X768P75,
-   V4L2_DV_BT_DMT_1024X768P85,
-   V4L2_DV_BT_DMT_1152X864P75,
-   V4L2_DV_BT_DMT_1280X768P60_RB,
-   V4L2_DV_BT_DMT_1280X768P60,
-   V4L2_DV_BT_DMT_1280X768P75,
-   V4L2_DV_BT_DMT_1280X768P85,
-   V4L2_DV_BT_DMT_1280X800P60_RB,
-   V4L2_DV_BT_DMT_1280X800P60,
-   V4L2_DV_BT_DMT_1280X800P75,
-   V4L2_DV_BT_DMT_1280X800P85,
-   V4L2_DV_BT_DMT_1280X960P60,
-   V4L2_DV_BT_DMT_1280X960P85,
-   V4L2_DV_BT_DMT_1280X1024P60,
-   V4L2_DV_BT_DMT_1280X1024P75,
-   V4L2_DV_BT_DMT_1280X1024P85,
-   V4L2_DV_BT_DMT_1360X768P60,
-   V4L2_DV_BT_DMT_1400X1050P60_RB,
-   V4L2_DV_BT_DMT_1400X1050P60,
-   V4L2_DV_BT_DMT_1400X1050P75,
-   V4L2_DV_BT_DMT_1400X1050P85,
-   V4L2_DV_BT_DMT_1440X900P60_RB,
-   V4L2_DV_BT_DMT_1440X900P60,
-   V4L2_DV_BT_DMT_1600X1200P60,
-   V4L2_DV_BT_DMT_1680X1050P60_RB,
-   V4L2_DV_BT_DMT_1680X1050P60,
-   V4L2_DV_BT_DMT_1792X1344P60,
-   V4L2_DV_BT_DMT_1856X1392P60,
-   V4L2_DV_BT_DMT_1920X1200P60_RB,
-   V4L2_DV_BT_DMT_1366X768P60,
-   V4L2_DV_BT_DMT_1920X1080P60,
-   {},
+static const struct v4l2_dv_timings_cap ad9389b_timings_cap = {
+   .type = V4L2_DV_BT_656_1120,
+   .bt = {
+   .max_width = 1920,
+   .max_height = 1200,
+   .min_pixelclock = 2700,
+   .max_pixelclock = 17000,
+   .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
+   V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT,
+   .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
+   V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM,
+   },
 };
 
 static int ad9389b_s_dv_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings)
 {
struct ad9389b_state *state = get_ad9389b_state(sd);
-   int i;
 
v4l2_dbg(1, debug, sd, %s:\n, __func__);
 
/* quick sanity check */
-   if (timings-type != V4L2_DV_BT_656_1120)
-   return -EINVAL;
-
-   if (timings-bt.interlaced)
-   return -EINVAL;
-   if (timings-bt.pixelclock  2700 ||
-   timings-bt.pixelclock  17000)
+   if (!v4l2_dv_valid_timings(timings, ad9389b_timings_cap))
return -EINVAL;
 
/* Fill the optional fields .standards and .flags in struct 
v4l2_dv_timings
-  if the format is listed in ad9389b_timings[] */
-   for (i = 0; ad9389b_timings[i].bt.width; i++) {
-   if (v4l_match_dv_timings(timings, ad9389b_timings[i], 0)) {
-   *timings = ad9389b_timings[i];
-   break;
-   }
-   }
+  if the format is one of the CEA or DMT timings. */
+   v4l2_find_dv_timings_cap(timings, ad9389b_timings_cap, 0);
 
timings-bt.flags = ~V4L2_DV_FL_REDUCED_FPS;
 
@@ -761,26 +700,13 @@ static int ad9389b_g_dv_timings(struct v4l2_subdev *sd,
 static int ad9389b_enum_dv_timings(struct v4l2_subdev *sd,
struct v4l2_enum_dv_timings *timings)
 {
-   if (timings-index = ARRAY_SIZE(ad9389b_timings))
-   return -EINVAL;
-
-   memset(timings-reserved, 0, sizeof(timings-reserved));
-   timings-timings = ad9389b_timings[timings-index];
- 

[RFC PATCH 3/8] v4l2: move dv-timings related code to v4l2-dv-timings.c

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

v4l2-common.c contained a bunch of dv-timings related functions.
Move that to the new v4l2-dv-timings.c which is a more appropriate
place for them.

There aren't many drivers that do HDTV, so it is a good idea to separate
common code related to that into a module of its own.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/i2c/ad9389b.c   |   1 +
 drivers/media/i2c/adv7604.c   |   1 +
 drivers/media/i2c/ths8200.c   |   1 +
 drivers/media/usb/hdpvr/hdpvr-video.c |   1 +
 drivers/media/v4l2-core/v4l2-common.c | 357 -
 drivers/media/v4l2-core/v4l2-dv-timings.c | 358 +-
 include/media/v4l2-common.h   |  13 --
 include/media/v4l2-dv-timings.h   |  59 +
 8 files changed, 420 insertions(+), 371 deletions(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index ba4364d..2fa8d72 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -33,6 +33,7 @@
 #include linux/v4l2-dv-timings.h
 #include media/v4l2-device.h
 #include media/v4l2-common.h
+#include media/v4l2-dv-timings.h
 #include media/v4l2-ctrls.h
 #include media/ad9389b.h
 
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 1d675b5..181a6c3 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -38,6 +38,7 @@
 #include linux/v4l2-dv-timings.h
 #include media/v4l2-device.h
 #include media/v4l2-ctrls.h
+#include media/v4l2-dv-timings.h
 #include media/adv7604.h
 
 static int debug;
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 8a29810..aef7c0e 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -21,6 +21,7 @@
 #include linux/module.h
 #include linux/v4l2-dv-timings.h
 
+#include media/v4l2-dv-timings.h
 #include media/v4l2-async.h
 #include media/v4l2-device.h
 
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c 
b/drivers/media/usb/hdpvr/hdpvr-video.c
index 4f8567a..9c67b6e 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -24,6 +24,7 @@
 #include linux/v4l2-dv-timings.h
 #include media/v4l2-dev.h
 #include media/v4l2-common.h
+#include media/v4l2-dv-timings.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-event.h
 #include hdpvr.h
diff --git a/drivers/media/v4l2-core/v4l2-common.c 
b/drivers/media/v4l2-core/v4l2-common.c
index a95e5e2..037d7a5 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -495,363 +495,6 @@ void v4l_bound_align_image(u32 *w, unsigned int wmin, 
unsigned int wmax,
 }
 EXPORT_SYMBOL_GPL(v4l_bound_align_image);
 
-/**
- * v4l_match_dv_timings - check if two timings match
- * @t1 - compare this v4l2_dv_timings struct...
- * @t2 - with this struct.
- * @pclock_delta - the allowed pixelclock deviation.
- *
- * Compare t1 with t2 with a given margin of error for the pixelclock.
- */
-bool v4l_match_dv_timings(const struct v4l2_dv_timings *t1,
- const struct v4l2_dv_timings *t2,
- unsigned pclock_delta)
-{
-   if (t1-type != t2-type || t1-type != V4L2_DV_BT_656_1120)
-   return false;
-   if (t1-bt.width == t2-bt.width 
-   t1-bt.height == t2-bt.height 
-   t1-bt.interlaced == t2-bt.interlaced 
-   t1-bt.polarities == t2-bt.polarities 
-   t1-bt.pixelclock = t2-bt.pixelclock - pclock_delta 
-   t1-bt.pixelclock = t2-bt.pixelclock + pclock_delta 
-   t1-bt.hfrontporch == t2-bt.hfrontporch 
-   t1-bt.vfrontporch == t2-bt.vfrontporch 
-   t1-bt.vsync == t2-bt.vsync 
-   t1-bt.vbackporch == t2-bt.vbackporch 
-   (!t1-bt.interlaced ||
-   (t1-bt.il_vfrontporch == t2-bt.il_vfrontporch 
-t1-bt.il_vsync == t2-bt.il_vsync 
-t1-bt.il_vbackporch == t2-bt.il_vbackporch)))
-   return true;
-   return false;
-}
-EXPORT_SYMBOL_GPL(v4l_match_dv_timings);
-
-/*
- * CVT defines
- * Based on Coordinated Video Timings Standard
- * version 1.1 September 10, 2003
- */
-
-#define CVT_PXL_CLK_GRAN   25  /* pixel clock granularity */
-
-/* Normal blanking */
-#define CVT_MIN_V_BPORCH   7   /* lines */
-#define CVT_MIN_V_PORCH_RND3   /* lines */
-#define CVT_MIN_VSYNC_BP   550 /* min time of vsync + back porch (us) 
*/
-
-/* Normal blanking for CVT uses GTF to calculate horizontal blanking */
-#define CVT_CELL_GRAN  8   /* character cell granularity */
-#define CVT_M  600 /* blanking formula gradient */
-#define CVT_C  40  /* blanking formula offset */
-#define CVT_K  128 /* blanking formula scaling factor */
-#define CVT_J  20  /* blanking formula scaling factor */
-#define CVT_C_PRIME (((CVT_C - CVT_J) * CVT_K / 

[RFC PATCH 4/8] DocBook/media/v4l: il_* fields always 0 for progressive formats

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Clarify that the il_vfrontporch, il_vsync and il_vbackporch fields must
always be 0 for progressive formats.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml 
b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
index 7236970..c433657 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
@@ -156,19 +156,19 @@ bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync 
polarity and bit 1 (V4L2_DV_H
entry__u32/entry
entrystructfieldil_vfrontporch/structfield/entry
entryVertical front porch in lines for the even field (aka field 
2) of
-   interlaced field formats./entry
+   interlaced field formats. Must be 0 for progressive formats./entry
  /row
  row
entry__u32/entry
entrystructfieldil_vsync/structfield/entry
entryVertical sync length in lines for the even field (aka field 
2) of
-   interlaced field formats./entry
+   interlaced field formats. Must be 0 for progressive formats./entry
  /row
  row
entry__u32/entry
entrystructfieldil_vbackporch/structfield/entry
entryVertical back porch in lines for the even field (aka field 
2) of
-   interlaced field formats./entry
+   interlaced field formats. Must be 0 for progressive formats./entry
  /row
  row
entry__u32/entry
-- 
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


[RFC PATCH 7/8] v4l2: use new V4L2_DV_BT_BLANKING/FRAME defines

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Use the new blanking and frame size defines. This also fixed a bug in
these drivers: they assumed that the height for interlaced formats was
the field height, however height is the frame height. So the height
for a field is actually bt-height / 2.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 drivers/media/platform/davinci/vpif_capture.c | 10 ++
 drivers/media/platform/davinci/vpif_display.c | 10 ++
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index b11d7a7..e1b6a3b 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1799,19 +1799,15 @@ static int vpif_s_dv_timings(struct file *file, void 
*priv,
 
/* Configure video port timings */
 
-   std_info-eav2sav = bt-hbackporch + bt-hfrontporch +
-   bt-hsync - 8;
+   std_info-eav2sav = V4L2_DV_BT_BLANKING_WIDTH(bt) - 8;
std_info-sav2eav = bt-width;
 
std_info-l1 = 1;
std_info-l3 = bt-vsync + bt-vbackporch + 1;
 
+   std_info-vsize = V4L2_DV_BT_FRAME_HEIGHT(bt);
if (bt-interlaced) {
if (bt-il_vbackporch || bt-il_vfrontporch || bt-il_vsync) {
-   std_info-vsize = bt-height * 2 +
-   bt-vfrontporch + bt-vsync + bt-vbackporch +
-   bt-il_vfrontporch + bt-il_vsync +
-   bt-il_vbackporch;
std_info-l5 = std_info-vsize/2 -
(bt-vfrontporch - 1);
std_info-l7 = std_info-vsize/2 + 1;
@@ -1825,8 +1821,6 @@ static int vpif_s_dv_timings(struct file *file, void 
*priv,
return -EINVAL;
}
} else {
-   std_info-vsize = bt-height + bt-vfrontporch +
-   bt-vsync + bt-vbackporch;
std_info-l5 = std_info-vsize - (bt-vfrontporch - 1);
}
strncpy(std_info-name, Custom timings BT656/1120, VPIF_MAX_NAME);
diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index c2ff067..a42e43c 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1436,19 +1436,15 @@ static int vpif_s_dv_timings(struct file *file, void 
*priv,
 
/* Configure video port timings */
 
-   std_info-eav2sav = bt-hbackporch + bt-hfrontporch +
-   bt-hsync - 8;
+   std_info-eav2sav = V4L2_DV_BT_BLANKING_WIDTH(bt) - 8;
std_info-sav2eav = bt-width;
 
std_info-l1 = 1;
std_info-l3 = bt-vsync + bt-vbackporch + 1;
 
+   std_info-vsize = V4L2_DV_BT_FRAME_HEIGHT(bt);
if (bt-interlaced) {
if (bt-il_vbackporch || bt-il_vfrontporch || bt-il_vsync) {
-   std_info-vsize = bt-height * 2 +
-   bt-vfrontporch + bt-vsync + bt-vbackporch +
-   bt-il_vfrontporch + bt-il_vsync +
-   bt-il_vbackporch;
std_info-l5 = std_info-vsize/2 -
(bt-vfrontporch - 1);
std_info-l7 = std_info-vsize/2 + 1;
@@ -1462,8 +1458,6 @@ static int vpif_s_dv_timings(struct file *file, void 
*priv,
return -EINVAL;
}
} else {
-   std_info-vsize = bt-height + bt-vfrontporch +
-   bt-vsync + bt-vbackporch;
std_info-l5 = std_info-vsize - (bt-vfrontporch - 1);
}
strncpy(std_info-name, Custom timings BT656/1120,
-- 
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


[RFC PATCH 1/8] v4l2-dv-timings.h: remove duplicate V4L2_DV_BT_DMT_1366X768P60

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This particular DMT timing definition was duplicated in the header.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 include/uapi/linux/v4l2-dv-timings.h | 8 
 1 file changed, 8 deletions(-)

diff --git a/include/uapi/linux/v4l2-dv-timings.h 
b/include/uapi/linux/v4l2-dv-timings.h
index 4e0c58d..be709fe 100644
--- a/include/uapi/linux/v4l2-dv-timings.h
+++ b/include/uapi/linux/v4l2-dv-timings.h
@@ -823,12 +823,4 @@
V4L2_DV_FL_REDUCED_BLANKING) \
 }
 
-#define V4L2_DV_BT_DMT_1366X768P60 { \
-   .type = V4L2_DV_BT_656_1120, \
-   V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
-   V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
-   8550, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
-   V4L2_DV_BT_STD_DMT, 0) \
-}
-
 #endif
-- 
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


[RFC PATCH 2/8] v4l2-dv-timings: add new helper module.

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This module makes it easy to filter valid timings from the full list of
CEA and DMT timings based on the timings capabilities.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/v4l2-core/Makefile  |   1 +
 drivers/media/v4l2-core/v4l2-dv-timings.c | 192 ++
 include/media/v4l2-dv-timings.h   |  67 +++
 3 files changed, 260 insertions(+)
 create mode 100644 drivers/media/v4l2-core/v4l2-dv-timings.c
 create mode 100644 include/media/v4l2-dv-timings.h

diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 4c33b8d6..1a85eee 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -17,6 +17,7 @@ endif
 obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2_INT_DEVICE) += v4l2-int-device.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
+obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
 
 obj-$(CONFIG_VIDEO_TUNER) += tuner.o
 
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c 
b/drivers/media/v4l2-core/v4l2-dv-timings.c
new file mode 100644
index 000..5827946
--- /dev/null
+++ b/drivers/media/v4l2-core/v4l2-dv-timings.c
@@ -0,0 +1,192 @@
+/*
+ * v4l2-dv-timings - dv-timings helper functions
+ *
+ * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights 
reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/errno.h
+#include linux/videodev2.h
+#include linux/v4l2-dv-timings.h
+#include media/v4l2-common.h
+#include media/v4l2-dv-timings.h
+
+static const struct v4l2_dv_timings timings[] = {
+   V4L2_DV_BT_CEA_640X480P59_94,
+   V4L2_DV_BT_CEA_720X480I59_94,
+   V4L2_DV_BT_CEA_720X480P59_94,
+   V4L2_DV_BT_CEA_720X576I50,
+   V4L2_DV_BT_CEA_720X576P50,
+   V4L2_DV_BT_CEA_1280X720P24,
+   V4L2_DV_BT_CEA_1280X720P25,
+   V4L2_DV_BT_CEA_1280X720P30,
+   V4L2_DV_BT_CEA_1280X720P50,
+   V4L2_DV_BT_CEA_1280X720P60,
+   V4L2_DV_BT_CEA_1920X1080P24,
+   V4L2_DV_BT_CEA_1920X1080P25,
+   V4L2_DV_BT_CEA_1920X1080P30,
+   V4L2_DV_BT_CEA_1920X1080I50,
+   V4L2_DV_BT_CEA_1920X1080P50,
+   V4L2_DV_BT_CEA_1920X1080I60,
+   V4L2_DV_BT_CEA_1920X1080P60,
+   V4L2_DV_BT_DMT_640X350P85,
+   V4L2_DV_BT_DMT_640X400P85,
+   V4L2_DV_BT_DMT_720X400P85,
+   V4L2_DV_BT_DMT_640X480P72,
+   V4L2_DV_BT_DMT_640X480P75,
+   V4L2_DV_BT_DMT_640X480P85,
+   V4L2_DV_BT_DMT_800X600P56,
+   V4L2_DV_BT_DMT_800X600P60,
+   V4L2_DV_BT_DMT_800X600P72,
+   V4L2_DV_BT_DMT_800X600P75,
+   V4L2_DV_BT_DMT_800X600P85,
+   V4L2_DV_BT_DMT_800X600P120_RB,
+   V4L2_DV_BT_DMT_848X480P60,
+   V4L2_DV_BT_DMT_1024X768I43,
+   V4L2_DV_BT_DMT_1024X768P60,
+   V4L2_DV_BT_DMT_1024X768P70,
+   V4L2_DV_BT_DMT_1024X768P75,
+   V4L2_DV_BT_DMT_1024X768P85,
+   V4L2_DV_BT_DMT_1024X768P120_RB,
+   V4L2_DV_BT_DMT_1152X864P75,
+   V4L2_DV_BT_DMT_1280X768P60_RB,
+   V4L2_DV_BT_DMT_1280X768P60,
+   V4L2_DV_BT_DMT_1280X768P75,
+   V4L2_DV_BT_DMT_1280X768P85,
+   V4L2_DV_BT_DMT_1280X768P120_RB,
+   V4L2_DV_BT_DMT_1280X800P60_RB,
+   V4L2_DV_BT_DMT_1280X800P60,
+   V4L2_DV_BT_DMT_1280X800P75,
+   V4L2_DV_BT_DMT_1280X800P85,
+   V4L2_DV_BT_DMT_1280X800P120_RB,
+   V4L2_DV_BT_DMT_1280X960P60,
+   V4L2_DV_BT_DMT_1280X960P85,
+   V4L2_DV_BT_DMT_1280X960P120_RB,
+   V4L2_DV_BT_DMT_1280X1024P60,
+   V4L2_DV_BT_DMT_1280X1024P75,
+   V4L2_DV_BT_DMT_1280X1024P85,
+   V4L2_DV_BT_DMT_1280X1024P120_RB,
+   V4L2_DV_BT_DMT_1360X768P60,
+   V4L2_DV_BT_DMT_1360X768P120_RB,
+   V4L2_DV_BT_DMT_1366X768P60,
+   V4L2_DV_BT_DMT_1366X768P60_RB,
+   V4L2_DV_BT_DMT_1400X1050P60_RB,
+   V4L2_DV_BT_DMT_1400X1050P60,
+   V4L2_DV_BT_DMT_1400X1050P75,
+   V4L2_DV_BT_DMT_1400X1050P85,
+   V4L2_DV_BT_DMT_1400X1050P120_RB,
+   V4L2_DV_BT_DMT_1440X900P60_RB,
+   V4L2_DV_BT_DMT_1440X900P60,
+   V4L2_DV_BT_DMT_1440X900P75,
+   V4L2_DV_BT_DMT_1440X900P85,
+   V4L2_DV_BT_DMT_1440X900P120_RB,
+   V4L2_DV_BT_DMT_1600X900P60_RB,
+   V4L2_DV_BT_DMT_1600X1200P60,
+   V4L2_DV_BT_DMT_1600X1200P65,
+   

[RFC PATCH 6/8] v4l2: use new V4L2_DV_BT_BLANKING/FRAME defines

2013-07-29 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Use the new defines to calculate the full blanking and frame sizes.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Lad, Prabhakar prabhakar.cse...@gmail.com
Cc: Scott Jiang scott.jiang.li...@gmail.com
---
 drivers/media/i2c/ad9389b.c| 6 ++
 drivers/media/i2c/adv7604.c| 8 
 drivers/media/i2c/ths7303.c| 6 ++
 drivers/media/i2c/ths8200.c| 8 
 drivers/media/platform/blackfin/bfin_capture.c | 9 ++---
 drivers/media/usb/hdpvr/hdpvr-video.c  | 6 ++
 6 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 2fa8d72..5295234 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -445,10 +445,8 @@ static int ad9389b_log_status(struct v4l2_subdev *sd)
}
if (state-dv_timings.type == V4L2_DV_BT_656_1120) {
struct v4l2_bt_timings *bt = bt = state-dv_timings.bt;
-   u32 frame_width = bt-width + bt-hfrontporch +
-   bt-hsync + bt-hbackporch;
-   u32 frame_height = bt-height + bt-vfrontporch +
-   bt-vsync + bt-vbackporch;
+   u32 frame_width = V4L2_DV_BT_FRAME_WIDTH(bt);
+   u32 frame_height = V4L2_DV_BT_FRAME_HEIGHT(bt);
u32 frame_size = frame_width * frame_height;
 
v4l2_info(sd, timings: %ux%u%s%u (%ux%u). Pix freq. = %u Hz. 
Polarities = 0x%x\n,
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 181a6c3..3ec7ec0 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -261,22 +261,22 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl 
*ctrl)
 
 static inline unsigned hblanking(const struct v4l2_bt_timings *t)
 {
-   return t-hfrontporch + t-hsync + t-hbackporch;
+   return V4L2_DV_BT_BLANKING_WIDTH(t);
 }
 
 static inline unsigned htotal(const struct v4l2_bt_timings *t)
 {
-   return t-width + t-hfrontporch + t-hsync + t-hbackporch;
+   return V4L2_DV_BT_FRAME_WIDTH(t);
 }
 
 static inline unsigned vblanking(const struct v4l2_bt_timings *t)
 {
-   return t-vfrontporch + t-vsync + t-vbackporch;
+   return V4L2_DV_BT_BLANKING_HEIGHT(t);
 }
 
 static inline unsigned vtotal(const struct v4l2_bt_timings *t)
 {
-   return t-height + t-vfrontporch + t-vsync + t-vbackporch;
+   return V4L2_DV_BT_FRAME_HEIGHT(t);
 }
 
 /* --- */
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c
index 0a2dacb..42276d9 100644
--- a/drivers/media/i2c/ths7303.c
+++ b/drivers/media/i2c/ths7303.c
@@ -291,10 +291,8 @@ static int ths7303_log_status(struct v4l2_subdev *sd)
struct v4l2_bt_timings *bt = bt = state-bt;
u32 frame_width, frame_height;
 
-   frame_width = bt-width + bt-hfrontporch +
- bt-hsync + bt-hbackporch;
-   frame_height = bt-height + bt-vfrontporch +
-  bt-vsync + bt-vbackporch;
+   frame_width = V4L2_DV_BT_FRAME_WIDTH(bt);
+   frame_height = V4L2_DV_BT_FRAME_HEIGHT(bt);
v4l2_info(sd,
  timings: %dx%d%s%d (%dx%d). Pix freq. = %d Hz. 
Polarities = 0x%x\n,
  bt-width, bt-height, bt-interlaced ? i : p,
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index aef7c0e..28932e9 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -65,22 +65,22 @@ static inline struct ths8200_state *to_state(struct 
v4l2_subdev *sd)
 
 static inline unsigned hblanking(const struct v4l2_bt_timings *t)
 {
-   return t-hfrontporch + t-hsync + t-hbackporch;
+   return V4L2_DV_BT_BLANKING_WIDTH(t);
 }
 
 static inline unsigned htotal(const struct v4l2_bt_timings *t)
 {
-   return t-width + t-hfrontporch + t-hsync + t-hbackporch;
+   return V4L2_DV_BT_FRAME_WIDTH(t);
 }
 
 static inline unsigned vblanking(const struct v4l2_bt_timings *t)
 {
-   return t-vfrontporch + t-vsync + t-vbackporch;
+   return V4L2_DV_BT_BLANKING_HEIGHT(t);
 }
 
 static inline unsigned vtotal(const struct v4l2_bt_timings *t)
 {
-   return t-height + t-vfrontporch + t-vsync + t-vbackporch;
+   return V4L2_DV_BT_FRAME_HEIGHT(t);
 }
 
 static int ths8200_read(struct v4l2_subdev *sd, u8 reg)
diff --git a/drivers/media/platform/blackfin/bfin_capture.c 
b/drivers/media/platform/blackfin/bfin_capture.c
index 7f838c6..4c11059 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -388,13 +388,8 @@ static int bcap_start_streaming(struct vb2_queue *vq, 
unsigned int count)
 
params.hdelay = bt-hsync + bt-hbackporch;
params.vdelay = bt-vsync + 

[PATCH 0/1] qv4l2: Fixed a bug in the v4l2-api

2013-07-29 Thread Bård Eirik Winther
Fixed a bug where the get_interval in v4l2-api where it would test for
a compatibility flag irrelevant to the feature support and resulting
return false.

--
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] qv4l2: Fixed a bug in the v4l2-api

2013-07-29 Thread Bård Eirik Winther
The get_interval would return false even if devices had support for this

Signed-off-by: Bård Eirik Winther bwint...@cisco.com
---
 utils/qv4l2/v4l2-api.cpp | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/utils/qv4l2/v4l2-api.cpp b/utils/qv4l2/v4l2-api.cpp
index 9c37be3..7a438af 100644
--- a/utils/qv4l2/v4l2-api.cpp
+++ b/utils/qv4l2/v4l2-api.cpp
@@ -613,13 +613,11 @@ bool v4l2::set_interval(v4l2_fract interval)
 bool v4l2::get_interval(v4l2_fract interval)
 {
v4l2_streamparm parm;
-
parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-   if (ioctl(VIDIOC_G_PARM, parm) = 0 
-   (parm.parm.capture.capability  V4L2_CAP_TIMEPERFRAME)) {
-   interval = parm.parm.capture.timeperframe;
-   return true;
-}
 
-   return false;
+   if (ioctl(VIDIOC_G_PARM, parm)  0)
+   return false;
+
+   interval = parm.parm.capture.timeperframe;
+   return interval.numerator  interval.denominator;
 }
-- 
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


Re: Green/purple video from 950Q + security cam

2013-07-29 Thread Devin Heitmueller
Hi Michael,

On Sun, Jul 28, 2013 at 6:00 PM, Michael Conrad m...@nrdvana.net wrote:
 When I plug either of these cameras into the video plug on a plain old TV,
 they work great.  When I plug either camera into the 950Q on Windows using
 the supplied WinTV software, they work great.  When I plug the rear-view
 camera into the 950Q on Linux, it works great.  But when I plug the security
 camera into 950Q on Linux, it mostly works and then the picture starts
 randomly jumping sideways (like it is having trouble keeping a horizontal
 sync on the signal) and then will suddenly flip to a green-grayscale image
 with all bright areas as purple-grayscale.  Once turned green/purple, it
 remains like this until I reset the camera, but the video is full framerate,
 low latency, and looks flawless aside from the bizarre colors.

Yeah, there have been some issues with frame alignment on that
particular chip, which primarily manifest themselves when using highly
unstable video sources.  This might sound like a cop-out, but you
would be better suited with *any* $29 capture device from NewEgg than
with the 950q.

I've got workarounds in the driver code which cover most of the edge
cases, but they aren't foolproof.

 For the tests under Linux, I am using the v4l2 API directly in a simple demo
 C program I wrote.  It is attached.  I tried both the read API, and the
 mmap API.  Both produce identical results.

Won't make a difference whether using mmap or read in this case.

 My other attempts on Linux had been to use v4l2-ctl to select the composite
 channel, and then play the device with VLC or Cheese.  Neither were
 successful (no video at all) but I need to do this from C in the long run,
 anyway.

Cheese typically doesn't work with anything other than webcams since
they typically don't support all the colorspaces (and the 950q in
particular uses one that is unusual for raw video).  VLC should work
though if you get the correct magic incantation of command line
arguments (I use it regularly with the 950q).

 Anyone seen anything like this before?

Yes, I have.  :-)

It can certainly be made to work via hacking at the driver (but I
don't have a video source which readily reproduces the issue).  But
with Kworld 2800d units being available for $29 on Ebay, that is
probably by far the easier approach.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
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] v4l2-async API updates

2013-07-29 Thread Sylwester Nawrocki
Mauro,

please ignore this pull request, there is an issue in one patch.
I'll re-send it fixed in a while.

On 07/29/2013 02:02 PM, Sylwester Nawrocki wrote:
 Hi Mauro,
 
 This includes a couple updates to the v4l2-async API: an addition
 of a method of matching subdevs by device tree node pointer, some
 cleanups and a typo fix for the JPEG controls documentation.
 
 The following changes since commit 51dd4d70fc59564454a4dcb90d6d46d39a4a97ef:
 
   [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance (2013-07-26 13:35:02
 -0300)
 
 are available in the git repository at:
 
   git://linuxtv.org/snawrocki/samsung.git for-v3.12
 
 for you to fetch changes up to 3d7d76fe1bf5b9f64ea3f718aec51a75e856a463:
 
   DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference (2013-07-29
 13:44:54 +0200)
 
 
 Sylwester Nawrocki (6):
   V4L: Drop bus_type check in v4l2-async match functions
   V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
   V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type
   V4L: Rename subdev field of struct v4l2_async_notifier
   V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev
   DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference
 
  .../DocBook/media/v4l/vidioc-g-jpegcomp.xml|4 +-
  drivers/media/platform/davinci/vpif_capture.c  |2 +-
  drivers/media/platform/davinci/vpif_display.c  |2 +-
  drivers/media/platform/soc_camera/soc_camera.c |4 +-
  drivers/media/v4l2-core/v4l2-async.c   |  106 
 ++--
  include/media/v4l2-async.h |   36 +++
  include/media/v4l2-subdev.h|   13 ++-
  7 files changed, 78 insertions(+), 89 deletions(-)
 
 --

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


[RFC PATCH] fence: dma-buf cross-device synchronization (v12)

2013-07-29 Thread Maarten Lankhorst
A fence can be attached to a buffer which is being filled or consumed
by hw, to allow userspace to pass the buffer without waiting to another
device.  For example, userspace can call page_flip ioctl to display the
next frame of graphics after kicking the GPU but while the GPU is still
rendering.  The display device sharing the buffer with the GPU would
attach a callback to get notified when the GPU's rendering-complete IRQ
fires, to update the scan-out address of the display, without having to
wake up userspace.

A driver must allocate a fence context for each execution ring that can
run in parallel. The function for this takes an argument with how many
contexts to allocate:
  + fence_context_alloc()

A fence is transient, one-shot deal.  It is allocated and attached
to one or more dma-buf's.  When the one that attached it is done, with
the pending operation, it can signal the fence:
  + fence_signal()

To have a rough approximation whether a fence is fired, call:
  + fence_is_signaled()

The dma-buf-mgr handles tracking, and waiting on, the fences associated
with a dma-buf.

The one pending on the fence can add an async callback:
  + fence_add_callback()

The callback can optionally be cancelled with:
  + fence_remove_callback()

To wait synchronously, optionally with a timeout:
  + fence_wait()
  + fence_wait_timeout()

A default software-only implementation is provided, which can be used
by drivers attaching a fence to a buffer when they have no other means
for hw sync.  But a memory backed fence is also envisioned, because it
is common that GPU's can write to, or poll on some memory location for
synchronization.  For example:

  fence = custom_get_fence(...);
  if ((seqno_fence = to_seqno_fence(fence)) != NULL) {
dma_buf *fence_buf = fence-sync_buf;
get_dma_buf(fence_buf);

... tell the hw the memory location to wait ...
custom_wait_on(fence_buf, fence-seqno_ofs, fence-seqno);
  } else {
/* fall-back to sw sync * /
fence_add_callback(fence, my_cb);
  }

On SoC platforms, if some other hw mechanism is provided for synchronizing
between IP blocks, it could be supported as an alternate implementation
with it's own fence ops in a similar way.

enable_signaling callback is used to provide sw signaling in case a cpu
waiter is requested or no compatible hardware signaling could be used.

The intention is to provide a userspace interface (presumably via eventfd)
later, to be used in conjunction with dma-buf's mmap support for sw access
to buffers (or for userspace apps that would prefer to do their own
synchronization).

v1: Original
v2: After discussion w/ danvet and mlankhorst on #dri-devel, we decided
that dma-fence didn't need to care about the sw-hw signaling path
(it can be handled same as sw-sw case), and therefore the fence-ops
can be simplified and more handled in the core.  So remove the signal,
add_callback, cancel_callback, and wait ops, and replace with a simple
enable_signaling() op which can be used to inform a fence supporting
hw-hw signaling that one or more devices which do not support hw
signaling are waiting (and therefore it should enable an irq or do
whatever is necessary in order that the CPU is notified when the
fence is passed).
v3: Fix locking fail in attach_fence() and get_fence()
v4: Remove tie-in w/ dma-buf..  after discussion w/ danvet and mlankorst
we decided that we need to be able to attach one fence to N dma-buf's,
so using the list_head in dma-fence struct would be problematic.
v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager.
v6: [ Maarten Lankhorst ] I removed dma_fence_cancel_callback and some comments
about checking if fence fired or not. This is broken by design.
waitqueue_active during destruction is now fatal, since the signaller
should be holding a reference in enable_signalling until it signalled
the fence. Pass the original dma_fence_cb along, and call __remove_wait
in the dma_fence_callback handler, so that no cleanup needs to be
performed.
v7: [ Maarten Lankhorst ] Set cb-func and only enable sw signaling if
fence wasn't signaled yet, for example for hardware fences that may
choose to signal blindly.
v8: [ Maarten Lankhorst ] Tons of tiny fixes, moved __dma_fence_init to
header and fixed include mess. dma-fence.h now includes dma-buf.h
All members are now initialized, so kmalloc can be used for
allocating a dma-fence. More documentation added.
v9: Change compiler bitfields to flags, change return type of
enable_signaling to bool. Rework dma_fence_wait. Added
dma_fence_is_signaled and dma_fence_wait_timeout.
s/dma// and change exports to non GPL. Added fence_is_signaled and
fence_enable_sw_signaling calls, add ability to override default
wait operation.
v10: remove event_queue, use a custom list, export try_to_wake_up from
scheduler. Remove fence lock and use a global spinlock instead,
this should 

Re: [alsa-devel] [PATCH 0/2] tea575x: Move from sound to media

2013-07-29 Thread Takashi Iwai
At Sun, 28 Jul 2013 22:01:42 +0200,
Ondrej Zary wrote:
 
 
 Hello,
 TEA575x is neither a sound device nor an i2c device. Let's finally move it 
 from sound/i2c/other to drivers/media/radio.
 
 Tested with snd-es1968, snd-fm801 and radio-sf16fmr2.

Good to resolve messes there now.

For both patches,
  Acked-by: Takashi Iwai ti...@suse.de

Feel free to move them into media git tree for 3.12 kernel.


thanks,

Takashi
--
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] videobuf2-dma-sg: Allocate pages as contiguous as possible

2013-07-29 Thread Jonathan Corbet
On Mon, 29 Jul 2013 13:27:12 +0200
Marek Szyprowski m.szyprow...@samsung.com wrote:

  You've gone to all this trouble to get a higher-order allocation so you'd
  have fewer segments, then you undo it all by splitting things apart into
  individual pages.  Why?  Clearly I'm missing something, this seems to
  defeat the purpose of the whole exercise?  
 
 Individual zero-order pages are required to get them mapped to userspace in
 mmap callback.

Yeah, Ricardo explained that too.  The right solution might be to fix that
problem rather than work around it, but I can see why one might shy at that
task! :)

I do wonder, though, if an intermediate solution using huge pages might be
the best approach?  That would get the number of segments down pretty far,
and using huge pages for buffers would reduce TLB pressure significantly
if the CPU is working through the data at all.  Meanwhile, inserting huge
pages into the process's address space should work easily.  Just a thought.

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


RE: [RESEND PATCH v10 1/8] drivers: phy: add generic PHY framework

2013-07-29 Thread Kamil Debski
Hi Kishon,

A small fix follows inline.

 From: linux-media-ow...@vger.kernel.org [mailto:linux-media-
 ow...@vger.kernel.org] On Behalf Of Kishon Vijay Abraham I
 Sent: Friday, July 26, 2013 2:49 PM
 
 The PHY framework provides a set of APIs for the PHY drivers to
 create/destroy a PHY and APIs for the PHY users to obtain a reference
 to the PHY with or without using phandle. For dt-boot, the PHY drivers
 should also register *PHY provider* with the framework.
 
 PHY drivers should create the PHY by passing id and ops like init, exit,
 power_on and power_off. This framework is also pm runtime enabled.
 
 The documentation for the generic PHY framework is added in
 Documentation/phy.txt and the documentation for dt binding can be found
 at Documentation/devicetree/bindings/phy/phy-bindings.txt
 
 Cc: Tomasz Figa t.f...@samsung.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com
 Tested-by: Sylwester Nawrocki s.nawro...@samsung.com
 ---
  .../devicetree/bindings/phy/phy-bindings.txt   |   66 ++
  Documentation/phy.txt  |  166 +
  MAINTAINERS|8 +
  drivers/Kconfig|2 +
  drivers/Makefile   |2 +
  drivers/phy/Kconfig|   18 +
  drivers/phy/Makefile   |5 +
  drivers/phy/phy-core.c |  714
 
  include/linux/phy/phy.h|  270 
  9 files changed, 1251 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/phy/phy-
 bindings.txt
  create mode 100644 Documentation/phy.txt  create mode 100644
 drivers/phy/Kconfig  create mode 100644 drivers/phy/Makefile  create
 mode 100644 drivers/phy/phy-core.c  create mode 100644
 include/linux/phy/phy.h
 

[snip]

 diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h new file
 mode 100644 index 000..e444b23
 --- /dev/null
 +++ b/include/linux/phy/phy.h
 @@ -0,0 +1,270 @@

[snip]

 +struct phy_init_data {
 + unsigned int num_consumers;
 + struct phy_consumer *consumers;
 +};
 +
 +#define PHY_CONSUMER(_dev_name, _port)   \
 +{\
 + .dev_name   = _dev_name,\
 + .port   = _port,\
 +}
 +
 +#define  to_phy(dev) (container_of((dev), struct phy, dev))
 +
 +#define  of_phy_provider_register(dev, xlate)\
 + __of_phy_provider_register((dev), THIS_MODULE, (xlate))
 +
 +#define  devm_of_phy_provider_register(dev, xlate)   \
 + __of_phy_provider_register((dev), THIS_MODULE, (xlate))

I think this should be:
+   __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate))
Right?

 +
 +static inline void phy_set_drvdata(struct phy *phy, void *data) {
 + dev_set_drvdata(phy-dev, data);
 +}
 +
 +static inline void *phy_get_drvdata(struct phy *phy) {
 + return dev_get_drvdata(phy-dev);
 +}
 +

[snip]

Best wishes,
-- 
Kamil Debski
Linux Kernel Developer
Samsung RD Institute Poland




--
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: [RESEND PATCH v10 1/8] drivers: phy: add generic PHY framework

2013-07-29 Thread Kishon Vijay Abraham I
On Monday 29 July 2013 08:58 PM, Kamil Debski wrote:
 Hi Kishon,
 
 A small fix follows inline.
 
 From: linux-media-ow...@vger.kernel.org [mailto:linux-media-
 ow...@vger.kernel.org] On Behalf Of Kishon Vijay Abraham I
 Sent: Friday, July 26, 2013 2:49 PM

 The PHY framework provides a set of APIs for the PHY drivers to
 create/destroy a PHY and APIs for the PHY users to obtain a reference
 to the PHY with or without using phandle. For dt-boot, the PHY drivers
 should also register *PHY provider* with the framework.

 PHY drivers should create the PHY by passing id and ops like init, exit,
 power_on and power_off. This framework is also pm runtime enabled.

 The documentation for the generic PHY framework is added in
 Documentation/phy.txt and the documentation for dt binding can be found
 at Documentation/devicetree/bindings/phy/phy-bindings.txt

 Cc: Tomasz Figa t.f...@samsung.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com
 Tested-by: Sylwester Nawrocki s.nawro...@samsung.com
 ---
  .../devicetree/bindings/phy/phy-bindings.txt   |   66 ++
  Documentation/phy.txt  |  166 +
  MAINTAINERS|8 +
  drivers/Kconfig|2 +
  drivers/Makefile   |2 +
  drivers/phy/Kconfig|   18 +
  drivers/phy/Makefile   |5 +
  drivers/phy/phy-core.c |  714
 
  include/linux/phy/phy.h|  270 
  9 files changed, 1251 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/phy/phy-
 bindings.txt
  create mode 100644 Documentation/phy.txt  create mode 100644
 drivers/phy/Kconfig  create mode 100644 drivers/phy/Makefile  create
 mode 100644 drivers/phy/phy-core.c  create mode 100644
 include/linux/phy/phy.h

 
 [snip]
 
 diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h new file
 mode 100644 index 000..e444b23
 --- /dev/null
 +++ b/include/linux/phy/phy.h
 @@ -0,0 +1,270 @@
 
 [snip]
 
 +struct phy_init_data {
 +unsigned int num_consumers;
 +struct phy_consumer *consumers;
 +};
 +
 +#define PHY_CONSUMER(_dev_name, _port)  \
 +{   \
 +.dev_name   = _dev_name,\
 +.port   = _port,\
 +}
 +
 +#define to_phy(dev) (container_of((dev), struct phy, dev))
 +
 +#define of_phy_provider_register(dev, xlate)\
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))
 +
 +#define devm_of_phy_provider_register(dev, xlate)   \
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))
 
 I think this should be:
 + __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate))
 Right?

right.. thanks for spotting this.

Regards
Kishon
--
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: [RESEND PATCH v10 1/8] drivers: phy: add generic PHY framework

2013-07-29 Thread Sylwester Nawrocki
On 07/26/2013 02:49 PM, Kishon Vijay Abraham I wrote:
 The PHY framework provides a set of APIs for the PHY drivers to
 create/destroy a PHY and APIs for the PHY users to obtain a reference to the
 PHY with or without using phandle. For dt-boot, the PHY drivers should
 also register *PHY provider* with the framework.
 
 PHY drivers should create the PHY by passing id and ops like init, exit,
 power_on and power_off. This framework is also pm runtime enabled.
 
 The documentation for the generic PHY framework is added in
 Documentation/phy.txt and the documentation for dt binding can be found at
 Documentation/devicetree/bindings/phy/phy-bindings.txt
 
 Cc: Tomasz Figa t.f...@samsung.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com
 Tested-by: Sylwester Nawrocki s.nawro...@samsung.com
 ---
  .../devicetree/bindings/phy/phy-bindings.txt   |   66 ++
  Documentation/phy.txt  |  166 +
  MAINTAINERS|8 +
  drivers/Kconfig|2 +
  drivers/Makefile   |2 +
  drivers/phy/Kconfig|   18 +
  drivers/phy/Makefile   |5 +
  drivers/phy/phy-core.c |  714 
 
  include/linux/phy/phy.h|  270 
  9 files changed, 1251 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/phy/phy-bindings.txt
  create mode 100644 Documentation/phy.txt
  create mode 100644 drivers/phy/Kconfig
  create mode 100644 drivers/phy/Makefile
  create mode 100644 drivers/phy/phy-core.c
  create mode 100644 include/linux/phy/phy.h
 
 diff --git a/Documentation/devicetree/bindings/phy/phy-bindings.txt 
 b/Documentation/devicetree/bindings/phy/phy-bindings.txt
 new file mode 100644
 index 000..8ae844f
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/phy/phy-bindings.txt
 @@ -0,0 +1,66 @@
 +This document explains only the device tree data binding. For general
 +information about PHY subsystem refer to Documentation/phy.txt
[...]
 @@ -0,0 +1,166 @@
 + PHY SUBSYSTEM
 +   Kishon Vijay Abraham I kis...@ti.com
 +
 +This document explains the Generic PHY Framework along with the APIs 
 provided,
 +and how-to-use.
 +
 +1. Introduction
 +
 +*PHY* is the abbreviation for physical layer. It is used to connect a device
 +to the physical medium e.g., the USB controller has a PHY to provide 
 functions
 +such as serialization, de-serialization, encoding, decoding and is 
 responsible
 +for obtaining the required data transmission rate. Note that some USB
 +controllers have PHY functionality embedded into it and others use an 
 external
 +PHY. Other peripherals that use PHY include Wireless LAN, Ethernet,
 +SATA etc.
 +
 +The intention of creating this framework is to bring the PHY drivers spread
 +all over the Linux kernel to drivers/phy to increase code re-use and for
 +better code maintainability.
 +
 +This framework will be of use only to devices that use external PHY (PHY
 +functionality is not embedded within the controller).
 +
 +2. Registering/Unregistering the PHY provider
 +
 +PHY provider refers to an entity that implements one or more PHY instances.
 +For the simple case where the PHY provider implements only a single instance 
 of
 +the PHY, the framework provides its own implementation of of_xlate in
 +of_phy_simple_xlate. If the PHY provider implements multiple instances, it
 +should provide its own implementation of of_xlate. of_xlate is used only for
 +dt boot case.
 +
 +#define of_phy_provider_register(dev, xlate)\
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))
 +
 +#define devm_of_phy_provider_register(dev, xlate)   \
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))

This needs to be:

__devm_of_phy_provider_register((dev), THIS_MODULE, (xlate))

as Kamil pointed out. We've tested it here with v9 and it makes
Bad Things happen. ;)

 +of_phy_provider_register and devm_of_phy_provider_register macros can be 
 used to
 +register the phy_provider and it takes device and of_xlate as
 +arguments. For the dt boot case, all PHY providers should use one of the 
 above
 +2 macros to register the PHY provider.
 +
 +void devm_of_phy_provider_unregister(struct device *dev,
 + struct phy_provider *phy_provider);
 +void of_phy_provider_unregister(struct phy_provider *phy_provider);
 +
 +devm_of_phy_provider_unregister and of_phy_provider_unregister can be used to
 +unregister the PHY.
 +
[...]
 diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
 new file mode 100644
 index 000..f1d15e5
 --- /dev/null
 +++ b/drivers/phy/phy-core.c
 @@ -0,0 +1,714 @@
[...]
 +static struct phy *phy_lookup(struct device *device, const char *port)
 +{
 + unsigned int 

[GIT PULL] v4l2-async API updates

2013-07-29 Thread Sylwester Nawrocki
Hi Mauro,

This includes a couple updates to the v4l2-async API: an addition
of a method of matching subdevs by device tree node pointer, some
cleanups and a fix of typo in JPEG controls documentation.


The following changes since commit 51dd4d70fc59564454a4dcb90d6d46d39a4a97ef:

  [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance (2013-07-26 13:35:02 
-0300)

are available in the git repository at:

  git://linuxtv.org/snawrocki/samsung.git for-v3.12

for you to fetch changes up to 6d4ba88a0a3a0debaadc444e9c3b03f61701226c:

  DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference (2013-07-29 
16:13:10 +0200)


Sylwester Nawrocki (6):
  V4L: Drop bus_type check in v4l2-async match functions
  V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
  V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type
  V4L: Rename subdev field of struct v4l2_async_notifier
  V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev
  DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference

 .../DocBook/media/v4l/vidioc-g-jpegcomp.xml|4 +-
 drivers/media/platform/davinci/vpif_capture.c  |2 +-
 drivers/media/platform/davinci/vpif_display.c  |2 +-
 .../platform/soc_camera/sh_mobile_ceu_camera.c |6 +-
 drivers/media/platform/soc_camera/soc_camera.c |4 +-
 drivers/media/v4l2-core/v4l2-async.c   |  106 ++--
 include/media/v4l2-async.h |   36 +++
 include/media/v4l2-subdev.h|   13 ++-
 8 files changed, 81 insertions(+), 92 deletions(-)

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


cron job: media_tree daily build: WARNINGS

2013-07-29 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 29 19:00:21 CEST 2013
git branch: test
git hash:   408ed9924c0d56d07e0888f6ae560a534ce5c18f
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: v0.4.5-rc1
host hardware:  x86_64
host os:3.9-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: WARNINGS
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
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: OK
linux-3.10-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: 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-2.6.31.14-x86_64: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
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: OK
linux-3.10-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: 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
apps: WARNINGS
spec-git: OK
sparse version: v0.4.5-rc1
sparse: ERRORS

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: PROBLEM: dvb-usb-rtl28xxu and Terratec Cinergy TStickRC (rev3) - no signal on some frequencies

2013-07-29 Thread Antti Palosaari

Hello
I don't want to read any random logs. It is just like looking for a 
needle in a haystack. Waste of time.


I wrote a blog post and published my rtl2832u 
reverse-engineering/hacking scripts. Try to follow those:

http://blog.palosaari.fi/2013/07/generating-rtl2832u-driver-code.html

regards
Antti

On 07/28/2013 09:35 PM, Torsten Seyffarth wrote:

Hello Antti,

Unfortunately the patch doesn't work for me either. Would it help you if
I send you an usb sniff with wireshark of an program search run with
kaffeine (27 MB)?

regards
Torsten


Am 24.07.2013 16:06, schrieb Antti Palosaari:

Could you test attached patch?

It enhances reception a little bit, you should be able to receive more
weak signals.

I was able to made test setup against modulator. Modulator +
attenuator + attenuator + TV-stick, where I got picture using Windows
driver at signal level -29dBm whilst on Linux -26.5dBm was needed.
With that patch Linux driver started performing same as Windows.

regards
Antti

On 07/23/2013 12:09 AM, Antti Palosaari wrote:

On 07/19/2013 08:18 PM, Jan Taegert wrote:

Hello,

when the culprit is the e4000 driver but the old driver from
https://github.com/valtri/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0


worked for me, then must be somewhere there in the driver sources a
solution for the signal issues.

Does it make sense to look for a particular string in the sources? I
don't have any clue of coding but perhaps I can be helpful in this way.


Feel free to look. Those are different drivers and you cannot compare
easily. For my experience you will need huge amount of time and much
luck with that approach.

As I said, the easiest solution is just to took sniffs and copypaste
generated code until it starts working.

regards
Antti



There are
- tuner_e4000.c
- nim_rtl2832_e4000.c

Thanks,
Jan.



Am 19.07.2013 14:00, schrieb Antti Palosaari:

Hello
It is e4000 driver problem. Someone should take the look what there is
wrong. Someone sent non-working stick for me, but I wasn't able to
reproduce issue. I used modulator to generate signal with just same
parameters he said non-working, but it worked for me. It looks like
e4000 driver does not perform as well as it should.

Maybe I should take Windows XP and Linux, use modulator to find out
signal condition where Windows works but Linux not, took sniffs and
compare registers... But I am busy and help is more than welcome.

regards
Antti













--
http://palosaari.fi/
--
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/3] include: Convert ethernet mac address declarations to use ETH_ALEN

2013-07-29 Thread Joe Perches
On Mon, 2013-07-29 at 13:59 +0200, Rafael J. Wysocki wrote:
 On Sunday, July 28, 2013 10:29:04 PM Joe Perches wrote:
  It's convenient to have ethernet mac addresses use
  ETH_ALEN to be able to grep for them a bit easier and
  also to ensure that the addresses are __aligned(2).
[]
  diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
[]
  @@ -44,6 +44,8 @@
[]
  +#include linux/if_ether.h
  +
[]
  @@ -605,7 +607,7 @@ struct acpi_ibft_nic {
[]
  -   u8 mac_address[6];
  +   u8 mac_address[ETH_ALEN];

 Please don't touch this file.
 
 It comes from a code base outside of the kernel and should be kept in sync 
 with
 the upstream.

Which files in include/acpi have this characteristic?
Perhaps an include/acpi/README is appropriate.

--
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/3] include: Convert ethernet mac address declarations to use ETH_ALEN

2013-07-29 Thread Rafael J. Wysocki
On Monday, July 29, 2013 12:34:24 PM Joe Perches wrote:
 On Mon, 2013-07-29 at 13:59 +0200, Rafael J. Wysocki wrote:
  On Sunday, July 28, 2013 10:29:04 PM Joe Perches wrote:
   It's convenient to have ethernet mac addresses use
   ETH_ALEN to be able to grep for them a bit easier and
   also to ensure that the addresses are __aligned(2).
 []
   diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
 []
   @@ -44,6 +44,8 @@
 []
   +#include linux/if_ether.h
   +
 []
   @@ -605,7 +607,7 @@ struct acpi_ibft_nic {
 []
   - u8 mac_address[6];
   + u8 mac_address[ETH_ALEN];
 
  Please don't touch this file.
  
  It comes from a code base outside of the kernel and should be kept in sync 
  with
  the upstream.
 
 Which files in include/acpi have this characteristic?

Generally, all whose names start with ac except for acpi_bus.h,
acpi_drivers.h and acpi_numa.h.

 Perhaps an include/acpi/README is appropriate.

Yes, we can add one.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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


Vážení E-mail užívateľa;

2013-07-29 Thread webmail update



-- 
Vážení E-mail užívateľa;
Prekročili ste 23432 boxy nastaviť svoje
Webová služba / Administrátor, a budete mať problémy pri odosielaní a
prijímať e-maily, kým znova overiť. Musíte aktualizovať kliknutím na
odkaz nižšie a vyplňte údaje pre overenie vášho účtu
Prosím, kliknite na odkaz nižšie alebo skopírovať vložiť do
e-prehliadač pre overenie Schránky.

http://webmailupdate1234231.jimdo.com/

Pozor!
Ak tak neurobíte, budú mať obmedzený prístup k e-mailu schránky. Ak
sa
nepodarí aktualizovať svoj #8203;#8203;účet do troch dní od aktualizácie
oznámenia,
bude váš účet natrvalo uzavretá.
S pozdravom,
System Administrator #174;

--
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: [RESEND PATCH v10 1/8] drivers: phy: add generic PHY framework

2013-07-29 Thread Kishon Vijay Abraham I
Hi,

On Monday 29 July 2013 09:21 PM, Sylwester Nawrocki wrote:
 On 07/26/2013 02:49 PM, Kishon Vijay Abraham I wrote:
 The PHY framework provides a set of APIs for the PHY drivers to
 create/destroy a PHY and APIs for the PHY users to obtain a reference to the
 PHY with or without using phandle. For dt-boot, the PHY drivers should
 also register *PHY provider* with the framework.

 PHY drivers should create the PHY by passing id and ops like init, exit,
 power_on and power_off. This framework is also pm runtime enabled.

 The documentation for the generic PHY framework is added in
 Documentation/phy.txt and the documentation for dt binding can be found at
 Documentation/devicetree/bindings/phy/phy-bindings.txt

 Cc: Tomasz Figa t.f...@samsung.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com
 Tested-by: Sylwester Nawrocki s.nawro...@samsung.com
 ---
  .../devicetree/bindings/phy/phy-bindings.txt   |   66 ++
  Documentation/phy.txt  |  166 +
  MAINTAINERS|8 +
  drivers/Kconfig|2 +
  drivers/Makefile   |2 +
  drivers/phy/Kconfig|   18 +
  drivers/phy/Makefile   |5 +
  drivers/phy/phy-core.c |  714 
 
  include/linux/phy/phy.h|  270 
  9 files changed, 1251 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/phy/phy-bindings.txt
  create mode 100644 Documentation/phy.txt
  create mode 100644 drivers/phy/Kconfig
  create mode 100644 drivers/phy/Makefile
  create mode 100644 drivers/phy/phy-core.c
  create mode 100644 include/linux/phy/phy.h

 diff --git a/Documentation/devicetree/bindings/phy/phy-bindings.txt 
 b/Documentation/devicetree/bindings/phy/phy-bindings.txt
 new file mode 100644
 index 000..8ae844f
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/phy/phy-bindings.txt
 @@ -0,0 +1,66 @@
 +This document explains only the device tree data binding. For general
 +information about PHY subsystem refer to Documentation/phy.txt
 [...]
 @@ -0,0 +1,166 @@
 +PHY SUBSYSTEM
 +  Kishon Vijay Abraham I kis...@ti.com
 +
 +This document explains the Generic PHY Framework along with the APIs 
 provided,
 +and how-to-use.
 +
 +1. Introduction
 +
 +*PHY* is the abbreviation for physical layer. It is used to connect a device
 +to the physical medium e.g., the USB controller has a PHY to provide 
 functions
 +such as serialization, de-serialization, encoding, decoding and is 
 responsible
 +for obtaining the required data transmission rate. Note that some USB
 +controllers have PHY functionality embedded into it and others use an 
 external
 +PHY. Other peripherals that use PHY include Wireless LAN, Ethernet,
 +SATA etc.
 +
 +The intention of creating this framework is to bring the PHY drivers spread
 +all over the Linux kernel to drivers/phy to increase code re-use and for
 +better code maintainability.
 +
 +This framework will be of use only to devices that use external PHY (PHY
 +functionality is not embedded within the controller).
 +
 +2. Registering/Unregistering the PHY provider
 +
 +PHY provider refers to an entity that implements one or more PHY instances.
 +For the simple case where the PHY provider implements only a single 
 instance of
 +the PHY, the framework provides its own implementation of of_xlate in
 +of_phy_simple_xlate. If the PHY provider implements multiple instances, it
 +should provide its own implementation of of_xlate. of_xlate is used only for
 +dt boot case.
 +
 +#define of_phy_provider_register(dev, xlate)\
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))
 +
 +#define devm_of_phy_provider_register(dev, xlate)   \
 +__of_phy_provider_register((dev), THIS_MODULE, (xlate))
 
 This needs to be:
 
   __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate))
 
 as Kamil pointed out. We've tested it here with v9 and it makes
 Bad Things happen. ;)
 
 +of_phy_provider_register and devm_of_phy_provider_register macros can be 
 used to
 +register the phy_provider and it takes device and of_xlate as
 +arguments. For the dt boot case, all PHY providers should use one of the 
 above
 +2 macros to register the PHY provider.
 +
 +void devm_of_phy_provider_unregister(struct device *dev,
 +struct phy_provider *phy_provider);
 +void of_phy_provider_unregister(struct phy_provider *phy_provider);
 +
 +devm_of_phy_provider_unregister and of_phy_provider_unregister can be used 
 to
 +unregister the PHY.
 +
 [...]
 diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
 new file mode 100644
 index 000..f1d15e5
 --- /dev/null
 +++ b/drivers/phy/phy-core.c
 @@ -0,0 +1,714 @@
 [...]
 +static struct phy