Re: [PATCH/RFC v6 3/3] leds: Add LED Flash Class wrapper to LED subsystem

2014-11-04 Thread Jacek Anaszewski

Hi Bryan,

Thanks for a review.

On 11/04/2014 02:34 AM, Bryan Wu wrote:

On Mon, Sep 22, 2014 at 8:21 AM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:

Some LED devices support two operation modes - torch and flash.


I got several terms here:
flash, torch and indicator.

And we have 3 CAPs
CAP_TORCH
CAP_FLASH
CAP_INDICATOR

I assume flash == indicator but it doesn't from the code. So what's
the difference between flash and indicator.


Indicator is a so-called privacy led, that can be used to indicate
when a person is being photographed or filmed. V4L2 API defines
only an API for setting its intensity.

Adding Sakari.


This patch provides support for flash LED devices in the LED subsystem
by introducing new sysfs attributes and kernel internal interface.
The attributes being introduced are: flash_brightness, flash_strobe,
flash_timeout, max_flash_timeout, max_flash_brightness, flash_fault,
indicator_brightness and  max_indicator_brightness. All the flash
related features are placed in a separate module.



There is no torch interface? only flash and indicator.


LED Class interface is used for torch.


The modifications aim to be compatible with V4L2 framework requirements
related to the flash devices management. The design assumes that V4L2
sub-device can take of the LED class device control and communicate
with it through the kernel internal interface. When V4L2 Flash sub-device
file is opened, the LED class device sysfs interface is made
unavailable.

Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Acked-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Bryan Wu coolo...@gmail.com
Cc: Richard Purdie rpur...@rpsys.net
---
  drivers/leds/Kconfig|   11 +
  drivers/leds/Makefile   |1 +
  drivers/leds/led-class-flash.c  |  557 +++
  drivers/leds/led-class.c|4 +
  include/linux/led-class-flash.h |  238 +
  include/linux/leds.h|3 +
  6 files changed, 814 insertions(+)
  create mode 100644 drivers/leds/led-class-flash.c
  create mode 100644 include/linux/led-class-flash.h

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 8c96e2d..3c58021 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -22,6 +22,17 @@ config LEDS_CLASS
   This option enables the led sysfs class in /sys/class/leds.  You'll
   need this to do anything useful with LEDs.  If unsure, say N.

+config LEDS_CLASS_FLASH
+   tristate LED Flash Class Support
+   depends on LEDS_CLASS
+   depends on OF
+   help
+ This option enables the flash led sysfs class in /sys/class/leds.
+ It wrapps LED Class and adds flash LEDs specific sysfs attributes
+ and kernel internal API to it. You'll need this to provide support
+ for the flash related features of a LED device. It can be built
+ as a module.
+
  comment LED drivers

  config LEDS_88PM860X
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index d8cc5f2..9238b8a 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -2,6 +2,7 @@
  # LED Core
  obj-$(CONFIG_NEW_LEDS) += led-core.o
  obj-$(CONFIG_LEDS_CLASS)   += led-class.o
+obj-$(CONFIG_LEDS_CLASS_FLASH) += led-class-flash.o
  obj-$(CONFIG_LEDS_TRIGGERS)+= led-triggers.o

  # LED Platform Drivers
diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
new file mode 100644
index 000..f1ba539
--- /dev/null
+++ b/drivers/leds/led-class-flash.c
@@ -0,0 +1,557 @@
+/*
+ * LED Flash Class interface
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd.
+ * Author: Jacek Anaszewski j.anaszew...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/device.h
+#include linux/init.h
+#include linux/leds.h
+#include linux/led-class-flash.h
+#include linux/module.h
+#include linux/slab.h
+#include leds.h
+
+#define has_flash_op(flash, op)\
+   (flash  flash-ops-op)
+
+#define call_flash_op(flash, op, args...)  \
+   ((has_flash_op(flash, op)) ?\
+   (flash-ops-op(flash, args)) : \
+   -EINVAL)
+
+static ssize_t flash_brightness_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t size)
+{
+   struct led_classdev *led_cdev = dev_get_drvdata(dev);
+   struct led_classdev_flash *flash = lcdev_to_flash(led_cdev);
+   unsigned long state;
+   ssize_t ret;
+
+   mutex_lock(led_cdev-led_access);
+
+   if (led_sysfs_is_disabled(led_cdev)) {
+   ret = -EBUSY;
+   goto unlock;
+   }
+
+   ret = kstrtoul(buf, 10, state);
+   if (ret)
+   goto unlock;
+
+   ret = 

Re: [PATCH] staging: media: lirc: replace dev_err by pr_err

2014-11-04 Thread Sudip Mukherjee
On Tue, Nov 04, 2014 at 02:13:19AM +0200, Aya Mahfouz wrote:
 This patch replaces dev_err by pr_err since the value
 of ir is NULL when the message is displayed.
 
 Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
 ---
  drivers/staging/media/lirc/lirc_zilog.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
 b/drivers/staging/media/lirc/lirc_zilog.c
 index 11a7cb1..ecdd71e 100644
 --- a/drivers/staging/media/lirc/lirc_zilog.c
 +++ b/drivers/staging/media/lirc/lirc_zilog.c
 @@ -1633,7 +1633,7 @@ out_put_xx:
  out_put_ir:
   put_ir_device(ir, true);
  out_no_ir:
 - dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
 + pr_err(%s: probing IR %s on %s (i2c-%d) failed with %d\n,
hi,
instead of ir-l.dev , can you please try dev_err like this :

dev_err(client-dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
__func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
ret);   

thanks
sudip


   __func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
  ret);
   mutex_unlock(ir_devices_lock);
 -- 
 1.9.3
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/15] [media] Make mediabus format subsystem neutral

2014-11-04 Thread Boris Brezillon
Hello,

This patch series prepares the use of media bus formats outside of
the V4L2 subsytem (my final goal is to use it in the Atmel HLCDC DRM
driver where I have to configure my DPI/RGB bus according to the
connected display).

The series first defines a new enum with a neutral name (media_bus_format),
and then replace all references to the old enum and its values within the
kernel.

It also deprecates the v4l2_mbus_pixelcode enum and the v4l2-mediabus.h
header. Kernel users can't use the v4l2_mbus_pixelcode enum anymore and new
user-space users are encouraged to move to the media_bus_format enum
and include v4l2-mbus.h.

Hans, I'm not sure this is exactly what you had in mind for
v4l2_mbus_pixelcode deprecation. If you agree with this approach, and think
it is worth it, I can reorder the series and squash the last 4 patches into
previous ones (patches 4, 9, 6 and 8)

Best Regards,

Boris

Boris Brezillon (15):
  [media] Move mediabus format definition to a more standard place
  [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values
  [media] Make use of the new media_bus_format definitions
  [media] i2c: Make use of media_bus_format enum
  [media] pci: Make use of media_bus_format enum
  [media] platform: Make use of media_bus_format enum
  [media] usb: Make use of media_bus_format enum
  staging: media: Make use of media_bus_format enum
  gpu: ipu-v3: Make use of media_bus_format enum
  [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the
kernel
  [media] Deprecate v4l2_mbus_pixelcode
  [media] i2c: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h
  gpu: ipu-v3: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h
  [media] platform: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h
  staging: media: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h

 Documentation/DocBook/media/Makefile   |   4 +-
 Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++---
 Documentation/video4linux/soc-camera.txt   |   2 +-
 arch/arm/mach-davinci/board-dm355-evm.c|   2 +-
 arch/arm/mach-davinci/board-dm365-evm.c|   4 +-
 arch/arm/mach-davinci/dm355.c  |   6 +-
 arch/arm/mach-davinci/dm365.c  |   6 +-
 arch/arm/mach-shmobile/board-mackerel.c|   2 +-
 arch/sh/boards/mach-ap325rxa/setup.c   |   2 +-
 drivers/gpu/ipu-v3/ipu-csi.c   |  68 ++---
 drivers/media/i2c/adv7170.c|  16 +-
 drivers/media/i2c/adv7175.c|  16 +-
 drivers/media/i2c/adv7180.c|   6 +-
 drivers/media/i2c/adv7183.c|   6 +-
 drivers/media/i2c/adv7604.c|  72 ++---
 drivers/media/i2c/adv7842.c|   6 +-
 drivers/media/i2c/ak881x.c |   8 +-
 drivers/media/i2c/cx25840/cx25840-core.c   |   2 +-
 drivers/media/i2c/m5mols/m5mols_core.c |   6 +-
 drivers/media/i2c/ml86v7667.c  |   6 +-
 drivers/media/i2c/mt9m032.c|   8 +-
 drivers/media/i2c/mt9p031.c|   8 +-
 drivers/media/i2c/mt9t001.c|  10 +-
 drivers/media/i2c/mt9v011.c|   6 +-
 drivers/media/i2c/mt9v032.c|  14 +-
 drivers/media/i2c/noon010pc30.c|  12 +-
 drivers/media/i2c/ov7670.c |  16 +-
 drivers/media/i2c/ov9650.c |  10 +-
 drivers/media/i2c/s5c73m3/s5c73m3.h|   6 +-
 drivers/media/i2c/s5k4ecgx.c   |   4 +-
 drivers/media/i2c/s5k5baf.c|  14 +-
 drivers/media/i2c/s5k6a3.c |   2 +-
 drivers/media/i2c/s5k6aa.c |   8 +-
 drivers/media/i2c/saa6752hs.c  |   6 +-
 drivers/media/i2c/saa7115.c|   2 +-
 drivers/media/i2c/saa717x.c|   2 +-
 drivers/media/i2c/smiapp/smiapp-core.c |  34 +--
 drivers/media/i2c/soc_camera/imx074.c  |  10 +-
 drivers/media/i2c/soc_camera/mt9m001.c |  14 +-
 drivers/media/i2c/soc_camera/mt9m111.c |  72 ++---
 drivers/media/i2c/soc_camera/mt9t031.c |  12 +-
 drivers/media/i2c/soc_camera/mt9t112.c |  24 +-
 drivers/media/i2c/soc_camera/mt9v022.c |  26 +-
 drivers/media/i2c/soc_camera/ov2640.c  |  56 ++--
 drivers/media/i2c/soc_camera/ov5642.c  |  10 +-
 drivers/media/i2c/soc_camera/ov6650.c  |  60 ++--
 drivers/media/i2c/soc_camera/ov772x.c  |  22 +-
 drivers/media/i2c/soc_camera/ov9640.c  |  42 +--
 drivers/media/i2c/soc_camera/ov9740.c  |  14 +-
 drivers/media/i2c/soc_camera/rj54n1cb0c.c  |  56 ++--
 drivers/media/i2c/soc_camera/tw9910.c  |  12 +-
 drivers/media/i2c/sr030pc30.c

[PATCH 09/15] gpu: ipu-v3: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Reference new definitions in the ipu-v3 driver.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/gpu/ipu-v3/ipu-csi.c | 66 ++--
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index d6f56471..752cdd2 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -227,83 +227,83 @@ static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, 
u32 pixel_clk,
 static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code)
 {
switch (mbus_code) {
-   case V4L2_MBUS_FMT_BGR565_2X8_BE:
-   case V4L2_MBUS_FMT_BGR565_2X8_LE:
-   case V4L2_MBUS_FMT_RGB565_2X8_BE:
-   case V4L2_MBUS_FMT_RGB565_2X8_LE:
+   case MEDIA_BUS_FMT_BGR565_2X8_BE:
+   case MEDIA_BUS_FMT_BGR565_2X8_LE:
+   case MEDIA_BUS_FMT_RGB565_2X8_BE:
+   case MEDIA_BUS_FMT_RGB565_2X8_LE:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_RGB565;
cfg-mipi_dt = MIPI_DT_RGB565;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE:
-   case V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE:
+   case MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE:
+   case MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_RGB444;
cfg-mipi_dt = MIPI_DT_RGB444;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE:
-   case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE:
+   case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE:
+   case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_RGB555;
cfg-mipi_dt = MIPI_DT_RGB555;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_UYVY8_2X8:
+   case MEDIA_BUS_FMT_UYVY8_2X8:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY;
cfg-mipi_dt = MIPI_DT_YUV422;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_YUYV8_2X8:
+   case MEDIA_BUS_FMT_YUYV8_2X8:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV;
cfg-mipi_dt = MIPI_DT_YUV422;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_UYVY8_1X16:
+   case MEDIA_BUS_FMT_UYVY8_1X16:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY;
cfg-mipi_dt = MIPI_DT_YUV422;
cfg-data_width = IPU_CSI_DATA_WIDTH_16;
break;
-   case V4L2_MBUS_FMT_YUYV8_1X16:
+   case MEDIA_BUS_FMT_YUYV8_1X16:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV;
cfg-mipi_dt = MIPI_DT_YUV422;
cfg-data_width = IPU_CSI_DATA_WIDTH_16;
break;
-   case V4L2_MBUS_FMT_SBGGR8_1X8:
-   case V4L2_MBUS_FMT_SGBRG8_1X8:
-   case V4L2_MBUS_FMT_SGRBG8_1X8:
-   case V4L2_MBUS_FMT_SRGGB8_1X8:
+   case MEDIA_BUS_FMT_SBGGR8_1X8:
+   case MEDIA_BUS_FMT_SGBRG8_1X8:
+   case MEDIA_BUS_FMT_SGRBG8_1X8:
+   case MEDIA_BUS_FMT_SRGGB8_1X8:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
cfg-mipi_dt = MIPI_DT_RAW8;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8:
-   case V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8:
-   case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8:
-   case V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8:
-   case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE:
-   case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE:
-   case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE:
-   case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE:
+   case MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8:
+   case MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8:
+   case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8:
+   case MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8:
+   case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE:
+   case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE:
+   case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE:
+   case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE:
cfg-data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
cfg-mipi_dt = MIPI_DT_RAW10;
cfg-data_width = IPU_CSI_DATA_WIDTH_8;
break;
-   case V4L2_MBUS_FMT_SBGGR10_1X10:
-   case V4L2_MBUS_FMT_SGBRG10_1X10:
-   case V4L2_MBUS_FMT_SGRBG10_1X10:
-   case V4L2_MBUS_FMT_SRGGB10_1X10:
+   case MEDIA_BUS_FMT_SBGGR10_1X10:
+   case MEDIA_BUS_FMT_SGBRG10_1X10:
+   case MEDIA_BUS_FMT_SGRBG10_1X10:
+   case MEDIA_BUS_FMT_SRGGB10_1X10:
cfg-data_fmt = 

[PATCH 06/15] [media] platform: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Reference new definitions in all platform drivers.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 Documentation/video4linux/soc-camera.txt   |   2 +-
 arch/arm/mach-davinci/board-dm355-evm.c|   2 +-
 arch/arm/mach-davinci/board-dm365-evm.c|   4 +-
 arch/arm/mach-davinci/dm355.c  |   6 +-
 arch/arm/mach-davinci/dm365.c  |   6 +-
 arch/arm/mach-shmobile/board-mackerel.c|   2 +-
 arch/sh/boards/mach-ap325rxa/setup.c   |   2 +-
 drivers/media/platform/blackfin/bfin_capture.c |  14 +--
 drivers/media/platform/davinci/vpbe.c  |   2 +-
 drivers/media/platform/davinci/vpfe_capture.c  |   4 +-
 drivers/media/platform/exynos-gsc/gsc-core.c   |   8 +-
 drivers/media/platform/exynos-gsc/gsc-core.h   |   2 +-
 drivers/media/platform/exynos4-is/fimc-capture.c   |   2 +-
 drivers/media/platform/exynos4-is/fimc-core.c  |  14 +--
 drivers/media/platform/exynos4-is/fimc-core.h  |   4 +-
 drivers/media/platform/exynos4-is/fimc-isp.c   |  16 +--
 drivers/media/platform/exynos4-is/fimc-lite-reg.c  |  26 ++---
 drivers/media/platform/exynos4-is/fimc-lite.c  |  14 +--
 drivers/media/platform/exynos4-is/fimc-reg.c   |  14 +--
 drivers/media/platform/exynos4-is/mipi-csis.c  |  14 +--
 drivers/media/platform/marvell-ccic/mcam-core.c|  22 ++--
 drivers/media/platform/marvell-ccic/mcam-core.h|   2 +-
 drivers/media/platform/omap3isp/ispccdc.c  | 112 ++---
 drivers/media/platform/omap3isp/ispccp2.c  |  18 ++--
 drivers/media/platform/omap3isp/ispcsi2.c  |  42 
 drivers/media/platform/omap3isp/isppreview.c   |  58 +--
 drivers/media/platform/omap3isp/ispresizer.c   |  18 ++--
 drivers/media/platform/omap3isp/ispvideo.c |  94 -
 drivers/media/platform/omap3isp/ispvideo.h |  10 +-
 drivers/media/platform/s3c-camif/camif-capture.c   |  10 +-
 drivers/media/platform/s3c-camif/camif-regs.c  |   8 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c   |   2 +-
 drivers/media/platform/s5p-tv/sdo_drv.c|   2 +-
 drivers/media/platform/sh_vou.c|   8 +-
 drivers/media/platform/soc_camera/atmel-isi.c  |  22 ++--
 drivers/media/platform/soc_camera/mx2_camera.c |  24 ++---
 drivers/media/platform/soc_camera/mx3_camera.c |   6 +-
 drivers/media/platform/soc_camera/omap1_camera.c   |  36 +++
 drivers/media/platform/soc_camera/pxa_camera.c |  16 +--
 drivers/media/platform/soc_camera/rcar_vin.c   |  14 +--
 .../platform/soc_camera/sh_mobile_ceu_camera.c |  20 ++--
 drivers/media/platform/soc_camera/sh_mobile_csi2.c |  38 +++
 drivers/media/platform/soc_camera/soc_camera.c |   2 +-
 .../platform/soc_camera/soc_camera_platform.c  |   2 +-
 drivers/media/platform/soc_camera/soc_mediabus.c   |  78 +++---
 drivers/media/platform/via-camera.c|   8 +-
 drivers/media/platform/vsp1/vsp1_bru.c |  14 +--
 drivers/media/platform/vsp1/vsp1_hsit.c|  12 +--
 drivers/media/platform/vsp1/vsp1_lif.c |  10 +-
 drivers/media/platform/vsp1/vsp1_lut.c |  14 +--
 drivers/media/platform/vsp1/vsp1_rwpf.c|  10 +-
 drivers/media/platform/vsp1/vsp1_sru.c |  12 +--
 drivers/media/platform/vsp1/vsp1_uds.c |  10 +-
 drivers/media/platform/vsp1/vsp1_video.c   |  42 
 include/media/davinci/vpbe.h   |   2 +-
 include/media/davinci/vpbe_venc.h  |   4 +-
 include/media/exynos-fimc.h|   2 +-
 include/media/soc_camera.h |   2 +-
 include/media/soc_mediabus.h   |   6 +-
 59 files changed, 485 insertions(+), 485 deletions(-)

diff --git a/Documentation/video4linux/soc-camera.txt 
b/Documentation/video4linux/soc-camera.txt
index daa9e2a..84f41cf 100644
--- a/Documentation/video4linux/soc-camera.txt
+++ b/Documentation/video4linux/soc-camera.txt
@@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides 
support to
 conveniently manage these formats. A table of standard transformations is
 maintained by soc-camera core, which describes, what FOURCC pixel format will
 be obtained, if a media-bus pixel format is stored in memory according to
-certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
+certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
 sample and stored in memory in the little-endian order with no gaps between
 bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These
 standard transformations will be used by 

[PATCH 15/15] staging: media: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h

2014-11-04 Thread Boris Brezillon
The v4l2-mediabus.h header is now deprecated and should be replaced with
v4l2-mbus.h.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/staging/media/omap4iss/iss_csi2.c  | 2 +-
 drivers/staging/media/omap4iss/iss_video.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss_csi2.c 
b/drivers/staging/media/omap4iss/iss_csi2.c
index b72e530..f47e4e5 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -13,7 +13,7 @@
 
 #include linux/delay.h
 #include media/v4l2-common.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/mm.h
 
 #include iss.h
diff --git a/drivers/staging/media/omap4iss/iss_video.h 
b/drivers/staging/media/omap4iss/iss_video.h
index cc8146b..a028b51 100644
--- a/drivers/staging/media/omap4iss/iss_video.h
+++ b/drivers/staging/media/omap4iss/iss_video.h
@@ -14,7 +14,7 @@
 #ifndef OMAP4_ISS_VIDEO_H
 #define OMAP4_ISS_VIDEO_H
 
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include media/media-entity.h
 #include media/v4l2-dev.h
 #include media/v4l2-fh.h
-- 
1.9.1

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


[PATCH 07/15] [media] usb: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Reference new definitions in all usb drivers.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/media/usb/cx231xx/cx231xx-417.c   | 2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c | 4 ++--
 drivers/media/usb/em28xx/em28xx-camera.c  | 2 +-
 drivers/media/usb/go7007/go7007-v4l2.c| 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c   | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c 
b/drivers/media/usb/cx231xx/cx231xx-417.c
index 459bb0e..95653ba 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1878,7 +1878,7 @@ static int cx231xx_s_video_encoding(struct 
cx2341x_handler *cxhdl, u32 val)
/* fix videodecoder resolution */
fmt.width = cxhdl-width / (is_mpeg1 ? 2 : 1);
fmt.height = cxhdl-height;
-   fmt.code = V4L2_MBUS_FMT_FIXED;
+   fmt.code = MEDIA_BUS_FMT_FIXED;
v4l2_subdev_call(dev-sd_cx25840, video, s_mbus_fmt, fmt);
return 0;
 }
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c 
b/drivers/media/usb/cx231xx/cx231xx-video.c
index 3b3ada6..989d527 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -967,7 +967,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void 
*priv,
dev-height = f-fmt.pix.height;
dev-format = fmt;
 
