Re: Suspected cache coherency problem on V4L2 and AR7100 CPU

2013-10-04 Thread Krzysztof Hałasa
 I'm debugging a problem with a SOLO6110-based H.264 PCI video encoder on
 Atheros AR7100-based (MIPS, big-endian) platform.

BTW this CPU obviously has VIPT data cache, this means a physical page
with multiple virtual addresses (e.g. mapped multiple times) may and
will be cached multiple times.

AR7100 = arch/mips/ath79.
-- 
Krzysztof Halasa

Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] v4l: omap4iss: Add support for OMAP4 camera interface - Video devices

2013-10-04 Thread Dan Carpenter
On Thu, Oct 03, 2013 at 01:55:29AM +0200, Laurent Pinchart wrote:
 +
 + ret = vb2_streamon(vfh-queue, type);
 + if (ret  0)
 + goto err_iss_video_check_format;
 +
 + /* In sensor-to-memory mode, the stream can be started synchronously
 +  * to the stream on command. In memory-to-memory mode, it will be
 +  * started when buffers are queued on both the input and output.
 +  */
 + if (pipe-input == NULL) {
 + unsigned long flags;
 + ret = omap4iss_pipeline_set_stream(pipe,
 +   ISS_PIPELINE_STREAM_CONTINUOUS);
 + if (ret  0)
 + goto err_omap4iss_set_stream;
 + spin_lock_irqsave(video-qlock, flags);
 + if (list_empty(video-dmaqueue))
 + video-dmaqueue_flags |= ISS_VIDEO_DMAQUEUE_UNDERRUN;
 + spin_unlock_irqrestore(video-qlock, flags);
 + }
 +
 + if (ret  0) {
 +err_omap4iss_set_stream:
 + vb2_streamoff(vfh-queue, type);
 +err_iss_video_check_format:
 + media_entity_pipeline_stop(video-video.entity);
 +err_media_entity_pipeline_start:
 + if (video-iss-pdata-set_constraints)
 + video-iss-pdata-set_constraints(video-iss, false);
 + video-queue = NULL;
 + }
 +
 + if (!ret)
 + video-streaming = 1;
 +
 + mutex_unlock(video-stream_lock);
 + return ret;
 +}

This driver is mostly really nice code, but this error handling is
spaghetti-al-nasty.  Just split up the success and failure returns.

video-streaming = 1;
mutex_unlock(video-stream_lock);
return 0;

err_omap4iss_set_stream:
vb2_streamoff(vfh-queue, type);
err_iss_video_check_format:
media_entity_pipeline_stop(video-video.entity);
err_media_entity_pipeline_start:
if (video-iss-pdata-set_constraints)
video-iss-pdata-set_constraints(video-iss, false);
video-queue = NULL;

mutex_unlock(video-stream_lock);
return ret;
}

regards,
dan carpenter


--
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 0/3] media: Add SH-Mobile RCAR-H2 Lager board support

2013-10-04 Thread Hans Verkuil
On 09/24/2013 06:14 PM, Guennadi Liakhovetski wrote:
 Hi Valentine,
 
 Since patches 2 and 3 here are for soc-camera, I can offer to take all 3 
 via my tree after all comments to patch 1/3 are addressed and someone 
 (Laurent?) has acked it. Alternatively I can ack the two patches and let 
 all 3 go via another tree, or we can split this series too - no problem 
 with me either way.

I prefer to take these patches. 95% of the work is in the first patch adding
the new adv driver, and I'm responsible for video receivers/transmitters.

There is going to be a revision anyway, so let's wait for v2.

Regards,

Hans

 
 Thanks
 Guennadi
 
 On Tue, 24 Sep 2013, Valentine Barshak wrote:
 
 The following patches add ADV7611/ADV7612 HDMI receiver I2C driver
 and add RCAR H2 SOC support along with ADV761x output format support
 to rcar_vin soc_camera driver.

 These changes are needed for SH-Mobile R8A7790 Lager board
 video input support.

 Valentine Barshak (3):
   media: i2c: Add ADV761X support
   media: rcar_vin: Add preliminary r8a7790 H2 support
   media: rcar_vin: Add RGB888_1X24 input format support

  drivers/media/i2c/Kconfig|   11 +
  drivers/media/i2c/Makefile   |1 +
  drivers/media/i2c/adv761x.c  | 1060 
 ++
  drivers/media/platform/soc_camera/rcar_vin.c |   17 +-
  include/media/adv761x.h  |   28 +
  5 files changed, 1114 insertions(+), 3 deletions(-)
  create mode 100644 drivers/media/i2c/adv761x.c
  create mode 100644 include/media/adv761x.h

 -- 
 1.8.3.1

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

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


[GIT PULL FOR v3.13] Various fixes

2013-10-04 Thread Hans Verkuil
Hi Mauro,

Just a bunch of various fixes. Most notably the solo fixes for big-endian 
systems:
these fixes were removed when I did the large sync to the Bluecherry code base 
for the
solo driver. Many thanks to Krzysztof for doing this work again.

Regards,

Hans

The following changes since commit d10e8280c4c2513d3e7350c27d8e6f0fa03a5f71:

  [media] cx24117: use hybrid_tuner_request/release_state to share state 
between multiple instances (2013-10-03 07:40:12 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v3.13

for you to fetch changes up to fffc9c8a324c7b43db9e359ae4710176fa66f432:

  radio-sf16fmr2: Remove redundant dev_set_drvdata (2013-10-04 12:32:42 +0200)


Dan Carpenter (1):
  snd_tea575x: precedence bug in fmr2_tea575x_get_pins()

Krzysztof Hałasa (4):
  SOLO6x10: don't do DMA from stack in solo_dma_vin_region().
  SOLO6x10: Remove unused #define SOLO_DEFAULT_GOP
  SOLO6x10: Fix video encoding on big-endian systems.
  SOLO6x10: Fix video headers on certain hardware.

Michael Opdenacker (1):
  davinci: remove deprecated IRQF_DISABLED

Sachin Kamat (1):
  radio-sf16fmr2: Remove redundant dev_set_drvdata

Sylwester Nawrocki (1):
  v4l2-ctrls: Correct v4l2_ctrl_get_int_menu() function prototype

 drivers/media/platform/davinci/vpbe_display.c  |   2 +-
 drivers/media/platform/davinci/vpfe_capture.c  |   4 +-
 drivers/media/radio/radio-sf16fmr2.c   |   5 +--
 drivers/media/v4l2-core/v4l2-ctrls.c   |   6 +--
 drivers/staging/media/solo6x10/solo6x10-disp.c |  24 
 drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 153 
-
 drivers/staging/media/solo6x10/solo6x10.h  |   1 -
 include/media/v4l2-common.h|   2 +-
 8 files changed, 117 insertions(+), 80 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v3.12] Various fixes

2013-10-04 Thread Hans Verkuil

The following changes since commit d10e8280c4c2513d3e7350c27d8e6f0fa03a5f71:

  [media] cx24117: use hybrid_tuner_request/release_state to share state 