-   v4l2_fill_mbus_format(mbus_fmt, f-fmt.pix, V4L2_MBUS_FMT_FIXED);
+   v4l2_fill_mbus_format(mbus_fmt, f-fmt.pix, MEDIA_BUS_FMT_FIXED);
call_all(dev, video, s_mbus_fmt, mbus_fmt);
v4l2_fill_pix_format(f-fmt.pix, mbus_fmt);
 
@@ -1012,7 +1012,7 @@ static int vidioc_s_std(struct file *file, void *priv, 
v4l2_std_id norm)
   resolution (since a standard change effects things like the number
   of lines in VACT, etc) */
memset(mbus_fmt, 0, sizeof(mbus_fmt));
-   mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
+   mbus_fmt.code = MEDIA_BUS_FMT_FIXED;
mbus_fmt.width = dev-width;
mbus_fmt.height = dev-height;
call_all(dev, video, s_mbus_fmt, mbus_fmt);
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c 
b/drivers/media/usb/em28xx/em28xx-camera.c
index 6d2ea9a..38cf6c8 100644
--- a/drivers/media/usb/em28xx/em28xx-camera.c
+++ b/drivers/media/usb/em28xx/em28xx-camera.c
@@ -430,7 +430,7 @@ int em28xx_init_camera(struct em28xx *dev)
break;
}
 
-   fmt.code = V4L2_MBUS_FMT_YUYV8_2X8;
+   fmt.code = MEDIA_BUS_FMT_YUYV8_2X8;
fmt.width = 640;
fmt.height = 480;
v4l2_subdev_call(subdev, video, s_mbus_fmt, fmt);
diff --git a/drivers/media/usb/go7007/go7007-v4l2.c 
b/drivers/media/usb/go7007/go7007-v4l2.c
index ec799b4..d6bf982 100644
--- a/drivers/media/usb/go7007/go7007-v4l2.c
+++ b/drivers/media/usb/go7007/go7007-v4l2.c
@@ -252,7 +252,7 @@ static int set_capture_size(struct go7007 *go, struct 
v4l2_format *fmt, int try)
if (go-board_info-sensor_flags  GO7007_SENSOR_SCALING) {
struct v4l2_mbus_framefmt mbus_fmt;
 
-   mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
+   mbus_fmt.code = MEDIA_BUS_FMT_FIXED;
mbus_fmt.width = fmt ? fmt-fmt.pix.width : width;
mbus_fmt.height = height;
go-encoder_h_halve = 0;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 9623b62..2fd9b5e 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -2966,7 +2966,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
memset(fmt, 0, sizeof(fmt));
fmt.width = hdw-res_hor_val;
fmt.height = hdw-res_ver_val;
-   fmt.code = V4L2_MBUS_FMT_FIXED;
+   fmt.code = MEDIA_BUS_FMT_FIXED;
pvr2_trace(PVR2_TRACE_CHIPS, subdev v4l2 set_size(%dx%d),
   fmt.width, fmt.height);
v4l2_device_call_all(hdw-v4l2_dev, 0, video, s_mbus_fmt, 
fmt);
-- 
1.9.1

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


[PATCH 11/15] [media] Deprecate v4l2_mbus_pixelcode

2014-11-04 Thread Boris Brezillon
The v4l2_mbus_pixelcode enum (or its values) should be replaced by the
media_bus_format enum.
Keep this enum in v4l2-mediabus.h and create a new header containing
the v4l2_mbus_framefmt struct definition (which is not deprecated) so
that we can add a #warning statement in v4l2-mediabus.h and hopefully
encourage users to move to the new definitions.

Replace inclusion of v4l2-mediabus.h with v4l2-mbus.h in all common headers
and update the documentation Makefile to parse v4l2-mbus.h instead of
v4l2-mediabus.h.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 Documentation/DocBook/media/Makefile |  2 +-
 include/media/v4l2-mediabus.h|  2 +-
 include/uapi/linux/Kbuild|  1 +
 include/uapi/linux/v4l2-mbus.h   | 35 +++
 include/uapi/linux/v4l2-mediabus.h   | 26 --
 include/uapi/linux/v4l2-subdev.h |  2 +-
 6 files changed, 43 insertions(+), 25 deletions(-)
 create mode 100644 include/uapi/linux/v4l2-mbus.h

diff --git a/Documentation/DocBook/media/Makefile 
b/Documentation/DocBook/media/Makefile
index 181b7f4..30a22fa 100644
--- a/Documentation/DocBook/media/Makefile
+++ b/Documentation/DocBook/media/Makefile
@@ -99,7 +99,7 @@ STRUCTS = \
$(shell perl -ne 'print $$1  if (/^struct\s+([^\s]+)\s+/)' 
$(srctree)/include/uapi/linux/dvb/video.h) \
$(shell perl -ne 'print $$1  if /^struct\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/media.h) \
$(shell perl -ne 'print $$1  if /^struct\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/v4l2-subdev.h) \
-   $(shell perl -ne 'print $$1  if /^struct\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/v4l2-mediabus.h)
+   $(shell perl -ne 'print $$1  if /^struct\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/v4l2-mbus.h)
 
 ERRORS = \
E2BIG \
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 4915621..fc6bdd3 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -11,7 +11,7 @@
 #ifndef V4L2_MEDIABUS_H
 #define V4L2_MEDIABUS_H
 
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 
 /* Parallel flags */
 /*
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index b2c23f8..7b72720 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -408,6 +408,7 @@ header-y += uvcvideo.h
 header-y += v4l2-common.h
 header-y += v4l2-controls.h
 header-y += v4l2-dv-timings.h
+header-y += v4l2-mbus.h
 header-y += v4l2-mediabus.h
 header-y += v4l2-subdev.h
 header-y += veth.h
diff --git a/include/uapi/linux/v4l2-mbus.h b/include/uapi/linux/v4l2-mbus.h
new file mode 100644
index 000..2778c6e
--- /dev/null
+++ b/include/uapi/linux/v4l2-mbus.h
@@ -0,0 +1,35 @@
+/*
+ * Media Bus API header
+ *
+ * Copyright (C) 2009, Guennadi Liakhovetski g.liakhovet...@gmx.de
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_V4L2_MBUS_H
+#define __LINUX_V4L2_MBUS_H
+
+#include linux/types.h
+#include linux/videodev2.h
+#include linux/media-bus-format.h
+
+/**
+ * struct v4l2_mbus_framefmt - frame format on the media bus
+ * @width: frame width
+ * @height:frame height
+ * @code:  data format code (from enum media_bus_format)
+ * @field: used interlacing type (from enum v4l2_field)
+ * @colorspace:colorspace of the data (from enum v4l2_colorspace)
+ */
+struct v4l2_mbus_framefmt {
+   __u32   width;
+   __u32   height;
+   __u32   code;
+   __u32   field;
+   __u32   colorspace;
+   __u32   reserved[7];
+};
+
+#endif
diff --git a/include/uapi/linux/v4l2-mediabus.h 
b/include/uapi/linux/v4l2-mediabus.h
index 5a3e797..a587eac 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -10,12 +10,12 @@
 
 #ifndef __LINUX_V4L2_MEDIABUS_H
 #define __LINUX_V4L2_MEDIABUS_H
+#ifndef __KERNEL__
 
-#include linux/types.h
-#include linux/videodev2.h
-#include linux/media-bus-format.h
+#warning Use v4l2-mbus.h instead of v4l2-mediabus.h
+
+#include linux/v4l2-mbus.h
 
-#ifndef __KERNEL__
 #define MEDIA_BUS_TO_V4L2_MBUS(x)  V4L2_MBUS_FMT_ ## x = MEDIA_BUS_FMT_ ## 
x
 
 enum v4l2_mbus_pixelcode {
@@ -104,22 +104,4 @@ enum v4l2_mbus_pixelcode {
MEDIA_BUS_TO_V4L2_MBUS(AHSV_1X32),
 };
 #endif /* __KERNEL__ */
-
-/**
- * struct v4l2_mbus_framefmt - frame format on the media bus
- * @width: frame width
- * @height:frame height
- * @code:  data format code (from enum v4l2_mbus_pixelcode)
- * @field: used interlacing type (from enum v4l2_field)
- * @colorspace:colorspace of the data (from enum v4l2_colorspace)
- */
-struct v4l2_mbus_framefmt {
-   __u32   width;
-   __u32   

[PATCH 08/15] staging: media: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Reference new definitions in all media drivers residing in staging.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/staging/media/davinci_vpfe/dm365_ipipe.c   |  18 ++--
 .../staging/media/davinci_vpfe/dm365_ipipe_hw.c|  26 +++---
 drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 100 ++---
 drivers/staging/media/davinci_vpfe/dm365_isif.c|  90 +--
 drivers/staging/media/davinci_vpfe/dm365_resizer.c |  96 ++--
 .../staging/media/davinci_vpfe/vpfe_mc_capture.c   |  18 ++--
 drivers/staging/media/omap4iss/iss_csi2.c  |  62 ++---
 drivers/staging/media/omap4iss/iss_ipipe.c |  16 ++--
 drivers/staging/media/omap4iss/iss_ipipeif.c   |  28 +++---
 drivers/staging/media/omap4iss/iss_resizer.c   |  26 +++---
 drivers/staging/media/omap4iss/iss_video.c |  78 
 drivers/staging/media/omap4iss/iss_video.h |  10 +--
 12 files changed, 284 insertions(+), 284 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index bdc7f00..704fa20 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -37,15 +37,15 @@
 
 /* ipipe input format's */
 static const unsigned int ipipe_input_fmts[] = {
-   V4L2_MBUS_FMT_UYVY8_2X8,
-   V4L2_MBUS_FMT_SGRBG12_1X12,
-   V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8,
-   V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8,
+   MEDIA_BUS_FMT_UYVY8_2X8,
+   MEDIA_BUS_FMT_SGRBG12_1X12,
+   MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
+   MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,
 };
 
 /* ipipe output format's */
 static const unsigned int ipipe_output_fmts[] = {
-   V4L2_MBUS_FMT_UYVY8_2X8,
+   MEDIA_BUS_FMT_UYVY8_2X8,
 };
 
 static int ipipe_validate_lutdpc_params(struct vpfe_ipipe_lutdpc *lutdpc)
@@ -1457,7 +1457,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe,
 
/* If not found, use SBGGR10 as default */
if (i = ARRAY_SIZE(ipipe_input_fmts))
-   fmt-code = V4L2_MBUS_FMT_SGRBG12_1X12;
+   fmt-code = MEDIA_BUS_FMT_SGRBG12_1X12;
} else if (pad == IPIPE_PAD_SOURCE) {
for (i = 0; i  ARRAY_SIZE(ipipe_output_fmts); i++)
if (fmt-code == ipipe_output_fmts[i])
@@ -1465,7 +1465,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe,
 
/* If not found, use UYVY as default */
if (i = ARRAY_SIZE(ipipe_output_fmts))
-   fmt-code = V4L2_MBUS_FMT_UYVY8_2X8;
+   fmt-code = MEDIA_BUS_FMT_UYVY8_2X8;
}
 
fmt-width = clamp_t(u32, fmt-width, MIN_OUT_HEIGHT, max_out_width);
@@ -1642,7 +1642,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct 
v4l2_subdev_fh *fh)
memset(format, 0, sizeof(format));
format.pad = IPIPE_PAD_SINK;
format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
-   format.format.code = V4L2_MBUS_FMT_SGRBG12_1X12;
+   format.format.code = MEDIA_BUS_FMT_SGRBG12_1X12;
format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A;
format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A;
ipipe_set_format(sd, fh, format);
@@ -1650,7 +1650,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct 
v4l2_subdev_fh *fh)
memset(format, 0, sizeof(format));
format.pad = IPIPE_PAD_SOURCE;
format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
-   format.format.code = V4L2_MBUS_FMT_UYVY8_2X8;
+   format.format.code = MEDIA_BUS_FMT_UYVY8_2X8;
format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A;
format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A;
ipipe_set_format(sd, fh, format);
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
index b2daf5e..4a0895b2 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
@@ -196,12 +196,12 @@ ipipe_setup_resizer(void *__iomem rsz_base, struct 
resizer_params *params)
rsz_set_rsz_regs(rsz_base, RSZ_B, params);
 }
 
-static u32 ipipe_get_color_pat(enum v4l2_mbus_pixelcode pix)
+static u32 ipipe_get_color_pat(enum media_bus_format pix)
 {
switch (pix) {
-   case V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8:
-   case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8:
-   case V4L2_MBUS_FMT_SGRBG12_1X12:
+   case MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8:
+   case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8:
+   case MEDIA_BUS_FMT_SGRBG12_1X12:
return ipipe_sgrbg_pattern;
 
default:
@@ -211,23 +211,23 @@ static u32 

[PATCH 12/15] [media] i2c: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h

2014-11-04 Thread Boris Brezillon
The v4l2-mediabus.h header is now deprecated and should be replaced with
v4l2-mbus.h.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/media/i2c/mt9m032.c   | 2 +-
 drivers/media/i2c/mt9t001.c   | 2 +-
 drivers/media/i2c/mt9v032.c   | 2 +-
 drivers/media/i2c/smiapp/smiapp-core.c| 2 +-
 drivers/media/i2c/soc_camera/imx074.c | 2 +-
 drivers/media/i2c/soc_camera/mt9m111.c| 2 +-
 drivers/media/i2c/soc_camera/mt9t031.c| 2 +-
 drivers/media/i2c/soc_camera/mt9t112.c| 2 +-
 drivers/media/i2c/soc_camera/ov2640.c | 2 +-
 drivers/media/i2c/soc_camera/ov5642.c | 2 +-
 drivers/media/i2c/soc_camera/ov6650.c | 2 +-
 drivers/media/i2c/soc_camera/ov772x.c | 2 +-
 drivers/media/i2c/soc_camera/ov9640.c | 2 +-
 drivers/media/i2c/soc_camera/ov9740.c | 2 +-
 drivers/media/i2c/soc_camera/rj54n1cb0c.c | 2 +-
 drivers/media/i2c/soc_camera/tw9910.c | 2 +-
 drivers/media/i2c/tvp514x.c   | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
index 45b3fca..502b23f 100644
--- a/drivers/media/i2c/mt9m032.c
+++ b/drivers/media/i2c/mt9m032.c
@@ -28,7 +28,7 @@
 #include linux/module.h
 #include linux/mutex.h
 #include linux/slab.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 
 #include media/media-entity.h
 #include media/mt9m032.h
diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
index d9e9889..f1053f9 100644
--- a/drivers/media/i2c/mt9t001.c
+++ b/drivers/media/i2c/mt9t001.c
@@ -19,7 +19,7 @@
 #include linux/regulator/consumer.h
 #include linux/slab.h
 #include linux/videodev2.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 
 #include media/mt9t001.h
 #include media/v4l2-ctrls.h
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index 93687c1..e0c944a 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -20,7 +20,7 @@
 #include linux/regmap.h
 #include linux/slab.h
 #include linux/videodev2.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/module.h
 
 #include media/mt9v032.h
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 82d2e0a..8ccb7fa 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -34,7 +34,7 @@
 #include linux/regulator/consumer.h
 #include linux/slab.h
 #include linux/smiapp.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include media/v4l2-device.h
 
 #include smiapp.h
diff --git a/drivers/media/i2c/soc_camera/imx074.c 
b/drivers/media/i2c/soc_camera/imx074.c
index f9c0474..48892a1 100644
--- a/drivers/media/i2c/soc_camera/imx074.c
+++ b/drivers/media/i2c/soc_camera/imx074.c
@@ -12,7 +12,7 @@
 
 #include linux/delay.h
 #include linux/i2c.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/slab.h
 #include linux/videodev2.h
 #include linux/module.h
diff --git a/drivers/media/i2c/soc_camera/mt9m111.c 
b/drivers/media/i2c/soc_camera/mt9m111.c
index d140c7a..2b1179f 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -13,7 +13,7 @@
 #include linux/log2.h
 #include linux/gpio.h
 #include linux/delay.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/module.h
 
 #include media/soc_camera.h
diff --git a/drivers/media/i2c/soc_camera/mt9t031.c 
b/drivers/media/i2c/soc_camera/mt9t031.c
index 13177ca..d6b1503 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -13,7 +13,7 @@
 #include linux/log2.h
 #include linux/pm.h
 #include linux/slab.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/videodev2.h
 #include linux/module.h
 
diff --git a/drivers/media/i2c/soc_camera/mt9t112.c 
b/drivers/media/i2c/soc_camera/mt9t112.c
index 6ef9665..59396de 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -22,7 +22,7 @@
 #include linux/init.h
 #include linux/module.h
 #include linux/slab.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/videodev2.h
 
 #include media/mt9t112.h
diff --git a/drivers/media/i2c/soc_camera/ov2640.c 
b/drivers/media/i2c/soc_camera/ov2640.c
index bc3ca24..dcc6fa8 100644
--- a/drivers/media/i2c/soc_camera/ov2640.c
+++ b/drivers/media/i2c/soc_camera/ov2640.c
@@ -18,7 +18,7 @@
 #include linux/i2c.h
 #include linux/slab.h
 #include linux/delay.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/videodev2.h
 
 #include media/soc_camera.h
diff --git a/drivers/media/i2c/soc_camera/ov5642.c 
b/drivers/media/i2c/soc_camera/ov5642.c
index 5f43e03..73111bd 100644
--- a/drivers/media/i2c/soc_camera/ov5642.c
+++ b/drivers/media/i2c/soc_camera/ov5642.c
@@ -21,7 +21,7 @@
 #include linux/slab.h
 #include linux/videodev2.h
 

[PATCH 10/15] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel

2014-11-04 Thread Boris Brezillon
Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel
users don't have access to these definitions.

We have to keep this definition for user-space users even though they're
encouraged to move to the new media_bus_format enum.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 include/uapi/linux/v4l2-mediabus.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/v4l2-mediabus.h 
b/include/uapi/linux/v4l2-mediabus.h
index 9fbe891..5a3e797 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -15,6 +15,7 @@
 #include linux/videodev2.h
 #include linux/media-bus-format.h
 
+#ifndef __KERNEL__
 #define MEDIA_BUS_TO_V4L2_MBUS(x)  V4L2_MBUS_FMT_ ## x = MEDIA_BUS_FMT_ ## 
x
 
 enum v4l2_mbus_pixelcode {
@@ -102,6 +103,7 @@ enum v4l2_mbus_pixelcode {
 
MEDIA_BUS_TO_V4L2_MBUS(AHSV_1X32),
 };
+#endif /* __KERNEL__ */
 
 /**
  * struct v4l2_mbus_framefmt - frame format on the media bus
-- 
1.9.1

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


[PATCH 03/15] [media] Make use of the new media_bus_format definitions

2014-11-04 Thread Boris Brezillon
Replace references to the v4l2_mbus_pixelcode enum with the new
media_bus_format enum in all common headers.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 include/media/v4l2-mediabus.h| 2 +-
 include/media/v4l2-subdev.h  | 2 +-
 include/uapi/linux/v4l2-subdev.h | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 395c4a9..4915621 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -98,7 +98,7 @@ static inline void v4l2_fill_pix_format(struct 
v4l2_pix_format *pix_fmt,
 
 static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
   const struct v4l2_pix_format *pix_fmt,
-  enum v4l2_mbus_pixelcode code)
+  enum media_bus_format code)
 {
mbus_fmt-width = pix_fmt-width;
mbus_fmt-height = pix_fmt-height;
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index d746572..9af5932 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -341,7 +341,7 @@ struct v4l2_subdev_video_ops {
int (*query_dv_timings)(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings);
int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index,
-enum v4l2_mbus_pixelcode *code);
+enum media_bus_format *code);
int (*enum_mbus_fsizes)(struct v4l2_subdev *sd,
 struct v4l2_frmsizeenum *fsize);
int (*g_mbus_fmt)(struct v4l2_subdev *sd,
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
index a619cdd..7f44f04 100644
--- a/include/uapi/linux/v4l2-subdev.h
+++ b/include/uapi/linux/v4l2-subdev.h
@@ -68,7 +68,7 @@ struct v4l2_subdev_crop {
  * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
  * @pad: pad number, as reported by the media API
  * @index: format index during enumeration
- * @code: format code (from enum v4l2_mbus_pixelcode)
+ * @code: format code (from enum media_bus_format)
  */
 struct v4l2_subdev_mbus_code_enum {
__u32 pad;
@@ -81,7 +81,7 @@ struct v4l2_subdev_mbus_code_enum {
  * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
  * @pad: pad number, as reported by the media API
  * @index: format index during enumeration
- * @code: format code (from enum v4l2_mbus_pixelcode)
+ * @code: format code (from enum media_bus_format)
  */
 struct v4l2_subdev_frame_size_enum {
__u32 index;
@@ -109,7 +109,7 @@ struct v4l2_subdev_frame_interval {
  * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
  * @pad: pad number, as reported by the media API
  * @index: frame interval index during enumeration
- * @code: format code (from enum v4l2_mbus_pixelcode)
+ * @code: format code (from enum media_bus_format)
  * @width: frame width in pixels
  * @height: frame height in pixels
  * @interval: frame interval in seconds
-- 
1.9.1

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


[PATCH 05/15] [media] pci: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Replace all references to the old definition in pci drivers.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/media/pci/cx18/cx18-av-core.c   | 2 +-
 drivers/media/pci/cx18/cx18-controls.c  | 2 +-
 drivers/media/pci/cx18/cx18-ioctl.c | 2 +-
 drivers/media/pci/cx23885/cx23885-video.c   | 2 +-
 drivers/media/pci/ivtv/ivtv-controls.c  | 2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +-
 drivers/media/pci/saa7134/saa7134-empress.c | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/pci/cx18/cx18-av-core.c 
b/drivers/media/pci/cx18/cx18-av-core.c
index 2d3afe0..4c6ce21 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -952,7 +952,7 @@ static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, 
struct v4l2_mbus_framefmt
int HSC, VSC, Vsrc, Hsrc, filter, Vlines;
int is_50Hz = !(state-std  V4L2_STD_525_60);
 
-   if (fmt-code != V4L2_MBUS_FMT_FIXED)
+   if (fmt-code != MEDIA_BUS_FMT_FIXED)
return -EINVAL;
 
fmt-field = V4L2_FIELD_INTERLACED;
diff --git a/drivers/media/pci/cx18/cx18-controls.c 
b/drivers/media/pci/cx18/cx18-controls.c
index 282a3d2..4aeb7c6 100644
--- a/drivers/media/pci/cx18/cx18-controls.c
+++ b/drivers/media/pci/cx18/cx18-controls.c
@@ -98,7 +98,7 @@ static int cx18_s_video_encoding(struct cx2341x_handler 
*cxhdl, u32 val)
/* fix videodecoder resolution */
fmt.width = cxhdl-width / (is_mpeg1 ? 2 : 1);
fmt.height = cxhdl-height;
-   fmt.code = V4L2_MBUS_FMT_FIXED;
+   fmt.code = MEDIA_BUS_FMT_FIXED;
v4l2_subdev_call(cx-sd_av, video, s_mbus_fmt, fmt);
return 0;
 }
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c 
b/drivers/media/pci/cx18/cx18-ioctl.c
index 6f2b590..71963db 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -294,7 +294,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
 
mbus_fmt.width = cx-cxhdl.width = w;
mbus_fmt.height = cx-cxhdl.height = h;
-   mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
+   mbus_fmt.code = MEDIA_BUS_FMT_FIXED;
v4l2_subdev_call(cx-sd_av, video, s_mbus_fmt, mbus_fmt);
return cx18_g_fmt_vid_cap(file, fh, fmt);
 }
diff --git a/drivers/media/pci/cx23885/cx23885-video.c 
b/drivers/media/pci/cx23885/cx23885-video.c
index 682a4f9..091f5db 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -608,7 +608,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void 
*priv,
dev-field  = f-fmt.pix.field;
dprintk(2, %s() width=%d height=%d field=%d\n, __func__,
dev-width, dev-height, dev-field);
-   v4l2_fill_mbus_format(mbus_fmt, f-fmt.pix, V4L2_MBUS_FMT_FIXED);
+   v4l2_fill_mbus_format(mbus_fmt, f-fmt.pix, MEDIA_BUS_FMT_FIXED);
call_all(dev, video, s_mbus_fmt, mbus_fmt);
v4l2_fill_pix_format(f-fmt.pix, mbus_fmt);
/* s_mbus_fmt overwrites f-fmt.pix.field, restore it */
diff --git a/drivers/media/pci/ivtv/ivtv-controls.c 
b/drivers/media/pci/ivtv/ivtv-controls.c
index 2b0ab26..ccf548c 100644
--- a/drivers/media/pci/ivtv/ivtv-controls.c
+++ b/drivers/media/pci/ivtv/ivtv-controls.c
@@ -69,7 +69,7 @@ static int ivtv_s_video_encoding(struct cx2341x_handler 
*cxhdl, u32 val)
/* fix videodecoder resolution */
fmt.width = cxhdl-width / (is_mpeg1 ? 2 : 1);
fmt.height = cxhdl-height;
-   fmt.code = V4L2_MBUS_FMT_FIXED;
+   fmt.code = MEDIA_BUS_FMT_FIXED;
v4l2_subdev_call(itv-sd_video, video, s_mbus_fmt, fmt);
return 0;
 }
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c 
b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 3e0cb77..4d8ee18 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -595,7 +595,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, 
struct v4l2_format *f
fmt-fmt.pix.width /= 2;
mbus_fmt.width = fmt-fmt.pix.width;
mbus_fmt.height = h;
-   mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
+   mbus_fmt.code = MEDIA_BUS_FMT_FIXED;
v4l2_subdev_call(itv-sd_video, video, s_mbus_fmt, mbus_fmt);
return ivtv_g_fmt_vid_cap(file, fh, fmt);
 }
diff --git a/drivers/media/pci/saa7134/saa7134-empress.c 
b/drivers/media/pci/saa7134/saa7134-empress.c
index e4ea85f..8b3bb78 100644
--- a/drivers/media/pci/saa7134/saa7134-empress.c
+++ b/drivers/media/pci/saa7134/saa7134-empress.c
@@ -140,7 +140,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void 
*priv,
struct saa7134_dev *dev = video_drvdata(file);
struct v4l2_mbus_framefmt mbus_fmt;
 
-   v4l2_fill_mbus_format(mbus_fmt, 

[PATCH 01/15] [media] Move mediabus format definition to a more standard place

2014-11-04 Thread Boris Brezillon
Rename mediabus formats and move the enum into a separate header file so
that it can be used by DRM/KMS subsystem without any reference to the V4L2
subsystem.

Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.

Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 include/uapi/linux/Kbuild |   1 +
 include/uapi/linux/media-bus-format.h | 126 +++
 include/uapi/linux/v4l2-mediabus.h| 184 +++---
 3 files changed, 206 insertions(+), 105 deletions(-)
 create mode 100644 include/uapi/linux/media-bus-format.h

diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index b70237e..b2c23f8 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -414,6 +414,7 @@ header-y += veth.h
 header-y += vfio.h
 header-y += vhost.h
 header-y += videodev2.h
+header-y += media-bus-format.h
 header-y += virtio_9p.h
 header-y += virtio_balloon.h
 header-y += virtio_blk.h
diff --git a/include/uapi/linux/media-bus-format.h 
b/include/uapi/linux/media-bus-format.h
new file mode 100644
index 000..2a826e9
--- /dev/null
+++ b/include/uapi/linux/media-bus-format.h
@@ -0,0 +1,126 @@
+/*
+ * Media Bus API header
+ *
+ * Copyright (C) 2009, Guennadi Liakhovetski g.liakhovet...@gmx.de
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_MEDIA_BUS_FORMAT_H
+#define __LINUX_MEDIA_BUS_FORMAT_H
+
+/*
+ * These bus formats uniquely identify data formats on the data bus. Format 0
+ * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
+ * the data format is fixed. Additionally, 2X8 means that one pixel is
+ * transferred in two 8-bit samples, BE or LE specify in which order those
+ * samples are transferred over the bus: LE means that the least significant
+ * bits are transferred first, BE means that the most significant bits are
+ * transferred first, and PADHI and PADLO define which bits - low or high,
+ * in the incomplete high byte, are filled with padding bits.
+ *
+ * The bus formats are grouped by type, bus_width, bits per component, samples
+ * per pixel and order of subsamples. Numerical values are sorted using generic
+ * numerical sort order (8 thus comes before 10).
+ *
+ * As their value can't change when a new bus format is inserted in the
+ * enumeration, the bus formats are explicitly given a numerical value. The 
next
+ * free values for each category are listed below, update them when inserting
+ * new pixel codes.
+ */
+enum media_bus_format {
+   MEDIA_BUS_FMT_FIXED = 0x0001,
+
+   /* RGB - next is 0x100e */
+   MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
+   MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
+   MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
+   MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
+   MEDIA_BUS_FMT_BGR565_2X8_BE = 0x1005,
+   MEDIA_BUS_FMT_BGR565_2X8_LE = 0x1006,
+   MEDIA_BUS_FMT_RGB565_2X8_BE = 0x1007,
+   MEDIA_BUS_FMT_RGB565_2X8_LE = 0x1008,
+   MEDIA_BUS_FMT_RGB666_1X18 = 0x1009,
+   MEDIA_BUS_FMT_RGB888_1X24 = 0x100a,
+   MEDIA_BUS_FMT_RGB888_2X12_BE = 0x100b,
+   MEDIA_BUS_FMT_RGB888_2X12_LE = 0x100c,
+   MEDIA_BUS_FMT_ARGB_1X32 = 0x100d,
+
+   /* YUV (including grey) - next is 0x2024 */
+   MEDIA_BUS_FMT_Y8_1X8 = 0x2001,
+   MEDIA_BUS_FMT_UV8_1X8 = 0x2015,
+   MEDIA_BUS_FMT_UYVY8_1_5X8 = 0x2002,
+   MEDIA_BUS_FMT_VYUY8_1_5X8 = 0x2003,
+   MEDIA_BUS_FMT_YUYV8_1_5X8 = 0x2004,
+   MEDIA_BUS_FMT_YVYU8_1_5X8 = 0x2005,
+   MEDIA_BUS_FMT_UYVY8_2X8 = 0x2006,
+   MEDIA_BUS_FMT_VYUY8_2X8 = 0x2007,
+   MEDIA_BUS_FMT_YUYV8_2X8 = 0x2008,
+   MEDIA_BUS_FMT_YVYU8_2X8 = 0x2009,
+   MEDIA_BUS_FMT_Y10_1X10 = 0x200a,
+   MEDIA_BUS_FMT_UYVY10_2X10 = 0x2018,
+   MEDIA_BUS_FMT_VYUY10_2X10 = 0x2019,
+   MEDIA_BUS_FMT_YUYV10_2X10 = 0x200b,
+   MEDIA_BUS_FMT_YVYU10_2X10 = 0x200c,
+   MEDIA_BUS_FMT_Y12_1X12 = 0x2013,
+   MEDIA_BUS_FMT_UYVY8_1X16 = 0x200f,
+   MEDIA_BUS_FMT_VYUY8_1X16 = 0x2010,
+   MEDIA_BUS_FMT_YUYV8_1X16 = 0x2011,
+   MEDIA_BUS_FMT_YVYU8_1X16 = 0x2012,
+   MEDIA_BUS_FMT_YDYUYDYV8_1X16 = 0x2014,
+   MEDIA_BUS_FMT_UYVY10_1X20 = 0x201a,
+   MEDIA_BUS_FMT_VYUY10_1X20 = 0x201b,
+   MEDIA_BUS_FMT_YUYV10_1X20 = 0x200d,
+   MEDIA_BUS_FMT_YVYU10_1X20 = 0x200e,
+   MEDIA_BUS_FMT_YUV10_1X30 = 0x2016,
+   MEDIA_BUS_FMT_AYUV8_1X32 = 0x2017,
+   MEDIA_BUS_FMT_UYVY12_2X12 = 0x201c,
+   MEDIA_BUS_FMT_VYUY12_2X12 = 0x201d,
+   MEDIA_BUS_FMT_YUYV12_2X12 = 0x201e,
+   MEDIA_BUS_FMT_YVYU12_2X12 = 0x201f,
+   MEDIA_BUS_FMT_UYVY12_1X24 = 0x2020,
+   MEDIA_BUS_FMT_VYUY12_1X24 = 0x2021,
+   MEDIA_BUS_FMT_YUYV12_1X24 = 0x2022,
+   MEDIA_BUS_FMT_YVYU12_1X24 = 

[PATCH 13/15] gpu: ipu-v3: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h

2014-11-04 Thread Boris Brezillon
The v4l2-mediabus.h header is now deprecated and should be replaced with
v4l2-mbus.h.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/gpu/ipu-v3/ipu-csi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index 752cdd2..8aea0de 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -21,7 +21,7 @@
 #include linux/err.h
 #include linux/platform_device.h
 #include linux/videodev2.h
-#include uapi/linux/v4l2-mediabus.h
+#include uapi/linux/v4l2-mbus.h
 #include linux/clk.h
 #include linux/clk-provider.h
 #include linux/clkdev.h
-- 
1.9.1

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


[PATCH 14/15] [media] platform: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h

2014-11-04 Thread Boris Brezillon
The v4l2-mediabus.h header is now deprecated and should be replaced with
v4l2-mbus.h.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/media/platform/omap3isp/ispcsi2.c  | 2 +-
 drivers/media/platform/omap3isp/ispvideo.h | 2 +-
 drivers/media/platform/vsp1/vsp1_video.c   | 2 +-
 include/media/soc_mediabus.h   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispcsi2.c 
b/drivers/media/platform/omap3isp/ispcsi2.c
index 995a268..64acb66 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -15,7 +15,7 @@
  */
 #include linux/delay.h
 #include media/v4l2-common.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/mm.h
 
 #include isp.h
diff --git a/drivers/media/platform/omap3isp/ispvideo.h 
b/drivers/media/platform/omap3isp/ispvideo.h
index 9de3de5..7738d27 100644
--- a/drivers/media/platform/omap3isp/ispvideo.h
+++ b/drivers/media/platform/omap3isp/ispvideo.h
@@ -16,7 +16,7 @@
 #ifndef OMAP3_ISP_VIDEO_H
 #define OMAP3_ISP_VIDEO_H
 
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include media/media-entity.h
 #include media/v4l2-dev.h
 #include media/v4l2-fh.h
diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
b/drivers/media/platform/vsp1/vsp1_video.c
index d91f19a..bb3af00 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -16,7 +16,7 @@
 #include linux/mutex.h
 #include linux/sched.h
 #include linux/slab.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 #include linux/videodev2.h
 
 #include media/media-entity.h
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index 9d8e7a1..e357182 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -12,7 +12,7 @@
 #define SOC_MEDIABUS_H
 
 #include linux/videodev2.h
-#include linux/v4l2-mediabus.h
+#include linux/v4l2-mbus.h
 
 /**
  * enum soc_mbus_packing - data packing types on the media-bus
-- 
1.9.1

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


[PATCH 02/15] [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definition to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Update the v4l documentation accordingly.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 Documentation/DocBook/media/Makefile   |   2 +-
 Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++---
 include/uapi/linux/v4l2-mediabus.h |   2 +
 3 files changed, 157 insertions(+), 155 deletions(-)

diff --git a/Documentation/DocBook/media/Makefile 
b/Documentation/DocBook/media/Makefile
index 8bf7c61..181b7f4 100644
--- a/Documentation/DocBook/media/Makefile
+++ b/Documentation/DocBook/media/Makefile
@@ -86,7 +86,7 @@ ENUMS = \
$(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/dvb/net.h) \
$(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/dvb/video.h) \
$(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/media.h) \
-   $(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/v4l2-mediabus.h) \
+   $(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/media-bus-format.h) \
$(shell perl -ne 'print $$1  if /^enum\s+([^\s]+)\s+/' 
$(srctree)/include/uapi/linux/v4l2-subdev.h)
 
 STRUCTS = \
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml 
b/Documentation/DocBook/media/v4l/subdev-formats.xml
index b2d5a03..18730b9 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -86,7 +86,7 @@
   green and 5-bit blue values padded on the high bit, transferred as 2 
8-bit
   samples per pixel with the most significant bits (padding, red and half 
of
   the green value) transferred first will be named
-  constantV4L2_MBUS_FMT_RGB555_2X8_PADHI_BE/constant.
+  constantMEDIA_BUS_FMT_RGB555_2X8_PADHI_BE/constant.
   /para
 
   paraThe following tables list existing packed RGB formats./para
@@ -176,8 +176,8 @@
/row
  /thead
  tbody valign=top
-   row id=V4L2-MBUS-FMT-RGB444-2X8-PADHI-BE
- entryV4L2_MBUS_FMT_RGB444_2X8_PADHI_BE/entry
+   row id=MEDIA-BUS-FMT-RGB444-2X8-PADHI-BE
+ entryMEDIA_BUS_FMT_RGB444_2X8_PADHI_BE/entry
  entry0x1001/entry
  entry/entry
  dash-ent-24;
@@ -204,8 +204,8 @@
  entrybsubscript1/subscript/entry
  entrybsubscript0/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-RGB444-2X8-PADHI-LE
- entryV4L2_MBUS_FMT_RGB444_2X8_PADHI_LE/entry
+   row id=MEDIA-BUS-FMT-RGB444-2X8-PADHI-LE
+ entryMEDIA_BUS_FMT_RGB444_2X8_PADHI_LE/entry
  entry0x1002/entry
  entry/entry
  dash-ent-24;
@@ -232,8 +232,8 @@
  entryrsubscript1/subscript/entry
  entryrsubscript0/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-RGB555-2X8-PADHI-BE
- entryV4L2_MBUS_FMT_RGB555_2X8_PADHI_BE/entry
+   row id=MEDIA-BUS-FMT-RGB555-2X8-PADHI-BE
+ entryMEDIA_BUS_FMT_RGB555_2X8_PADHI_BE/entry
  entry0x1003/entry
  entry/entry
  dash-ent-24;
@@ -260,8 +260,8 @@
  entrybsubscript1/subscript/entry
  entrybsubscript0/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-RGB555-2X8-PADHI-LE
- entryV4L2_MBUS_FMT_RGB555_2X8_PADHI_LE/entry
+   row id=MEDIA-BUS-FMT-RGB555-2X8-PADHI-LE
+ entryMEDIA_BUS_FMT_RGB555_2X8_PADHI_LE/entry
  entry0x1004/entry
  entry/entry
  dash-ent-24;
@@ -288,8 +288,8 @@
  entrygsubscript4/subscript/entry
  entrygsubscript3/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-BGR565-2X8-BE
- entryV4L2_MBUS_FMT_BGR565_2X8_BE/entry
+   row id=MEDIA-BUS-FMT-BGR565-2X8-BE
+ entryMEDIA_BUS_FMT_BGR565_2X8_BE/entry
  entry0x1005/entry
  entry/entry
  dash-ent-24;
@@ -316,8 +316,8 @@
  entryrsubscript1/subscript/entry
  entryrsubscript0/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-BGR565-2X8-LE
- entryV4L2_MBUS_FMT_BGR565_2X8_LE/entry
+   row id=MEDIA-BUS-FMT-BGR565-2X8-LE
+ entryMEDIA_BUS_FMT_BGR565_2X8_LE/entry
  entry0x1006/entry
  entry/entry
  dash-ent-24;
@@ -344,8 +344,8 @@
  entrygsubscript4/subscript/entry
  entrygsubscript3/subscript/entry
/row
-   row id=V4L2-MBUS-FMT-RGB565-2X8-BE
- entryV4L2_MBUS_FMT_RGB565_2X8_BE/entry
+   row 

[PATCH 04/15] [media] i2c: Make use of media_bus_format enum

2014-11-04 Thread Boris Brezillon
In order to have subsytem agnostic media bus format definitions we've
moved media bus definitions to include/uapi/linux/media-bus-format.h and
prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

Replace all references to the old definitions in i2c drivers.

Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
---
 drivers/media/i2c/adv7170.c   | 16 +++
 drivers/media/i2c/adv7175.c   | 16 +++
 drivers/media/i2c/adv7180.c   |  6 +--
 drivers/media/i2c/adv7183.c   |  6 +--
 drivers/media/i2c/adv7604.c   | 72 +++
 drivers/media/i2c/adv7842.c   |  6 +--
 drivers/media/i2c/ak881x.c|  8 ++--
 drivers/media/i2c/cx25840/cx25840-core.c  |  2 +-
 drivers/media/i2c/m5mols/m5mols_core.c|  6 +--
 drivers/media/i2c/ml86v7667.c |  6 +--
 drivers/media/i2c/mt9m032.c   |  6 +--
 drivers/media/i2c/mt9p031.c   |  8 ++--
 drivers/media/i2c/mt9t001.c   |  8 ++--
 drivers/media/i2c/mt9v011.c   |  6 +--
 drivers/media/i2c/mt9v032.c   | 12 +++---
 drivers/media/i2c/noon010pc30.c   | 12 +++---
 drivers/media/i2c/ov7670.c| 16 +++
 drivers/media/i2c/ov9650.c| 10 ++---
 drivers/media/i2c/s5c73m3/s5c73m3.h   |  6 +--
 drivers/media/i2c/s5k4ecgx.c  |  4 +-
 drivers/media/i2c/s5k5baf.c   | 14 +++---
 drivers/media/i2c/s5k6a3.c|  2 +-
 drivers/media/i2c/s5k6aa.c|  8 ++--
 drivers/media/i2c/saa6752hs.c |  6 +--
 drivers/media/i2c/saa7115.c   |  2 +-
 drivers/media/i2c/saa717x.c   |  2 +-
 drivers/media/i2c/smiapp/smiapp-core.c| 32 +++---
 drivers/media/i2c/soc_camera/imx074.c |  8 ++--
 drivers/media/i2c/soc_camera/mt9m001.c| 14 +++---
 drivers/media/i2c/soc_camera/mt9m111.c| 70 +++---
 drivers/media/i2c/soc_camera/mt9t031.c| 10 ++---
 drivers/media/i2c/soc_camera/mt9t112.c| 22 +-
 drivers/media/i2c/soc_camera/mt9v022.c| 26 +--
 drivers/media/i2c/soc_camera/ov2640.c | 54 +++
 drivers/media/i2c/soc_camera/ov5642.c |  8 ++--
 drivers/media/i2c/soc_camera/ov6650.c | 58 -
 drivers/media/i2c/soc_camera/ov772x.c | 20 -
 drivers/media/i2c/soc_camera/ov9640.c | 40 -
 drivers/media/i2c/soc_camera/ov9740.c | 12 +++---
 drivers/media/i2c/soc_camera/rj54n1cb0c.c | 54 +++
 drivers/media/i2c/soc_camera/tw9910.c | 10 ++---
 drivers/media/i2c/sr030pc30.c | 14 +++---
 drivers/media/i2c/tvp514x.c   | 12 +++---
 drivers/media/i2c/tvp5150.c   |  6 +--
 drivers/media/i2c/tvp7002.c   | 10 ++---
 drivers/media/i2c/vs6624.c| 18 
 46 files changed, 382 insertions(+), 382 deletions(-)

diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c
index 04bb297..0f6c852 100644
--- a/drivers/media/i2c/adv7170.c
+++ b/drivers/media/i2c/adv7170.c
@@ -63,9 +63,9 @@ static inline struct adv7170 *to_adv7170(struct v4l2_subdev 
*sd)
 
 static char *inputs[] = { pass_through, play_back };
 
-static enum v4l2_mbus_pixelcode adv7170_codes[] = {
-   V4L2_MBUS_FMT_UYVY8_2X8,
-   V4L2_MBUS_FMT_UYVY8_1X16,
+static enum media_bus_format adv7170_codes[] = {
+   MEDIA_BUS_FMT_UYVY8_2X8,
+   MEDIA_BUS_FMT_UYVY8_1X16,
 };
 
 /* --- */
@@ -263,7 +263,7 @@ static int adv7170_s_routing(struct v4l2_subdev *sd,
 }
 
 static int adv7170_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
-   enum v4l2_mbus_pixelcode *code)
+   enum media_bus_format *code)
 {
if (index = ARRAY_SIZE(adv7170_codes))
return -EINVAL;
@@ -278,9 +278,9 @@ static int adv7170_g_fmt(struct v4l2_subdev *sd,
u8 val = adv7170_read(sd, 0x7);
 
if ((val  0x40) == (1  6))
-   mf-code = V4L2_MBUS_FMT_UYVY8_1X16;
+   mf-code = MEDIA_BUS_FMT_UYVY8_1X16;
else
-   mf-code = V4L2_MBUS_FMT_UYVY8_2X8;
+   mf-code = MEDIA_BUS_FMT_UYVY8_2X8;
 
mf-colorspace  = V4L2_COLORSPACE_SMPTE170M;
mf-width   = 0;
@@ -297,11 +297,11 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd,
int ret;
 
switch (mf-code) {
-   case V4L2_MBUS_FMT_UYVY8_2X8:
+   case MEDIA_BUS_FMT_UYVY8_2X8:
val = ~0x40;
break;
 
-   case V4L2_MBUS_FMT_UYVY8_1X16:
+   case MEDIA_BUS_FMT_UYVY8_1X16:
val |= 0x40;
break;
 
diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c
index b88f3b3..3a7c461 100644
--- a/drivers/media/i2c/adv7175.c
+++ b/drivers/media/i2c/adv7175.c
@@ -60,9 

Re: [PATCH 01/15] [media] Move mediabus format definition to a more standard place

2014-11-04 Thread Hans Verkuil
Hi Boris,

On 11/04/14 10:54, Boris Brezillon wrote:
 Rename mediabus formats and move the enum into a separate header file so
 that it can be used by DRM/KMS subsystem without any reference to the V4L2
 subsystem.
 
 Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.

I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't be
deprecated and neither can a #warning be added.

The best approach, I think, is to use a macro in media-bus-format.h
that will either define just the MEDIA_BUS value when compiled in the kernel, or
define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.

E.g. something like this:

#ifdef __KERNEL__
#define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
#else
/* Keep V4L2_MBUS_FMT for backwards compatibility */
#define MEDIA_BUS_FMT_ENTRY(name, val) \
MEDIA_BUS_FMT_ # name = val, \
V4L2_MBUS_FMT_ # name = val
#endif

An alternative approach is to have v4l2-mediabus.h include media-bus-format.h,
put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big comment
there that applications should use the defines from media-bus-format.h and that
this enum is frozen (i.e. new values are only added to media-bus-format.h).

But I think I like the macro idea best.

Regards,

Hans

 
 Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
 Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
 ---
  include/uapi/linux/Kbuild |   1 +
  include/uapi/linux/media-bus-format.h | 126 +++
  include/uapi/linux/v4l2-mediabus.h| 184 
 +++---
  3 files changed, 206 insertions(+), 105 deletions(-)
  create mode 100644 include/uapi/linux/media-bus-format.h
 
 diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
 index b70237e..b2c23f8 100644
 --- a/include/uapi/linux/Kbuild
 +++ b/include/uapi/linux/Kbuild
 @@ -414,6 +414,7 @@ header-y += veth.h
  header-y += vfio.h
  header-y += vhost.h
  header-y += videodev2.h
 +header-y += media-bus-format.h
  header-y += virtio_9p.h
  header-y += virtio_balloon.h
  header-y += virtio_blk.h
 diff --git a/include/uapi/linux/media-bus-format.h 
 b/include/uapi/linux/media-bus-format.h
 new file mode 100644
 index 000..2a826e9
 --- /dev/null
 +++ b/include/uapi/linux/media-bus-format.h
 @@ -0,0 +1,126 @@
 +/*
 + * Media Bus API header
 + *
 + * Copyright (C) 2009, Guennadi Liakhovetski g.liakhovet...@gmx.de
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +#ifndef __LINUX_MEDIA_BUS_FORMAT_H
 +#define __LINUX_MEDIA_BUS_FORMAT_H
 +
 +/*
 + * These bus formats uniquely identify data formats on the data bus. Format 0
 + * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
 + * the data format is fixed. Additionally, 2X8 means that one pixel is
 + * transferred in two 8-bit samples, BE or LE specify in which order 
 those
 + * samples are transferred over the bus: LE means that the least 
 significant
 + * bits are transferred first, BE means that the most significant bits are
 + * transferred first, and PADHI and PADLO define which bits - low or 
 high,
 + * in the incomplete high byte, are filled with padding bits.
 + *
 + * The bus formats are grouped by type, bus_width, bits per component, 
 samples
 + * per pixel and order of subsamples. Numerical values are sorted using 
 generic
 + * numerical sort order (8 thus comes before 10).
 + *
 + * As their value can't change when a new bus format is inserted in the
 + * enumeration, the bus formats are explicitly given a numerical value. The 
 next
 + * free values for each category are listed below, update them when inserting
 + * new pixel codes.
 + */
 +enum media_bus_format {
 + MEDIA_BUS_FMT_FIXED = 0x0001,
 +
 + /* RGB - next is 0x100e */
 + MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
 + MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
 + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
 + MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
 + MEDIA_BUS_FMT_BGR565_2X8_BE = 0x1005,
 + MEDIA_BUS_FMT_BGR565_2X8_LE = 0x1006,
 + MEDIA_BUS_FMT_RGB565_2X8_BE = 0x1007,
 + MEDIA_BUS_FMT_RGB565_2X8_LE = 0x1008,
 + MEDIA_BUS_FMT_RGB666_1X18 = 0x1009,
 + MEDIA_BUS_FMT_RGB888_1X24 = 0x100a,
 + MEDIA_BUS_FMT_RGB888_2X12_BE = 0x100b,
 + MEDIA_BUS_FMT_RGB888_2X12_LE = 0x100c,
 + MEDIA_BUS_FMT_ARGB_1X32 = 0x100d,
 +
 + /* YUV (including grey) - next is 0x2024 */
 + MEDIA_BUS_FMT_Y8_1X8 = 0x2001,
 + MEDIA_BUS_FMT_UV8_1X8 = 0x2015,
 + MEDIA_BUS_FMT_UYVY8_1_5X8 = 0x2002,
 + MEDIA_BUS_FMT_VYUY8_1_5X8 = 0x2003,
 + MEDIA_BUS_FMT_YUYV8_1_5X8 = 0x2004,
 + MEDIA_BUS_FMT_YVYU8_1_5X8 = 0x2005,
 + MEDIA_BUS_FMT_UYVY8_2X8 = 0x2006,
 + MEDIA_BUS_FMT_VYUY8_2X8 = 0x2007,
 + 

Re: [PATCH 01/15] [media] Move mediabus format definition to a more standard place

2014-11-04 Thread Hans Verkuil


On 11/04/14 11:20, Hans Verkuil wrote:
 Hi Boris,
 
 On 11/04/14 10:54, Boris Brezillon wrote:
 Rename mediabus formats and move the enum into a separate header file so
 that it can be used by DRM/KMS subsystem without any reference to the V4L2
 subsystem.

 Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.
 
 I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't 
 be
 deprecated and neither can a #warning be added.
 
 The best approach, I think, is to use a macro in media-bus-format.h
 that will either define just the MEDIA_BUS value when compiled in the kernel, 
 or
 define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.
 
 E.g. something like this:
 
 #ifdef __KERNEL__
 #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
 #else
 /* Keep V4L2_MBUS_FMT for backwards compatibility */
 #define MEDIA_BUS_FMT_ENTRY(name, val) \
   MEDIA_BUS_FMT_ # name = val, \
   V4L2_MBUS_FMT_ # name = val
 #endif

And v4l2-mediabus.h needs this as well:

#ifndef __KERNEL__
/* For backwards compatibility */
#define v4l2_mbus_pixelcode media_bus_format
#endif

Regards,

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


[PATCH] MAINTAINERS: add maintainer for CODA video4linux mem2mem driver

2014-11-04 Thread Philipp Zabel
Add myself as maintainer for the CODA V4L2 mem2mem driver.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 MAINTAINERS | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3c64271..34d3671 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2487,6 +2487,13 @@ F:   fs/coda/
 F: include/linux/coda*.h
 F: include/uapi/linux/coda*.h
 
+CODA V4L2 MEM2MEM DRIVER
+M: Philipp Zabel p.za...@pengutronix.de
+L: linux-media@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/media/coda.txt
+F: drivers/media/platform/coda/
+
 COMMON CLK FRAMEWORK
 M: Mike Turquette mturque...@linaro.org
 L: linux-ker...@vger.kernel.org
-- 
2.1.1

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


Re: [PATCH 01/15] [media] Move mediabus format definition to a more standard place

2014-11-04 Thread Boris Brezillon
Hi Hans,

On Tue, 04 Nov 2014 11:20:40 +0100
Hans Verkuil hansv...@cisco.com wrote:

 Hi Boris,
 
 On 11/04/14 10:54, Boris Brezillon wrote:
  Rename mediabus formats and move the enum into a separate header file so
  that it can be used by DRM/KMS subsystem without any reference to the V4L2
  subsystem.
  
  Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.
 
 I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't 
 be
 deprecated and neither can a #warning be added.
 
 The best approach, I think, is to use a macro in media-bus-format.h
 that will either define just the MEDIA_BUS value when compiled in the kernel, 
 or
 define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.
 
 E.g. something like this:
 
 #ifdef __KERNEL__
 #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
 #else
 /* Keep V4L2_MBUS_FMT for backwards compatibility */
 #define MEDIA_BUS_FMT_ENTRY(name, val) \
   MEDIA_BUS_FMT_ # name = val, \
   V4L2_MBUS_FMT_ # name = val
 #endif

Okay, but this means we keep adding V4L2_MBUS_FMT_ definitions even for
new formats (which definitely doesn't encourage people to move on).
Moreover, we add a V4L2 prefix in what was supposed to be a subsystem
neutral header.

Anyway, these are just nitpicks, and if you prefer this approach
I'll rework my series :-).

 
 An alternative approach is to have v4l2-mediabus.h include media-bus-format.h,
 put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big 
 comment
 there that applications should use the defines from media-bus-format.h and 
 that
 this enum is frozen (i.e. new values are only added to media-bus-format.h).
 
 But I think I like the macro idea best.

As you wish, my only intent is to use those bus format definitions in a
DRM driver :-).

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.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: [PATCH 01/15] [media] Move mediabus format definition to a more standard place

2014-11-04 Thread Hans Verkuil
Well, I gave two alternatives :-)

Both are fine as far as I am concerned, but it would be nice to hear
what others think.

Regards,

Hans

On 11/04/14 11:45, Boris Brezillon wrote:
 Hi Hans,
 
 On Tue, 04 Nov 2014 11:20:40 +0100
 Hans Verkuil hansv...@cisco.com wrote:
 
 Hi Boris,

 On 11/04/14 10:54, Boris Brezillon wrote:
 Rename mediabus formats and move the enum into a separate header file so
 that it can be used by DRM/KMS subsystem without any reference to the V4L2
 subsystem.

 Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.

 I missed earlier that v4l2-mediabus.h contained a struct as well, so it 
 can't be
 deprecated and neither can a #warning be added.

 The best approach, I think, is to use a macro in media-bus-format.h
 that will either define just the MEDIA_BUS value when compiled in the 
 kernel, or
 define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.

 E.g. something like this:

 #ifdef __KERNEL__
 #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
 #else
 /* Keep V4L2_MBUS_FMT for backwards compatibility */
 #define MEDIA_BUS_FMT_ENTRY(name, val) \
  MEDIA_BUS_FMT_ # name = val, \
  V4L2_MBUS_FMT_ # name = val
 #endif
 
 Okay, but this means we keep adding V4L2_MBUS_FMT_ definitions even for
 new formats (which definitely doesn't encourage people to move on).
 Moreover, we add a V4L2 prefix in what was supposed to be a subsystem
 neutral header.
 
 Anyway, these are just nitpicks, and if you prefer this approach
 I'll rework my series :-).
 

 An alternative approach is to have v4l2-mediabus.h include 
 media-bus-format.h,
 put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big 
 comment
 there that applications should use the defines from media-bus-format.h and 
 that
 this enum is frozen (i.e. new values are only added to media-bus-format.h).

 But I think I like the macro idea best.
 
 As you wish, my only intent is to use those bus format definitions in a
 DRM driver :-).
 
 Thanks,
 
 Boris
 
 
--
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 4/5] [media] vivid: add support for contiguous DMA buffers

2014-11-04 Thread Philipp Zabel
Hi Hans,

Am Montag, den 03.11.2014, 14:38 +0100 schrieb Hans Verkuil:
 Hi Philipp,
 
 I've been playing with this and I cannot make it work. One thing that is 
 missing
 in this patch is that the device struct isn't passed to v4l2_device_register.
 Without that the vb2 allocation context will actually be a NULL pointer.
 
 But after fixing that and a few other minor things (see this branch of mine:
 git://linuxtv.org/hverkuil/media_tree.git vivid) it still won't work because
 dma_alloc_coherent fails and that's because the device is not DMA capable.

Thanks you. Unfortunately I don't have experience with coherent dma on
x86 either, I've only tested this on ARM with CMA. I suspect a missing
call to dma_set_mask_and_coherent in the probe function be the issue?

regards
Philipp

--
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: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Sakari Ailus
Hi Grazvydas,

On Tue, Nov 04, 2014 at 01:16:03AM +0200, Grazvydas Ignotas wrote:
 Hi,
 
 On Mon, Nov 3, 2014 at 12:57 AM, Sakari Ailus sakari.ai...@iki.fi wrote:
  Hi Grazvydas,
 
  On Sun, Nov 02, 2014 at 04:03:55AM +0200, Grazvydas Ignotas wrote:
  There is periodic stutter (seen in vlc, for example) since 3.9 where
  the stream stops for around half a second every 3-5 seconds or so.
  Bisecting points to 1b18e7a0be859911b22138ce27258687efc528b8 v4l:
  Tell user space we're using monotonic timestamps. I've verified the
  problem is there on stock Ubuntu 14.04 kernel, 3.16.7 from kernel.org
  and when using media_build.git . The commit does not revert on newer
  kernels as that code changed, but checking out a commit before the one
  mentioned gives properly working kernel.
 
  I'm using Logitech C920 which can do h264 compression and playing the
  video using vlc:
  cvlc v4l2:///dev/video0:chroma=h264:width=1280:height=720
 
  I've got Logitech C270 here but I can't reproduce the problem. The frame
  rate with the above command is really low, around 5. With a smaller
  resolution it works quite smoothly. The reason might be that the pixel
  format is still YUYV. The other option appears to be MJPG.
 
 I've tried lower resolution and YUYV with MJPG too, this has the same problem:
 cvlc v4l2:///dev/video0:chroma=h264:width=320:height=240
 cvlc v4l2:///dev/video0:chroma=yuyv:width=320:height=240
 
 
  My vlc is of version 2.0.3 (Debian). Which one do you have, and does it use
  libv4l2?
 
 Mine is 2.1.4, my distro is Ubuntu 14.04. I can see libv4l2.so.0.0.0
 in maps, but I have no idea what it's used for..
 
  Have you tried with a different application to see if the problem persists?
 
 Tried mplayer and cheese now, and it seems they are not affected, so
 it's an issue with vlc. I wonder why it doesn't like newer flags..
 
 Ohwell, sorry for the noise.

I guess the newer VLC could indeed pay attention to the monotonic timestamp
flag. Remi, any idea?

-- 
Cheers,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Rémi Denis-Courmont

Le 2014-11-04 14:58, Sakari Ailus a écrit :
 Have you tried with a different application to see if the problem 
persists?


Tried mplayer and cheese now, and it seems they are not affected, so
it's an issue with vlc. I wonder why it doesn't like newer flags..

Ohwell, sorry for the noise.


I guess the newer VLC could indeed pay attention to the monotonic 
timestamp

flag. Remi, any idea?


VLC takes the kernel timestamp, if monotonic, since version 2.1. 
Otherwise, it generates its own inaccurate timestamp. So either that 
code is wrong, or the kernel timestamps are.


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


[PATCH 1/1] smipcie: add DVBSky S952 V3 support

2014-11-04 Thread Nibble Max
DVBSky S952 V3 card has a dual channels of dvb-s/s2.
1Frontend: Integrated tuner and demod: M88RS6000
2PCIe bridge: SMI PCIe

Signed-off-by: Nibble Max nibble@gmail.com
---
 drivers/media/pci/smipcie/Kconfig   |  2 +
 drivers/media/pci/smipcie/smipcie.c | 78 +
 2 files changed, 80 insertions(+)

diff --git a/drivers/media/pci/smipcie/Kconfig 
b/drivers/media/pci/smipcie/Kconfig
index 78b76ca..75a2992 100644
--- a/drivers/media/pci/smipcie/Kconfig
+++ b/drivers/media/pci/smipcie/Kconfig
@@ -3,9 +3,11 @@ config DVB_SMIPCIE
depends on DVB_CORE  PCI  I2C
select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
help
  Support for cards with SMI PCIe bridge:
  - DVBSky S950 V3
+ - DVBSky S952 V3
 
  Say Y or M if you own such a device and want to use it.
  If unsure say N.
diff --git a/drivers/media/pci/smipcie/smipcie.c 
b/drivers/media/pci/smipcie/smipcie.c
index 6ad6cc5..d1c1463 100644
--- a/drivers/media/pci/smipcie/smipcie.c
+++ b/drivers/media/pci/smipcie/smipcie.c
@@ -17,6 +17,7 @@
 #include smipcie.h
 #include m88ds3103.h
 #include m88ts2022.h
+#include m88rs6000t.h
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
@@ -542,6 +543,70 @@ err_tuner_i2c_device:
return ret;
 }
 
+static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = {
+   .i2c_addr = 0x69,
+   .clock = 2700,
+   .i2c_wr_max = 33,
+   .ts_mode = M88DS3103_TS_PARALLEL,
+   .ts_clk = 16000,
+   .ts_clk_pol = 1,
+   .agc = 0x99,
+   .lnb_hv_pol = 0,
+   .lnb_en_pol = 1,
+};
+
+static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port)
+{
+   int ret = 0;
+   struct smi_dev *dev = port-dev;
+   struct i2c_adapter *i2c;
+   /* tuner I2C module */
+   struct i2c_adapter *tuner_i2c_adapter;
+   struct i2c_client *tuner_client;
+   struct i2c_board_info tuner_info;
+   struct m88rs6000t_config m88rs6000t_config;
+
+   memset(tuner_info, 0, sizeof(struct i2c_board_info));
+   i2c = (port-idx == 0) ? dev-i2c_bus[0] : dev-i2c_bus[1];
+
+   /* attach demod */
+   port-fe = dvb_attach(m88ds3103_attach,
+   smi_dvbsky_m88rs6000_cfg, i2c, tuner_i2c_adapter);
+   if (!port-fe) {
+   ret = -ENODEV;
+   return ret;
+   }
+   /* attach tuner */
+   m88rs6000t_config.fe = port-fe;
+   strlcpy(tuner_info.type, m88rs6000t, I2C_NAME_SIZE);
+   tuner_info.addr = 0x21;
+   tuner_info.platform_data = m88rs6000t_config;
+   request_module(m88rs6000t);
+   tuner_client = i2c_new_device(tuner_i2c_adapter, tuner_info);
+   if (tuner_client == NULL || tuner_client-dev.driver == NULL) {
+   ret = -ENODEV;
+   goto err_tuner_i2c_device;
+   }
+
+   if (!try_module_get(tuner_client-dev.driver-owner)) {
+   ret = -ENODEV;
+   goto err_tuner_i2c_module;
+   }
+
+   /* delegate signal strength measurement to tuner */
+   port-fe-ops.read_signal_strength =
+   port-fe-ops.tuner_ops.get_rf_strength;
+
+   port-i2c_client_tuner = tuner_client;
+   return ret;
+
+err_tuner_i2c_module:
+   i2c_unregister_device(tuner_client);
+err_tuner_i2c_device:
+   dvb_frontend_detach(port-fe);
+   return ret;
+}
+
 static int smi_fe_init(struct smi_port *port)
 {
int ret = 0;
@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port)
case DVBSKY_FE_M88DS3103:
ret = smi_dvbsky_m88ds3103_fe_attach(port);
break;
+   case DVBSKY_FE_M88RS6000:
+   ret = smi_dvbsky_m88rs6000_fe_attach(port);
+   break;
}
if (ret  0)
return ret;
@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
.fe_1 = DVBSKY_FE_M88DS3103,
 };
 
+static struct smi_cfg_info dvbsky_s952_cfg = {
+   .type = SMI_DVBSKY_S952,
+   .name = DVBSky S952 V3,
+   .ts_0 = SMI_TS_DMA_BOTH,
+   .ts_1 = SMI_TS_DMA_BOTH,
+   .fe_0 = DVBSKY_FE_M88RS6000,
+   .fe_1 = DVBSKY_FE_M88RS6000,
+};
+
 /* PCI IDs */
 #define SMI_ID(_subvend, _subdev, _driverdata) {   \
.vendor  = SMI_VID,.device= SMI_PID, \
@@ -925,6 +1002,7 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
 
 static const struct pci_device_id smi_id_table[] = {
SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg),
+   SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg),
{0}
 };
 MODULE_DEVICE_TABLE(pci, smi_id_table);

-- 
1.9.1

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


Re: [PATCH 1/1] smipcie: add DVBSky S952 V3 support

2014-11-04 Thread Nibble Max
Hello Mauro,

I check media_tree.git on linuxtv.org that the media tree does not include S952 
V3 code.
S952 V3 card has M88RS6000 dvb frontend. S950 V3 card has M88TS2022/M88DS3103 
dvb frontend.
There are 2 reasons:
1 I submit two patchs for smipcie bridge driver.
 first one for S950 V3: http://patchwork.linuxtv.org/patch/26364/ 
 later one for S950 V3 and S952 V3: http://patchwork.linuxtv.org/patch/26436
2 I do not resend the patch for smipcie bridge driver together with the 
updated patchs for m88rs6000t and m88ds3103.

Sorry for my wrong actions. It makes you to pick up the first one which has no 
S952 V3 code.
So I submit S952 V3 patch for the current media_tree.git code again.

BR,
Max

On 2014-11-04 22:46:01, Nibble Max wrote:
DVBSky S952 V3 card has a dual channels of dvb-s/s2.
1Frontend: Integrated tuner and demod: M88RS6000
2PCIe bridge: SMI PCIe

Signed-off-by: Nibble Max nibble@gmail.com
---
 drivers/media/pci/smipcie/Kconfig   |  2 +
 drivers/media/pci/smipcie/smipcie.c | 78 +
 2 files changed, 80 insertions(+)

diff --git a/drivers/media/pci/smipcie/Kconfig 
b/drivers/media/pci/smipcie/Kconfig
index 78b76ca..75a2992 100644
--- a/drivers/media/pci/smipcie/Kconfig
+++ b/drivers/media/pci/smipcie/Kconfig
@@ -3,9 +3,11 @@ config DVB_SMIPCIE
   depends on DVB_CORE  PCI  I2C
   select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
   select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
+  select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
   help
 Support for cards with SMI PCIe bridge:
 - DVBSky S950 V3
+- DVBSky S952 V3
 
 Say Y or M if you own such a device and want to use it.
 If unsure say N.
diff --git a/drivers/media/pci/smipcie/smipcie.c 
b/drivers/media/pci/smipcie/smipcie.c
index 6ad6cc5..d1c1463 100644
--- a/drivers/media/pci/smipcie/smipcie.c
+++ b/drivers/media/pci/smipcie/smipcie.c
@@ -17,6 +17,7 @@
 #include smipcie.h
 #include m88ds3103.h
 #include m88ts2022.h
+#include m88rs6000t.h
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
@@ -542,6 +543,70 @@ err_tuner_i2c_device:
   return ret;
 }
 