between multiple instances (2013-10-03 07:40:12 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v3.12

for you to fetch changes up to 28b5399a1cee08c790d51896b53bc8a08c26edd5:

  saa7134: Fix crash when device is closed before streamoff (2013-10-04 
12:40:56 +0200)


Gianluca Gennari (4):
  adv7842: fix compilation with GCC  4.4.6
  adv7511: fix compilation with GCC  4.4.6
  ad9389b: fix compilation with GCC  4.4.6
  ths8200: fix compilation with GCC  4.4.6

Simon Farnsworth (1):
  saa7134: Fix crash when device is closed before streamoff

Wei Yongjun (1):
  adv7511: fix error return code in adv7511_probe()

 drivers/media/i2c/ad9389b.c   | 15 ++-
 drivers/media/i2c/adv7511.c   | 18 +-
 drivers/media/i2c/adv7842.c   | 30 --
 drivers/media/i2c/ths8200.c   | 12 
 drivers/media/pci/saa7134/saa7134-video.c |  1 +
 5 files changed, 32 insertions(+), 44 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libtool warning in libdvbv5

2013-10-04 Thread Hans Verkuil
Hi Gregor,

When linking libdvbv5.la I get the following warning from libtool:

  CCLD libdvbv5.la
libtool: link: warning: `-version-info/-version-number' is ignored for 
convenience libraries

Other libs don't give that warning, but I don't see any obvious differences.

Do you know what might cause this?

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] dvb-apps: fix compiler warnings

2013-10-04 Thread Hans Verkuil
This patch fixes all remaining dvb-apps compiler warnings:

test_video.c:322:2: warning: format ‘%d’ expects argument of type 
‘int’, but argument 2 has type ‘ssize_t’ [-Wformat=]
dvbscan.c:128:6: warning: variable ‘output_type’ set but not used 
[-Wunused-but-set-variable]
dvbscan.c:126:6: warning: variable ‘uk_ordering’ set but not used 
[-Wunused-but-set-variable]
dvbscan.c:124:32: warning: variable ‘inversion’ set but not used 
[-Wunused-but-set-variable]
dvbscan_dvb.c:27:44: warning: unused parameter ‘fe’ [-Wunused-parameter]
dvbscan_atsc.c:27:45: warning: unused parameter ‘fe’ [-Wunused-parameter]

Make.rules has been updated to remove the deprecated -W flag which caused the 
last
two warnings (I see no reason to give warnings for unused parameters).

A printf was updated to fix a type mismatch and dvbscan.c was updated to fix 
several
'set but not used' warnings. I decided not to remove the ignored options just 
in case
some scripts might use them, but I did document in the usage message that those 
options
are ignored.

Fixing this should allow the daily build to produce an OK message, I hope.

Regards,

Hans

diff -r 3ee111da5b3a Make.rules
--- a/Make.rulesMon May 13 15:49:02 2013 +0530
+++ b/Make.rulesFri Oct 04 13:40:18 2013 +0200
@@ -1,6 +1,6 @@
 # build rules for linuxtv.org dvb-apps
 
-CFLAGS ?= -g -Wall -W -Wshadow -Wpointer-arith -Wstrict-prototypes
+CFLAGS ?= -g -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes
 
 ifneq ($(lib_name),)
 
diff -r 3ee111da5b3a test/test_video.c
--- a/test/test_video.c Mon May 13 15:49:02 2013 +0530
+++ b/test/test_video.c Fri Oct 04 13:40:18 2013 +0200
@@ -319,7 +319,7 @@
return;
}
 
-   printf(read: %d bytes\n,read(filefd,sp.iFrame,sp.size));
+   printf(read: %zd bytes\n,read(filefd,sp.iFrame,sp.size));
videoStillPicture(fd,sp);
 
sleep(3);
diff -r 3ee111da5b3a util/dvbscan/dvbscan.c
--- a/util/dvbscan/dvbscan.cMon May 13 15:49:02 2013 +0530
+++ b/util/dvbscan/dvbscan.cFri Oct 04 13:40:18 2013 +0200
@@ -74,8 +74,8 @@
   Dual LO, 
H:5150MHz, V:5750MHz.\n
* One of the sec definitions from the 
secfile if supplied\n
 -satpos positionSpecify DISEQC switch position for 
DVB-S.\n
--inversion on|off|auto Specify inversion (default: auto).\n
--uk-ordering  Use UK DVB-T channel ordering if 
present.\n
+-inversion on|off|auto Specify inversion (default: auto) 
(note: this option is ignored).\n
+-uk-ordering  Use UK DVB-T channel ordering if 
present (note: this option is ignored).\n
 -timeout secs   Specify filter timeout to use (standard 
specced values will be used by default)\n
 -filter filter  Specify service filter, a comma 
seperated list of the following tokens:\n
(If no filter is supplied, all 
services will be output)\n
@@ -83,10 +83,11 @@
* radio - Output radio channels\n
* other - Output other channels\n
* encrypted - Output encrypted 
channels\n
--out raw filename|-  Output in raw format to filename or 
stdout\n
+-out raw filename|- Output in raw format to filename or 
stdout\n
  channels filename|-  Output in channels.conf format to 
filename or stdout.\n
  vdr12 filename|- Output in vdr 1.2.x format to 
filename or stdout.\n
  vdr13 filename|- Output in vdr 1.3.x format to 
filename or stdout.\n
+  Note: this option is ignored.\n
 initial scan file\n;
fprintf(stderr, %s\n, _usage);
 
@@ -121,11 +122,11 @@
char *secfile = NULL;
char *secid = NULL;
int satpos = 0;
-   enum dvbfe_spectral_inversion inversion = DVBFE_INVERSION_AUTO;
+   //enum dvbfe_spectral_inversion inversion = DVBFE_INVERSION_AUTO;
int service_filter = -1;
-   int uk_ordering = 0;
+   //int uk_ordering = 0;
int timeout = 5;
-   int output_type = OUTPUT_TYPE_RAW;
+   //int output_type = OUTPUT_TYPE_RAW;
char *output_filename = NULL;
char *scan_filename = NULL;
struct dvbsec_config sec;
@@ -172,11 +173,11 @@
if ((argc - argpos)  2)
usage();
if (!strcmp(argv[argpos+1], off)) {
-   inversion = DVBFE_INVERSION_OFF;
+   //inversion = DVBFE_INVERSION_OFF;
} else if (!strcmp(argv[argpos+1], on)) {
-   inversion = DVBFE_INVERSION_ON;
+   

[PATCH v4 0/4] Exynos5 Series SCALER Driver

2013-10-04 Thread Shaik Ameer Basha
This patch adds support for SCALER device which is a
new device for scaling, blending, color fill  and color space
conversion on EXYNOS5410/5420 SoCs.

This device supports the following as key features.
input image format
- YCbCr420 2P(UV/VU), 3P
- YCbCr422 1P(YUYV/UYVY/YVYU), 2P(UV,VU), 3P
- YCbCr444 2P(UV,VU), 3P
- RGB565, ARGB1555, ARGB, ARGB, RGBA
- Pre-multiplexed ARGB, L8A8 and L8
output image format
- YCbCr420 2P(UV/VU), 3P
- YCbCr422 1P(YUYV/UYVY/YVYU), 2P(UV,VU), 3P
- YCbCr444 2P(UV,VU), 3P
- RGB565, ARGB1555, ARGB, ARGB, RGBA
- Pre-multiplexed ARGB
input rotation
- 0/90/180/270 degree, X/Y/XY Flip
scale ratio
- 1/4 scale down to 16 scale up
color space conversion
- RGB to YUV / YUV to RGB
Size - Exynos5420
- Input : 16x16 to 8192x8192
- Output:   4x4 to 8192x8192
Size - Exynos5410
- Input/Output: 4x4 to 4096x4096
alpha blending, color fill

Rebased on:
---
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git:master

Changes from v3:
---
Addressed review comments from, Sylwester Nawrocki and Hans Verkuil.
Links to the review comments:
1] https://linuxtv.org/patch/20072/
2] https://linuxtv.org/patch/20073/

Changes from v2:
---
Addressed review comments from, Inki Dae, Hans Verkuil and Sylwester Nawrocki.
Links to the review comments:
1] https://linuxtv.org/patch/19783/
2] https://linuxtv.org/patch/19784/
3] https://linuxtv.org/patch/19785/
4] https://linuxtv.org/patch/19786/
5] https://linuxtv.org/patch/19787/

Changes from v1:
---
1] Split the previous single patch into multiple patches.
2] Added DT binding documentation.
3] Removed the unnecessary header file inclusions.
4] Fix the condition check in mscl_prepare_address for swapping cb/cr addresses.

Shaik Ameer Basha (4):
  [media] exynos-scaler: Add new driver for Exynos5 SCALER
  [media] exynos-scaler: Add core functionality for the SCALER driver
  [media] exynos-scaler: Add m2m functionality for the SCALER driver
  [media] exynos-scaler: Add DT bindings for SCALER driver

 .../devicetree/bindings/media/exynos5-scaler.txt   |   22 +
 drivers/media/platform/Kconfig |8 +
 drivers/media/platform/Makefile|1 +
 drivers/media/platform/exynos-scaler/Makefile  |3 +
 drivers/media/platform/exynos-scaler/scaler-m2m.c  |  786 +
 drivers/media/platform/exynos-scaler/scaler-regs.c |  336 ++
 drivers/media/platform/exynos-scaler/scaler-regs.h |  331 ++
 drivers/media/platform/exynos-scaler/scaler.c  | 1238 
 drivers/media/platform/exynos-scaler/scaler.h  |  375 ++
 9 files changed, 3100 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/exynos5-scaler.txt
 create mode 100644 drivers/media/platform/exynos-scaler/Makefile
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-m2m.c
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.c
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.h
 create mode 100644 drivers/media/platform/exynos-scaler/scaler.c
 create mode 100644 drivers/media/platform/exynos-scaler/scaler.h

-- 
1.7.9.5

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


[PATCH v4 4/4] [media] exynos-scaler: Add DT bindings for SCALER driver

2013-10-04 Thread Shaik Ameer Basha
This patch adds the DT binding documentation for the
Exynos5420/5410 based SCALER device driver.

Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
---
 .../devicetree/bindings/media/exynos5-scaler.txt   |   22 
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/exynos5-scaler.txt

diff --git a/Documentation/devicetree/bindings/media/exynos5-scaler.txt 
b/Documentation/devicetree/bindings/media/exynos5-scaler.txt
new file mode 100644
index 000..f620baf
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/exynos5-scaler.txt
@@ -0,0 +1,22 @@
+* Samsung Exynos5 SCALER device
+
+SCALER is used for scaling, blending, color fill and color space
+conversion on EXYNOS[5420/5410] SoCs.
+
+Required properties:
+- compatible: should be samsung,exynos5420-scaler or
+   samsung,exynos5410-scaler
+- reg: should contain SCALER physical address location and length.
+- interrupts: should contain SCALER interrupt number
+- clocks: should contain the SCALER clock specifier, from the
+   common clock bindings
+- clock-names: should be scaler
+
+Example:
+   scaler_0: scaler@0x1280 {
+   compatible = samsung,exynos5420-scaler;
+   reg = 0x1280 0x1000;
+   interrupts = 0 220 0;
+   clocks = clock 381;
+   clock-names = scaler;
+   };
-- 
1.7.9.5

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


[PATCH v4 3/4] [media] exynos-scaler: Add m2m functionality for the SCALER driver

2013-10-04 Thread Shaik Ameer Basha
This patch adds the Makefile and memory to memory (m2m) interface
functionality for the SCALER driver.

Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
---
 drivers/media/platform/Kconfig|8 +
 drivers/media/platform/Makefile   |1 +
 drivers/media/platform/exynos-scaler/Makefile |3 +
 drivers/media/platform/exynos-scaler/scaler-m2m.c |  786 +
 4 files changed, 798 insertions(+)
 create mode 100644 drivers/media/platform/exynos-scaler/Makefile
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-m2m.c

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 8068d7b..339d3ba 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -201,6 +201,14 @@ config VIDEO_SAMSUNG_EXYNOS_GSC
help
  This is a v4l2 driver for Samsung EXYNOS5 SoC G-Scaler.
 
+config VIDEO_SAMSUNG_EXYNOS_SCALER
+   tristate Samsung Exynos SCALER driver
+   depends on OF  VIDEO_DEV  VIDEO_V4L2  ARCH_EXYNOS5
+   select VIDEOBUF2_DMA_CONTIG
+   select V4L2_MEM2MEM_DEV
+   help
+ This is a v4l2 driver for Samsung EXYNOS5410/5420 SoC SCALER.
+
 config VIDEO_SH_VEU
tristate SuperH VEU mem2mem video processing driver
depends on VIDEO_DEV  VIDEO_V4L2  GENERIC_HARDIRQS  HAS_DMA
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 4e4da48..14cdad5 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_TV)+= s5p-tv/
 
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D)+= s5p-g2d/
 obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC) += exynos-gsc/
+obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_SCALER)  += exynos-scaler/
 
 obj-$(CONFIG_BLACKFIN)  += blackfin/
 
diff --git a/drivers/media/platform/exynos-scaler/Makefile 
b/drivers/media/platform/exynos-scaler/Makefile
new file mode 100644
index 000..6c8a25b
--- /dev/null
+++ b/drivers/media/platform/exynos-scaler/Makefile
@@ -0,0 +1,3 @@
+exynos-scaler-objs := scaler.o scaler-m2m.o scaler-regs.o
+
+obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_SCALER)  += exynos-scaler.o
diff --git a/drivers/media/platform/exynos-scaler/scaler-m2m.c 
b/drivers/media/platform/exynos-scaler/scaler-m2m.c
new file mode 100644
index 000..eb3af85
--- /dev/null
+++ b/drivers/media/platform/exynos-scaler/scaler-m2m.c
@@ -0,0 +1,786 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Samsung EXYNOS5 SoC series SCALER driver
+ *
+ * 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/module.h
+#include linux/pm_runtime.h
+
+#include media/v4l2-ioctl.h
+
+#include scaler-regs.h
+
+#define SCALER_DEF_PIX_FMT V4L2_PIX_FMT_RGB32
+#define SCALER_DEF_WIDTH   1280
+#define SCALER_DEF_HEIGHT  720
+
+static int scaler_m2m_ctx_stop_req(struct scaler_ctx *ctx)
+{
+   struct scaler_ctx *curr_ctx;
+   struct scaler_dev *scaler = ctx-scaler_dev;
+   int ret;
+
+   curr_ctx = v4l2_m2m_get_curr_priv(scaler-m2m.m2m_dev);
+   if (!scaler_m2m_pending(scaler) || (curr_ctx != ctx))
+   return 0;
+
+   scaler_ctx_state_lock_set(SCALER_CTX_STOP_REQ, ctx);
+   ret = wait_event_timeout(scaler-irq_queue,
+   !scaler_ctx_state_is_set(SCALER_CTX_STOP_REQ, ctx),
+   SCALER_SHUTDOWN_TIMEOUT);
+
+   return ret == 0 ? -ETIMEDOUT : ret;
+}
+
+static int scaler_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
+{
+   struct scaler_ctx *ctx = q-drv_priv;
+   int ret;
+
+   ret = pm_runtime_get_sync(ctx-scaler_dev-pdev-dev);
+
+   return ret  0 ? 0 : ret;
+}
+
+static int scaler_m2m_stop_streaming(struct vb2_queue *q)
+{
+   struct scaler_ctx *ctx = q-drv_priv;
+   int ret;
+
+   ret = scaler_m2m_ctx_stop_req(ctx);
+   if (ret  0)
+   scaler_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
+
+   pm_runtime_put(ctx-scaler_dev-pdev-dev);
+
+   return 0;
+}
+
+void scaler_m2m_job_finish(struct scaler_ctx *ctx, int vb_state)
+{
+   struct vb2_buffer *src_vb, *dst_vb;
+
+   if (!ctx || !ctx-m2m_ctx)
+   return;
+
+   src_vb = v4l2_m2m_src_buf_remove(ctx-m2m_ctx);
+   dst_vb = v4l2_m2m_dst_buf_remove(ctx-m2m_ctx);
+
+   if (src_vb  dst_vb) {
+   v4l2_m2m_buf_done(src_vb, vb_state);
+   v4l2_m2m_buf_done(dst_vb, vb_state);
+
+   v4l2_m2m_job_finish(ctx-scaler_dev-m2m.m2m_dev,
+   ctx-m2m_ctx);
+   }
+}
+
+static void scaler_m2m_job_abort(void *priv)
+{
+   struct scaler_ctx *ctx = priv;
+   int ret;
+
+   ret = scaler_m2m_ctx_stop_req(ctx);
+   if (ret  0)
+   

[PATCH v4 1/4] [media] exynos-scaler: Add new driver for Exynos5 SCALER

2013-10-04 Thread Shaik Ameer Basha
This patch adds support for SCALER device which is a new device
for scaling, blending, color fill  and color space conversion
on EXYNOS5410 and EXYNOS5420 SoCs.

This device supports the followings as key feature.
input image format
- YCbCr420 2P(UV/VU), 3P
- YCbCr422 1P(YUYV/UYVY/YVYU), 2P(UV,VU), 3P
- YCbCr444 2P(UV,VU), 3P
- RGB565, ARGB1555, ARGB, ARGB, RGBA
- Pre-multiplexed ARGB, L8A8 and L8
output image format
- YCbCr420 2P(UV/VU), 3P
- YCbCr422 1P(YUYV/UYVY/YVYU), 2P(UV,VU), 3P
- YCbCr444 2P(UV,VU), 3P
- RGB565, ARGB1555, ARGB, ARGB, RGBA
- Pre-multiplexed ARGB
input rotation
- 0/90/180/270 degree, X/Y/XY Flip
scale ratio
- 1/4 scale down to 16 scale up
color space conversion
- RGB to YUV / YUV to RGB
Size - Exynos5420
- Input : 16x16 to 8192x8192
- Output:   4x4 to 8192x8192
Size - Exynos5410
- Input/Output: 4x4 to 4096x4096
alpha blending, color fill

Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
---
 drivers/media/platform/exynos-scaler/scaler-regs.c |  336 
 drivers/media/platform/exynos-scaler/scaler-regs.h |  331 +++
 2 files changed, 667 insertions(+)
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.c
 create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.h

diff --git a/drivers/media/platform/exynos-scaler/scaler-regs.c 
b/drivers/media/platform/exynos-scaler/scaler-regs.c
new file mode 100644
index 000..ae4a548
--- /dev/null
+++ b/drivers/media/platform/exynos-scaler/scaler-regs.c
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Samsung EXYNOS5 SoC series SCALER driver
+ *
+ * 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/delay.h
+#include linux/platform_device.h
+
+#include scaler-regs.h
+
+/* Scaler reset timeout in milliseconds */
+#define SCALER_RESET_TIMEOUT   50
+
+void scaler_hw_set_sw_reset(struct scaler_dev *dev)
+{
+   u32 cfg;
+
+   cfg = scaler_read(dev, SCALER_CFG);
+   cfg |= SCALER_CFG_SOFT_RESET;
+
+   scaler_write(dev, SCALER_CFG, cfg);
+}
+
+int scaler_wait_reset(struct scaler_dev *dev)
+{
+   unsigned long end = jiffies + msecs_to_jiffies(SCALER_RESET_TIMEOUT);
+   u32 cfg, reset_done = 0;
+
+   while (time_before(jiffies, end)) {
+   cfg = scaler_read(dev, SCALER_CFG);
+   if (!(cfg  SCALER_CFG_SOFT_RESET)) {
+   reset_done = 1;
+   break;
+   }
+   usleep_range(10, 20);
+   }
+
+   /*
+* Write any value to read/write register and read it back.
+* If the written and read value matches, then the reset process is
+* succeeded.
+*/
+   while (reset_done) {
+
+   /*
+* TODO: need to define number of tries before returning
+* -EBUSY to the caller
+*/
+
+   scaler_write(dev, SCALER_CFG_SOFT_RESET_CHECK_REG,
+   SCALER_CFG_SOFT_RESET_CHECK_VAL);
+   if (SCALER_CFG_SOFT_RESET_CHECK_VAL ==
+   scaler_read(dev, SCALER_CFG_SOFT_RESET_CHECK_REG))
+   return 0;
+   }
+
+   return -EBUSY;
+}
+
+void scaler_hw_set_irq(struct scaler_dev *dev, int irq_num, bool enable)
+{
+   u32 cfg;
+
+   if ((irq_num  SCALER_INT_FRAME_END) ||
+   (irq_num  SCALER_INT_TIMEOUT))
+   return;
+
+   cfg = scaler_read(dev, SCALER_INT_EN);
+   if (enable)
+   cfg |= (1  irq_num);
+   else
+   cfg = ~(1  irq_num);
+   scaler_write(dev, SCALER_INT_EN, cfg);
+}
+
+void scaler_hw_set_input_addr(struct scaler_dev *dev, struct scaler_addr *addr)
+{
+   scaler_dbg(dev, src_buf: 0x%x, cb: 0x%x, cr: 0x%x,
+   addr-y, addr-cb, addr-cr);
+   scaler_write(dev, SCALER_SRC_Y_BASE, addr-y);
+   scaler_write(dev, SCALER_SRC_CB_BASE, addr-cb);
+   scaler_write(dev, SCALER_SRC_CR_BASE, addr-cr);
+}
+
+void scaler_hw_set_output_addr(struct scaler_dev *dev,
+struct scaler_addr *addr)
+{
+   scaler_dbg(dev, dst_buf: 0x%x, cb: 0x%x, cr: 0x%x,
+   addr-y, addr-cb, addr-cr);
+   scaler_write(dev, SCALER_DST_Y_BASE, addr-y);
+   scaler_write(dev, SCALER_DST_CB_BASE, addr-cb);
+   scaler_write(dev, SCALER_DST_CR_BASE, addr-cr);
+}
+
+void scaler_hw_set_in_size(struct scaler_ctx *ctx)
+{
+   struct scaler_dev *dev = ctx-scaler_dev;
+   struct scaler_frame *frame = ctx-s_frame;
+   u32 cfg;
+
+   /* set input pixel offset */
+   

[PATCH v4 2/4] [media] exynos-scaler: Add core functionality for the SCALER driver

2013-10-04 Thread Shaik Ameer Basha
This patch adds the core functionality for the SCALER driver.

Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
---
 drivers/media/platform/exynos-scaler/scaler.c | 1238 +
 drivers/media/platform/exynos-scaler/scaler.h |  375 
 2 files changed, 1613 insertions(+)
 create mode 100644 drivers/media/platform/exynos-scaler/scaler.c
 create mode 100644 drivers/media/platform/exynos-scaler/scaler.h

diff --git a/drivers/media/platform/exynos-scaler/scaler.c 
b/drivers/media/platform/exynos-scaler/scaler.c
new file mode 100644
index 000..57635f2
--- /dev/null
+++ b/drivers/media/platform/exynos-scaler/scaler.c
@@ -0,0 +1,1238 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Samsung EXYNOS5 SoC series SCALER driver
+ *
+ * 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/clk.h
+#include linux/interrupt.h
+#include linux/module.h
+#include linux/of_platform.h
+#include linux/pm_runtime.h
+
+#include scaler-regs.h
+
+#define SCALER_CLOCK_GATE_NAME scaler
+
+static const struct scaler_fmt scaler_formats[] = {
+   {
+   .name   = YUV 4:2:0 non-contig. 2p, Y/CbCr,
+   .pixelformat= V4L2_PIX_FMT_NV12M,
+   .depth  = { 8, 4 },
+   .color  = SCALER_YUV420,
+   .color_order= SCALER_CBCR,
+   .num_planes = 2,
+   .num_comp   = 2,
+   .scaler_color   = SCALER_YUV420_2P_Y_UV,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+
+   }, {
+   .name   = YUV 4:2:0 contig. 2p, Y/CbCr,
+   .pixelformat= V4L2_PIX_FMT_NV12,
+   .depth  = { 12 },
+   .color  = SCALER_YUV420,
+   .color_order= SCALER_CBCR,
+   .num_planes = 1,
+   .num_comp   = 2,
+   .scaler_color   = SCALER_YUV420_2P_Y_UV,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = YUV 4:2:0 n.c. 2p, Y/CbCr tiled,
+   .pixelformat= V4L2_PIX_FMT_NV12MT_16X16,
+   .depth  = { 8, 4 },
+   .color  = SCALER_YUV420,
+   .color_order= SCALER_CBCR,
+   .num_planes = 2,
+   .num_comp   = 2,
+   .scaler_color   = SCALER_YUV420_2P_Y_UV,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_TILED),
+   }, {
+   .name   = YUV 4:2:2 contig. 2p, Y/CbCr,
+   .pixelformat= V4L2_PIX_FMT_NV16,
+   .depth  = { 16 },
+   .color  = SCALER_YUV422,
+   .color_order= SCALER_CBCR,
+   .num_planes = 1,
+   .num_comp   = 2,
+   .scaler_color   = SCALER_YUV422_2P_Y_UV,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = YUV 4:4:4 contig. 2p, Y/CbCr,
+   .pixelformat= V4L2_PIX_FMT_NV24,
+   .depth  = { 24 },
+   .color  = SCALER_YUV444,
+   .color_order= SCALER_CBCR,
+   .num_planes = 1,
+   .num_comp   = 2,
+   .scaler_color   = SCALER_YUV444_2P_Y_UV,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = RGB565,
+   .pixelformat= V4L2_PIX_FMT_RGB565X,
+   .depth  = { 16 },
+   .color  = SCALER_RGB,
+   .num_planes = 1,
+   .num_comp   = 1,
+   .scaler_color   = SCALER_RGB565,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = XRGB-1555, 16 bpp,
+   .pixelformat= V4L2_PIX_FMT_RGB555,
+   .depth  = { 16 },
+   .color  = SCALER_RGB,
+   .num_planes = 1,
+   .num_comp   = 1,
+   .scaler_color   = SCALER_ARGB1555,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = XRGB-, 32 bpp,
+   .pixelformat= V4L2_PIX_FMT_RGB32,
+   .depth  = { 32 },
+   .color  = SCALER_RGB,
+   .num_planes = 1,
+   .num_comp   = 1,
+   .scaler_color   = SCALER_ARGB,
+   .flags  = (SCALER_FMT_SRC | SCALER_FMT_DST),
+   }, {
+   .name   = YUV 4:2:2 packed, YCrYCb,
+   .pixelformat= V4L2_PIX_FMT_YVYU,
+   .depth  = { 16 

[PATCH] vb2: Allow STREAMOFF for io emulator

2013-10-04 Thread Ricardo Ribalda Delgado
A video device opened and streaming in io emulator mode can only stop
streamming if its file descriptor is closed.

There are some parameters that can only be changed if the device is not
streaming. Also, the power consumption of a device streaming could be
different than one not streaming.

With this patch a video device opened in io emulator can be stopped on
demand.

Signed-off-by: Ricardo Ribalda Delgado ricardo.riba...@gmail.com
---
 drivers/media/v4l2-core/videobuf2-core.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index 9fc4bab..097fba8 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1686,6 +1686,7 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type 
type)
 }
 EXPORT_SYMBOL_GPL(vb2_streamon);
 
+static int __vb2_cleanup_fileio(struct vb2_queue *q);
 
 /**
  * vb2_streamoff - stop streaming
@@ -1704,11 +1705,6 @@ EXPORT_SYMBOL_GPL(vb2_streamon);
  */
 int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
 {
-   if (q-fileio) {
-   dprintk(1, streamoff: file io in progress\n);
-   return -EBUSY;
-   }
-
if (type != q-type) {
dprintk(1, streamoff: invalid stream type\n);
return -EINVAL;
@@ -1719,6 +1715,11 @@ int vb2_streamoff(struct vb2_queue *q, enum 
v4l2_buf_type type)
return -EINVAL;
}
 
+   if (q-fileio) {
+   __vb2_cleanup_fileio(q);
+   return 0;
+   }
+
/*
 * Cancel will pause streaming and remove all buffers from the driver
 * and videobuf, effectively returning control over them to userspace.
-- 
1.8.4.rc3

--
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/14] timblogiw: fix two sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/platform/timblogiw.c:763:43: warning: incorrect type in 
initializer (incompatible argument 3 (different signedness))
drivers/media/platform/timblogiw.c:764:43: warning: incorrect type in 
initializer (incompatible argument 3 (different signedness))

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Richard Röjfors richard.rojf...@pelagicore.com
---
 drivers/media/platform/timblogiw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/timblogiw.c 
b/drivers/media/platform/timblogiw.c
index b557caf..6a74ce0 100644
--- a/drivers/media/platform/timblogiw.c
+++ b/drivers/media/platform/timblogiw.c
@@ -403,7 +403,7 @@ static int timblogiw_s_input(struct file *file, void  
*priv, unsigned int input)
return 0;
 }
 
-static int timblogiw_streamon(struct file *file, void  *priv, unsigned int 
type)
+static int timblogiw_streamon(struct file *file, void  *priv, enum 
v4l2_buf_type type)
 {
struct video_device *vdev = video_devdata(file);
struct timblogiw_fh *fh = priv;
@@ -420,7 +420,7 @@ static int timblogiw_streamon(struct file *file, void  
*priv, unsigned int type)
 }
 
 static int timblogiw_streamoff(struct file *file, void  *priv,
-   unsigned int type)
+   enum v4l2_buf_type type)
 {
struct video_device *vdev = video_devdata(file);
struct timblogiw_fh *fh = priv;
-- 
1.8.3.2

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


[PATCH 05/14] cxd2820r_core: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/cxd2820r_core.c:34:32: error: cannot size expression
drivers/media/dvb-frontends/cxd2820r_core.c:68:32: error: cannot size expression

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/cxd2820r_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c 
b/drivers/media/dvb-frontends/cxd2820r_core.c
index 7ca5c69..d9eeeb1 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -31,7 +31,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, 
u8 i2c, u8 reg,
{
.addr = i2c,
.flags = 0,
-   .len = sizeof(buf),
+   .len = len + 1,
.buf = buf,
}
};
@@ -65,7 +65,7 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, 
u8 i2c, u8 reg,
}, {
.addr = i2c,
.flags = I2C_M_RD,
-   .len = sizeof(buf),
+   .len = len,
.buf = buf,
}
};
-- 
1.8.3.2

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


[PATCH 04/14] tuner-xs2028.c: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/tuners/tuner-xc2028.c:575:24: warning: cast to restricted __le16
drivers/media/tuners/tuner-xc2028.c:686:21: warning: cast to restricted __le16

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/tuners/tuner-xc2028.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/tuners/tuner-xc2028.c 
b/drivers/media/tuners/tuner-xc2028.c
index 878d2c4..e287a74 100644
--- a/drivers/media/tuners/tuner-xc2028.c
+++ b/drivers/media/tuners/tuner-xc2028.c
@@ -572,7 +572,7 @@ static int load_firmware(struct dvb_frontend *fe, unsigned 
int type,
return -EINVAL;
}
 
-   size = le16_to_cpu(*(__u16 *) p);
+   size = le16_to_cpu(*(__le16 *) p);
p += sizeof(size);
 
if (size == 0x)
@@ -683,7 +683,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int 
type,
/* 16 SCODE entries per file; each SCODE entry is 12 bytes and
 * has a 2-byte size header in the firmware format. */
if (priv-firm[pos].size != 14 * 16 || scode = 16 ||
-   le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
+   le16_to_cpu(*(__le16 *)(p + 14 * scode)) != 12)
return -EINVAL;
p += 14 * scode + 2;
}
-- 
1.8.3.2

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


[PATCH 00/14] Fixes for sparse warnings

2013-10-04 Thread Hans Verkuil
This is a first set of fixes for sparse warnings. There are lots more, but
you have to start somewhere...

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 01/14] hdpvr: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/usb/hdpvr/hdpvr-core.c:110:54: warning: incorrect type in 
argument 1 (different base types)
drivers/media/usb/hdpvr/hdpvr-core.c:112:39: warning: invalid assignment: +=
drivers/media/usb/hdpvr/hdpvr-core.c:304:26: warning: Using plain integer as 
NULL pointer

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/usb/hdpvr/hdpvr-core.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c 
b/drivers/media/usb/hdpvr/hdpvr-core.c
index 6e50707..2f0c89c 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -78,7 +78,8 @@ void hdpvr_delete(struct hdpvr_device *dev)
 
 static void challenge(u8 *bytes)
 {
-   u64 *i64P, tmp64;
+   __le64 *i64P;
+   u64 tmp64;
uint i, idx;
 
for (idx = 0; idx  32; ++idx) {
@@ -106,10 +107,10 @@ static void challenge(u8 *bytes)
for (i = 0; i  3; i++)
bytes[1] *= bytes[6] + 1;
for (i = 0; i  3; i++) {
-   i64P = (u64 *)bytes;
+   i64P = (__le64 *)bytes;
tmp64 = le64_to_cpup(i64P);
-   tmp64 = bytes[7]  0x0f;
-   *i64P += cpu_to_le64(tmp64);
+   tmp64 = tmp64 + (tmp64  (bytes[7]  0x0f));
+   *i64P = cpu_to_le64(tmp64);
}
break;
}
@@ -301,8 +302,6 @@ static int hdpvr_probe(struct usb_interface *interface,
goto error;
}
 
-   dev-workqueue = 0;
-
/* init video transfer queues first of all */
/* to prevent oops in hdpvr_delete() on error paths */
INIT_LIST_HEAD(dev-free_buff_list);
-- 
1.8.3.2

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


[PATCH 06/14] drxd_hard: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/drxd_hard.c:1017:70: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:1038:69: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2836:33: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2972:30: warning: Using plain integer 
as NULL pointer

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/drxd_hard.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxd_hard.c 
b/drivers/media/dvb-frontends/drxd_hard.c
index cbd7c92..959ae36 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -1014,7 +1014,7 @@ static int HI_CfgCommand(struct drxd_state *state)
status = Write16(state, HI_RA_RAM_SRV_CMD__A,
 HI_RA_RAM_SRV_CMD_CONFIG, 0);
else
-   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, 0);
+   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, NULL);
mutex_unlock(state-mutex);
return status;
 }
@@ -1035,7 +1035,7 @@ static int HI_ResetCommand(struct drxd_state *state)
status = Write16(state, HI_RA_RAM_SRV_RST_KEY__A,
 HI_RA_RAM_SRV_RST_KEY_ACT, 0);
if (status == 0)
-   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, 0);
+   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, NULL);
mutex_unlock(state-mutex);
msleep(1);
return status;
@@ -2833,7 +2833,7 @@ static int drxd_init(struct dvb_frontend *fe)
int err = 0;
 
 /* if (request_firmware(state-fw, drxd.fw, state-dev)0) */
-   return DRXD_init(state, 0, 0);
+   return DRXD_init(state, NULL, 0);
 
err = DRXD_init(state, state-fw-data, state-fw-size);
release_firmware(state-fw);
@@ -2969,7 +2969,7 @@ struct dvb_frontend *drxd_attach(const struct drxd_config 
*config,
 
mutex_init(state-mutex);
 
-   if (Read16(state, 0, 0, 0)  0)
+   if (Read16(state, 0, NULL, 0)  0)
goto error;
 
state-frontend.ops = drxd_ops;
-- 
1.8.3.2

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


[PATCH 12/14] tlg2300: fix sparse warning

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/usb/tlg2300/pd-main.c:235:25: warning: incorrect type in 
assignment (different base types)

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Huang Shijie shij...@gmail.com
---
 drivers/media/usb/tlg2300/pd-main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/tlg2300/pd-main.c 
b/drivers/media/usb/tlg2300/pd-main.c
index 95f94e5..3316caa 100644
--- a/drivers/media/usb/tlg2300/pd-main.c
+++ b/drivers/media/usb/tlg2300/pd-main.c
@@ -232,7 +232,7 @@ static int firmware_download(struct usb_device *udev)
goto out;
}
 
-   max_packet_size = udev-ep_out[0x1]-desc.wMaxPacketSize;
+   max_packet_size = le16_to_cpu(udev-ep_out[0x1]-desc.wMaxPacketSize);
log(\t\t download size : %d, (int)max_packet_size);
 
for (offset = 0; offset  fwlength; offset += max_packet_size) {
-- 
1.8.3.2

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


[PATCH 14/14] siano: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/common/siano/smsdvb-main.c:47:5: warning: symbol 
'sms_to_guard_interval_table' was not declared. Should it be static?
drivers/media/common/siano/smsdvb-main.c:54:5: warning: symbol 
'sms_to_code_rate_table' was not declared. Should it be static?
drivers/media/common/siano/smsdvb-main.c:63:5: warning: symbol 
'sms_to_hierarchy_table' was not declared. Should it be static?
drivers/media/common/siano/smsdvb-main.c:70:5: warning: symbol 
'sms_to_modulation_table' was not declared. Should it be static?
drivers/media/common/siano/smscoreapi.c:925:35: warning: cast to restricted 
__le32
drivers/media/common/siano/smscoreapi.c:926:28: warning: cast to restricted 
__le32

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Mauro Carvalho Chehab m.che...@samsung.com
---
 drivers/media/common/siano/smscoreapi.c  | 4 ++--
 drivers/media/common/siano/smsdvb-main.c | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/common/siano/smscoreapi.c 
b/drivers/media/common/siano/smscoreapi.c
index a142f79..9df2410 100644
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -922,8 +922,8 @@ static int smscore_load_firmware_family2(struct 
smscore_device_t *coredev,
u32 i, *ptr;
u8 *payload = firmware-payload;
int rc = 0;
-   firmware-start_address = le32_to_cpu(firmware-start_address);
-   firmware-length = le32_to_cpu(firmware-length);
+   firmware-start_address = le32_to_cpup((__le32 
*)firmware-start_address);
+   firmware-length = le32_to_cpup((__le32 *)firmware-length);
 
mem_address = firmware-start_address;
 
diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index 63676a8..85151ef 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -44,14 +44,14 @@ module_param_named(debug, sms_dbg, int, 0644);
 MODULE_PARM_DESC(debug, set debug level (info=1, adv=2 (or-able)));
 
 
-u32 sms_to_guard_interval_table[] = {
+static u32 sms_to_guard_interval_table[] = {
[0] = GUARD_INTERVAL_1_32,
[1] = GUARD_INTERVAL_1_16,
[2] = GUARD_INTERVAL_1_8,
[3] = GUARD_INTERVAL_1_4,
 };
 
-u32 sms_to_code_rate_table[] = {
+static u32 sms_to_code_rate_table[] = {
[0] = FEC_1_2,
[1] = FEC_2_3,
[2] = FEC_3_4,
@@ -60,14 +60,14 @@ u32 sms_to_code_rate_table[] = {
 };
 
 
-u32 sms_to_hierarchy_table[] = {
+static u32 sms_to_hierarchy_table[] = {
[0] = HIERARCHY_NONE,
[1] = HIERARCHY_1,
[2] = HIERARCHY_2,
[3] = HIERARCHY_4,
 };
 
-u32 sms_to_modulation_table[] = {
+static u32 sms_to_modulation_table[] = {
[0] = QPSK,
[1] = QAM_16,
[2] = QAM_64,
-- 
1.8.3.2

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


[PATCH 11/14] cx231xx: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:31:19: warning: symbol 
'cx231xx_Scenario' was not declared. Should it be static?
drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c:675:23: warning: cast to restricted 
__le32

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c 
b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
index d7308ab..2a34cee 100644
--- a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
+++ b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
@@ -28,7 +28,7 @@ MODULE_PARM_DESC(pcb_debug, enable pcb config debug messages 
[video]);
 
 
/**/
 
-struct pcb_config cx231xx_Scenario[] = {
+static struct pcb_config cx231xx_Scenario[] = {
{
 INDEX_SELFPOWER_DIGITAL_ONLY,  /* index */
 USB_SELF_POWER,/* power_type */
@@ -672,7 +672,7 @@ u32 initialize_cx231xx(struct cx231xx *dev)
pcb config it is related to */
cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4);
 
-   config_info = le32_to_cpu(*((u32 *) data));
+   config_info = le32_to_cpu(*((__le32 *)data));
usb_speed = (u8) (config_info  0x1);
 
/* Verify this device belongs to Bus power or Self power device */
-- 
1.8.3.2

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


[PATCH 07/14] drxk_hard: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxk_hard.c:2784:63: warning: Using plain integer 
as NULL pointer

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/drxk_hard.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxk_hard.c 
b/drivers/media/dvb-frontends/drxk_hard.c
index 082014d..d416c15 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -1083,7 +1083,7 @@ static int hi_cfg_command(struct drxk_state *state)
 SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY);
if (status  0)
goto error;
-   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, 0);
+   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, NULL);
if (status  0)
goto error;
 
@@ -2781,7 +2781,7 @@ static int ConfigureI2CBridge(struct drxk_state *state, 
bool b_enable_bridge)
goto error;
}
 
-   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, 0);
+   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, NULL);
 
 error:
if (status  0)
-- 
1.8.3.2

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


[PATCH 10/14] az6027: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/usb/dvb-usb/az6027.c:257:23: warning: symbol 
'az6027_stb0899_config' was not declared. Should it be static?
drivers/media/usb/dvb-usb/az6027.c:294:23: warning: symbol 
'az6027_stb6100_config' was not declared. Should it be static?

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/usb/dvb-usb/az6027.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/az6027.c 
b/drivers/media/usb/dvb-usb/az6027.c
index ea2d5ee..c11138e 100644
--- a/drivers/media/usb/dvb-usb/az6027.c
+++ b/drivers/media/usb/dvb-usb/az6027.c
@@ -254,7 +254,7 @@ static const struct stb0899_s1_reg 
az6027_stb0899_s1_init_3[] = {
 
 
 
-struct stb0899_config az6027_stb0899_config = {
+static struct stb0899_config az6027_stb0899_config = {
.init_dev   = az6027_stb0899_s1_init_1,
.init_s2_demod  = stb0899_s2_init_2,
.init_s1_demod  = az6027_stb0899_s1_init_3,
@@ -291,7 +291,7 @@ struct stb0899_config az6027_stb0899_config = {
.tuner_set_rfsiggain= NULL,
 };
 
-struct stb6100_config az6027_stb6100_config = {
+static struct stb6100_config az6027_stb6100_config = {
.tuner_address  = 0xc0,
.refclock   = 2700,
 };
-- 
1.8.3.2

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


[PATCH 02/14] pvrusb2: fix sparse warning

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2871:13: warning: symbol 
'pvr2_hdw_get_detected_std' was not declared. Should it be static?

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Mike Isely is...@pobox.com
---
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index c4d51d7..ea05f67 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -2868,7 +2868,7 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, 
int id,
pvr2_subdev_set_control(hdw, id, #lab, (hdw)-lab##_val); \
}
 
-v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw)
+static v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw)
 {
v4l2_std_id std;
std = (v4l2_std_id)hdw-std_mask_avail;
-- 
1.8.3.2

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


Re: [PATCH] vb2: Allow STREAMOFF for io emulator

2013-10-04 Thread Hans Verkuil
Hi Ricardo,

On 10/04/2013 03:49 PM, Ricardo Ribalda Delgado wrote:
 A video device opened and streaming in io emulator mode can only stop
 streamming if its file descriptor is closed.
 
 There are some parameters that can only be changed if the device is not
 streaming. Also, the power consumption of a device streaming could be
 different than one not streaming.
 
 With this patch a video device opened in io emulator can be stopped on
 demand.

Why would you want this? If you can call STREAMOFF, why not use stream I/O
all the way? That's much more efficient than read() anyway.

Unless there is a very good use-case, I don't see a good reason for mixing
file I/O with streaming I/O ioctls.

Regards,

Hans

 
 Signed-off-by: Ricardo Ribalda Delgado ricardo.riba...@gmail.com
 ---
  drivers/media/v4l2-core/videobuf2-core.c | 11 ++-
  1 file changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
 b/drivers/media/v4l2-core/videobuf2-core.c
 index 9fc4bab..097fba8 100644
 --- a/drivers/media/v4l2-core/videobuf2-core.c
 +++ b/drivers/media/v4l2-core/videobuf2-core.c
 @@ -1686,6 +1686,7 @@ int vb2_streamon(struct vb2_queue *q, enum 
 v4l2_buf_type type)
  }
  EXPORT_SYMBOL_GPL(vb2_streamon);
  
 +static int __vb2_cleanup_fileio(struct vb2_queue *q);
  
  /**
   * vb2_streamoff - stop streaming
 @@ -1704,11 +1705,6 @@ EXPORT_SYMBOL_GPL(vb2_streamon);
   */
  int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
  {
 - if (q-fileio) {
 - dprintk(1, streamoff: file io in progress\n);
 - return -EBUSY;
 - }
 -
   if (type != q-type) {
   dprintk(1, streamoff: invalid stream type\n);
   return -EINVAL;
 @@ -1719,6 +1715,11 @@ int vb2_streamoff(struct vb2_queue *q, enum 
 v4l2_buf_type type)
   return -EINVAL;
   }
  
 + if (q-fileio) {
 + __vb2_cleanup_fileio(q);
 + return 0;
 + }
 +
   /*
* Cancel will pause streaming and remove all buffers from the driver
* and videobuf, effectively returning control over them to userspace.
 

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


[PATCH 08/14] fmdrv_common: fix sparse warning

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/radio/wl128x/fmdrv_common.c:178:6: warning: symbol 'g_st_write' 
was not declared. Should it be static?

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Manjunatha Halli manjunatha_ha...@ti.com
---
 drivers/media/radio/wl128x/fmdrv_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/wl128x/fmdrv_common.c 
b/drivers/media/radio/wl128x/fmdrv_common.c
index 253f307..4b2e9e8 100644
--- a/drivers/media/radio/wl128x/fmdrv_common.c
+++ b/drivers/media/radio/wl128x/fmdrv_common.c
@@ -175,7 +175,7 @@ static int_handler_prototype int_handler_table[] = {
fm_irq_handle_intmsk_cmd_resp
 };
 
-long (*g_st_write) (struct sk_buff *skb);
+static long (*g_st_write) (struct sk_buff *skb);
 static struct completion wait_for_fmdrv_reg_comp;
 
 static inline void fm_irq_call(struct fmdev *fmdev)
-- 
1.8.3.2

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


[PATCH 13/14] cx25821: fix sparse warnings

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/pci/cx25821/cx25821-cards.c:49:20: warning: symbol 
'cx25821_bcount' was not declared. Should it be static?
drivers/media/pci/cx25821/cx25821-video-upstream.c:162:33: warning: incorrect 
type in assignment (different base types)
drivers/media/pci/cx25821/cx25821-video-upstream.c:163:33: warning: incorrect 
type in assignment (different base types)
drivers/media/pci/cx25821/cx25821-video-upstream.c:164:33: warning: incorrect 
type in assignment (different base types)
drivers/media/pci/cx25821/cx25821-video-upstream.c:165:33: warning: incorrect 
type in assignment (different base types)
drivers/media/pci/cx25821/cx25821-medusa-video.h:43:16: warning: symbol 
'_num_decoders' was not declared. Should it be static?
drivers/media/pci/cx25821/cx25821-medusa-video.h:44:16: warning: symbol 
'_num_cameras' was not declared. Should it be static?
drivers/media/pci/cx25821/cx25821-medusa-video.h:46:14: warning: symbol 
'_video_standard' was not declared. Should it be static?
drivers/media/pci/cx25821/cx25821-medusa-video.h:47:5: warning: symbol 
'_display_field_cnt' was not declared. Should it be static?

After analyzing the last four warnings carefully it became clear that these
variables were really completely unused. As a result of that the call to
medusa_set_decoderduration() is now dubious since the duration is always 0.

Without documentation, however, I can't tell what the right value is.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/pci/cx25821/cx25821-cards.c  |  2 --
 drivers/media/pci/cx25821/cx25821-medusa-video.c   | 18 ++
 drivers/media/pci/cx25821/cx25821-medusa-video.h   |  6 --
 drivers/media/pci/cx25821/cx25821-video-upstream.c |  8 
 4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/media/pci/cx25821/cx25821-cards.c 
b/drivers/media/pci/cx25821/cx25821-cards.c
index 3b409fe..f2ebc98 100644
--- a/drivers/media/pci/cx25821/cx25821-cards.c
+++ b/drivers/media/pci/cx25821/cx25821-cards.c
@@ -45,5 +45,3 @@ struct cx25821_board cx25821_boards[] = {
},
 
 };
-
-const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.c 
b/drivers/media/pci/cx25821/cx25821-medusa-video.c
index 22fa044..43bdfa4 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.c
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c
@@ -438,7 +438,7 @@ void medusa_set_resolution(struct cx25821_dev *dev, int 
width,
decoder_count = decoder_select + 1;
} else {
decoder = 0;
-   decoder_count = _num_decoders;
+   decoder_count = dev-_max_num_decoders;
}
 
switch (width) {
@@ -506,8 +506,6 @@ static void medusa_set_decoderduration(struct cx25821_dev 
*dev, int decoder,
break;
}
 
-   _display_field_cnt[decoder] = duration;
-
/* update hardware */
fld_cnt = cx25821_i2c_read(dev-i2c_bus[0], disp_cnt_reg, tmp);
 
@@ -667,8 +665,6 @@ int medusa_video_init(struct cx25821_dev *dev)
int ret_val = 0;
int i = 0;
 
-   _num_decoders = dev-_max_num_decoders;
-
/* disable Auto source selection on all video decoders */
value = cx25821_i2c_read(dev-i2c_bus[0], MON_A_CTRL, tmp);
value = 0xF0FF;
@@ -685,8 +681,14 @@ int medusa_video_init(struct cx25821_dev *dev)
if (ret_val  0)
goto error;
 
-   for (i = 0; i  _num_decoders; i++)
-   medusa_set_decoderduration(dev, i, _display_field_cnt[i]);
+   /*
+* FIXME: due to a coding bug the duration was always 0. It's
+* likely that it really should be something else, but due to the
+* lack of documentation I have no idea what it should be. For
+* now just fill in 0 as the duration.
+*/
+   for (i = 0; i  dev-_max_num_decoders; i++)
+   medusa_set_decoderduration(dev, i, 0);
 
/* Select monitor as DENC A input, power up the DAC */
value = cx25821_i2c_read(dev-i2c_bus[0], DENC_AB_CTRL, tmp);
@@ -717,7 +719,7 @@ int medusa_video_init(struct cx25821_dev *dev)
/* Turn on all of the data out and control output pins. */
value = cx25821_i2c_read(dev-i2c_bus[0], PIN_OE_CTRL, tmp);
value = 0xFEF0FE00;
-   if (_num_decoders == MAX_DECODERS) {
+   if (dev-_max_num_decoders == MAX_DECODERS) {
/*
 * Note: The octal board does not support control pins(bit16-19)
 * These bits are ignored in the octal board.
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.h 
b/drivers/media/pci/cx25821/cx25821-medusa-video.h
index 6175e09..8bf602f 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.h
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.h
@@ -40,10 +40,4 @@
 #define CONTRAST_DEFAULT5000
 #define HUE_DEFAULT 

[PATCH 09/14] radio-keene: fix sparse warning

2013-10-04 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

drivers/media/radio/radio-keene.c:126:45: warning: dubious: !x | y

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/radio/radio-keene.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-keene.c 
b/drivers/media/radio/radio-keene.c
index 21db23b..fa39640 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -123,7 +123,7 @@ static int keene_cmd_set(struct keene_device *radio)
/* If bit 0 is set, then transmit mono, otherwise stereo.
   If bit 2 is set, then enable 75 us preemphasis, otherwise
   it is 50 us. */
-   radio-buffer[3] = (!radio-stereo) | (radio-preemph_75_us ? 4 : 0);
+   radio-buffer[3] = (radio-stereo ? 0 : 1) | (radio-preemph_75_us ? 4 
: 0);
radio-buffer[4] = 0x00;
radio-buffer[5] = 0x00;
radio-buffer[6] = 0x00;
-- 
1.8.3.2

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


Re: [PATCH] vb2: Allow STREAMOFF for io emulator

2013-10-04 Thread Ricardo Ribalda Delgado
Hello Hans

I am implementing a test application for our camera, think of
v4l2-compliance but for testing the hardware (average of pixels,
rotation...) . I am implementing it using python (because of numpy and
matplotlib).

I dont really care about perferomance, I only care about the data
correctness, so the fileio fits perfectly my needs.

On the fileio api we dont have a way to tell the camera to stop, this
was an attempt to solve this issue. But if it is only an issue for
me we can forget about it :).

BTW, do you know about a complete v4l2 library for python? I am using
https://pypi.python.org/pypi/v4l2 , but it is quite old.

Thanks!


On Fri, Oct 4, 2013 at 4:09 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 Hi Ricardo,

 On 10/04/2013 03:49 PM, Ricardo Ribalda Delgado wrote:
 A video device opened and streaming in io emulator mode can only stop
 streamming if its file descriptor is closed.

 There are some parameters that can only be changed if the device is not
 streaming. Also, the power consumption of a device streaming could be
 different than one not streaming.

 With this patch a video device opened in io emulator can be stopped on
 demand.

 Why would you want this? If you can call STREAMOFF, why not use stream I/O
 all the way? That's much more efficient than read() anyway.

 Unless there is a very good use-case, I don't see a good reason for mixing
 file I/O with streaming I/O ioctls.

 Regards,

 Hans


 Signed-off-by: Ricardo Ribalda Delgado ricardo.riba...@gmail.com
 ---
  drivers/media/v4l2-core/videobuf2-core.c | 11 ++-
  1 file changed, 6 insertions(+), 5 deletions(-)

 diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
 b/drivers/media/v4l2-core/videobuf2-core.c
 index 9fc4bab..097fba8 100644
 --- a/drivers/media/v4l2-core/videobuf2-core.c
 +++ b/drivers/media/v4l2-core/videobuf2-core.c
 @@ -1686,6 +1686,7 @@ int vb2_streamon(struct vb2_queue *q, enum 
 v4l2_buf_type type)
  }
  EXPORT_SYMBOL_GPL(vb2_streamon);

 +static int __vb2_cleanup_fileio(struct vb2_queue *q);

  /**
   * vb2_streamoff - stop streaming
 @@ -1704,11 +1705,6 @@ EXPORT_SYMBOL_GPL(vb2_streamon);
   */
  int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
  {
 - if (q-fileio) {
 - dprintk(1, streamoff: file io in progress\n);
 - return -EBUSY;
 - }
 -
   if (type != q-type) {
   dprintk(1, streamoff: invalid stream type\n);
   return -EINVAL;
 @@ -1719,6 +1715,11 @@ int vb2_streamoff(struct vb2_queue *q, enum 
 v4l2_buf_type type)
   return -EINVAL;
   }

 + if (q-fileio) {
 + __vb2_cleanup_fileio(q);
 + return 0;
 + }
 +
   /*
* Cancel will pause streaming and remove all buffers from the driver
* and videobuf, effectively returning control over them to userspace.





-- 
Ricardo Ribalda
--
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 0/3] media: Add SH-Mobile RCAR-H2 Lager board support

2013-10-04 Thread Valentine

On 10/04/2013 02:13 PM, Hans Verkuil wrote:

On 09/24/2013 06:14 PM, Guennadi Liakhovetski wrote:

Hi Valentine,


Hi,



Since patches 2 and 3 here are for soc-camera, I can offer to take all 3
via my tree after all comments to patch 1/3 are addressed and someone
(Laurent?) has acked it. Alternatively I can ack the two patches and let
all 3 go via another tree, or we can split this series too - no problem
with me either way.


I prefer to take these patches. 95% of the work is in the first patch adding
the new adv driver, and I'm responsible for video receivers/transmitters.

There is going to be a revision anyway, so let's wait for v2.


Patch 2 doesn't really depend on the other ones.
So I think it can be added separately.
I'll resubmit it in a bit.

The ADV related stuff will be reworked/submitted later.



Regards,

Hans


Thanks,
Val.




Thanks
Guennadi

On Tue, 24 Sep 2013, Valentine Barshak wrote:


The following patches add ADV7611/ADV7612 HDMI receiver I2C driver
and add RCAR H2 SOC support along with ADV761x output format support
to rcar_vin soc_camera driver.

These changes are needed for SH-Mobile R8A7790 Lager board
video input support.

Valentine Barshak (3):
   media: i2c: Add ADV761X support
   media: rcar_vin: Add preliminary r8a7790 H2 support
   media: rcar_vin: Add RGB888_1X24 input format support

  drivers/media/i2c/Kconfig|   11 +
  drivers/media/i2c/Makefile   |1 +
  drivers/media/i2c/adv761x.c  | 1060 ++
  drivers/media/platform/soc_camera/rcar_vin.c |   17 +-
  include/media/adv761x.h  |   28 +
  5 files changed, 1114 insertions(+), 3 deletions(-)
  create mode 100644 drivers/media/i2c/adv761x.c
  create mode 100644 include/media/adv761x.h

--
1.8.3.1



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





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


[PATCH] media: rcar_vin: Add preliminary r8a7790 support

2013-10-04 Thread Valentine Barshak
Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
---
 drivers/media/platform/soc_camera/rcar_vin.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 
b/drivers/media/platform/soc_camera/rcar_vin.c
index d02a7e0..b21f777 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -105,6 +105,7 @@
 #define VIN_MAX_HEIGHT 2048
 
 enum chip_id {
+   RCAR_H2,
RCAR_H1,
RCAR_M1,
RCAR_E1,
@@ -300,7 +301,8 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
dmr = 0;
break;
case V4L2_PIX_FMT_RGB32:
-   if (priv-chip == RCAR_H1 || priv-chip == RCAR_E1) {
+   if (priv-chip == RCAR_H2 || priv-chip == RCAR_H1 ||
+   priv-chip == RCAR_E1) {
dmr = VNDMR_EXRGB;
break;
}
@@ -1381,6 +1383,7 @@ static struct soc_camera_host_ops rcar_vin_host_ops = {
 };
 
 static struct platform_device_id rcar_vin_id_table[] = {
+   { r8a7790-vin,  RCAR_H2 },
{ r8a7779-vin,  RCAR_H1 },
{ r8a7778-vin,  RCAR_M1 },
{ uPD35004-vin, RCAR_E1 },
-- 
1.8.3.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 05/14] cxd2820r_core: fix sparse warnings

2013-10-04 Thread Antti Palosaari

On 04.10.2013 17:01, Hans Verkuil wrote:

From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/cxd2820r_core.c:34:32: error: cannot size expression
drivers/media/dvb-frontends/cxd2820r_core.c:68:32: error: cannot size expression

Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



Cc: Antti Palosaari cr...@iki.fi
---
  drivers/media/dvb-frontends/cxd2820r_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c 
b/drivers/media/dvb-frontends/cxd2820r_core.c
index 7ca5c69..d9eeeb1 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -31,7 +31,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, 
u8 i2c, u8 reg,
{
.addr = i2c,
.flags = 0,
-   .len = sizeof(buf),
+   .len = len + 1,
.buf = buf,
}
};
@@ -65,7 +65,7 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, 
u8 i2c, u8 reg,
}, {
.addr = i2c,
.flags = I2C_M_RD,
-   .len = sizeof(buf),
+   .len = len,
.buf = buf,
}
};




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


Re: [PATCH 07/14] drxk_hard: fix sparse warnings

2013-10-04 Thread Antti Palosaari

On 04.10.2013 17:01, Hans Verkuil wrote:

From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxk_hard.c:2784:63: warning: Using plain integer 
as NULL pointer

Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



Cc: Antti Palosaari cr...@iki.fi
---
  drivers/media/dvb-frontends/drxk_hard.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxk_hard.c 
b/drivers/media/dvb-frontends/drxk_hard.c
index 082014d..d416c15 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -1083,7 +1083,7 @@ static int hi_cfg_command(struct drxk_state *state)
 SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY);
if (status  0)
goto error;
-   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, 0);
+   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, NULL);
if (status  0)
goto error;

@@ -2781,7 +2781,7 @@ static int ConfigureI2CBridge(struct drxk_state *state, 
bool b_enable_bridge)
goto error;
}

-   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, 0);
+   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, NULL);

  error:
if (status  0)




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


Re: [PATCH 06/14] drxd_hard: fix sparse warnings

2013-10-04 Thread Antti Palosaari

On 04.10.2013 17:01, Hans Verkuil wrote:

From: Hans Verkuil hans.verk...@cisco.com

drivers/media/dvb-frontends/drxd_hard.c:1017:70: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:1038:69: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2836:33: warning: Using plain integer 
as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2972:30: warning: Using plain integer 
as NULL pointer

Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



Cc: Antti Palosaari cr...@iki.fi
---
  drivers/media/dvb-frontends/drxd_hard.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxd_hard.c 
b/drivers/media/dvb-frontends/drxd_hard.c
index cbd7c92..959ae36 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -1014,7 +1014,7 @@ static int HI_CfgCommand(struct drxd_state *state)
status = Write16(state, HI_RA_RAM_SRV_CMD__A,
 HI_RA_RAM_SRV_CMD_CONFIG, 0);
else
-   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, 0);
+   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, NULL);
mutex_unlock(state-mutex);
return status;
  }
@@ -1035,7 +1035,7 @@ static int HI_ResetCommand(struct drxd_state *state)
status = Write16(state, HI_RA_RAM_SRV_RST_KEY__A,
 HI_RA_RAM_SRV_RST_KEY_ACT, 0);
if (status == 0)
-   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, 0);
+   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, NULL);
mutex_unlock(state-mutex);
msleep(1);
return status;
@@ -2833,7 +2833,7 @@ static int drxd_init(struct dvb_frontend *fe)
int err = 0;

  /*if (request_firmware(state-fw, drxd.fw, state-dev)0) */
-   return DRXD_init(state, 0, 0);
+   return DRXD_init(state, NULL, 0);

err = DRXD_init(state, state-fw-data, state-fw-size);
release_firmware(state-fw);
@@ -2969,7 +2969,7 @@ struct dvb_frontend *drxd_attach(const struct drxd_config 
*config,

mutex_init(state-mutex);

-   if (Read16(state, 0, 0, 0)  0)
+   if (Read16(state, 0, NULL, 0)  0)
goto error;

state-frontend.ops = drxd_ops;




--
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] cx24117: Prevent mutex to be stuck on locked state if FE init fails.

2013-10-04 Thread Luis Alves
Hi,
This patch will fix the situation where the mutex was left in a locked state if 
for some reason the FE init failed.

Regards,
Luis


Signed-off-by: Luis Alves lja...@gmail.com
---
 drivers/media/dvb-frontends/cx24117.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb-frontends/cx24117.c 
b/drivers/media/dvb-frontends/cx24117.c
index 9087309..476b422 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1238,11 +1238,11 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, cmd);
if (ret != 0)
-   return ret;
+   goto exit;
 
ret = cx24117_diseqc_init(fe);
if (ret != 0)
-   return ret;
+   goto exit;
 
/* CMD 3C */
cmd.args[0] = 0x3c;
@@ -1252,7 +1252,7 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.len = 4;
ret = cx24117_cmd_execute_nolock(fe, cmd);
if (ret != 0)
-   return ret;
+   goto exit;
 
/* CMD 34 */
cmd.args[0] = 0x34;
@@ -1260,9 +1260,8 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.args[2] = CX24117_OCC;
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, cmd);
-   if (ret != 0)
-   return ret;
 
+exit:
mutex_unlock(state-priv-fe_lock);
 
return ret;
-- 
1.7.9.5

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


Re: [PATCH] cx24117: Prevent mutex to be stuck on locked state if FE init fails.

2013-10-04 Thread Antti Palosaari

On 04.10.2013 17:48, Luis Alves wrote:

Hi,
This patch will fix the situation where the mutex was left in a locked state if 
for some reason the FE init failed.

Regards,
Luis


Signed-off-by: Luis Alves lja...@gmail.com


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



---
  drivers/media/dvb-frontends/cx24117.c |9 -
  1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb-frontends/cx24117.c 
b/drivers/media/dvb-frontends/cx24117.c
index 9087309..476b422 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1238,11 +1238,11 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, cmd);
if (ret != 0)
-   return ret;
+   goto exit;

ret = cx24117_diseqc_init(fe);
if (ret != 0)
-   return ret;
+   goto exit;

/* CMD 3C */
cmd.args[0] = 0x3c;
@@ -1252,7 +1252,7 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.len = 4;
ret = cx24117_cmd_execute_nolock(fe, cmd);
if (ret != 0)
-   return ret;
+   goto exit;

/* CMD 34 */
cmd.args[0] = 0x34;
@@ -1260,9 +1260,8 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.args[2] = CX24117_OCC;
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, cmd);
-   if (ret != 0)
-   return ret;

+exit:
mutex_unlock(state-priv-fe_lock);

return ret;




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


Re: [PATCH 05/14] cxd2820r_core: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:36 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/cxd2820r_core.c:34:32: error: cannot size
 expression
 drivers/media/dvb-frontends/cxd2820r_core.c:68:32: error: cannot size
 expression

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/cxd2820r_core.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c
 b/drivers/media/dvb-frontends/cxd2820r_core.c
 index 7ca5c69..d9eeeb1 100644
 --- a/drivers/media/dvb-frontends/cxd2820r_core.c
 +++ b/drivers/media/dvb-frontends/cxd2820r_core.c
 @@ -31,7 +31,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv
 *priv, u8 i2c, u8 reg,
 {
 .addr = i2c,
 .flags = 0,
 -   .len = sizeof(buf),
 +   .len = len + 1,
 .buf = buf,
 }
 };
 @@ -65,7 +65,7 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv
 *priv, u8 i2c, u8 reg,
 }, {
 .addr = i2c,
 .flags = I2C_M_RD,
 -   .len = sizeof(buf),
 +   .len = len,
 .buf = buf,
 }
 };



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

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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 04/14] tuner-xs2028.c: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:01 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/tuners/tuner-xc2028.c:575:24: warning: cast to restricted __le16
 drivers/media/tuners/tuner-xc2028.c:686:21: warning: cast to restricted __le16

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: Mauro Carvalho Chehab m.che...@samsung.com
 ---
  drivers/media/tuners/tuner-xc2028.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/tuners/tuner-xc2028.c 
 b/drivers/media/tuners/tuner-xc2028.c
 index 878d2c4..e287a74 100644
 --- a/drivers/media/tuners/tuner-xc2028.c
 +++ b/drivers/media/tuners/tuner-xc2028.c
 @@ -572,7 +572,7 @@ static int load_firmware(struct dvb_frontend *fe, 
 unsigned int type,
 return -EINVAL;
 }

 -   size = le16_to_cpu(*(__u16 *) p);
 +   size = le16_to_cpu(*(__le16 *) p);
 p += sizeof(size);

 if (size == 0x)
 @@ -683,7 +683,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned 
 int type,
 /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
  * has a 2-byte size header in the firmware format. */
 if (priv-firm[pos].size != 14 * 16 || scode = 16 ||
 -   le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
 +   le16_to_cpu(*(__le16 *)(p + 14 * scode)) != 12)
 return -EINVAL;
 p += 14 * scode + 2;
 }
 --
 1.8.3.2

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

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


Re: [PATCH 06/14] drxd_hard: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:44 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/drxd_hard.c:1017:70: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:1038:69: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:2836:33: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:2972:30: warning: Using plain
 integer as NULL pointer

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/drxd_hard.c | 8 
   1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/drivers/media/dvb-frontends/drxd_hard.c
 b/drivers/media/dvb-frontends/drxd_hard.c
 index cbd7c92..959ae36 100644
 --- a/drivers/media/dvb-frontends/drxd_hard.c
 +++ b/drivers/media/dvb-frontends/drxd_hard.c
 @@ -1014,7 +1014,7 @@ static int HI_CfgCommand(struct drxd_state *state)
 status = Write16(state, HI_RA_RAM_SRV_CMD__A,
  HI_RA_RAM_SRV_CMD_CONFIG, 0);
 else
 -   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, 0);
 +   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG,
 NULL);
 mutex_unlock(state-mutex);
 return status;
   }
 @@ -1035,7 +1035,7 @@ static int HI_ResetCommand(struct drxd_state *state)
 status = Write16(state, HI_RA_RAM_SRV_RST_KEY__A,
  HI_RA_RAM_SRV_RST_KEY_ACT, 0);
 if (status == 0)
 -   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, 0);
 +   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, NULL);
 mutex_unlock(state-mutex);
 msleep(1);
 return status;
 @@ -2833,7 +2833,7 @@ static int drxd_init(struct dvb_frontend *fe)
 int err = 0;

   /*if (request_firmware(state-fw, drxd.fw, state-dev)0) */
 -   return DRXD_init(state, 0, 0);
 +   return DRXD_init(state, NULL, 0);

 err = DRXD_init(state, state-fw-data, state-fw-size);
 release_firmware(state-fw);
 @@ -2969,7 +2969,7 @@ struct dvb_frontend *drxd_attach(const struct
 drxd_config *config,

 mutex_init(state-mutex);

 -   if (Read16(state, 0, 0, 0)  0)
 +   if (Read16(state, 0, NULL, 0)  0)
 goto error;

 state-frontend.ops = drxd_ops;



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

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


Re: [PATCH 07/14] drxk_hard: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:40 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxk_hard.c:2784:63: warning: Using plain
 integer as NULL pointer

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/drxk_hard.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/dvb-frontends/drxk_hard.c
 b/drivers/media/dvb-frontends/drxk_hard.c
 index 082014d..d416c15 100644
 --- a/drivers/media/dvb-frontends/drxk_hard.c
 +++ b/drivers/media/dvb-frontends/drxk_hard.c
 @@ -1083,7 +1083,7 @@ static int hi_cfg_command(struct drxk_state *state)
  SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY);
 if (status  0)
 goto error;
 -   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, 0);
 +   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, NULL);
 if (status  0)
 goto error;

 @@ -2781,7 +2781,7 @@ static int ConfigureI2CBridge(struct drxk_state
 *state, bool b_enable_bridge)
 goto error;
 }

 -   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, 0);
 +   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, NULL);

   error:
 if (status  0)



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

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


[GIT PULL BUG FIX] cx24117: prevent mutex to be stuck on locked state if FE init fails

2013-10-04 Thread Michael Krufky
The following changes since commit
d10e8280c4c2513d3e7350c27d8e6f0fa03a5f71:

  [media] cx24117: use hybrid_tuner_request/release_state to share
  state between multiple instances (2013-10-03 07:40:12 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb cx24117

for you to fetch changes up to 3f9c6e0698debcdbfc1568e16eb3cc45d320cc56:

  cx24117: prevent mutex to be stuck on locked state if FE init fails
  (2013-10-04 11:13:47 -0400)


Luis Alves (1):
  cx24117: prevent mutex to be stuck on locked state if FE init
fails

 drivers/media/dvb-frontends/cx24117.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: cx23885: Add basic analog radio support

2013-10-04 Thread Alfredo Jesús Delaiti

Hi all


El 14/01/12 15:25, Miroslav Slugeň escribió:

New version of patch, fixed video modes for DVR3200 tuners and working
audio mux.


I tested this patch (https://linuxtv.org/patch/9498/) with the latest 
versions of git (September 28, 2013) with my TV card (Mygica X8507) and 
it works.

I found some issue, although it may be through a bad implementation of mine.

Details of them:

1) Some warning when compiling

...
  CC [M] 
/home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-video.o
/home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-video.c:1910:8: 
: initialization from incompatible pointer type [enabled by default]
/home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-video.c:1910:8: 
warning: (near initialization for 'radio_ioctl_ops.vidioc_s_tuner') 
[enabled by default]
/home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-video.c:1911:8: 
warning: initialization from incompatible pointer type [enabled by default]
/home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-video.c:1911:8: 
warning: (near initialization for 'radio_ioctl_ops.vidioc_s_audio') 
[enabled by default]

  CC [M] /home/alfredo/ISDB/Nuevo_Driver/git/media_build/v4l/cx23885-vbi.o
...


static const struct v4l2_ioctl_ops radio_ioctl_ops = {

   .vidioc_s_tuner   = radio_s_tuner, /* line 1910 */
   .vidioc_s_audio   = radio_s_audio, /* line 1911 */



2)
No reports signal strength or stereo signal with KRadio. XC5000 neither 
reported (modprobe xc5000 debug=1). Maybe a feature XC5000.
To listen in stereo, sometimes, you have to turn on the Digital TV then 
Analog TV and then radio.


3)
To listen Analog TV I need changed to NTSC standard and then PAL-Nc (the 
norm in my country is PAL-Nc). If I leave the tune in NTSC no problem 
with sound.
The patch (https://linuxtv.org/patch/9505/) corrects the latter, if used 
tvtime with xawtv not always.
If I see-Digital TV (ISDB-T), then so as to listen the radio I have 
first put the TV-Analog, because I hear very low and a strong white noise.
The latter is likely to be corrected by resetting the tuner, I have to 
study it more.


I put below attached the patch applied to the plate: X8507.

Have you done any update of this patch?

Thanks
 .../media/pci/cx23885/{ = }/media/pci/cx23885/cx23885-cards.c   |6 ++
 drivers/media/pci/cx23885/{ = }/media/pci/cx23885/cx23885-dvb.c |1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c
index 6a71a96..324809a 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -526,16 +526,18 @@ struct cx23885_board cx23885_boards[] = {
 			.amux   = CX25840_AUDIO7,
 			.gpio0  = 0,
 		} },
 	},
 	[CX23885_BOARD_MYGICA_X8507] = {
 		.name		= Mygica X8502/X8507 ISDB-T,
 		.tuner_type = TUNER_XC5000,
 		.tuner_addr = 0x61,
+		.radio_type	= TUNER_XC5000,
+		.radio_addr	= 0x61,
 		.tuner_bus	= 1,
 		.porta		= CX23885_ANALOG_VIDEO,
 		.portb		= CX23885_MPEG_DVB,
 		.input		= {
 			{
 .type   = CX23885_VMUX_TELEVISION,
 .vmux   = CX25840_COMPOSITE2,
 .amux   = CX25840_AUDIO8,
@@ -555,16 +557,20 @@ struct cx23885_board cx23885_boards[] = {
 .type   = CX23885_VMUX_COMPONENT,
 .vmux   = CX25840_COMPONENT_ON |
 	CX25840_VIN1_CH1 |
 	CX25840_VIN6_CH2 |
 	CX25840_VIN7_CH3,
 .amux   = CX25840_AUDIO7,
 			},
 		},
+		.radio = {
+.type= CX23885_RADIO,
+.amux= CX25840_AUDIO8,
+			},
 	},
 	[CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL] = {
 		.name		= TerraTec Cinergy T PCIe Dual,
 		.portb		= CX23885_MPEG_DVB,
 		.portc		= CX23885_MPEG_DVB,
 	},
 	[CX23885_BOARD_TEVII_S471] = {
 		.name		= TeVii S471,
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
index 971e4ff..4e946b2 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -495,16 +495,17 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
 
 static struct mb86a20s_config mygica_x8507_mb86a20s_config = {
 	.demod_address = 0x10,
 };
 
 static struct xc5000_config mygica_x8507_xc5000_config = {
 	.i2c_address = 0x61,
 	.if_khz = 4000,
+	.radio_input = XC5000_RADIO_FM1,
 };
 
 static struct stv090x_config prof_8000_stv090x_config = {
 	.device = STV0903,
 	.demod_mode = STV090x_SINGLE,
 	.clk_mode   = STV090x_CLK_EXT,
 	.xtal   = 2700,
 	.address= 0x6A,


cron job: media_tree daily build: WARNINGS

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

Results of the daily build of media_tree:

date:   Sat Oct  5 04:00:20 CEST 2013
git branch: test
git hash:   d10e8280c4c2513d3e7350c27d8e6f0fa03a5f71
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: 0.4.5-rc1
host hardware:  x86_64
host os:3.10.1

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

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH 02/14] pvrusb2: fix sparse warning

2013-10-04 Thread Mike Isely

Acked-by: Mike Isely is...@pobox.com

  -Mike

On Fri, 4 Oct 2013, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com
 
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2871:13: warning: symbol 
 'pvr2_hdw_get_detected_std' was not declared. Should it be static?
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: Mike Isely is...@pobox.com
 ---
  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
 b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
 index c4d51d7..ea05f67 100644
 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
 +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
 @@ -2868,7 +2868,7 @@ static void pvr2_subdev_set_control(struct pvr2_hdw 
 *hdw, int id,
   pvr2_subdev_set_control(hdw, id, #lab, (hdw)-lab##_val); \
   }
  
 -v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw)
 +static v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw)
  {
   v4l2_std_id std;
   std = (v4l2_std_id)hdw-std_mask_avail;
 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
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