+static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = {
+  .i2c_addr = 0x69,
+  .clock = 2700,
+  .i2c_wr_max = 33,
+  .ts_mode = M88DS3103_TS_PARALLEL,
+  .ts_clk = 16000,
+  .ts_clk_pol = 1,
+  .agc = 0x99,
+  .lnb_hv_pol = 0,
+  .lnb_en_pol = 1,
+};
+
+static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port)
+{
+  int ret = 0;
+  struct smi_dev *dev = port-dev;
+  struct i2c_adapter *i2c;
+  /* tuner I2C module */
+  struct i2c_adapter *tuner_i2c_adapter;
+  struct i2c_client *tuner_client;
+  struct i2c_board_info tuner_info;
+  struct m88rs6000t_config m88rs6000t_config;
+
+  memset(tuner_info, 0, sizeof(struct i2c_board_info));
+  i2c = (port-idx == 0) ? dev-i2c_bus[0] : dev-i2c_bus[1];
+
+  /* attach demod */
+  port-fe = dvb_attach(m88ds3103_attach,
+  smi_dvbsky_m88rs6000_cfg, i2c, tuner_i2c_adapter);
+  if (!port-fe) {
+  ret = -ENODEV;
+  return ret;
+  }
+  /* attach tuner */
+  m88rs6000t_config.fe = port-fe;
+  strlcpy(tuner_info.type, m88rs6000t, I2C_NAME_SIZE);
+  tuner_info.addr = 0x21;
+  tuner_info.platform_data = m88rs6000t_config;
+  request_module(m88rs6000t);
+  tuner_client = i2c_new_device(tuner_i2c_adapter, tuner_info);
+  if (tuner_client == NULL || tuner_client-dev.driver == NULL) {
+  ret = -ENODEV;
+  goto err_tuner_i2c_device;
+  }
+
+  if (!try_module_get(tuner_client-dev.driver-owner)) {
+  ret = -ENODEV;
+  goto err_tuner_i2c_module;
+  }
+
+  /* delegate signal strength measurement to tuner */
+  port-fe-ops.read_signal_strength =
+  port-fe-ops.tuner_ops.get_rf_strength;
+
+  port-i2c_client_tuner = tuner_client;
+  return ret;
+
+err_tuner_i2c_module:
+  i2c_unregister_device(tuner_client);
+err_tuner_i2c_device:
+  dvb_frontend_detach(port-fe);
+  return ret;
+}
+
 static int smi_fe_init(struct smi_port *port)
 {
   int ret = 0;
@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port)
   case DVBSKY_FE_M88DS3103:
   ret = smi_dvbsky_m88ds3103_fe_attach(port);
   break;
+  case DVBSKY_FE_M88RS6000:
+  ret = smi_dvbsky_m88rs6000_fe_attach(port);
+  break;
   }
   if (ret  0)
   return ret;
@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
   .fe_1 = DVBSKY_FE_M88DS3103,
 };
 
+static struct smi_cfg_info dvbsky_s952_cfg = {
+  .type = SMI_DVBSKY_S952,
+  .name = DVBSky S952 V3,
+  .ts_0 = SMI_TS_DMA_BOTH,
+  .ts_1 = SMI_TS_DMA_BOTH,
+  .fe_0 = DVBSKY_FE_M88RS6000,
+  .fe_1 = DVBSKY_FE_M88RS6000,
+};
+
 /* PCI IDs */
 #define 

Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Paulo Assis
I've add to change guvcview so that it now generates it's own
monotonic timestamps, kernel timestamps (uvcvideo at least), caused a
similar problem, e.g:
I would get a couple of frames with correct timestamps, then I would
get at least one with a value lower than the rest, this caused
playback to stutter.
I didn't had time to check the cause, but it has been like this for
quite some time now.

Regards,
Paulo

2014-11-04 12:42 GMT+00:00 Rémi Denis-Courmont r...@remlab.net:
 Le 2014-11-04 14:58, Sakari Ailus a écrit :

  Have you tried with a different application to see if the problem
  persists?

 Tried mplayer and cheese now, and it seems they are not affected, so
 it's an issue with vlc. I wonder why it doesn't like newer flags..

 Ohwell, sorry for the noise.


 I guess the newer VLC could indeed pay attention to the monotonic
 timestamp
 flag. Remi, any idea?


 VLC takes the kernel timestamp, if monotonic, since version 2.1. Otherwise,
 it generates its own inaccurate timestamp. So either that code is wrong, or
 the kernel timestamps are.

 --
 Rémi Denis-Courmont

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


Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Sakari Ailus
Hi,

On Tue, Nov 04, 2014 at 03:02:58PM +, Paulo Assis wrote:
 I've add to change guvcview so that it now generates it's own
 monotonic timestamps, kernel timestamps (uvcvideo at least), caused a
 similar problem, e.g:
 I would get a couple of frames with correct timestamps, then I would
 get at least one with a value lower than the rest, this caused
 playback to stutter.
 I didn't had time to check the cause, but it has been like this for
 quite some time now.

Have you looked what kind of timestamps the device gives you? The uvc
devices provide their own hardware timestamps which the UVC driver uses. If
the device provides bad timestamps to the driver, the buffer timestamps
could end up being very wrong. I don't know if the driver tries to cope with
that. One thing to try would be to capture images with a program which
prints the buffer timestamps.

yavta does, for example, print both the monotonic timestamp from the buffer
and the time when the buffer has been dequeued:

URL:http://git.ideasonboard.org/yavta.git

$ yavta -c /dev/video0

should do it. The first timestamp is the buffer timestamp, and the latter is
the one is taken when the buffer is dequeued (by yavta).

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] of: Add a function to read 64-bit arrays

2014-11-04 Thread Grant Likely
On Fri,  3 Oct 2014 00:59:23 +0300
, Sakari Ailus sakari.ai...@iki.fi
 wrote:
 Implement of_property_read_u64_array() for reading 64-bit arrays.
 
 This is needed for e.g. reading the valid link frequencies in the smiapp
 driver.
 
 Signed-off-by: Sakari Ailus sakari.ai...@iki.fi

A patch that adds this function is alread part of the device properties
API patch series that will be merged for v3.19.

g.

 ---
 Hi,
 
 While the smiapp (found in drivers/media/i2c/smiapp/) OF support which needs
 this isn't in yet, other drivers such as mt9v032 which would be reading the
 valid link frequency control values will need reading arrays. This might
 make it to v4l2-of.c in the end.
 
  drivers/of/base.c  |   44 
  include/linux/of.h |3 +++
  2 files changed, 39 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/of/base.c b/drivers/of/base.c
 index d8574ad..35e24f4 100644
 --- a/drivers/of/base.c
 +++ b/drivers/of/base.c
 @@ -1214,6 +1214,41 @@ int of_property_read_u32_array(const struct 
 device_node *np,
  EXPORT_SYMBOL_GPL(of_property_read_u32_array);
  
  /**
 + * of_property_read_u64_array - Find and read an array of 64 bit integers
 + * from a property.
 + *
 + * @np:  device node from which the property value is to be read.
 + * @propname:name of the property to be searched.
 + * @out_values:  pointer to return value, modified only if return value 
 is 0.
 + * @sz:  number of array elements to read
 + *
 + * Search for a property in a device node and read 64-bit value(s) from
 + * it. Returns 0 on success, -EINVAL if the property does not exist,
 + * -ENODATA if property does not have a value, and -EOVERFLOW if the
 + * property data isn't large enough.
 + *
 + * The out_values is modified only if a valid u32 value can be decoded.
 + */
 +int of_property_read_u64_array(const struct device_node *np,
 +const char *propname, u64 *out_value, size_t sz)
 +{
 + const __be32 *val = of_find_property_value_of_size(
 + np, propname, sz * sizeof(*out_value));
 +
 + if (IS_ERR(val))
 + return PTR_ERR(val);
 +
 + while (sz--) {
 + *out_value = of_read_number(val, 2);
 + out_value++;
 + val += 2;
 + }
 +
 + return 0;
 +}
 +EXPORT_SYMBOL_GPL(of_property_read_u64_array);
 +
 +/**
   * of_property_read_u64 - Find and read a 64 bit integer from a property
   * @np:  device node from which the property value is to be read.
   * @propname:name of the property to be searched.
 @@ -1229,14 +1264,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_array);
  int of_property_read_u64(const struct device_node *np, const char *propname,
u64 *out_value)
  {
 - const __be32 *val = of_find_property_value_of_size(np, propname,
 - sizeof(*out_value));
 -
 - if (IS_ERR(val))
 - return PTR_ERR(val);
 -
 - *out_value = of_read_number(val, 2);
 - return 0;
 + return of_property_read_u64_array(np, propname, out_value, 1);
  }
  EXPORT_SYMBOL_GPL(of_property_read_u64);
  
 diff --git a/include/linux/of.h b/include/linux/of.h
 index 6c4363b..e84533f 100644
 --- a/include/linux/of.h
 +++ b/include/linux/of.h
 @@ -263,6 +263,9 @@ extern int of_property_read_u32_array(const struct 
 device_node *np,
 size_t sz);
  extern int of_property_read_u64(const struct device_node *np,
   const char *propname, u64 *out_value);
 +extern int of_property_read_u64_array(const struct device_node *np,
 +   const char *propname, u64 *out_value,
 +   size_t sz);
  
  extern int of_property_read_string(struct device_node *np,
  const char *propname,
 -- 
 1.7.10.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/

--
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 4/4] [media] solo6x10: don't turn off/on encoder interrupt in processing loop

2014-11-04 Thread Andrey Utkin
2014-11-03 19:15 GMT+04:00 Hans Verkuil hverk...@xs4all.nl:
 Hi Andrey,

 On 10/29/2014 05:03 PM, Andrey Utkin wrote:
 The used approach actually cannot prevent new encoder interrupt to
 appear, because interrupt handler can execute in different thread, and
 in current implementation there is still race condition regarding this.

 I don't understand what you mean with 'interrupt handler can execute in
 different thread'. Can you elaborate?

 Note that I do think that this change makes sense, but I do like to have a
 better explanation.


Hi Hans, thanks for response.

I'm not proficient in linux kernel, so it's hard to make sure and
strict statements regarding this.

In the commit justification I mean that solo_ring_thread(), which is
edited, runs in a thread started with kthread_run().
Interrupt hander is executed on random kernel thread (whichever is
currently running, is it correct?). So temporarily disabling
interrupts from video encoders by writing to special register cannot
be used for processing serialization, for fixation of state or
anything useful at all, thus it should be removed from code.

Is it clear now?

Please feel free to push the patch with edited description, even
without resubmission from me.

-- 
Andrey Utkin
--
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] ARM: imx: Fix the removal of CONFIG_SPI option

2014-11-04 Thread Antti Palosaari

Moikka,

On 11/04/2014 09:18 PM, Uwe Kleine-König wrote:

Hello,

On Tue, Nov 04, 2014 at 05:55:31PM +0200, Antti Palosaari wrote:

On 11/04/2014 05:26 PM, Uwe Kleine-König wrote:

[Note, this is a resend of a mail I accidently only sent to Fabio
before.]

Hello,

On Tue, Nov 04, 2014 at 08:28:47AM -0200, Fabio Estevam wrote:

From: Fabio Estevam fabio.este...@freescale.com

Since 64546e9fe3a5b8c (ARM: imx_v6_v7_defconfig updates) and commit
0650f855d2e4b0b9 (ARM: imx_v4_v5_defconfig: Select CONFIG_IMX_WEIM) CONFIG_SPI
selection was dropped by savedefconfig for imx_v4_v5_defconfig and
imx_v6_v7_defconfig.

In order to keep the same behaviour as previous kernel versions and avoid
regressions, let's add CONFIG_SPI option back.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
Changes since v1:
- Add commit id's that caused the issue.

on top of 64546e9fe3a5b8c doing

 make imx_v6_v7_defconfig

resulted in CONFIG_SPI=y. That's because MEDIA_SUBDRV_AUTOSELECT selects
SPI and has default y.

So the commit that really broke imx_v6_v7_defconfig is 7d24c514e8e0
([media] Kconfig: do not select SPI bus on sub-driver auto-select).
On a side note I wonder how that commit sneaked into v3.17-rc6.

I think people need to be more aware of the results of Kconfig changes


I added that SPI select patch for 3.17-rc1 and it was removed right
after I got bug report it should not be there. But there was of
course some delay and removal patch went to 3.17-rc6.

Still I think that -rc6 is quite late for such a patch. But obviously
I'm not the relevant maintainer here and YMMV.



Yes, it is late. I send PULL request last day of rc1, but media fixes 
are not send for every rc, instead for rc1 and 1-2 times after that, 
usually very near end of merge window.







But all in all, it was all happening during 3.17 period and I wonder
how it could affect you?

Commit 64546e9fe3a5 was based on v3.17-rc3 and so had the select SPI.
That's why savedefconfig removed CONFIG_SPI=y from the minimized config.

Dropping the select for -rc6 resulted in imx_v6_v7_defconfig not
including CONFIG_SPI any more.

I checked all commits listed by:

git log --oneline linus/master ^e4462ffc1602 -SCONFIG_SPI

and the two imx defconfigs are the only ones being affected by this
issue.

Best regards
Uwe



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


[PATCH] [media] af0933: Don't go past to clock_adc_lut buffer

2014-11-04 Thread Mauro Carvalho Chehab
Fixes the following sparse warnings:
drivers/media/dvb-frontends/af9033.c:295 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:300 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:584 af9033_set_frontend() error: 
buffer overflow 'coeff_lut' 3 = 3
drivers/media/dvb-frontends/af9033.c:595 af9033_set_frontend() error: 
buffer overflow 'clock_adc_lut' 11 = 11

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index c17e34fd0fb4..82ce47bdf5dc 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -291,6 +291,12 @@ static int af9033_init(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC config for clock=%d\n,
+   dev-cfg.clock);
+   goto err;
+   }
 
adc_cw = af9033_div(dev, clock_adc_lut[i].adc, 100ul, 19ul);
buf[0] = (adc_cw   0)  0xff;
@@ -580,7 +586,15 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
break;
}
}
-   ret =  af9033_wr_regs(dev, 0x81,
+   if (i == ARRAY_SIZE(coeff_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find LUT config for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
+
+   ret = af9033_wr_regs(dev, 0x81,
coeff_lut[i].val, sizeof(coeff_lut[i].val));
}
 
@@ -592,6 +606,13 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC clock for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
adc_freq = clock_adc_lut[i].adc;
 
/* get used IF frequency */
-- 
1.9.3

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


[PATCHv2] [media] af0933: Don't go past arrays

2014-11-04 Thread Mauro Carvalho Chehab
Fixes the following sparse warnings:
drivers/media/dvb-frontends/af9033.c:295 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:300 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:584 af9033_set_frontend() error: 
buffer overflow 'coeff_lut' 3 = 3
drivers/media/dvb-frontends/af9033.c:595 af9033_set_frontend() error: 
buffer overflow 'clock_adc_lut' 11 = 11

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

-
v2: Only changed the patch subject, as it fixes occurrences on 3
different arrays.

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index c17e34fd0fb4..82ce47bdf5dc 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -291,6 +291,12 @@ static int af9033_init(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC config for clock=%d\n,
+   dev-cfg.clock);
+   goto err;
+   }
 
adc_cw = af9033_div(dev, clock_adc_lut[i].adc, 100ul, 19ul);
buf[0] = (adc_cw   0)  0xff;
@@ -580,7 +586,15 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
break;
}
}
-   ret =  af9033_wr_regs(dev, 0x81,
+   if (i == ARRAY_SIZE(coeff_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find LUT config for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
+
+   ret = af9033_wr_regs(dev, 0x81,
coeff_lut[i].val, sizeof(coeff_lut[i].val));
}
 
@@ -592,6 +606,13 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC clock for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
adc_freq = clock_adc_lut[i].adc;
 
/* get used IF frequency */
-- 
1.9.3

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


Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Rémi Denis-Courmont
Le mardi 04 novembre 2014, 15:42:37 Rémi Denis-Courmont a écrit :
 Le 2014-11-04 14:58, Sakari Ailus a écrit :
   Have you tried with a different application to see if the problem
  
  persists?
  
  Tried mplayer and cheese now, and it seems they are not affected, so
  it's an issue with vlc. I wonder why it doesn't like newer flags..
  
  Ohwell, sorry for the noise.
  
  I guess the newer VLC could indeed pay attention to the monotonic
  timestamp
  flag. Remi, any idea?
 
 VLC takes the kernel timestamp, if monotonic, since version 2.1.
 Otherwise, it generates its own inaccurate timestamp. So either that
 code is wrong, or the kernel timestamps are.

From a quick check with C920, the timestamps from the kernel are quite 
jittery, and but seem to follow a pattern. When requesting a 10 Hz frame rate, 
I actually get a frame interval of about 8/9 (i.e. 89ms) jumping to 1/3 every 
approximately 2 seconds.

From my user-space point of view, this is a kernel issue. The problem probably 
just manifests when both VLC and Linux versions support monotonic timestamps.

Whether the root cause is in the kernel, the device driver or the firmware, I 
can´t say.

-- 
Rémi Denis-Courmont
http://www.remlab.net/

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


[PATCH] [media] s2255drv: fix spinlock issue

2014-11-04 Thread Dean Anderson
qlock spinlock controls access to buf_list and sequence.
qlock spinlock should not be locked during a copy to video buffers, an
operation that may sleep.

Signed-off-by: Dean Anderson linux-...@sensoray.com
---
 drivers/media/usb/s2255/s2255drv.c | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/media/usb/s2255/s2255drv.c 
b/drivers/media/usb/s2255/s2255drv.c
index ccc0009..24c4413 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -558,27 +558,31 @@ static void s2255_fwchunk_complete(struct urb *urb)
 
 }
 
-static int s2255_got_frame(struct s2255_vc *vc, int jpgsize)
+static void s2255_got_frame(struct s2255_vc *vc, int jpgsize)
 {
struct s2255_buffer *buf;
struct s2255_dev *dev = to_s2255_dev(vc-vdev.v4l2_dev);
unsigned long flags = 0;
-   int rc = 0;
+
spin_lock_irqsave(vc-qlock, flags);
if (list_empty(vc-buf_list)) {
dprintk(dev, 1, No active queue to serve\n);
-   rc = -1;
-   goto unlock;
+   spin_unlock_irqrestore(vc-qlock, flags);
+   return;
}
buf = list_entry(vc-buf_list.next,
 struct s2255_buffer, list);
list_del(buf-list);
v4l2_get_timestamp(buf-vb.v4l2_buf.timestamp);
+   buf-vb.v4l2_buf.field = vc-field;
+   buf-vb.v4l2_buf.sequence = vc-frame_count;
+   spin_unlock_irqrestore(vc-qlock, flags);
+
s2255_fillbuff(vc, buf, jpgsize);
+   /* tell v4l buffer was filled */
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_DONE);
dprintk(dev, 2, %s: [buf] [%p]\n, __func__, buf);
-unlock:
-   spin_unlock_irqrestore(vc-qlock, flags);
-   return rc;
+   return;
 }
 
 static const struct s2255_fmt *format_by_fourcc(int fourcc)
@@ -649,11 +653,6 @@ static void s2255_fillbuff(struct s2255_vc *vc,
}
dprintk(dev, 2, s2255fill at : Buffer 0x%08lx size= %d\n,
(unsigned long)vbuf, pos);
-   /* tell v4l buffer was filled */
-   buf-vb.v4l2_buf.field = vc-field;
-   buf-vb.v4l2_buf.sequence = vc-frame_count;
-   v4l2_get_timestamp(buf-vb.v4l2_buf.timestamp);
-   vb2_buffer_done(buf-vb, VB2_BUF_STATE_DONE);
 }
 
 
-- 
1.9.1

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


v4l2-ctl bug(?) printing ctrl payload array

2014-11-04 Thread Andrey Utkin
I used today's git master HEAD of v4l-utils.
There's a device which provides r/w v4l2 control for a map of motion
thresholds by regions. See

md_threshold_grid (u16): min=0 max=65535 step=1 default=768
[45][45] flags=has-payload

So when i print its value with -C md_threshold_grid, i see MD
Threshold Grid[0]: in the beginning of every line. I guess it is
supposed to have a number in brackets increase each line?
I am not smart enought to fix this in code from first glance, so I'm
just reporting this.

00:57:28krieger@zver /usr/local/src/v4l-utils/utils/v4l2-ctl
 $ git describe --long
v4l-utils-1.6.0-29-gc873001

00:49:32krieger@zver /usr/local/src/v4l-utils/utils/v4l2-ctl
 $ ./v4l2-ctl -d /dev/video12 --all
Driver Info (not using libv4l2):
Driver name   : solo6x10
Card type : Softlogic 6x10 Enc 2
Bus info  : PCI::07:05.0
Driver version: 3.18.0
Capabilities  : 0x8521
Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0521
Video Capture
Read/Write
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Encoder 3: no signal)
Video Standard = 0x1000
NTSC-M
Format Video Capture:
Width/Height  : 352/240
Pixel Format  : 'H264'
Field : None
Bytes per Line: 0
Size Image: 200704
Colorspace: Broadcast NTSC/PAL (SMPTE170M/ITU601)
Flags :
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 2

User Controls

 brightness (int): min=0 max=255 step=1
default=128 value=128 flags=slider
   contrast (int): min=0 max=255 step=1
default=128 value=128 flags=slider
 saturation (int): min=0 max=255 step=1
default=128 value=128 flags=slider
hue (int): min=0 max=255 step=1
default=128 value=128 flags=slider
  sharpness (int): min=0 max=15 step=1
default=0 value=0 flags=slider
   osd_text (str): min=0 max=44 step=1
value='' flags=has-payload

Codec Controls

 video_gop_size (int): min=1 max=255 step=1
default=30 value=30
  h264_minimum_qp_value (int): min=0 max=31 step=1 default=3 value=3

Detection Controls

  motion_detection_mode (menu)   : min=0 max=2 default=0 value=2
md_global_threshold (int): min=0 max=255 step=1
default=3 value=3 flags=slider
  md_threshold_grid (u16): min=0 max=65535 step=1
default=768 [45][45] flags=has-payload
 brightness (int): min=0 max=255 step=1
default=128 value=128 flags=slider
   contrast (int): min=0 max=255 step=1
default=128 value=128 flags=slider
 saturation (int): min=0 max=255 step=1
default=128 value=128 flags=slider
hue (int): min=0 max=255 step=1
default=128 value=128 flags=slider
  sharpness (int): min=0 max=15 step=1
default=0 value=0 flags=slider

00:53:23krieger@zver /usr/local/src/v4l-utils/utils/v4l2-ctl
 $ ./v4l2-ctl -d /dev/video12 -C md_threshold_grid
MD Threshold Grid[0]:  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0
MD Threshold Grid[0]:  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0
MD Threshold Grid[0]:  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0
MD Threshold Grid[0]:  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  0,  0,  0,  0,  0,
 0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0
MD Threshold Grid[0]:  0,  0,  0,  0,  0,  0,
0,  0,  0,  0,  

Re: Patch mceusb: fix invalid urb interval

2014-11-04 Thread Sean Young
On Mon, Nov 03, 2014 at 02:49:45PM -0200, Mauro Carvalho Chehab wrote:
 Em Mon, 20 Jan 2014 12:36:26 -0500
 Jarod Wilson ja...@redhat.com escreveu:
 
  On Sun, Jan 19, 2014 at 09:56:48PM +, Sean Young wrote:
   On Sun, Jan 19, 2014 at 10:05:15PM +0100, Martin Kittel wrote:
Hi Mauro, hi Sean,
  ...
From a71676dad29adef9cafb08598e693ec308ba2e95 Mon Sep 17 00:00:00 2001
From: Martin Kittel li...@martin-kittel.de
Date: Sun, 19 Jan 2014 21:24:55 +0100
Subject: [PATCH] mceusb: use endpoint xfer mode as advertised

mceusb always sets endpoints to interrupt transfer mode no matter
what the device itself is advertising. This causes trouble on xhci
hubs. This patch changes the behavior to honor the device endpoint
settings.
   
   This patch is wrong. I get:
   
   [   60.962727] [ cut here ]
   [   60.962729] WARNING: CPU: 0 PID: 0 at drivers/usb/core/urb.c:452 
   usb_submit_u
   rb+0x1fd/0x5b0()
   [   60.962730] usb 3-2: BOGUS urb xfer, pipe 1 != type 3
   
   This is because the patch no longer sets the endpoints to interrupt
   endpoints, but still uses the interrupt functions like
   usb_fill_int_urb().
  
  Crap, I sent a working patch to everyone a few days ago, but from a new
  host that didn't have relay stuff set up yet, so I don't think anyone got
  the message. Oops... I'll try to dig it back up. Its a quick fix, but its
  tested as fully functional on multiple devices here, including a mix of
  ones that claim bulk and interrupt, ones with no bInterval, ones with
  different non-0 bIntervals, etc.
 
 Hi All,
 
 This is still pending on my queue. Any news?

I'm pretty sure the proper fix for this problem has been merged already:

commit 0cacb46ace1f433f0ab02af10686f6dc50b5d268
Author: Matt DeVillier matt.devill...@gmail.com
Date:   Thu Apr 24 11:16:31 2014 -0300

[media] fix mceusb endpoint type identification/handling


Sean
--
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] staging: media: lirc: modify print calls

2014-11-04 Thread Aya Mahfouz
This patches replaces one pr_debug call by dev_dbg and
changes the device used by one of the dev_err calls.

Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
---
 drivers/staging/media/lirc/lirc_zilog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
b/drivers/staging/media/lirc/lirc_zilog.c
index 52f8e91..dca806a 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -1447,7 +1447,7 @@ static int ir_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
int ret;
bool tx_probe = false;
 
-   pr_debug(%s: %s on i2c-%d (%s), client addr=0x%02x\n,
+   dev_dbg(client-dev, %s: %s on i2c-%d (%s), client addr=0x%02x\n,
__func__, id-name, adap-nr, adap-name, client-addr);
 
/*
@@ -1631,7 +1631,7 @@ out_put_xx:
 out_put_ir:
put_ir_device(ir, true);
 out_no_ir:
-   dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
+   dev_err(client-dev, %s: probing IR %s on %s (i2c-%d) failed with 
%d\n,
__func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
   ret);
mutex_unlock(ir_devices_lock);
-- 
1.9.3

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


Re: [RFCv2 5/8] [media] si4713: add device tree support

2014-11-04 Thread Sakari Ailus
Hi Sebastian,

Nice set of patches! Thanks! :-)

On Tue, Oct 21, 2014 at 05:07:04PM +0200, Sebastian Reichel wrote:
 Add device tree support by changing the device registration order.
 In the device tree the si4713 node is a normal I2C device, which
 will be probed as such. Thus the V4L device must be probed from
 the I2C device and not the other way around.
 
 Signed-off-by: Sebastian Reichel s...@kernel.org
 ---
  drivers/media/radio/si4713/radio-platform-si4713.c | 28 --
  drivers/media/radio/si4713/si4713.c| 34 
 --
  drivers/media/radio/si4713/si4713.h|  6 
  include/media/radio-si4713.h   | 30 ---
  include/media/si4713.h |  1 +
  5 files changed, 45 insertions(+), 54 deletions(-)
  delete mode 100644 include/media/radio-si4713.h
 
 diff --git a/drivers/media/radio/si4713/radio-platform-si4713.c 
 b/drivers/media/radio/si4713/radio-platform-si4713.c
 index a47502a..2de5439 100644
 --- a/drivers/media/radio/si4713/radio-platform-si4713.c
 +++ b/drivers/media/radio/si4713/radio-platform-si4713.c
 @@ -34,7 +34,7 @@
  #include media/v4l2-fh.h
  #include media/v4l2-ctrls.h
  #include media/v4l2-event.h
 -#include media/radio-si4713.h
 +#include si4713.h
  
  /* module parameters */
  static int radio_nr = -1;/* radio device minor (-1 == auto assign) */
 @@ -153,7 +153,6 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
  {
   struct radio_si4713_platform_data *pdata = pdev-dev.platform_data;
   struct radio_si4713_device *rsdev;
 - struct i2c_adapter *adapter;
   struct v4l2_subdev *sd;
   int rval = 0;
  
 @@ -177,20 +176,11 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
   goto exit;
   }
  
 - adapter = i2c_get_adapter(pdata-i2c_bus);
 - if (!adapter) {
 - dev_err(pdev-dev, Cannot get i2c adapter %d\n,
 - pdata-i2c_bus);
 - rval = -ENODEV;
 - goto unregister_v4l2_dev;
 - }
 -
 - sd = v4l2_i2c_new_subdev_board(rsdev-v4l2_dev, adapter,
 -pdata-subdev_board_info, NULL);
 - if (!sd) {
 + sd = i2c_get_clientdata(pdata-subdev);
 + rval = v4l2_device_register_subdev(rsdev-v4l2_dev, sd);
 + if (rval) {
   dev_err(pdev-dev, Cannot get v4l2 subdevice\n);
 - rval = -ENODEV;
 - goto put_adapter;
 + goto unregister_v4l2_dev;
   }
  
   rsdev-radio_dev = radio_si4713_vdev_template;
 @@ -202,14 +192,12 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
   if (video_register_device(rsdev-radio_dev, VFL_TYPE_RADIO, radio_nr)) 
 {
   dev_err(pdev-dev, Could not register video device.\n);
   rval = -EIO;
 - goto put_adapter;
 + goto unregister_v4l2_dev;
   }
   dev_info(pdev-dev, New device successfully probed\n);
  
   goto exit;
  
 -put_adapter:
 - i2c_put_adapter(adapter);
  unregister_v4l2_dev:
   v4l2_device_unregister(rsdev-v4l2_dev);
  exit:
 @@ -220,14 +208,10 @@ exit:
  static int radio_si4713_pdriver_remove(struct platform_device *pdev)
  {
   struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
 - struct v4l2_subdev *sd = list_entry(v4l2_dev-subdevs.next,
 - struct v4l2_subdev, list);
 - struct i2c_client *client = v4l2_get_subdevdata(sd);
   struct radio_si4713_device *rsdev;
  
   rsdev = container_of(v4l2_dev, struct radio_si4713_device, v4l2_dev);
   video_unregister_device(rsdev-radio_dev);
 - i2c_put_adapter(client-adapter);
   v4l2_device_unregister(rsdev-v4l2_dev);
  
   return 0;
 diff --git a/drivers/media/radio/si4713/si4713.c 
 b/drivers/media/radio/si4713/si4713.c
 index ebec16d..94fe3c6 100644
 --- a/drivers/media/radio/si4713/si4713.c
 +++ b/drivers/media/radio/si4713/si4713.c
 @@ -1446,9 +1446,13 @@ static int si4713_probe(struct i2c_client *client,
   const struct i2c_device_id *id)
  {
   struct si4713_device *sdev;
 - struct si4713_platform_data *pdata = client-dev.platform_data;
   struct v4l2_ctrl_handler *hdl;
 - int rval, i;
 + struct si4713_platform_data *pdata = client-dev.platform_data;
 + struct device_node *np = client-dev.of_node;
 + int rval;
 +

Why empty line here?

It's not a bad practice to declare short temporary variables etc. as last.

 + struct radio_si4713_platform_data si4713_pdev_pdata;
 + struct platform_device *si4713_pdev;
  
   sdev = devm_kzalloc(client-dev, sizeof(*sdev), GFP_KERNEL);
   if (!sdev) {
 @@ -1608,8 +1612,31 @@ static int si4713_probe(struct i2c_client *client,
   goto free_ctrls;
   }
  
 + if ((pdata  pdata-is_platform_device) || np) {
 + si4713_pdev = 

Re: Patch mceusb: fix invalid urb interval

2014-11-04 Thread Mauro Carvalho Chehab
Em Tue, 04 Nov 2014 21:25:49 +
Sean Young s...@mess.org escreveu:

 On Mon, Nov 03, 2014 at 02:49:45PM -0200, Mauro Carvalho Chehab wrote:
  Em Mon, 20 Jan 2014 12:36:26 -0500
  Jarod Wilson ja...@redhat.com escreveu:
  
   On Sun, Jan 19, 2014 at 09:56:48PM +, Sean Young wrote:
On Sun, Jan 19, 2014 at 10:05:15PM +0100, Martin Kittel wrote:
 Hi Mauro, hi Sean,
   ...
 From a71676dad29adef9cafb08598e693ec308ba2e95 Mon Sep 17 00:00:00 
 2001
 From: Martin Kittel li...@martin-kittel.de
 Date: Sun, 19 Jan 2014 21:24:55 +0100
 Subject: [PATCH] mceusb: use endpoint xfer mode as advertised
 
 mceusb always sets endpoints to interrupt transfer mode no matter
 what the device itself is advertising. This causes trouble on xhci
 hubs. This patch changes the behavior to honor the device endpoint
 settings.

This patch is wrong. I get:

[   60.962727] [ cut here ]
[   60.962729] WARNING: CPU: 0 PID: 0 at drivers/usb/core/urb.c:452 
usb_submit_u
rb+0x1fd/0x5b0()
[   60.962730] usb 3-2: BOGUS urb xfer, pipe 1 != type 3

This is because the patch no longer sets the endpoints to interrupt
endpoints, but still uses the interrupt functions like
usb_fill_int_urb().
   
   Crap, I sent a working patch to everyone a few days ago, but from a new
   host that didn't have relay stuff set up yet, so I don't think anyone got
   the message. Oops... I'll try to dig it back up. Its a quick fix, but its
   tested as fully functional on multiple devices here, including a mix of
   ones that claim bulk and interrupt, ones with no bInterval, ones with
   different non-0 bIntervals, etc.
  
  Hi All,
  
  This is still pending on my queue. Any news?
 
 I'm pretty sure the proper fix for this problem has been merged already:
 
 commit 0cacb46ace1f433f0ab02af10686f6dc50b5d268
 Author: Matt DeVillier matt.devill...@gmail.com
 Date:   Thu Apr 24 11:16:31 2014 -0300
 
 [media] fix mceusb endpoint type identification/handling

Ah, OK. It seems I forgot to remove this from my queue.

Marked as superseed.

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


Re: [PATCH] [media] s2255drv: fix spinlock issue

2014-11-04 Thread Dean Anderson
This patch is not so urgent, but should still be considered.  Please 
disregard the second comment below, which is not correct.


The original code, however, holds the spinlock for a long time.  From 
the structure of videobuf2, we could just hold qlock during buf_list and 
sequence accesses.



On 2014-11-04 14:34, Dean Anderson wrote:

qlock spinlock controls access to buf_list and sequence.
qlock spinlock should not be locked during a copy to video buffers, an
operation that may sleep.

Signed-off-by: Dean Anderson linux-...@sensoray.com
---
 drivers/media/usb/s2255/s2255drv.c | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/media/usb/s2255/s2255drv.c
b/drivers/media/usb/s2255/s2255drv.c
index ccc0009..24c4413 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -558,27 +558,31 @@ static void s2255_fwchunk_complete(struct urb 
*urb)


 }

-static int s2255_got_frame(struct s2255_vc *vc, int jpgsize)
+static void s2255_got_frame(struct s2255_vc *vc, int jpgsize)
 {
struct s2255_buffer *buf;
struct s2255_dev *dev = to_s2255_dev(vc-vdev.v4l2_dev);
unsigned long flags = 0;
-   int rc = 0;
+
spin_lock_irqsave(vc-qlock, flags);
if (list_empty(vc-buf_list)) {
dprintk(dev, 1, No active queue to serve\n);
-   rc = -1;
-   goto unlock;
+   spin_unlock_irqrestore(vc-qlock, flags);
+   return;
}
buf = list_entry(vc-buf_list.next,
 struct s2255_buffer, list);
list_del(buf-list);
v4l2_get_timestamp(buf-vb.v4l2_buf.timestamp);
+   buf-vb.v4l2_buf.field = vc-field;
+   buf-vb.v4l2_buf.sequence = vc-frame_count;
+   spin_unlock_irqrestore(vc-qlock, flags);
+
s2255_fillbuff(vc, buf, jpgsize);
+   /* tell v4l buffer was filled */
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_DONE);
dprintk(dev, 2, %s: [buf] [%p]\n, __func__, buf);
-unlock:
-   spin_unlock_irqrestore(vc-qlock, flags);
-   return rc;
+   return;
 }

 static const struct s2255_fmt *format_by_fourcc(int fourcc)
@@ -649,11 +653,6 @@ static void s2255_fillbuff(struct s2255_vc *vc,
}
dprintk(dev, 2, s2255fill at : Buffer 0x%08lx size= %d\n,
(unsigned long)vbuf, pos);
-   /* tell v4l buffer was filled */
-   buf-vb.v4l2_buf.field = vc-field;
-   buf-vb.v4l2_buf.sequence = vc-frame_count;
-   v4l2_get_timestamp(buf-vb.v4l2_buf.timestamp);
-   vb2_buffer_done(buf-vb, VB2_BUF_STATE_DONE);
 }


--
1.9.1

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


[RFCv2] Media Token API Spec.

2014-11-04 Thread Shuah Khan
Hi Mauro,

Here is the RFC as promised. I also included the Media controller
as a an alternative and captured the discussion in the thread on
that topic. Please review.

-- Shuah

-
RFC Media Token API Specification

Let's start with a diagram of a media device (without IR, eeprom
and others):

http://linuxtv.org/downloads/presentations/typical_hybrid_hardware.png

The dot lines represent the parts of the graph that are switched by
the tuner, DMA or input select.

Please notice that the DMA engines, together with the stuff needed to
control A/V switches is at one single chip. Changing the registers there
can affect the other streams, specially on most sophisticated devices
like cx231xx, where it even has a power management IP block that
validates if a device to be turned on/off won't exceed the maximum
drain current of 500mA. That's basically why we need to do a temporary
lock alsa, dvb, v4l and IR drivers when doing certain changes.

Also, please notice that I2C buses that can be as slow as 10kbps
are used to control for several devices, like:
- the tuner
- the Digital TV (DTV) demod
- Analog and/or Video demod (sometimes embedded at the main
  chip)
- DTV demux (sometimes embedded at the main chip)
- The remote controller (sometimes embedded at the main chip)

For some devices, after powered on, or when certain parameters change, a
new firmware (and sometimes a hardware reset) is required. The firmware
size can be about 64KB or even bigger.

Also, the A/V switch it is actually two independent switches (or one
switch for video and one audio mux for audio) that needs to be changed
together when the source changes.

There are two components that are shared there between analog and
digital: the tuner (where the signal is captured) and the DMA engine
used to stream analog and Digital TV (dvb).

PS.: the diagram is over-simplified, as the tuner is just one of the
possible inputs for the analog part of the device. Other possible
inputs are S-Video, composite, HDMI, etc.

Sometimes, the audio DMA is also shared, e. g. just one stream comes
from the hardware. It is up to the driver to split audio and video and
send them to the V4L2 and ALSA APIs. This is the case of tm6000 driver.

Those shared components can be used either at analog or digital mode,
but not at the same time.

Also, programming the V4L2 analog and audio DMA and demods should be
done via V4L2 API, as this API allows the selection of the proper
audio/video input (almost all devices have multiple analog inputs).

Please notice that, if the tuner is on digital mode, the entire analog
path is disabled, including ALSA output.

If the tuner is on analog mode, both ALSA and V4L2 can work at the
same time. However, during the period where the tuner firmware is
loaded, and during the DMA configuration and input selection time,
neither ALSA or V4L2 can stream. Such configuration/firmware load
is commanded via V4L2 API, as ALSA knows nothing about tuner or
input selection.

At a higher level the problem description is:

There are 3 different device files that get created to control
tuner and audio functions on a media device. 4 drivers (dvb,
v4l2, alsa, and the main usb driver for the usb device), and
3 core APIs (dvb-core, v4l-core, audio) that control the tuner
and audio hardware and provide user API to these 3 device files.

The above driver model is simplified, there's 4th component for
some drivers: the mceusb driver, that handles remote controllers.
The mceusb handles the Microsoft Media Center Remote Control
protocol. It supports stand alone remote controller devices, but
it also supports a few USB devices that use a separate interface
for IR.

There are currently some issues on cx231xx and mceusb, as both drivers
can be used at the same time, but, when cx231xx sends certain commands,
the mceusb IR polls fail. This is out of the scope of the audio lock,
but it also needs to be addressed some day.

Most media user applications, drivers and the core have no knowledge
of each other. The only thing that is common across all these drivers
is the parent device for the main usb device which is controlled by
the usb driver.

Some media user applications like MythTV can handle all 3 APIs,
however, MythTV doesn't know how to associate ALSA, V4L2 and DVB
devnodes that belong to the same device. If MythTV finds, 3 V4L2
nodes, 3 ALSA nodes, and 1 DVB node, it doesn't know which device
is associated with the DVB node.

Almost all applications that are aware of V4L2 API are also aware of
ALSA API and may associate audio and video, as there is a way to
associate it using sysfs. However, several applications don't use it.

The premise for the main design idea in this series is creating
a common construct at the parent device structure that is visible
to all drivers to act as a master access control (lock). Let's call
this media token object with two 

Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9

2014-11-04 Thread Sakari Ailus
Sakari Ailus wrote:
 yavta does, for example, print both the monotonic timestamp from the buffer
 and the time when the buffer has been dequeued:
 
 URL:http://git.ideasonboard.org/yavta.git
 
   $ yavta -c /dev/video0
 
 should do it. The first timestamp is the buffer timestamp, and the latter is
 the one is taken when the buffer is dequeued (by yavta).

Removing the uvcvideo module and loading it again with trace=4096 before
capturing, and then kernel log would provide more useful information.

-- 
Sakari Ailus
sakari.ai...@iki.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: [PATCHv2] [media] af0933: Don't go past arrays

2014-11-04 Thread Antti Palosaari

Acked-by: Antti Palosaari cr...@iki.fi
Reviewed-by: Antti Palosaari cr...@iki.fi

anyhow, I think these branches could never taken in real life. But as a 
killing warnings and potential future changes I am pretty fine!


regards
Antti

On 11/04/2014 10:35 PM, Mauro Carvalho Chehab wrote:

Fixes the following sparse warnings:
drivers/media/dvb-frontends/af9033.c:295 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:300 af9033_init() error: buffer 
overflow 'clock_adc_lut' 11 = 11
drivers/media/dvb-frontends/af9033.c:584 af9033_set_frontend() error: 
buffer overflow 'coeff_lut' 3 = 3
drivers/media/dvb-frontends/af9033.c:595 af9033_set_frontend() error: 
buffer overflow 'clock_adc_lut' 11 = 11

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

-
v2: Only changed the patch subject, as it fixes occurrences on 3
 different arrays.

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index c17e34fd0fb4..82ce47bdf5dc 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -291,6 +291,12 @@ static int af9033_init(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC config for clock=%d\n,
+   dev-cfg.clock);
+   goto err;
+   }

adc_cw = af9033_div(dev, clock_adc_lut[i].adc, 100ul, 19ul);
buf[0] = (adc_cw   0)  0xff;
@@ -580,7 +586,15 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
break;
}
}
-   ret =  af9033_wr_regs(dev, 0x81,
+   if (i == ARRAY_SIZE(coeff_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find LUT config for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
+
+   ret = af9033_wr_regs(dev, 0x81,
coeff_lut[i].val, sizeof(coeff_lut[i].val));
}

@@ -592,6 +606,13 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
if (clock_adc_lut[i].clock == dev-cfg.clock)
break;
}
+   if (i == ARRAY_SIZE(clock_adc_lut)) {
+   dev_err(dev-client-dev,
+   Couldn't find ADC clock for clock=%d\n,
+   dev-cfg.clock);
+   ret = -EINVAL;
+   goto err;
+   }
adc_freq = clock_adc_lut[i].adc;

/* get used IF frequency */



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


cron job: media_tree daily build: ERRORS

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

Results of the daily build of media_tree:

date:   Wed Nov  5 04:00:16 CET 2014
git branch: test
git hash:   a8f29e89f2b54fbf2c52be341f149bc195b63a8b
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-34-g71e642a
host hardware:  x86_64
host os:3.17-2.slh.2-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.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: ERRORS
linux-3.2.37-i686: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-i686: OK
linux-3.18-rc1-i686: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: ERRORS
linux-3.2.37-x86_64: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16-x86_64: OK
linux-3.17-x86_64: OK
linux-3.18-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: ERRORS
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH] staging: media: lirc: replace dev_err by pr_err

2014-11-04 Thread Sudip Mukherjee
On Tue, Nov 04, 2014 at 11:48:26PM +0200, Aya Mahfouz wrote:
 On Tue, Nov 04, 2014 at 03:06:53PM +0530, Sudip Mukherjee wrote:
  On Tue, Nov 04, 2014 at 02:13:19AM +0200, Aya Mahfouz wrote:
   This patch replaces dev_err by pr_err since the value
   of ir is NULL when the message is displayed.
   
   Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
   ---
drivers/staging/media/lirc/lirc_zilog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
   
   diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
   b/drivers/staging/media/lirc/lirc_zilog.c
   index 11a7cb1..ecdd71e 100644
   --- a/drivers/staging/media/lirc/lirc_zilog.c
   +++ b/drivers/staging/media/lirc/lirc_zilog.c
   @@ -1633,7 +1633,7 @@ out_put_xx:
out_put_ir:
 put_ir_device(ir, true);
out_no_ir:
   - dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
   + pr_err(%s: probing IR %s on %s (i2c-%d) failed with %d\n,
  hi,
  instead of ir-l.dev , can you please try dev_err like this :
  
  dev_err(client-dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
  __func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
  ret);   
 
 
 Thanks Sudip. It works. Please add the Reviewed-by tag to the newer
 patch.
 
i think you forgot to add cc to the list and Greg K-H in your reply.
Greg should know that this patch is now not required, otherwise he might apply 
it to his tree.
so just replying to your mail while adding everyone else in the cc.

thanks
sudip


  thanks
  sudip
  
 
 Kind Regards,
 Aya Saif El-yazal Mahfouz
  
 __func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
ret);
 mutex_unlock(ir_devices_lock);
   -- 
   1.9.3
   
   --
   To unsubscribe from this list: send the line unsubscribe linux-kernel in
   the body of a message to majord...@vger.kernel.org
   More majordomo info at  http://vger.kernel.org/majordomo-info.html
   Please read the FAQ at  http://www.tux.org/lkml/
--
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