cron job: media_tree daily build: ERRORS

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

Results of the daily build of media_tree:

date:   Wed Jan 14 04:00:17 CET 2015
git branch: test
git hash:   99f3cd52aee21091ce62442285a68873e3be833f
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-41-g6c2d743
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:3.18.0-1.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.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: ERRORS
linux-3.10.1-i686: ERRORS
linux-3.11.1-i686: ERRORS
linux-3.12.23-i686: ERRORS
linux-3.13.11-i686: ERRORS
linux-3.14.9-i686: ERRORS
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-i686: OK
linux-3.18-i686: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: 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: ERRORS
linux-3.10.1-x86_64: ERRORS
linux-3.11.1-x86_64: ERRORS
linux-3.12.23-x86_64: ERRORS
linux-3.13.11-x86_64: ERRORS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-x86_64: ERRORS
linux-3.16-x86_64: ERRORS
linux-3.17-x86_64: ERRORS
linux-3.18-x86_64: ERRORS
apps: OK
spec-git: OK
sparse: ERRORS
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH] cx23885/vb2 regression: please test this patch

2015-01-13 Thread Raimonds Cicans

On 13.01.2015 19:55, Raimonds Cicans wrote:

On 13.01.2015 16:01, Hans Verkuil wrote:

Hi Raimonds, Jurgen,

Can you both test this patch? It should (I hope) solve the problems you
both had with the cx23885 driver.

This patch fixes a race condition in the vb2_thread that occurs when
the thread is stopped. The crucial fix is calling kthread_stop much
earlier in vb2_thread_stop(). But I also made the vb2_thread more
robust.


With this patch I am unable to get any error except first
(AMD-Vi: Event logged [IO_PAGE_FAULT...).
But I am not convinced, because before patch I get
first error much often and earlier than almost any other error,
so it may be just bad luck and other errors do not
appear because first error appear earlier.


I noticed that if I initialize card with commands:
/usr/bin/dvb-fe-tool -a 4 -d DVBS
/usr/bin/dvb-fe-tool -a 5 -d DVBS

and then run load which starts on first front-end and
only after some time on second, then I receive first
error much later or do not receive at all (for example
I was able to run VDR whole night without problems)


Raimonds Cicans

--
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] cx23885/vb2 regression: please test this patch

2015-01-13 Thread Raimonds Cicans

On 13.01.2015 16:01, Hans Verkuil wrote:

Hi Raimonds, Jurgen,

Can you both test this patch? It should (I hope) solve the problems you
both had with the cx23885 driver.

This patch fixes a race condition in the vb2_thread that occurs when
the thread is stopped. The crucial fix is calling kthread_stop much
earlier in vb2_thread_stop(). But I also made the vb2_thread more
robust.


With this patch I am unable to get any error except first
(AMD-Vi: Event logged [IO_PAGE_FAULT...).
But I am not convinced, because before patch I get
first error much often and earlier than almost any other error,
so it may be just bad luck and other errors do not
appear because first error appear earlier.

BTW question about RISC engine:
what kind of memory use RISC engine to store
DMA programs (code)? Internal SRAM or host's?
I ask because cx23885[0]: mpeg risc op code error
error message storm after first message looks like
RISC engine used host's memory when this memory
was unmapped.



Raimonds Cicans
--
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] BLACKFIN MEDIA DRIVER: rewrite the blackfin style of read/write into common style

2015-01-13 Thread Hao Liang
Signed-off-by: Hao Liang hliang1...@gmail.com
---
 drivers/media/platform/blackfin/ppi.c |   72 -
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/media/platform/blackfin/ppi.c 
b/drivers/media/platform/blackfin/ppi.c
index cff63e5..de4b5c7 100644
--- a/drivers/media/platform/blackfin/ppi.c
+++ b/drivers/media/platform/blackfin/ppi.c
@@ -20,6 +20,7 @@
 #include linux/module.h
 #include linux/slab.h
 #include linux/platform_device.h
+#include linux/io.h
 
 #include asm/bfin_ppi.h
 #include asm/blackfin.h
@@ -59,10 +60,10 @@ static irqreturn_t ppi_irq_err(int irq, void *dev_id)
/* register on bf561 is cleared when read 
 * others are W1C
 */
-   status = bfin_read16(reg-status);
+   status = readw(reg-status);
if (status  0x3000)
ppi-err = true;
-   bfin_write16(reg-status, 0xff00);
+   writew(0xff00, reg-status);
break;
}
case PPI_TYPE_EPPI:
@@ -70,10 +71,10 @@ static irqreturn_t ppi_irq_err(int irq, void *dev_id)
struct bfin_eppi_regs *reg = info-base;
unsigned short status;
 
-   status = bfin_read16(reg-status);
+   status = readw(reg-status);
if (status  0x2)
ppi-err = true;
-   bfin_write16(reg-status, 0x);
+   writew(0x, reg-status);
break;
}
case PPI_TYPE_EPPI3:
@@ -81,10 +82,10 @@ static irqreturn_t ppi_irq_err(int irq, void *dev_id)
struct bfin_eppi3_regs *reg = info-base;
unsigned long stat;
 
-   stat = bfin_read32(reg-stat);
+   stat = readl(reg-stat);
if (stat  0x2)
ppi-err = true;
-   bfin_write32(reg-stat, 0xc0ff);
+   writel(0xc0ff, reg-stat);
break;
}
default:
@@ -139,26 +140,25 @@ static int ppi_start(struct ppi_if *ppi)
case PPI_TYPE_PPI:
{
struct bfin_ppi_regs *reg = info-base;
-   bfin_write16(reg-control, ppi-ppi_control);
+   writew(ppi-ppi_control, reg-control);
break;
}
case PPI_TYPE_EPPI:
{
struct bfin_eppi_regs *reg = info-base;
-   bfin_write32(reg-control, ppi-ppi_control);
+   writel(ppi-ppi_control, reg-control);
break;
}
case PPI_TYPE_EPPI3:
{
struct bfin_eppi3_regs *reg = info-base;
-   bfin_write32(reg-ctl, ppi-ppi_control);
+   writel(ppi-ppi_control, reg-ctl);
break;
}
default:
return -EINVAL;
}
 
-   SSYNC();
return 0;
 }
 
@@ -172,19 +172,19 @@ static int ppi_stop(struct ppi_if *ppi)
case PPI_TYPE_PPI:
{
struct bfin_ppi_regs *reg = info-base;
-   bfin_write16(reg-control, ppi-ppi_control);
+   writew(ppi-ppi_control, reg-control);
break;
}
case PPI_TYPE_EPPI:
{
struct bfin_eppi_regs *reg = info-base;
-   bfin_write32(reg-control, ppi-ppi_control);
+   writel(ppi-ppi_control, reg-control);
break;
}
case PPI_TYPE_EPPI3:
{
struct bfin_eppi3_regs *reg = info-base;
-   bfin_write32(reg-ctl, ppi-ppi_control);
+   writel(ppi-ppi_control, reg-ctl);
break;
}
default:
@@ -195,7 +195,6 @@ static int ppi_stop(struct ppi_if *ppi)
clear_dma_irqstat(info-dma_ch);
disable_dma(info-dma_ch);
 
-   SSYNC();
return 0;
 }
 
@@ -242,9 +241,9 @@ static int ppi_set_params(struct ppi_if *ppi, struct 
ppi_params *params)
if (params-ppi_control  DMA32)
dma32 = 1;
 
-   bfin_write16(reg-control, ppi-ppi_control);
-   bfin_write16(reg-count, samples_per_line - 1);
-   bfin_write16(reg-frame, params-frame);
+   writew(ppi-ppi_control, reg-control);
+   writew(samples_per_line - 1, reg-count);
+   writew(params-frame, reg-frame);
break;
}
case PPI_TYPE_EPPI:
@@ -255,13 +254,13 @@ static int ppi_set_params(struct ppi_if *ppi, struct 
ppi_params *params)
|| (params-ppi_control  0x38000)  DLEN_16)
dma32 = 1;
 
-   bfin_write32(reg-control, ppi-ppi_control);
-   bfin_write16(reg-line, samples_per_line);
-   bfin_write16(reg-frame, params-frame);
-   bfin_write16(reg-hdelay, hdelay);
-   bfin_write16(reg-vdelay, params-vdelay);
-   bfin_write16(reg-hcount, hcount);
- 

Re: [RFC/PATCH] dvb-core: add template code for i2c binding model

2015-01-13 Thread Antti Palosaari

On 12/05/2014 12:49 PM, tsk...@gmail.com wrote:

From: Akihiro Tsukada tsk...@gmail.com

Define a standard interface for demod/tuner i2c driver modules.
A module client calls dvb_i2c_attach_{fe,tuner}(),
and a module driver defines struct dvb_i2c_module_param and
calls DEFINE_DVB_I2C_MODULE() macro.

This template provides implicit module requests and ref-counting,
alloc/free's private data structures,
fixes the usage of clientdata of i2c devices,
and defines the platformdata structures for passing around
device specific config/output parameters between drivers and clients.
These kinds of code are common to (almost) all dvb i2c drivers/client,
but they were scattered over adapter modules and demod/tuner modules.

Signed-off-by: Akihiro Tsukada tsk...@gmail.com
---
  drivers/media/dvb-core/Makefile   |   4 +
  drivers/media/dvb-core/dvb_frontend.h |   1 +
  drivers/media/dvb-core/dvb_i2c.c  | 219 ++
  drivers/media/dvb-core/dvb_i2c.h  | 110 +
  4 files changed, 334 insertions(+)
  create mode 100644 drivers/media/dvb-core/dvb_i2c.c
  create mode 100644 drivers/media/dvb-core/dvb_i2c.h

diff --git a/drivers/media/dvb-core/Makefile b/drivers/media/dvb-core/Makefile
index 8f22bcd..271648d 100644
--- a/drivers/media/dvb-core/Makefile
+++ b/drivers/media/dvb-core/Makefile
@@ -8,4 +8,8 @@ dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o 
\
 dvb_ca_en50221.o dvb_frontend.o\
 $(dvb-net-y) dvb_ringbuffer.o dvb_math.o

+ifneq ($(CONFIG_I2C)$(CONFIG_I2C_MODULE),)
+dvb-core-objs += dvb_i2c.o
+endif
+
  obj-$(CONFIG_DVB_CORE) += dvb-core.o
diff --git a/drivers/media/dvb-core/dvb_frontend.h 
b/drivers/media/dvb-core/dvb_frontend.h
index 816269e..41aae1b 100644
--- a/drivers/media/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb-core/dvb_frontend.h
@@ -415,6 +415,7 @@ struct dtv_frontend_properties {
  struct dvb_frontend {
struct dvb_frontend_ops ops;
struct dvb_adapter *dvb;
+   struct i2c_client *fe_cl;


IMHO that is ugly as hell. You should not add any hardware/driver things 
to DVB frontend, even more bad this adds I2C dependency to DVB frontend, 
how about some other busses... DVB frontend is *logical* entity 
representing the DVB device to system. All hardware specific things 
belongs to drivers - not the frontend at all.




void *demodulator_priv;
void *tuner_priv;
void *frontend_priv;


regards
Antti

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


[PATCH v2 8/8] ARM: at91: sama5: enable atmel-isi and ov2640 in defconfig

2015-01-13 Thread Josh Wu
Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Alexandre Belloni alexandre.bell...@free-electrons.com
---
 arch/arm/configs/sama5_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index b58fb32..92f1d71 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -139,6 +139,12 @@ CONFIG_POWER_RESET=y
 CONFIG_SSB=m
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_ACT8865=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_SOC_CAMERA=y
+CONFIG_SOC_CAMERA_OV2640=y
+CONFIG_VIDEO_ATMEL_ISI=y
 CONFIG_FB=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
-- 
1.9.1

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


Re: [PATCH v2 0/8] ARM: at91: dts: sama5d3: add dt support for atmel isi and ov2640 sensor

2015-01-13 Thread Josh Wu

On 1/13/2015 11:05 PM, Nicolas Ferre wrote:

Le 04/01/2015 10:02, Josh Wu a écrit :

This patch series add ISI and ov2640 support on dts files.

As the ov2640 driver dt is still in review. The patch is in: 
https://patchwork.linuxtv.org/patch/27554/
So I want to send this dt patch early for a review.

v1 - v2:
   1. add one more patch to change the pin name of ISI_MCK
   2. rewrite the commit [4/8] ARM: at91: dts: sama5d3: change name of 
pinctrl_isi_{power,reset}.
   3. move the common chip parts of ISI node to sama5d3.dtsi.

Bo Shen (3):
   ARM: at91: dts: sama5d3: split isi pinctrl
   ARM: at91: dts: sama5d3: add missing pins of isi
   ARM: at91: dts: sama5d3: move the isi mck pin to mb

Josh Wu (5):
   ARM: at91: dts: sama5d3: add isi clock
   ARM: at91: dts: sama5d3: change name of pinctrl_isi_{power,reset}
   ARM: at91: dts: sama5d3: change name of pinctrl of ISI_MCK
   ARM: at91: dts: sama5d3: add ov2640 camera sensor support
   ARM: at91: sama5: enable atmel-isi and ov2640 in defconfig

Josh,

It seems that this patch doesn't show up in the series: I only received
up to 6/8 patches (2 missing?). Can you please send it(them?)?


Thanks you, Nicolas. I am not aware that.
I just sent out the missing 7/8, 8/8 patches right now.

Best Regards,
Josh Wu



Bye,


  arch/arm/boot/dts/sama5d3.dtsi| 24 ++-
  arch/arm/boot/dts/sama5d3xmb.dtsi | 40 +++
  arch/arm/configs/sama5_defconfig  |  6 ++
  3 files changed, 61 insertions(+), 9 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


[PATCH v2 7/8] ARM: at91: dts: sama5d3: add ov2640 camera sensor support

2015-01-13 Thread Josh Wu
According to v4l2 dt document, we add:
  a camera host: ISI port.
  a i2c camera sensor: ov2640 port.
to sama5d3xmb.dtsi.

The ov2640 node defines the pinctrls, clocks and refer to isi port.
The ISI node also has a reference to the ov2640 port.

Signed-off-by: Josh Wu josh...@atmel.com
---
v1 - v2:
  1. move the chip common part of ISI DT node to sama5d3.dtsi.
  2. the pck1 pinctrl name is changed.

 arch/arm/boot/dts/sama5d3.dtsi|  6 ++
 arch/arm/boot/dts/sama5d3xmb.dtsi | 31 +--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index ed734e9..af61d55 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -214,9 +214,15 @@
compatible = atmel,at91sam9g45-isi;
reg = 0xf0034000 0x4000;
interrupts = 37 IRQ_TYPE_LEVEL_HIGH 5;
+   pinctrl-names = default;
+   pinctrl-0 = pinctrl_isi_data_0_7;
clocks = isi_clk;
clock-names = isi_clk;
status = disabled;
+   port {
+   #address-cells = 1;
+   #size-cells = 0;
+   };
};
 
mmc1: mmc@f800 {
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi 
b/arch/arm/boot/dts/sama5d3xmb.dtsi
index d9464fc..9fdb8a0 100644
--- a/arch/arm/boot/dts/sama5d3xmb.dtsi
+++ b/arch/arm/boot/dts/sama5d3xmb.dtsi
@@ -52,6 +52,29 @@
};
};
 
+   i2c1: i2c@f0018000 {
+   ov2640: camera@0x30 {
+   compatible = ovti,ov2640;
+   reg = 0x30;
+   pinctrl-names = default;
+   pinctrl-0 = pinctrl_pck1_as_isi_mck 
pinctrl_sensor_power pinctrl_sensor_reset;
+   resetb-gpios = pioE 24 
GPIO_ACTIVE_LOW;
+   pwdn-gpios = pioE 29 
GPIO_ACTIVE_HIGH;
+   /* use pck1 for the master clock of 
ov2640 */
+   clocks = pck1;
+   clock-names = xvclk;
+   assigned-clocks = pck1;
+   assigned-clock-rates = 2500;
+
+   port {
+   ov2640_0: endpoint {
+   remote-endpoint = 
isi_0;
+   bus-width = 8;
+   };
+   };
+   };
+   };
+
usart1: serial@f002 {
dmas = 0, 0;/*  Do not use DMA for 
usart1 */
pinctrl-names = default;
@@ -60,8 +83,12 @@
};
 
isi: isi@f0034000 {
-   pinctrl-names = default;
-   pinctrl-0 = pinctrl_isi_data_0_7;
+   port {
+   isi_0: endpoint {
+   remote-endpoint = ov2640_0;
+   bus-width = 8;
+   };
+   };
};
 
mmc1: mmc@f800 {
-- 
1.9.1

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


[PATCH] [media] rcar_vin: Update device_caps and capabilities in querycap

2015-01-13 Thread Nobuhiro Iwamatsu
device_caps in v4l2_capability structure must have been set value like
capabilities. This set the value to device_caps, and set V4L2_CAP_DEVICE_CAPS
to capabilities.
This fixes check by commit 454a4e728dd5 ([media] v4l2-ioctl: WARN_ON if
querycap didn't fill device_caps).

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 drivers/media/platform/soc_camera/rcar_vin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 
b/drivers/media/platform/soc_camera/rcar_vin.c
index 0c1f556..9f1473c 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -1799,7 +1799,9 @@ static int rcar_vin_querycap(struct soc_camera_host *ici,
 struct v4l2_capability *cap)
 {
strlcpy(cap-card, R_Car_VIN, sizeof(cap-card));
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
+
return 0;
 }
 
-- 
2.1.3

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


smiapp-core.c error if !defined(CONFIG_OF)

2015-01-13 Thread Hans Verkuil
Hi Sakari,

The daily build fails because of this error:

media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of function 
'of_read_number' [-Werror=implicit-function-declaration]
   pdata-op_sys_clock[i] = of_read_number(val + i * 2, 2);
   ^

Some digging showed that of_read_number is only available if CONFIG_OF
is defined. As far as I can see that is actually a bug in linux/of.h, as
I see no reason why it should be under CONFIG_OF.

Can you look at 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


Re: [PATCH/RFC v10 03/19] DT: leds: Add led-sources property

2015-01-13 Thread Jacek Anaszewski

On 01/12/2015 05:55 PM, Rob Herring wrote:

Adding Mark B and Liam...

On Mon, Jan 12, 2015 at 10:10 AM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:

On 01/12/2015 02:52 PM, Rob Herring wrote:


On Mon, Jan 12, 2015 at 2:32 AM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:

On 01/09/2015 07:33 PM, Rob Herring wrote:

On Fri, Jan 9, 2015 at 9:22 AM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:

Add a property for defining the device outputs the LED
represented by the DT child node is connected to.


[...]


b/Documentation/devicetree/bindings/leds/common.txt
index a2c3f7a..29295bf 100644
--- a/Documentation/devicetree/bindings/leds/common.txt
+++ b/Documentation/devicetree/bindings/leds/common.txt
@@ -1,6 +1,10 @@
Common leds properties.

Optional properties for child nodes:
+- led-sources : Array of bits signifying the LED current regulator
outputs the
+   LED represented by the child node is connected to (1 -
the LED
+   is connected to the output, 0 - the LED isn't connected
to the
+   output).




Sorry, I just don't understand this.




In some Flash LED devices one LED can be connected to one or more
electric current outputs, which allows for multiplying the maximum
current allowed for the LED. Each sub-LED is represented by a child
node in the DT binding of the Flash LED device and it needs to declare
which outputs it is connected to. In the example below the led-sources
property is a two element array, which means that the flash LED device
has two current outputs, and the bits signify if the LED is connected
to the output.



Sounds like a regulator for which we already have bindings for and we
have a driver for regulator based LEDs (but no binding for it).



Do you think of drivers/leds/leds-regulator.c driver? This driver just
allows for registering an arbitrary regulator device as a LED subsystem
device.

There are however devices that don't fall into this category, i.e. they
have many outputs, that can be connected to a single LED or to many LEDs
and the driver has to know what is the actual arrangement.


We may need to extend the regulator binding slightly and allow for
multiple phandles on a supply property, but wouldn't something like
this work:

led-supply = led-reg0, led-reg1, led-reg2, led-reg3;

The shared source is already supported by the regulator binding.


I think that we shouldn't split the LED devices into power supply
providers and consumers as in case of generic regulators. From this
point of view a LED device current output is a provider and a discrete
LED element is a consumer. In this approach each discrete LED element
should have a related driver which is not how LED devices are being
handled in the LED subsystem, where there is a single binding for a LED
device and there is a single driver for it which creates separate LED
class devices for each LED connected to the LED device output. Each
discrete LED is represented by a child node in the LED device binding.

I am aware that it may be tempting to treat LED devices as common
regulators, but they have their specific features which gave a
reason for introducing LED class for them. Besides, there is already
drivers/leds/leds-regulator.c driver for LED devices which support only
turning on/off and setting brightness level.

In your proposition a separate regulator provider binding would have
to be created for each current output and a separate binding for
each discrete LED connected to the LED device. It would create
unnecessary noise in a dts file.

Moreover, using regulator binding implies that we want to treat it
as a sheer power supply for our device (which would be a discrete LED
element in this case), whereas LED devices provide more features like
blinking pattern and for flash LED devices - flash timeout, external
strobe and flash faults.

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


Re: [PATCH v3 3/3] media: au0828 remove video and vbi buffer timeout work-around

2015-01-13 Thread Devin Heitmueller
 I couldn't reproduce what I was seeing when I did patch v2 series
 work. What I noticed was that I was seeing a few too many green screens
 and I had to re-tune xawtv when the timeout code is in place. My
 thinking was that this timeout handling could be introducing blank
 green frames when there is no need. However, I can't reproduce the
 problem on 3.19-rc4 base which is what I am using to test the changes
 to the patch series. Hence, I am not positive if the timeout code
 indeed was doing anything bad.

IIRC, the timer was set for 40ms, so if a complete video frame doesn't
arrive within that interval we generate a green frame.  It was never
really intended to have perfect clocking (i.e. 29.97 FPS), but is
really just there to prevent the tvtime user interface from blocking
indefinitely.

If you weren't seeing it in the V2 series, then I guess you fixed
whatever bug was present in V1.

 I am seeing tvtime hangs without the timeout. I am fine with this
 patch not going. It does make the code cleaner and also reduces
 buffer handling during streaming. However, there is a clear regression
 to tvtime.

Correct.  I think everybody agrees that the timer code is ugly and it
would be cleaner if it wasn't needed - except it clearly is needed to
prevent regressions in tvtime.

All that said, I'm quite excited to see the driver converted to VB2.  Nice job!

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 02/13] pinctrl: sun6i: Add A31s pinctrl support

2015-01-13 Thread Linus Walleij
On Wed, Dec 17, 2014 at 6:18 PM, Hans de Goede hdego...@redhat.com wrote:

 The A31s is a stripped down version of the A31, as such it is missing some
 pins and some functions on some pins.

 The new pinctrl-sun6i-a31s.c this commit adds is a copy of 
 pinctrl-sun6i-a31s.c
 with the missing pins and functions removed.

 Note there is no a31s specific version of pinctrl-sun6i-a31-r.c, as the
 prcm pins are identical between the A31 and the A31s.

 Signed-off-by: Hans de Goede hdego...@redhat.com
 ---
 Changes in v2:
 -Sync i2c3 muxing with v2 of pinctrl: sun6i: Add some missing functions
 -Add myself to the copyright header

Patch applied with Maxime's ACK.

Yours,
Linus Walleij
--
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


Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Francesco Other
Is there a gentleman that can help me with my problem? On linuxtv.org
they said that someone here sure will help me.

I submitted the problem here:
http://www.spinics.net/lists/linux-media/msg85432.html

Regards

Francesco
--
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] cx23885/vb2 regression: please test this patch

2015-01-13 Thread Hans Verkuil
Hi Raimonds, Jurgen,

Can you both test this patch? It should (I hope) solve the problems you
both had with the cx23885 driver.

This patch fixes a race condition in the vb2_thread that occurs when
the thread is stopped. The crucial fix is calling kthread_stop much
earlier in vb2_thread_stop(). But I also made the vb2_thread more
robust.

Regards,

Hans

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

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index d09a891..bc08a82 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -3146,27 +3146,26 @@ static int vb2_thread(void *data)
prequeue--;
} else {
call_void_qop(q, wait_finish, q);
-   ret = vb2_internal_dqbuf(q, fileio-b, 0);
+   if (!threadio-stop)
+   ret = vb2_internal_dqbuf(q, fileio-b, 0);
call_void_qop(q, wait_prepare, q);
dprintk(5, file io: vb2_dqbuf result: %d\n, ret);
}
-   if (threadio-stop)
-   break;
-   if (ret)
+   if (ret || threadio-stop)
break;
try_to_freeze();
 
vb = q-bufs[fileio-b.index];
if (!(fileio-b.flags  V4L2_BUF_FLAG_ERROR))
-   ret = threadio-fnc(vb, threadio-priv);
-   if (ret)
-   break;
+   if (threadio-fnc(vb, threadio-priv))
+   break;
call_void_qop(q, wait_finish, q);
if (set_timestamp)
v4l2_get_timestamp(fileio-b.timestamp);
-   ret = vb2_internal_qbuf(q, fileio-b);
+   if (!threadio-stop)
+   ret = vb2_internal_qbuf(q, fileio-b);
call_void_qop(q, wait_prepare, q);
-   if (ret)
+   if (ret || threadio-stop)
break;
}
 
@@ -3235,11 +3234,11 @@ int vb2_thread_stop(struct vb2_queue *q)
threadio-stop = true;
vb2_internal_streamoff(q, q-type);
call_void_qop(q, wait_prepare, q);
+   err = kthread_stop(threadio-thread);
q-fileio = NULL;
fileio-req.count = 0;
vb2_reqbufs(q, fileio-req);
kfree(fileio);
-   err = kthread_stop(threadio-thread);
threadio-thread = NULL;
kfree(threadio);
q-fileio = NULL;
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/3] media: au0828 remove video and vbi buffer timeout work-around

2015-01-13 Thread Shuah Khan
On 01/12/2015 09:44 PM, Devin Heitmueller wrote:
 Hi Shuah,
 
 On Mon, Jan 12, 2015 at 9:56 PM, Shuah Khan shua...@osg.samsung.com wrote:
 au0828 does video and vbi buffer timeout handling to prevent
 applications such as tvtime from hanging by ensuring that the
 video frames continue to be delivered even when the ITU-656
 input isn't receiving any data. This work-around is complex
 as it introduces set and clear timer code paths in start/stop
 streaming, and close interfaces. However, tvtime will hang
 without the following tvtime change:
 
 I'm confused.  When we last debated whether this patch would be
 accepted, the last message from Mauro said the following:
 
 That means that we'll need to keep holding such timeout code for
 years, until all distros update to a new tvtime, of course assuming
 that this is the only one application with such issue.
 
 In other words, the timeout code has to stay in there since otherwise
 it will cause ABI breakage.  It's great that Hans has submitted a
 patch to improve tvtime, and over the next couple of years that patch
 might actually start to appear in distributions.  That unfortunately
 doesn't change the fact that everybody who updates their kernel (or
 has it updated for them as part of their distribution) will go from
 works fine to completely broken.
 
 The driver was working before the VB2 conversion, so if there is now
 instability then it's likely that some bug was introduced during the
 conversion to VB2.  Simply ripping out the timeout code seems like the
 wrong approach to addressing a regression likely caused by your own
 VB2 conversion patch.
 

I couldn't reproduce what I was seeing when I did patch v2 series
work. What I noticed was that I was seeing a few too many green screens
and I had to re-tune xawtv when the timeout code is in place. My
thinking was that this timeout handling could be introducing blank
green frames when there is no need. However, I can't reproduce the
problem on 3.19-rc4 base which is what I am using to test the changes
to the patch series. Hence, I am not positive if the timeout code
indeed was doing anything bad.

I am seeing tvtime hangs without the timeout. I am fine with this
patch not going. It does make the code cleaner and also reduces
buffer handling during streaming. However, there is a clear regression
to tvtime.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 01/13] pinctrl: sun6i: Add some missing functions

2015-01-13 Thread Linus Walleij
On Wed, Dec 17, 2014 at 6:18 PM, Hans de Goede hdego...@redhat.com wrote:

 While working on pinctrl for the A31s, I noticed that function 4 of
 PA15 - PA18 was missing, add these.

 Signed-off-by: Hans de Goede hdego...@redhat.com
 ---
 Changes in v2:
 -Drop the changes to the muxing of i2c3 this was based on
  A31s Datasheet v1.40.pdf, but all other A31 related info puts them at the
  pins where we already have them, so leave this as is

Patch applied with Maxime's ACK.

Yours,
Linus Walleij
--
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 v7 1/3] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint

2015-01-13 Thread Tomi Valkeinen
On 23/12/14 15:09, Philipp Zabel wrote:
 Decrementing the reference count of the previous endpoint node allows to
 use the of_graph_get_next_endpoint function in a for_each_... style macro.
 All current users of this function that pass a non-NULL prev parameter
 (coresight, rcar-du, imx-drm, soc_camera, and omap2-dss) are changed to
 not decrement the passed prev argument's refcount themselves.
 
 Signed-off-by: Philipp Zabel p.za...@pengutronix.de
 Acked-by: Mauro Carvalho Chehab mche...@osg.samsung.com
 Acked-by: Mathieu Poirier mathieu.poir...@linaro.org
 ---
 Changes since v6:
  - Added omap2-dss.
  - Added Mathieu's ack.
 ---
  drivers/coresight/of_coresight.c  | 13 ++---
  drivers/gpu/drm/imx/imx-drm-core.c| 13 ++---
  drivers/gpu/drm/rcar-du/rcar_du_kms.c | 15 ---
  drivers/media/platform/soc_camera/soc_camera.c|  3 ++-
  drivers/of/base.c |  9 +
  drivers/video/fbdev/omap2/dss/omapdss-boot-init.c |  7 +--
  6 files changed, 12 insertions(+), 48 deletions(-)
 

For omapdss:

Acked-by: Tomi Valkeinen tomi.valkei...@ti.com

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: smiapp-core.c error if !defined(CONFIG_OF)

2015-01-13 Thread Sakari Ailus
Hi Hans,

On Tue, Jan 13, 2015 at 09:54:05AM +0100, Hans Verkuil wrote:
 Hi Sakari,
 
 The daily build fails because of this error:
 
 media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
 media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of function 
 'of_read_number' [-Werror=implicit-function-declaration]
pdata-op_sys_clock[i] = of_read_number(val + i * 2, 2);
^
 
 Some digging showed that of_read_number is only available if CONFIG_OF
 is defined. As far as I can see that is actually a bug in linux/of.h, as
 I see no reason why it should be under CONFIG_OF.

Well, it could be defined I guess --- it shouldn't have any use if OF isn't
in use. I'll submit a patch for that.

The problem in the smiapp driver is better fixed by applying smiapp: Use
of_property_read_u64_array() to read a 64-bit number array instead. Could
you try that? I'll submit this as a fix then. of_read_number() was just a
workaround for missing of_property_read_u64_array().

-- 
Kind regards,

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


Re: smiapp-core.c error if !defined(CONFIG_OF)

2015-01-13 Thread Sakari Ailus
On Tue, Jan 13, 2015 at 11:31:35AM +0200, Sakari Ailus wrote:
 Hi Hans,
 
 On Tue, Jan 13, 2015 at 09:54:05AM +0100, Hans Verkuil wrote:
  Hi Sakari,
  
  The daily build fails because of this error:
  
  media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
  media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of 
  function 'of_read_number' [-Werror=implicit-function-declaration]
 pdata-op_sys_clock[i] = of_read_number(val + i * 2, 2);
 ^
  
  Some digging showed that of_read_number is only available if CONFIG_OF
  is defined. As far as I can see that is actually a bug in linux/of.h, as
  I see no reason why it should be under CONFIG_OF.
 
 Well, it could be defined I guess --- it shouldn't have any use if OF isn't
 in use. I'll submit a patch for that.

Or not. There are a number of functions that are available only if CONFIG_OF
is defined, this is not an only case. If the drivers are happy with that, I
guess it's fine. I think a better solution might be to define a header for
drivers to include.

The issue in the smiapp driver is indeed better fixed by using the right
function to read the 64-bit unsigned integer array.

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


[PATCH 04/16] [media] adv7180: Cleanup register define naming

2015-01-13 Thread Lars-Peter Clausen
Consistently prefix register defines with ADV7180_REG. Also remove the ADI
from register names, the ADV7180 prefix should provide enough of a namespace
separation.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 105 ++--
 1 file changed, 52 insertions(+), 53 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index f2508abe..00ba845 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -31,7 +31,7 @@
 #include media/v4l2-ctrls.h
 #include linux/mutex.h
 
-#define ADV7180_INPUT_CONTROL_REG  0x00
+#define ADV7180_REG_INPUT_CONTROL  0x00
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM   0x00
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
 #define ADV7180_INPUT_CONTROL_AD_PAL_N_NTSC_J_SECAM0x20
@@ -50,36 +50,36 @@
 #define ADV7180_INPUT_CONTROL_PAL_SECAM_PED0xf0
 #define ADV7180_INPUT_CONTROL_INSEL_MASK   0x0f
 
-#define ADV7180_EXTENDED_OUTPUT_CONTROL_REG0x04
+#define ADV7180_REG_EXTENDED_OUTPUT_CONTROL0x04
 #define ADV7180_EXTENDED_OUTPUT_CONTROL_NTSCDIS0xC5
 
-#define ADV7180_AUTODETECT_ENABLE_REG  0x07
+#define ADV7180_REG_AUTODETECT_ENABLE  0x07
 #define ADV7180_AUTODETECT_DEFAULT 0x7f
 /* Contrast */
-#define ADV7180_CON_REG0x08/*Unsigned */
+#define ADV7180_REG_CON0x08/*Unsigned */
 #define ADV7180_CON_MIN0
 #define ADV7180_CON_DEF128
 #define ADV7180_CON_MAX255
 /* Brightness*/
-#define ADV7180_BRI_REG0x0a/*Signed */
+#define ADV7180_REG_BRI0x0a/*Signed */
 #define ADV7180_BRI_MIN-128
 #define ADV7180_BRI_DEF0
 #define ADV7180_BRI_MAX127
 /* Hue */
-#define ADV7180_HUE_REG0x0b/*Signed, inverted */
+#define ADV7180_REG_HUE0x0b/*Signed, inverted */
 #define ADV7180_HUE_MIN-127
 #define ADV7180_HUE_DEF0
 #define ADV7180_HUE_MAX128
 
-#define ADV7180_ADI_CTRL_REG   0x0e
-#define ADV7180_ADI_CTRL_IRQ_SPACE 0x20
+#define ADV7180_REG_CTRL   0x0e
+#define ADV7180_CTRL_IRQ_SPACE 0x20
 
-#define ADV7180_PWR_MAN_REG0x0f
+#define ADV7180_REG_PWR_MAN0x0f
 #define ADV7180_PWR_MAN_ON 0x04
 #define ADV7180_PWR_MAN_OFF0x24
 #define ADV7180_PWR_MAN_RES0x80
 
-#define ADV7180_STATUS1_REG0x10
+#define ADV7180_REG_STATUS10x10
 #define ADV7180_STATUS1_IN_LOCK0x01
 #define ADV7180_STATUS1_AUTOD_MASK 0x70
 #define ADV7180_STATUS1_AUTOD_NTSM_M_J 0x00
@@ -91,33 +91,33 @@
 #define ADV7180_STATUS1_AUTOD_PAL_COMB 0x60
 #define ADV7180_STATUS1_AUTOD_SECAM_5250x70
 
-#define ADV7180_IDENT_REG 0x11
+#define ADV7180_REG_IDENT 0x11
 #define ADV7180_ID_7180 0x18
 
-#define ADV7180_ICONF1_ADI 0x40
+#define ADV7180_REG_ICONF1 0x40
 #define ADV7180_ICONF1_ACTIVE_LOW  0x01
 #define ADV7180_ICONF1_PSYNC_ONLY  0x10
 #define ADV7180_ICONF1_ACTIVE_TO_CLR   0xC0
 /* Saturation */
-#define ADV7180_SD_SAT_CB_REG  0xe3/*Unsigned */
-#define ADV7180_SD_SAT_CR_REG  0xe4/*Unsigned */
+#define ADV7180_REG_SD_SAT_CB  0xe3/*Unsigned */
+#define ADV7180_REG_SD_SAT_CR  0xe4/*Unsigned */
 #define ADV7180_SAT_MIN0
 #define ADV7180_SAT_DEF128
 #define ADV7180_SAT_MAX255
 
 #define ADV7180_IRQ1_LOCK  0x01
 #define ADV7180_IRQ1_UNLOCK0x02
-#define ADV7180_ISR1_ADI   0x42
-#define ADV7180_ICR1_ADI   0x43
-#define ADV7180_IMR1_ADI   0x44
-#define ADV7180_IMR2_ADI   0x48
+#define ADV7180_REG_ISR1   0x42
+#define ADV7180_REG_ICR1   0x43
+#define ADV7180_REG_IMR1   0x44
+#define ADV7180_REG_IMR2   0x48
 #define ADV7180_IRQ3_AD_CHANGE 0x08
-#define ADV7180_ISR3_ADI   0x4A
-#define ADV7180_ICR3_ADI   0x4B
-#define ADV7180_IMR3_ADI   0x4C
-#define ADV7180_IMR4_ADI   0x50
+#define ADV7180_REG_ISR3   0x4A
+#define ADV7180_REG_ICR3   0x4B
+#define ADV7180_REG_IMR3   0x4C
+#define ADV7180_REG_IMR4   0x50
 
-#define ADV7180_NTSC_V_BIT_END_REG 0xE6
+#define ADV7180_REG_NTSC_V_BIT_END 0xE6
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
 struct adv7180_state {
@@ -198,7 +198,7 @@ static u32 adv7180_status_to_v4l2(u8 status1)
 static int __adv7180_status(struct i2c_client *client, u32 *status,
v4l2_std_id *std)
 {
-   int status1 = i2c_smbus_read_byte_data(client, ADV7180_STATUS1_REG);
+   int status1 = i2c_smbus_read_byte_data(client, ADV7180_REG_STATUS1);
 
if (status1  0)

[PATCH 16/16] [media] Add MAINTAINERS entry for the adv7180

2015-01-13 Thread Lars-Peter Clausen
Add myself as the maintainer for the adv7180 video subdev driver.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 MAINTAINERS | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4318f34..22bb77e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -659,6 +659,13 @@ L: linux-media@vger.kernel.org
 S: Maintained
 F: drivers/media/i2c/ad9389b*
 
+ANALOG DEVICES INC ADV7180 DRIVER
+M: Lars-Peter Clausen l...@metafoo.de
+L: linux-media@vger.kernel.org
+W: http://ez.analog.com/community/linux-device-drivers
+S: Supported
+F: drivers/media/i2c/adv7180.c
+
 ANALOG DEVICES INC ADV7511 DRIVER
 M: Hans Verkuil hans.verk...@cisco.com
 L: linux-media@vger.kernel.org
-- 
1.8.0

--
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/16] [media] adv7180: Add support for different chip

2015-01-13 Thread Lars-Peter Clausen
The adv7180 is part of a larger family of chips which all implement
different features from a feature superset. This patch series step by step
extends the current adv7180 with features from the superset that are
currently not supported and gradually adding support for more variations of
the chip.

The first half of this series contains fixes and cleanups while the second
half adds new features and support for new chips.

- Lars

Lars-Peter Clausen (16):
  [media] adv7180: Do not request the IRQ again during resume
  [media] adv7180: Pass correct flags to request_threaded_irq()
  [media] adv7180: Use inline function instead of macro
  [media] adv7180: Cleanup register define naming
  [media] adv7180: Do implicit register paging
  [media] adv7180: Reset the device before initialization
  [media] adv7180: Add media controller support
  [media] adv7180: Consolidate video mode setting
  [media] adv7180: Prepare for multi-chip support
  [media] adv7180: Add support for the ad7182
  [media] adv7180: Add support for the adv7280/adv7281/adv7282
  [media] adv7180: Add support for the
adv7280-m/adv7281-m/adv7281-ma/adv7282-m
  [media] adv7180: Add I2P support
  [media] adv7180: Add fast switch support
  [media] adv7180: Add free run mode controls
  [media] Add MAINTAINERS entry for the adv7180

 MAINTAINERS   |7 +
 drivers/media/i2c/Kconfig |2 +-
 drivers/media/i2c/adv7180.c   | 1137 ++---
 drivers/media/pci/sta2x11/Kconfig |1 +
 drivers/media/platform/Kconfig|2 +-
 5 files changed, 947 insertions(+), 202 deletions(-)

-- 
1.8.0

--
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/16] [media] adv7180: Use inline function instead of macro

2015-01-13 Thread Lars-Peter Clausen
Use a inline function instead of a macro for the container_of helper for
getting the driver's state struct from a control. A inline function has the
advantage that it is more typesafe and nicer in general.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index f424a4d..f2508abe 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -130,9 +130,11 @@ struct adv7180_state {
boolpowered;
u8  input;
 };
-#define to_adv7180_sd(_ctrl) (container_of(_ctrl-handler,\
-   struct adv7180_state,   \
-   ctrl_hdl)-sd)
+
+static struct adv7180_state *ctrl_to_adv7180(struct v4l2_ctrl *ctrl)
+{
+   return container_of(ctrl-handler, struct adv7180_state, ctrl_hdl);
+}
 
 static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 {
@@ -345,9 +347,8 @@ static int adv7180_s_power(struct v4l2_subdev *sd, int on)
 
 static int adv7180_s_ctrl(struct v4l2_ctrl *ctrl)
 {
-   struct v4l2_subdev *sd = to_adv7180_sd(ctrl);
-   struct adv7180_state *state = to_state(sd);
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
+   struct adv7180_state *state = ctrl_to_adv7180(ctrl);
+   struct i2c_client *client = v4l2_get_subdevdata(state-sd);
int ret = mutex_lock_interruptible(state-mutex);
int val;
 
-- 
1.8.0

--
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 09/16] [media] adv7180: Prepare for multi-chip support

2015-01-13 Thread Lars-Peter Clausen
The adv7180 is part of a larger family of device, which have all a very
similar register map layout. This patch prepares the adv7180 driver for
support for multiple different devices. For now the only difference we care
about is the number of input channel configurations. Also the way the input
format is configured slightly differs between some devices.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 187 ++--
 1 file changed, 130 insertions(+), 57 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 4d9bcc8..e3f91d5 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -32,23 +32,24 @@
 #include linux/mutex.h
 #include linux/delay.h
 
+#define ADV7180_STD_AD_PAL_BG_NTSC_J_SECAM 0x0
+#define ADV7180_STD_AD_PAL_BG_NTSC_J_SECAM_PED 0x1
+#define ADV7180_STD_AD_PAL_N_NTSC_J_SECAM  0x2
+#define ADV7180_STD_AD_PAL_N_NTSC_M_SECAM  0x3
+#define ADV7180_STD_NTSC_J 0x4
+#define ADV7180_STD_NTSC_M 0x5
+#define ADV7180_STD_PAL60  0x6
+#define ADV7180_STD_NTSC_443   0x7
+#define ADV7180_STD_PAL_BG 0x8
+#define ADV7180_STD_PAL_N  0x9
+#define ADV7180_STD_PAL_M  0xa
+#define ADV7180_STD_PAL_M_PED  0xb
+#define ADV7180_STD_PAL_COMB_N 0xc
+#define ADV7180_STD_PAL_COMB_N_PED 0xd
+#define ADV7180_STD_PAL_SECAM  0xe
+#define ADV7180_STD_PAL_SECAM_PED  0xf
+
 #define ADV7180_REG_INPUT_CONTROL  0x
-#define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM   0x00
-#define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
-#define ADV7180_INPUT_CONTROL_AD_PAL_N_NTSC_J_SECAM0x20
-#define ADV7180_INPUT_CONTROL_AD_PAL_N_NTSC_M_SECAM0x30
-#define ADV7180_INPUT_CONTROL_NTSC_J   0x40
-#define ADV7180_INPUT_CONTROL_NTSC_M   0x50
-#define ADV7180_INPUT_CONTROL_PAL600x60
-#define ADV7180_INPUT_CONTROL_NTSC_443 0x70
-#define ADV7180_INPUT_CONTROL_PAL_BG   0x80
-#define ADV7180_INPUT_CONTROL_PAL_N0x90
-#define ADV7180_INPUT_CONTROL_PAL_M0xa0
-#define ADV7180_INPUT_CONTROL_PAL_M_PED0xb0
-#define ADV7180_INPUT_CONTROL_PAL_COMB_N   0xc0
-#define ADV7180_INPUT_CONTROL_PAL_COMB_N_PED   0xd0
-#define ADV7180_INPUT_CONTROL_PAL_SECAM0xe0
-#define ADV7180_INPUT_CONTROL_PAL_SECAM_PED0xf0
 #define ADV7180_INPUT_CONTROL_INSEL_MASK   0x0f
 
 #define ADV7180_REG_EXTENDED_OUTPUT_CONTROL0x0004
@@ -121,6 +122,30 @@
 #define ADV7180_REG_NTSC_V_BIT_END 0x00E6
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
+#define ADV7180_INPUT_CVBS_AIN1 0x00
+#define ADV7180_INPUT_CVBS_AIN2 0x01
+#define ADV7180_INPUT_CVBS_AIN3 0x02
+#define ADV7180_INPUT_CVBS_AIN4 0x03
+#define ADV7180_INPUT_CVBS_AIN5 0x04
+#define ADV7180_INPUT_CVBS_AIN6 0x05
+#define ADV7180_INPUT_SVIDEO_AIN1_AIN2 0x06
+#define ADV7180_INPUT_SVIDEO_AIN3_AIN4 0x07
+#define ADV7180_INPUT_SVIDEO_AIN5_AIN6 0x08
+#define ADV7180_INPUT_YPRPB_AIN1_AIN2_AIN3 0x09
+#define ADV7180_INPUT_YPRPB_AIN4_AIN5_AIN6 0x0a
+
+struct adv7180_state;
+
+#define ADV7180_FLAG_RESET_POWERED BIT(0)
+
+struct adv7180_chip_info {
+   unsigned int flags;
+   unsigned int valid_input_mask;
+   int (*set_std)(struct adv7180_state *st, unsigned int std);
+   int (*select_input)(struct adv7180_state *st, unsigned int input);
+   int (*init)(struct adv7180_state *state);
+};
+
 struct adv7180_state {
struct v4l2_ctrl_handler ctrl_hdl;
struct v4l2_subdev  sd;
@@ -134,6 +159,7 @@ struct adv7180_state {
 
struct i2c_client   *client;
unsigned intregister_page;
+   const struct adv7180_chip_info *chip_info;
 };
 
 static struct adv7180_state *ctrl_to_adv7180(struct v4l2_ctrl *ctrl)
@@ -167,6 +193,11 @@ static int adv7180_read(struct adv7180_state *state, 
unsigned int reg)
return i2c_smbus_read_byte_data(state-client, reg  0xff);
 }
 
+static int adv7180_set_video_standard(struct adv7180_state *state,
+   unsigned int std)
+{
+   return state-chip_info-set_std(state, std);
+}
 
 static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 {
@@ -199,22 +230,22 @@ static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 static int v4l2_std_to_adv7180(v4l2_std_id std)
 {
if (std == V4L2_STD_PAL_60)
-   return ADV7180_INPUT_CONTROL_PAL60;
+   return ADV7180_STD_PAL60;
if (std == V4L2_STD_NTSC_443)
-   return ADV7180_INPUT_CONTROL_NTSC_443;
+   return 

[PATCH 08/16] [media] adv7180: Consolidate video mode setting

2015-01-13 Thread Lars-Peter Clausen
We have basically the same code to set the video standard in init_device()
and adv7180_s_std(). Factor this out into a common helper function.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 67 ++---
 1 file changed, 32 insertions(+), 35 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 349cae3..4d9bcc8 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -304,37 +304,54 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, 
u32 *status)
return ret;
 }
 
-static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
+static int adv7180_program_std(struct adv7180_state *state)
 {
-   struct adv7180_state *state = to_state(sd);
-   int ret = mutex_lock_interruptible(state-mutex);
-   if (ret)
-   return ret;
+   int ret;
 
-   /* all standards - autodetect */
-   if (std == V4L2_STD_ALL) {
+   if (state-autodetect) {
ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL,
ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM
| state-input);
if (ret  0)
-   goto out;
+   return ret;
 
__adv7180_status(state, NULL, state-curr_norm);
-   state-autodetect = true;
} else {
-   ret = v4l2_std_to_adv7180(std);
+   ret = v4l2_std_to_adv7180(state-curr_norm);
if (ret  0)
-   goto out;
+   return ret;
 
ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL,
ret | state-input);
if (ret  0)
+   return ret;
+   }
+
+   return 0;
+}
+
+static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
+{
+   struct adv7180_state *state = to_state(sd);
+   int ret = mutex_lock_interruptible(state-mutex);
+
+   if (ret)
+   return ret;
+
+   /* all standards - autodetect */
+   if (std == V4L2_STD_ALL) {
+   state-autodetect = true;
+   } else {
+   /* Make sure we can support this std */
+   ret = v4l2_std_to_adv7180(std);
+   if (ret  0)
goto out;
 
state-curr_norm = std;
state-autodetect = false;
}
-   ret = 0;
+
+   ret = adv7180_program_std(state);
 out:
mutex_unlock(state-mutex);
return ret;
@@ -547,30 +564,10 @@ static int init_device(struct adv7180_state *state)
adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
usleep_range(2000, 1);
 
-   /* Initialize adv7180 */
-   /* Enable autodetection */
-   if (state-autodetect) {
-   ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL,
-   ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM
- | state-input);
-   if (ret  0)
-   goto out_unlock;
-
-   ret = adv7180_write(state, ADV7180_REG_AUTODETECT_ENABLE,
- ADV7180_AUTODETECT_DEFAULT);
-   if (ret  0)
-   goto out_unlock;
-   } else {
-   ret = v4l2_std_to_adv7180(state-curr_norm);
-   if (ret  0)
-   goto out_unlock;
-
-   ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL,
- ret | state-input);
-   if (ret  0)
-   goto out_unlock;
+   ret = adv7180_program_std(state);
+   if (ret)
+   goto out_unlock;
 
-   }
/* ITU-R BT.656-4 compatible */
ret = adv7180_write(state, ADV7180_REG_EXTENDED_OUTPUT_CONTROL,
ADV7180_EXTENDED_OUTPUT_CONTROL_NTSCDIS);
-- 
1.8.0

--
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/16] [media] adv7180: Do not request the IRQ again during resume

2015-01-13 Thread Lars-Peter Clausen
Currently the IRQ is requested from within the init_device() function. This
function is not only called during device probe, but also during resume
causing the driver to try to request the IRQ again. Move requesting the IRQ
from init_device() to the probe function to make sure that it is only
requested once.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index bffe6eb..172e4a2 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -553,11 +553,6 @@ static int init_device(struct i2c_client *client, struct 
adv7180_state *state)
 
/* register for interrupts */
if (state-irq  0) {
-   ret = request_threaded_irq(state-irq, NULL, adv7180_irq,
-  IRQF_ONESHOT, KBUILD_MODNAME, state);
-   if (ret)
-   return ret;
-
ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG,
ADV7180_ADI_CTRL_IRQ_SPACE);
if (ret  0)
@@ -597,7 +592,6 @@ static int init_device(struct i2c_client *client, struct 
adv7180_state *state)
return 0;
 
 err:
-   free_irq(state-irq, state);
return ret;
 }
 
@@ -636,6 +630,13 @@ static int adv7180_probe(struct i2c_client *client,
if (ret)
goto err_free_ctrl;
 
+   if (state-irq) {
+   ret = request_threaded_irq(client-irq, NULL, adv7180_irq,
+  IRQF_ONESHOT, KBUILD_MODNAME, state);
+   if (ret)
+   goto err_free_ctrl;
+   }
+
ret = v4l2_async_register_subdev(sd);
if (ret)
goto err_free_irq;
-- 
1.8.0

--
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/16] [media] adv7180: Add support for the adv7280-m/adv7281-m/adv7281-ma/adv7282-m

2015-01-13 Thread Lars-Peter Clausen
This patch adds support for the adv7280-m/adv2781-m/adv7281-ma/adv7282-m
devices to the adv7180 driver. They are very similar to the
adv7280/adv7281/adv7282 but instead of parallel video out they feature a
MIPI CSI2 transmitter.

The CSI2 transmitter is configured via a separate I2C address, so we need to
register a dummy device for it.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 170 +++-
 1 file changed, 154 insertions(+), 16 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index ea6695c..868a677 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -124,6 +124,11 @@
 #define ADV7180_REG_NTSC_V_BIT_END 0x00E6
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
+#define ADV7180_REG_CSI_SLAVE_ADDR 0xFE
+
+#define ADV7180_CSI_REG_PWRDN  0x00
+#define ADV7180_CSI_PWRDN  0x80
+
 #define ADV7180_INPUT_CVBS_AIN1 0x00
 #define ADV7180_INPUT_CVBS_AIN2 0x01
 #define ADV7180_INPUT_CVBS_AIN3 0x02
@@ -155,10 +160,13 @@
 #define ADV7182_INPUT_DIFF_CVBS_AIN5_AIN6 0x10
 #define ADV7182_INPUT_DIFF_CVBS_AIN7_AIN8 0x11
 
+#define ADV7180_DEFAULT_CSI_I2C_ADDR 0x44
+
 struct adv7180_state;
 
 #define ADV7180_FLAG_RESET_POWERED BIT(0)
 #define ADV7180_FLAG_V2BIT(1)
+#define ADV7180_FLAG_MIPI_CSI2 BIT(2)
 
 struct adv7180_chip_info {
unsigned int flags;
@@ -181,6 +189,7 @@ struct adv7180_state {
 
struct i2c_client   *client;
unsigned intregister_page;
+   struct i2c_client   *csi_client;
const struct adv7180_chip_info *chip_info;
 };
 
@@ -215,6 +224,12 @@ static int adv7180_read(struct adv7180_state *state, 
unsigned int reg)
return i2c_smbus_read_byte_data(state-client, reg  0xff);
 }
 
+static int adv7180_csi_write(struct adv7180_state *state, unsigned int reg,
+   unsigned int value)
+{
+   return i2c_smbus_write_byte_data(state-csi_client, reg, value);
+}
+
 static int adv7180_set_video_standard(struct adv7180_state *state,
unsigned int std)
 {
@@ -407,13 +422,31 @@ out:
 static int adv7180_set_power(struct adv7180_state *state, bool on)
 {
u8 val;
+   int ret;
 
if (on)
val = ADV7180_PWR_MAN_ON;
else
val = ADV7180_PWR_MAN_OFF;
 
-   return adv7180_write(state, ADV7180_REG_PWR_MAN, val);
+   ret = adv7180_write(state, ADV7180_REG_PWR_MAN, val);
+   if (ret)
+   return ret;
+
+   if (state-chip_info-flags  ADV7180_FLAG_MIPI_CSI2) {
+   if (on) {
+   adv7180_csi_write(state, 0xDE, 0x02);
+   adv7180_csi_write(state, 0xD2, 0xF7);
+   adv7180_csi_write(state, 0xD8, 0x65);
+   adv7180_csi_write(state, 0xE0, 0x09);
+   adv7180_csi_write(state, 0x2C, 0x00);
+   adv7180_csi_write(state, 0x00, 0x00);
+   } else {
+   adv7180_csi_write(state, 0x00, 0x80);
+   }
+   }
+
+   return 0;
 }
 
 static int adv7180_s_power(struct v4l2_subdev *sd, int on)
@@ -550,13 +583,22 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
 static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
 struct v4l2_mbus_config *cfg)
 {
-   /*
-* The ADV7180 sensor supports BT.601/656 output modes.
-* The BT.656 is default and not yet configurable by s/w.
-*/
-   cfg-flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING |
-V4L2_MBUS_DATA_ACTIVE_HIGH;
-   cfg-type = V4L2_MBUS_BT656;
+   struct adv7180_state *state = to_state(sd);
+
+   if (state-chip_info-flags  ADV7180_FLAG_MIPI_CSI2) {
+   cfg-type = V4L2_MBUS_CSI2;
+   cfg-flags = V4L2_MBUS_CSI2_1_LANE |
+   V4L2_MBUS_CSI2_CHANNEL_0 |
+   V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
+   } else {
+   /*
+* The ADV7180 sensor supports BT.601/656 output modes.
+* The BT.656 is default and not yet configurable by s/w.
+*/
+   cfg-flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING |
+V4L2_MBUS_DATA_ACTIVE_HIGH;
+   cfg-type = V4L2_MBUS_BT656;
+   }
 
return 0;
 }
@@ -639,20 +681,32 @@ static int adv7180_select_input(struct adv7180_state 
*state, unsigned int input)
 
 static int adv7182_init(struct adv7180_state *state)
 {
+   if (state-chip_info-flags  ADV7180_FLAG_MIPI_CSI2)
+   adv7180_write(state, ADV7180_REG_CSI_SLAVE_ADDR,
+   ADV7180_DEFAULT_CSI_I2C_ADDR  1);
+
if (state-chip_info-flags  ADV7180_FLAG_V2) {
/* ADI recommended writes for improved video quality */
adv7180_write(state, 0x0080, 

[PATCH 13/16] [media] adv7180: Add I2P support

2015-01-13 Thread Lars-Peter Clausen
Some of the devices supported by this driver have a interlaced-to-
progressive converter which can optionally be enabled. This patch adds
support for enabling and disabling the I2P converter on such devices.

I2P mode can be enabled by selecting V4L2_FIELD_NONE instead of
V4L2_FIELD_INTERLACED for the format.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 156 +---
 1 file changed, 148 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 868a677..4d789c7 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -124,6 +124,7 @@
 #define ADV7180_REG_NTSC_V_BIT_END 0x00E6
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
+#define ADV7180_REG_VPP_SLAVE_ADDR 0xFD
 #define ADV7180_REG_CSI_SLAVE_ADDR 0xFE
 
 #define ADV7180_CSI_REG_PWRDN  0x00
@@ -161,12 +162,14 @@
 #define ADV7182_INPUT_DIFF_CVBS_AIN7_AIN8 0x11
 
 #define ADV7180_DEFAULT_CSI_I2C_ADDR 0x44
+#define ADV7180_DEFAULT_VPP_I2C_ADDR 0x42
 
 struct adv7180_state;
 
 #define ADV7180_FLAG_RESET_POWERED BIT(0)
 #define ADV7180_FLAG_V2BIT(1)
 #define ADV7180_FLAG_MIPI_CSI2 BIT(2)
+#define ADV7180_FLAG_I2P   BIT(3)
 
 struct adv7180_chip_info {
unsigned int flags;
@@ -190,7 +193,9 @@ struct adv7180_state {
struct i2c_client   *client;
unsigned intregister_page;
struct i2c_client   *csi_client;
+   struct i2c_client   *vpp_client;
const struct adv7180_chip_info *chip_info;
+   enum v4l2_field field;
 };
 
 static struct adv7180_state *ctrl_to_adv7180(struct v4l2_ctrl *ctrl)
@@ -236,6 +241,12 @@ static int adv7180_set_video_standard(struct adv7180_state 
*state,
return state-chip_info-set_std(state, std);
 }
 
+static int adv7180_vpp_write(struct adv7180_state *state, unsigned int reg,
+   unsigned int value)
+{
+   return i2c_smbus_write_byte_data(state-vpp_client, reg, value);
+}
+
 static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 {
/* in case V4L2_IN_ST_NO_SIGNAL */
@@ -440,6 +451,8 @@ static int adv7180_set_power(struct adv7180_state *state, 
bool on)
adv7180_csi_write(state, 0xD8, 0x65);
adv7180_csi_write(state, 0xE0, 0x09);
adv7180_csi_write(state, 0x2C, 0x00);
+   if (state-field == V4L2_FIELD_NONE)
+   adv7180_csi_write(state, 0x1D, 0x80);
adv7180_csi_write(state, 0x00, 0x00);
} else {
adv7180_csi_write(state, 0x00, 0x80);
@@ -559,25 +572,97 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
 
fmt-code = MEDIA_BUS_FMT_YUYV8_2X8;
fmt-colorspace = V4L2_COLORSPACE_SMPTE170M;
-   fmt-field = V4L2_FIELD_INTERLACED;
fmt-width = 720;
fmt-height = state-curr_norm  V4L2_STD_525_60 ? 480 : 576;
 
return 0;
 }
 
+static int adv7180_set_field_mode(struct adv7180_state *state)
+{
+   if (!(state-chip_info-flags  ADV7180_FLAG_I2P))
+   return 0;
+
+   if (state-field == V4L2_FIELD_NONE) {
+   if (state-chip_info-flags  ADV7180_FLAG_MIPI_CSI2) {
+   adv7180_csi_write(state, 0x01, 0x20);
+   adv7180_csi_write(state, 0x02, 0x28);
+   adv7180_csi_write(state, 0x03, 0x38);
+   adv7180_csi_write(state, 0x04, 0x30);
+   adv7180_csi_write(state, 0x05, 0x30);
+   adv7180_csi_write(state, 0x06, 0x80);
+   adv7180_csi_write(state, 0x07, 0x70);
+   adv7180_csi_write(state, 0x08, 0x50);
+   }
+   adv7180_vpp_write(state, 0xa3, 0x00);
+   adv7180_vpp_write(state, 0x5b, 0x00);
+   adv7180_vpp_write(state, 0x55, 0x80);
+   } else {
+   if (state-chip_info-flags  ADV7180_FLAG_MIPI_CSI2) {
+   adv7180_csi_write(state, 0x01, 0x18);
+   adv7180_csi_write(state, 0x02, 0x18);
+   adv7180_csi_write(state, 0x03, 0x30);
+   adv7180_csi_write(state, 0x04, 0x20);
+   adv7180_csi_write(state, 0x05, 0x28);
+   adv7180_csi_write(state, 0x06, 0x40);
+   adv7180_csi_write(state, 0x07, 0x58);
+   adv7180_csi_write(state, 0x08, 0x30);
+   }
+   adv7180_vpp_write(state, 0xa3, 0x70);
+   adv7180_vpp_write(state, 0x5b, 0x80);
+   adv7180_vpp_write(state, 0x55, 0x00);
+   }
+
+   return 0;
+}
+
 static int adv7180_get_pad_format(struct v4l2_subdev *sd,
  struct v4l2_subdev_fh *fh,
  struct v4l2_subdev_format *format)
 {
-   

[PATCH 15/16] [media] adv7180: Add free run mode controls

2015-01-13 Thread Lars-Peter Clausen
The adv7180 (and similar) has support for a so called free run mode in which
it will output a predefined test signal. This patch adds support for
configuring the various aspects of the so called free run mode.

The patch adds three new v4l controls:
* Free Running Mode: Allows to either disable or enable free running
  mode or set it to automatic. In automatic mode the adv7180 will go to
  free run mode if no external signal source could be detected
* Free Running Pattern: Allows to select which pattern will be displayed
  in free run mode
* Free Running Color: Allows to select the color of the pattern

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 125 ++--
 1 file changed, 122 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 82c8296..678d6c9 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -75,6 +75,9 @@
 #define ADV7180_HUE_DEF0
 #define ADV7180_HUE_MAX128
 
+#define ADV7180_REG_DEF_VAL_Y  0x000c
+#define ADV7180_REG_DEF_VAL_C  0x000d
+
 #define ADV7180_REG_CTRL   0x000e
 #define ADV7180_CTRL_IRQ_SPACE 0x20
 
@@ -168,6 +171,11 @@
 #define ADV7180_DEFAULT_VPP_I2C_ADDR 0x42
 
 #define V4L2_CID_ADV_FAST_SWITCH   (V4L2_CID_DV_CLASS_BASE + 0x1010)
+#define V4L2_CID_ADV_FREE_RUN_COLOR(V4L2_CID_DV_CLASS_BASE + 0x1002)
+#define V4L2_CID_ADV_FREE_RUN_MODE (V4L2_CID_DV_CLASS_BASE + 0x1003)
+#define V4L2_CID_ADV_FREE_RUN_PATTERN  (V4L2_CID_DV_CLASS_BASE + 0x1004)
+
+#define ADV7180_INPUT_DISABLED (~0x00)
 
 struct adv7180_state;
 
@@ -193,6 +201,7 @@ struct adv7180_state {
v4l2_std_id curr_norm;
boolautodetect;
boolpowered;
+   boolforce_free_run;
u8  input;
 
struct i2c_client   *client;
@@ -363,10 +372,13 @@ static int adv7180_s_routing(struct v4l2_subdev *sd, u32 
input,
goto out;
}
 
-   ret = state-chip_info-select_input(state, input);
-
-   if (ret == 0)
+   if (state-force_free_run) {
state-input = input;
+   } else {
+   ret = state-chip_info-select_input(state, input);
+   if (ret == 0)
+   state-input = input;
+   }
 out:
mutex_unlock(state-mutex);
return ret;
@@ -488,6 +500,7 @@ static int adv7180_s_ctrl(struct v4l2_ctrl *ctrl)
 {
struct adv7180_state *state = ctrl_to_adv7180(ctrl);
int ret = mutex_lock_interruptible(state-mutex);
+   int reg_val;
int val;
 
if (ret)
@@ -526,6 +539,53 @@ static int adv7180_s_ctrl(struct v4l2_ctrl *ctrl)
adv7180_write(state, ADV7180_REG_FLCONTROL, 0x00);
}
break;
+   case V4L2_CID_ADV_FREE_RUN_MODE:
+   switch (ctrl-val) {
+   case 1: /* Enabled */
+   ret = state-chip_info-select_input(state,
+   ADV7180_INPUT_DISABLED);
+   state-force_free_run = true;
+   break;
+   case 0: /* Disabled */
+   case 2: /* Automatic */
+   ret = state-chip_info-select_input(state,
+   state-input);
+   state-force_free_run = false;
+   break;
+   default:
+   break;
+   }
+   reg_val = adv7180_read(state, ADV7180_REG_DEF_VAL_Y);
+   reg_val = 0xfc;
+   reg_val |= ctrl-val;
+   adv7180_write(state, ADV7180_REG_DEF_VAL_Y, reg_val);
+   break;
+   case V4L2_CID_ADV_FREE_RUN_PATTERN:
+   reg_val = adv7180_read(state, 0x14);
+   reg_val = 0xf8;
+   reg_val |= ctrl-val;
+   adv7180_write(state, 0x14, reg_val);
+   break;
+   case V4L2_CID_ADV_FREE_RUN_COLOR: {
+   int r = (ctrl-val  0xff)  16;
+   int g = (ctrl-val  0x00ff00)  8;
+   int b = (ctrl-val  0xff);
+   /* RGB - YCbCr, numerical approximation */
+   int y = ((66 * r + 129 * g + 25 * b + 128)  8) + 16;
+   int cb = ((-38 * r - 74 * g + 112 * b + 128)  8) + 128;
+   int cr = ((112 * r - 94 * g - 18 * b + 128)  8) + 128;
+
+   /* Y is 6-bit, Cb and Cr 4-bit */
+   y = 2;
+   cb = 4;
+   cr = 4;
+
+   reg_val = adv7180_read(state, ADV7180_REG_DEF_VAL_Y);
+   adv7180_write(state, ADV7180_REG_DEF_VAL_Y,
+   (y  2) | (reg_val  0x03));
+   adv7180_write(state, ADV7180_REG_DEF_VAL_C, (cr  4) | cb);
+   break;
+  

[PATCH 10/16] [media] adv7180: Add support for the ad7182

2015-01-13 Thread Lars-Peter Clausen
This patch adds support for the adv7182 to the adv7180 driver. The adv7182
is similar to the adv7180, the main difference from the driver's point of
view is how the video input and how the input format are selected.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 149 
 1 file changed, 149 insertions(+)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index e3f91d5..4e518d5 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -52,6 +52,8 @@
 #define ADV7180_REG_INPUT_CONTROL  0x
 #define ADV7180_INPUT_CONTROL_INSEL_MASK   0x0f
 
+#define ADV7182_REG_INPUT_VIDSEL   0x0002
+
 #define ADV7180_REG_EXTENDED_OUTPUT_CONTROL0x0004
 #define ADV7180_EXTENDED_OUTPUT_CONTROL_NTSCDIS0xC5
 
@@ -134,6 +136,25 @@
 #define ADV7180_INPUT_YPRPB_AIN1_AIN2_AIN3 0x09
 #define ADV7180_INPUT_YPRPB_AIN4_AIN5_AIN6 0x0a
 
+#define ADV7182_INPUT_CVBS_AIN1 0x00
+#define ADV7182_INPUT_CVBS_AIN2 0x01
+#define ADV7182_INPUT_CVBS_AIN3 0x02
+#define ADV7182_INPUT_CVBS_AIN4 0x03
+#define ADV7182_INPUT_CVBS_AIN5 0x04
+#define ADV7182_INPUT_CVBS_AIN6 0x05
+#define ADV7182_INPUT_CVBS_AIN7 0x06
+#define ADV7182_INPUT_CVBS_AIN8 0x07
+#define ADV7182_INPUT_SVIDEO_AIN1_AIN2 0x08
+#define ADV7182_INPUT_SVIDEO_AIN3_AIN4 0x09
+#define ADV7182_INPUT_SVIDEO_AIN5_AIN6 0x0a
+#define ADV7182_INPUT_SVIDEO_AIN7_AIN8 0x0b
+#define ADV7182_INPUT_YPRPB_AIN1_AIN2_AIN3 0x0c
+#define ADV7182_INPUT_YPRPB_AIN4_AIN5_AIN6 0x0d
+#define ADV7182_INPUT_DIFF_CVBS_AIN1_AIN2 0x0e
+#define ADV7182_INPUT_DIFF_CVBS_AIN3_AIN4 0x0f
+#define ADV7182_INPUT_DIFF_CVBS_AIN5_AIN6 0x10
+#define ADV7182_INPUT_DIFF_CVBS_AIN7_AIN8 0x11
+
 struct adv7180_state;
 
 #define ADV7180_FLAG_RESET_POWERED BIT(0)
@@ -615,6 +636,118 @@ static int adv7180_select_input(struct adv7180_state 
*state, unsigned int input)
return adv7180_write(state, ADV7180_REG_INPUT_CONTROL, ret);
 }
 
+static int adv7182_init(struct adv7180_state *state)
+{
+   /* ADI required writes */
+   adv7180_write(state, 0x0003, 0x0c);
+   adv7180_write(state, 0x0004, 0x07);
+   adv7180_write(state, 0x0013, 0x00);
+   adv7180_write(state, 0x001d, 0x40);
+
+   return 0;
+}
+
+static int adv7182_set_std(struct adv7180_state *state, unsigned int std)
+{
+   return adv7180_write(state, ADV7182_REG_INPUT_VIDSEL, std  4);
+}
+
+enum adv7182_input_type {
+   ADV7182_INPUT_TYPE_CVBS,
+   ADV7182_INPUT_TYPE_DIFF_CVBS,
+   ADV7182_INPUT_TYPE_SVIDEO,
+   ADV7182_INPUT_TYPE_YPBPR,
+};
+
+static enum adv7182_input_type adv7182_get_input_type(unsigned int input)
+{
+   switch (input) {
+   case ADV7182_INPUT_CVBS_AIN1:
+   case ADV7182_INPUT_CVBS_AIN2:
+   case ADV7182_INPUT_CVBS_AIN3:
+   case ADV7182_INPUT_CVBS_AIN4:
+   case ADV7182_INPUT_CVBS_AIN5:
+   case ADV7182_INPUT_CVBS_AIN6:
+   case ADV7182_INPUT_CVBS_AIN7:
+   case ADV7182_INPUT_CVBS_AIN8:
+   return ADV7182_INPUT_TYPE_CVBS;
+   case ADV7182_INPUT_SVIDEO_AIN1_AIN2:
+   case ADV7182_INPUT_SVIDEO_AIN3_AIN4:
+   case ADV7182_INPUT_SVIDEO_AIN5_AIN6:
+   case ADV7182_INPUT_SVIDEO_AIN7_AIN8:
+   return ADV7182_INPUT_TYPE_SVIDEO;
+   case ADV7182_INPUT_YPRPB_AIN1_AIN2_AIN3:
+   case ADV7182_INPUT_YPRPB_AIN4_AIN5_AIN6:
+   return ADV7182_INPUT_TYPE_YPBPR;
+   case ADV7182_INPUT_DIFF_CVBS_AIN1_AIN2:
+   case ADV7182_INPUT_DIFF_CVBS_AIN3_AIN4:
+   case ADV7182_INPUT_DIFF_CVBS_AIN5_AIN6:
+   case ADV7182_INPUT_DIFF_CVBS_AIN7_AIN8:
+   return ADV7182_INPUT_TYPE_DIFF_CVBS;
+   default: /* Will never happen */
+   return 0;
+   }
+}
+
+/* ADI recommended writes to registers 0x52, 0x53, 0x54 */
+static unsigned int adv7182_lbias_settings[][3] = {
+   [ADV7182_INPUT_TYPE_CVBS] = { 0xCB, 0x4E, 0x80 },
+   [ADV7182_INPUT_TYPE_DIFF_CVBS] = { 0xC0, 0x4E, 0x80 },
+   [ADV7182_INPUT_TYPE_SVIDEO] = { 0x0B, 0xCE, 0x80 },
+   [ADV7182_INPUT_TYPE_YPBPR] = { 0x0B, 0x4E, 0xC0 },
+};
+
+static int adv7182_select_input(struct adv7180_state *state, unsigned int 
input)
+{
+   enum adv7182_input_type input_type;
+   unsigned int *lbias;
+   unsigned int i;
+   int ret;
+
+   ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL, input);
+   if (ret)
+   return ret;
+
+   /* Reset clamp circuitry - ADI recommended writes */
+   adv7180_write(state, 0x809c, 0x00);
+   adv7180_write(state, 0x809c, 0xff);
+
+   input_type = adv7182_get_input_type(input);
+
+   switch (input_type) {
+   case ADV7182_INPUT_TYPE_CVBS:
+   case ADV7182_INPUT_TYPE_DIFF_CVBS:
+   /* ADI recommends to use the SH1 filter */
+   adv7180_write(state, 0x0017, 0x41);
+   break;
+   default:
+   

[PATCH 14/16] [media] adv7180: Add fast switch support

2015-01-13 Thread Lars-Peter Clausen
In fast switch mode the adv7180 (and similar) can lock onto a new signal
faster when switching between different inputs. As a downside though it is
no longer able to auto-detect the incoming format.

The fast switch mode is exposed as a boolean v4l control that allows
userspace applications to either enable or disable fast switch mode.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 4d789c7..82c8296 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -127,6 +127,9 @@
 #define ADV7180_REG_VPP_SLAVE_ADDR 0xFD
 #define ADV7180_REG_CSI_SLAVE_ADDR 0xFE
 
+#define ADV7180_REG_FLCONTROL 0x40e0
+#define ADV7180_FLCONTROL_FL_ENABLE 0x1
+
 #define ADV7180_CSI_REG_PWRDN  0x00
 #define ADV7180_CSI_PWRDN  0x80
 
@@ -164,6 +167,8 @@
 #define ADV7180_DEFAULT_CSI_I2C_ADDR 0x44
 #define ADV7180_DEFAULT_VPP_I2C_ADDR 0x42
 
+#define V4L2_CID_ADV_FAST_SWITCH   (V4L2_CID_DV_CLASS_BASE + 0x1010)
+
 struct adv7180_state;
 
 #define ADV7180_FLAG_RESET_POWERED BIT(0)
@@ -509,6 +514,18 @@ static int adv7180_s_ctrl(struct v4l2_ctrl *ctrl)
break;
ret = adv7180_write(state, ADV7180_REG_SD_SAT_CR, val);
break;
+   case V4L2_CID_ADV_FAST_SWITCH:
+   if (ctrl-val) {
+   /* ADI required write */
+   adv7180_write(state, 0x80d9, 0x44);
+   adv7180_write(state, ADV7180_REG_FLCONTROL,
+   ADV7180_FLCONTROL_FL_ENABLE);
+   } else {
+   /* ADI required write */
+   adv7180_write(state, 0x80d9, 0xc4);
+   adv7180_write(state, ADV7180_REG_FLCONTROL, 0x00);
+   }
+   break;
default:
ret = -EINVAL;
}
@@ -521,6 +538,16 @@ static const struct v4l2_ctrl_ops adv7180_ctrl_ops = {
.s_ctrl = adv7180_s_ctrl,
 };
 
+static const struct v4l2_ctrl_config adv7180_ctrl_fast_switch = {
+   .ops = adv7180_ctrl_ops,
+   .id = V4L2_CID_ADV_FAST_SWITCH,
+   .name = Fast switching,
+   .type = V4L2_CTRL_TYPE_BOOLEAN,
+   .min = 0,
+   .max = 1,
+   .step = 1,
+};
+
 static int adv7180_init_controls(struct adv7180_state *state)
 {
v4l2_ctrl_handler_init(state-ctrl_hdl, 4);
@@ -537,6 +564,8 @@ static int adv7180_init_controls(struct adv7180_state 
*state)
v4l2_ctrl_new_std(state-ctrl_hdl, adv7180_ctrl_ops,
  V4L2_CID_HUE, ADV7180_HUE_MIN,
  ADV7180_HUE_MAX, 1, ADV7180_HUE_DEF);
+   v4l2_ctrl_new_custom(state-ctrl_hdl, adv7180_ctrl_fast_switch, NULL);
+
state-sd.ctrl_handler = state-ctrl_hdl;
if (state-ctrl_hdl.error) {
int err = state-ctrl_hdl.error;
-- 
1.8.0

--
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/16] [media] adv7180: Add support for the adv7280/adv7281/adv7282

2015-01-13 Thread Lars-Peter Clausen
This patch adds support for the adv7280/adv7281/adv7282 devices to the
adv7180 driver. They are very similar to the adv7182, the main difference
from the drivers point of view are some different tuning constants for
improved video performance.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 56 +++--
 1 file changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 4e518d5..ea6695c 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -158,6 +158,7 @@
 struct adv7180_state;
 
 #define ADV7180_FLAG_RESET_POWERED BIT(0)
+#define ADV7180_FLAG_V2BIT(1)
 
 struct adv7180_chip_info {
unsigned int flags;
@@ -638,9 +639,18 @@ static int adv7180_select_input(struct adv7180_state 
*state, unsigned int input)
 
 static int adv7182_init(struct adv7180_state *state)
 {
+   if (state-chip_info-flags  ADV7180_FLAG_V2) {
+   /* ADI recommended writes for improved video quality */
+   adv7180_write(state, 0x0080, 0x51);
+   adv7180_write(state, 0x0081, 0x51);
+   adv7180_write(state, 0x0082, 0x68);
+   adv7180_write(state, 0x0004, 0x17);
+   } else {
+   adv7180_write(state, 0x0004, 0x07);
+   }
+
/* ADI required writes */
adv7180_write(state, 0x0003, 0x0c);
-   adv7180_write(state, 0x0004, 0x07);
adv7180_write(state, 0x0013, 0x00);
adv7180_write(state, 0x001d, 0x40);
 
@@ -697,6 +707,13 @@ static unsigned int adv7182_lbias_settings[][3] = {
[ADV7182_INPUT_TYPE_YPBPR] = { 0x0B, 0x4E, 0xC0 },
 };
 
+static unsigned int adv7280_lbias_settings[][3] = {
+   [ADV7182_INPUT_TYPE_CVBS] = { 0xCD, 0x4E, 0x80 },
+   [ADV7182_INPUT_TYPE_DIFF_CVBS] = { 0xC0, 0x4E, 0x80 },
+   [ADV7182_INPUT_TYPE_SVIDEO] = { 0x0B, 0xCE, 0x80 },
+   [ADV7182_INPUT_TYPE_YPBPR] = { 0x0B, 0x4E, 0xC0 },
+};
+
 static int adv7182_select_input(struct adv7180_state *state, unsigned int 
input)
 {
enum adv7182_input_type input_type;
@@ -725,7 +742,10 @@ static int adv7182_select_input(struct adv7180_state 
*state, unsigned int input)
break;
}
 
-   lbias = adv7182_lbias_settings[input_type];
+   if (state-chip_info-flags  ADV7180_FLAG_V2)
+   lbias = adv7280_lbias_settings[input_type];
+   else
+   lbias = adv7182_lbias_settings[input_type];
 
for (i = 0; i  ARRAY_SIZE(adv7182_lbias_settings[0]); i++)
adv7180_write(state, 0x0052 + i, lbias[i]);
@@ -784,6 +804,35 @@ static const struct adv7180_chip_info adv7182_info = {
.select_input = adv7182_select_input,
 };
 
+static const struct adv7180_chip_info adv7280_info = {
+   .flags = ADV7180_FLAG_V2,
+   .valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
+   BIT(ADV7182_INPUT_CVBS_AIN2) |
+   BIT(ADV7182_INPUT_CVBS_AIN3) |
+   BIT(ADV7182_INPUT_CVBS_AIN4) |
+   BIT(ADV7182_INPUT_SVIDEO_AIN1_AIN2) |
+   BIT(ADV7182_INPUT_SVIDEO_AIN3_AIN4) |
+   BIT(ADV7182_INPUT_YPRPB_AIN1_AIN2_AIN3),
+   .init = adv7182_init,
+   .set_std = adv7182_set_std,
+   .select_input = adv7182_select_input,
+};
+
+static const struct adv7180_chip_info adv7281_info = {
+   .flags = ADV7180_FLAG_V2,
+   .valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
+   BIT(ADV7182_INPUT_CVBS_AIN2) |
+   BIT(ADV7182_INPUT_CVBS_AIN7) |
+   BIT(ADV7182_INPUT_CVBS_AIN8) |
+   BIT(ADV7182_INPUT_SVIDEO_AIN1_AIN2) |
+   BIT(ADV7182_INPUT_SVIDEO_AIN7_AIN8) |
+   BIT(ADV7182_INPUT_DIFF_CVBS_AIN1_AIN2) |
+   BIT(ADV7182_INPUT_DIFF_CVBS_AIN7_AIN8),
+   .init = adv7182_init,
+   .set_std = adv7182_set_std,
+   .select_input = adv7182_select_input,
+};
+
 static int init_device(struct adv7180_state *state)
 {
int ret;
@@ -930,6 +979,9 @@ static int adv7180_remove(struct i2c_client *client)
 static const struct i2c_device_id adv7180_id[] = {
{ adv7180, (kernel_ulong_t)adv7180_info },
{ adv7182, (kernel_ulong_t)adv7182_info },
+   { adv7280, (kernel_ulong_t)adv7280_info },
+   { adv7281, (kernel_ulong_t)adv7281_info },
+   { adv7282, (kernel_ulong_t)adv7281_info },
{},
 };
 MODULE_DEVICE_TABLE(i2c, adv7180_id);
-- 
1.8.0

--
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/16] [media] adv7180: Reset the device before initialization

2015-01-13 Thread Lars-Peter Clausen
Reset the device when initializing it so it is in a good known state and the
assumed register settings matches the actual register settings.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index cc05db9..eeb5a4a 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -30,6 +30,7 @@
 #include media/v4l2-device.h
 #include media/v4l2-ctrls.h
 #include linux/mutex.h
+#include linux/delay.h
 
 #define ADV7180_REG_INPUT_CONTROL  0x
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM   0x00
@@ -524,6 +525,9 @@ static int init_device(struct adv7180_state *state)
 
mutex_lock(state-mutex);
 
+   adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
+   usleep_range(2000, 1);
+
/* Initialize adv7180 */
/* Enable autodetection */
if (state-autodetect) {
@@ -696,14 +700,14 @@ static int adv7180_resume(struct device *dev)
struct adv7180_state *state = to_state(sd);
int ret;
 
-   if (state-powered) {
-   ret = adv7180_set_power(state, true);
-   if (ret)
-   return ret;
-   }
ret = init_device(state);
if (ret  0)
return ret;
+
+   ret = adv7180_set_power(state, state-powered);
+   if (ret)
+   return ret;
+
return 0;
 }
 
-- 
1.8.0

--
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/16] [media] adv7180: Do implicit register paging

2015-01-13 Thread Lars-Peter Clausen
The ad7180 has multiple register pages which can be switched between by
writing to a register. Currently the driver manually switches between pages
whenever a register outside of the default register map is accessed and
switches back after it has been accessed. This is a bit tedious and also
potential source for bugs.

This patch adds two helper functions that take care of switching between
pages and reading/writing the register. The register numbers for registers
are updated to encode both the page (in the upper 8-bits) and the register
(in the lower 8-bits) numbers.

Having multiple pages means that a register access is not a single atomic
i2c_smbus_write_byte_data() or i2c_smbus_read_byte_data() call and we need
to make sure that concurrent register access does not race against each
other.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 206 ++--
 1 file changed, 105 insertions(+), 101 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 00ba845..cc05db9 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -31,7 +31,7 @@
 #include media/v4l2-ctrls.h
 #include linux/mutex.h
 
-#define ADV7180_REG_INPUT_CONTROL  0x00
+#define ADV7180_REG_INPUT_CONTROL  0x
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM   0x00
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
 #define ADV7180_INPUT_CONTROL_AD_PAL_N_NTSC_J_SECAM0x20
@@ -50,28 +50,28 @@
 #define ADV7180_INPUT_CONTROL_PAL_SECAM_PED0xf0
 #define ADV7180_INPUT_CONTROL_INSEL_MASK   0x0f
 
-#define ADV7180_REG_EXTENDED_OUTPUT_CONTROL0x04
+#define ADV7180_REG_EXTENDED_OUTPUT_CONTROL0x0004
 #define ADV7180_EXTENDED_OUTPUT_CONTROL_NTSCDIS0xC5
 
 #define ADV7180_REG_AUTODETECT_ENABLE  0x07
 #define ADV7180_AUTODETECT_DEFAULT 0x7f
 /* Contrast */
-#define ADV7180_REG_CON0x08/*Unsigned */
+#define ADV7180_REG_CON0x0008  /*Unsigned */
 #define ADV7180_CON_MIN0
 #define ADV7180_CON_DEF128
 #define ADV7180_CON_MAX255
 /* Brightness*/
-#define ADV7180_REG_BRI0x0a/*Signed */
+#define ADV7180_REG_BRI0x000a  /*Signed */
 #define ADV7180_BRI_MIN-128
 #define ADV7180_BRI_DEF0
 #define ADV7180_BRI_MAX127
 /* Hue */
-#define ADV7180_REG_HUE0x0b/*Signed, inverted */
+#define ADV7180_REG_HUE0x000b  /*Signed, inverted */
 #define ADV7180_HUE_MIN-127
 #define ADV7180_HUE_DEF0
 #define ADV7180_HUE_MAX128
 
-#define ADV7180_REG_CTRL   0x0e
+#define ADV7180_REG_CTRL   0x000e
 #define ADV7180_CTRL_IRQ_SPACE 0x20
 
 #define ADV7180_REG_PWR_MAN0x0f
@@ -79,7 +79,7 @@
 #define ADV7180_PWR_MAN_OFF0x24
 #define ADV7180_PWR_MAN_RES0x80
 
-#define ADV7180_REG_STATUS10x10
+#define ADV7180_REG_STATUS10x0010
 #define ADV7180_STATUS1_IN_LOCK0x01
 #define ADV7180_STATUS1_AUTOD_MASK 0x70
 #define ADV7180_STATUS1_AUTOD_NTSM_M_J 0x00
@@ -91,33 +91,33 @@
 #define ADV7180_STATUS1_AUTOD_PAL_COMB 0x60
 #define ADV7180_STATUS1_AUTOD_SECAM_5250x70
 
-#define ADV7180_REG_IDENT 0x11
+#define ADV7180_REG_IDENT 0x0011
 #define ADV7180_ID_7180 0x18
 
-#define ADV7180_REG_ICONF1 0x40
+#define ADV7180_REG_ICONF1 0x0040
 #define ADV7180_ICONF1_ACTIVE_LOW  0x01
 #define ADV7180_ICONF1_PSYNC_ONLY  0x10
 #define ADV7180_ICONF1_ACTIVE_TO_CLR   0xC0
 /* Saturation */
-#define ADV7180_REG_SD_SAT_CB  0xe3/*Unsigned */
-#define ADV7180_REG_SD_SAT_CR  0xe4/*Unsigned */
+#define ADV7180_REG_SD_SAT_CB  0x00e3  /*Unsigned */
+#define ADV7180_REG_SD_SAT_CR  0x00e4  /*Unsigned */
 #define ADV7180_SAT_MIN0
 #define ADV7180_SAT_DEF128
 #define ADV7180_SAT_MAX255
 
 #define ADV7180_IRQ1_LOCK  0x01
 #define ADV7180_IRQ1_UNLOCK0x02
-#define ADV7180_REG_ISR1   0x42
-#define ADV7180_REG_ICR1   0x43
-#define ADV7180_REG_IMR1   0x44
-#define ADV7180_REG_IMR2   0x48
+#define ADV7180_REG_ISR1   0x0042
+#define ADV7180_REG_ICR1   0x0043
+#define ADV7180_REG_IMR1   0x0044
+#define ADV7180_REG_IMR2   0x0048
 #define ADV7180_IRQ3_AD_CHANGE 0x08
-#define ADV7180_REG_ISR3   0x4A
-#define ADV7180_REG_ICR3   0x4B
-#define ADV7180_REG_IMR3   0x4C
+#define ADV7180_REG_ISR3   0x004A
+#define ADV7180_REG_ICR3   0x004B
+#define ADV7180_REG_IMR3   0x004C
 #define ADV7180_REG_IMR4   0x50
 
-#define ADV7180_REG_NTSC_V_BIT_END 0xE6
+#define ADV7180_REG_NTSC_V_BIT_END 0x00E6
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
 

[PATCH 07/16] [media] adv7180: Add media controller support

2015-01-13 Thread Lars-Peter Clausen
Add media controller support to the adv7180 driver by registering a media
entity instance for it as well as implementing pad ops for configuring the
format.

As there currently don't seem to be any users of the video ops format
operations those are removed as well in this patch.

Also set the V4L2_SUBDEV_FL_HAS_DEVNODE flag for the subdevice so it is
possible to create a subdevice device node.

Since the driver now depends on VIDEO_V4L2_SUBDEV_API all drivers which
select the driver need to depend on that symbol as well.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/Kconfig |  2 +-
 drivers/media/i2c/adv7180.c   | 50 +++
 drivers/media/pci/sta2x11/Kconfig |  1 +
 drivers/media/platform/Kconfig|  2 +-
 4 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index ca84543..f37890a 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -177,7 +177,7 @@ comment Video decoders
 
 config VIDEO_ADV7180
tristate Analog Devices ADV7180 decoder
-   depends on VIDEO_V4L2  I2C
+   depends on VIDEO_V4L2  I2C  VIDEO_V4L2_SUBDEV_API
---help---
  Support for the Analog Devices ADV7180 video decoder.
 
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index eeb5a4a..349cae3 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -124,6 +124,7 @@
 struct adv7180_state {
struct v4l2_ctrl_handler ctrl_hdl;
struct v4l2_subdev  sd;
+   struct media_padpad;
struct mutexmutex; /* mutual excl. when accessing chip */
int irq;
v4l2_std_id curr_norm;
@@ -442,13 +443,14 @@ static void adv7180_exit_controls(struct adv7180_state 
*state)
v4l2_ctrl_handler_free(state-ctrl_hdl);
 }
 
-static int adv7180_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned int index,
-u32 *code)
+static int adv7180_enum_mbus_code(struct v4l2_subdev *sd,
+ struct v4l2_subdev_fh *fh,
+ struct v4l2_subdev_mbus_code_enum *code)
 {
-   if (index  0)
+   if (code-index != 0)
return -EINVAL;
 
-   *code = MEDIA_BUS_FMT_YUYV8_2X8;
+   code-code = MEDIA_BUS_FMT_YUYV8_2X8;
 
return 0;
 }
@@ -467,6 +469,20 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
return 0;
 }
 
+static int adv7180_get_pad_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_fh *fh,
+ struct v4l2_subdev_format *format)
+{
+   return adv7180_mbus_fmt(sd, format-format);
+}
+
+static int adv7180_set_pad_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_fh *fh,
+ struct v4l2_subdev_format *format)
+{
+   return adv7180_mbus_fmt(sd, format-format);
+}
+
 static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
 struct v4l2_mbus_config *cfg)
 {
@@ -486,10 +502,6 @@ static const struct v4l2_subdev_video_ops 
adv7180_video_ops = {
.querystd = adv7180_querystd,
.g_input_status = adv7180_g_input_status,
.s_routing = adv7180_s_routing,
-   .enum_mbus_fmt = adv7180_enum_mbus_fmt,
-   .try_mbus_fmt = adv7180_mbus_fmt,
-   .g_mbus_fmt = adv7180_mbus_fmt,
-   .s_mbus_fmt = adv7180_mbus_fmt,
.g_mbus_config = adv7180_g_mbus_config,
 };
 
@@ -497,9 +509,16 @@ static const struct v4l2_subdev_core_ops adv7180_core_ops 
= {
.s_power = adv7180_s_power,
 };
 
+static const struct v4l2_subdev_pad_ops adv7180_pad_ops = {
+   .enum_mbus_code = adv7180_enum_mbus_code,
+   .set_fmt = adv7180_set_pad_format,
+   .get_fmt = adv7180_get_pad_format,
+};
+
 static const struct v4l2_subdev_ops adv7180_ops = {
.core = adv7180_core_ops,
.video = adv7180_video_ops,
+   .pad = adv7180_pad_ops,
 };
 
 static irqreturn_t adv7180_irq(int irq, void *devid)
@@ -630,20 +649,28 @@ static int adv7180_probe(struct i2c_client *client,
state-input = 0;
sd = state-sd;
v4l2_i2c_subdev_init(sd, client, adv7180_ops);
+   sd-flags = V4L2_SUBDEV_FL_HAS_DEVNODE;
 
ret = adv7180_init_controls(state);
if (ret)
goto err_unreg_subdev;
-   ret = init_device(state);
+
+   state-pad.flags = MEDIA_PAD_FL_SOURCE;
+   sd-entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
+   ret = media_entity_init(sd-entity, 1, state-pad, 0);
if (ret)
goto err_free_ctrl;
 
+   ret = init_device(state);
+   if (ret)
+   goto err_media_entity_cleanup;
+
if (state-irq) {
ret = request_threaded_irq(client-irq, NULL, adv7180_irq,
   IRQF_ONESHOT | 

[PATCH 02/16] [media] adv7180: Pass correct flags to request_threaded_irq()

2015-01-13 Thread Lars-Peter Clausen
Most IRQ controllers support different types of interrupts. The adv7180
generates falling edge interrupts, so make sure to pass IRQF_TRIGGER_FALLING
to request_threaded_irq() so the IRQ controller is configured for the
correct mode.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
---
 drivers/media/i2c/adv7180.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 172e4a2..f424a4d 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -632,7 +632,8 @@ static int adv7180_probe(struct i2c_client *client,
 
if (state-irq) {
ret = request_threaded_irq(client-irq, NULL, adv7180_irq,
-  IRQF_ONESHOT, KBUILD_MODNAME, state);
+  IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
+  KBUILD_MODNAME, state);
if (ret)
goto err_free_ctrl;
}
-- 
1.8.0

--
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 14/16] [media] adv7180: Add fast switch support

2015-01-13 Thread Hans Verkuil
Hi Lars-Peter,

A few small comments:

On 01/13/15 13:01, Lars-Peter Clausen wrote:
 In fast switch mode the adv7180 (and similar) can lock onto a new signal
 faster when switching between different inputs. As a downside though it is
 no longer able to auto-detect the incoming format.
 
 The fast switch mode is exposed as a boolean v4l control that allows
 userspace applications to either enable or disable fast switch mode.
 
 Signed-off-by: Lars-Peter Clausen l...@metafoo.de
 ---
  drivers/media/i2c/adv7180.c | 29 +
  1 file changed, 29 insertions(+)
 
 diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
 index 4d789c7..82c8296 100644
 --- a/drivers/media/i2c/adv7180.c
 +++ b/drivers/media/i2c/adv7180.c
 @@ -127,6 +127,9 @@
  #define ADV7180_REG_VPP_SLAVE_ADDR   0xFD
  #define ADV7180_REG_CSI_SLAVE_ADDR   0xFE
  
 +#define ADV7180_REG_FLCONTROL 0x40e0
 +#define ADV7180_FLCONTROL_FL_ENABLE 0x1
 +
  #define ADV7180_CSI_REG_PWRDN0x00
  #define ADV7180_CSI_PWRDN0x80
  
 @@ -164,6 +167,8 @@
  #define ADV7180_DEFAULT_CSI_I2C_ADDR 0x44
  #define ADV7180_DEFAULT_VPP_I2C_ADDR 0x42
  
 +#define V4L2_CID_ADV_FAST_SWITCH (V4L2_CID_DV_CLASS_BASE + 0x1010)

You need to reserve a range for private controls in uapi/linux/v4l2-controls.h
(see e.g. V4L2_CID_USER_SAA7134_BASE). Currently only user class controls
have a range reservation, but it can be done for other control classes as well.
However, I would put this control in the user class anyway. The DV class isn't
really appropriate for an SDTV device.

 +
  struct adv7180_state;
  
  #define ADV7180_FLAG_RESET_POWERED   BIT(0)
 @@ -509,6 +514,18 @@ static int adv7180_s_ctrl(struct v4l2_ctrl *ctrl)
   break;
   ret = adv7180_write(state, ADV7180_REG_SD_SAT_CR, val);
   break;
 + case V4L2_CID_ADV_FAST_SWITCH:
 + if (ctrl-val) {
 + /* ADI required write */
 + adv7180_write(state, 0x80d9, 0x44);
 + adv7180_write(state, ADV7180_REG_FLCONTROL,
 + ADV7180_FLCONTROL_FL_ENABLE);
 + } else {
 + /* ADI required write */
 + adv7180_write(state, 0x80d9, 0xc4);
 + adv7180_write(state, ADV7180_REG_FLCONTROL, 0x00);
 + }
 + break;
   default:
   ret = -EINVAL;
   }
 @@ -521,6 +538,16 @@ static const struct v4l2_ctrl_ops adv7180_ctrl_ops = {
   .s_ctrl = adv7180_s_ctrl,
  };
  
 +static const struct v4l2_ctrl_config adv7180_ctrl_fast_switch = {
 + .ops = adv7180_ctrl_ops,
 + .id = V4L2_CID_ADV_FAST_SWITCH,
 + .name = Fast switching,

This should be Fast Switching to be consistent with the standard control 
naming
convention.

 + .type = V4L2_CTRL_TYPE_BOOLEAN,
 + .min = 0,
 + .max = 1,
 + .step = 1,
 +};
 +
  static int adv7180_init_controls(struct adv7180_state *state)
  {
   v4l2_ctrl_handler_init(state-ctrl_hdl, 4);
 @@ -537,6 +564,8 @@ static int adv7180_init_controls(struct adv7180_state 
 *state)
   v4l2_ctrl_new_std(state-ctrl_hdl, adv7180_ctrl_ops,
 V4L2_CID_HUE, ADV7180_HUE_MIN,
 ADV7180_HUE_MAX, 1, ADV7180_HUE_DEF);
 + v4l2_ctrl_new_custom(state-ctrl_hdl, adv7180_ctrl_fast_switch, NULL);
 +
   state-sd.ctrl_handler = state-ctrl_hdl;
   if (state-ctrl_hdl.error) {
   int err = state-ctrl_hdl.error;
 

Regards,

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


Re: [PATCH 00/16] [media] adv7180: Add support for different chip

2015-01-13 Thread Hans Verkuil
Hi Lars,

On 01/13/15 13:01, Lars-Peter Clausen wrote:
 The adv7180 is part of a larger family of chips which all implement
 different features from a feature superset. This patch series step by step
 extends the current adv7180 with features from the superset that are
 currently not supported and gradually adding support for more variations of
 the chip.
 
 The first half of this series contains fixes and cleanups while the second
 half adds new features and support for new chips.

For patches 1-7, 9-13 and 16:

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

I need a bit more time to review patches 8 and 15. Ping me if you haven't
heard from me by Friday.

BTW: is the adv7183 part of the same family? There is a separate i2c driver
for it in the kernel, so I was wondering if that could be merged into this
driver eventually.

Did you check with authors of drivers that use the adv7180 to ensure nothing
broke? They should be pinged about this at least.

Regards,

Hans

 
 - Lars
 
 Lars-Peter Clausen (16):
   [media] adv7180: Do not request the IRQ again during resume
   [media] adv7180: Pass correct flags to request_threaded_irq()
   [media] adv7180: Use inline function instead of macro
   [media] adv7180: Cleanup register define naming
   [media] adv7180: Do implicit register paging
   [media] adv7180: Reset the device before initialization
   [media] adv7180: Add media controller support
   [media] adv7180: Consolidate video mode setting
   [media] adv7180: Prepare for multi-chip support
   [media] adv7180: Add support for the ad7182
   [media] adv7180: Add support for the adv7280/adv7281/adv7282
   [media] adv7180: Add support for the
 adv7280-m/adv7281-m/adv7281-ma/adv7282-m
   [media] adv7180: Add I2P support
   [media] adv7180: Add fast switch support
   [media] adv7180: Add free run mode controls
   [media] Add MAINTAINERS entry for the adv7180
 
  MAINTAINERS   |7 +
  drivers/media/i2c/Kconfig |2 +-
  drivers/media/i2c/adv7180.c   | 1137 
 ++---
  drivers/media/pci/sta2x11/Kconfig |1 +
  drivers/media/platform/Kconfig|2 +-
  5 files changed, 947 insertions(+), 202 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: FOSDEM15: Graphics DevRoom: call for speakers.

2015-01-13 Thread Luc Verhaegen
On Tue, Jan 13, 2015 at 01:14:17PM +0100, Thierry Reding wrote:
 On Tue, Dec 09, 2014 at 03:39:26PM +0100, Luc Verhaegen wrote:
  On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
   Hi,
   
   At FOSDEM on the 31st of january and the 1st of February 2015, there 
   will be another graphics DevRoom. URL: https://fosdem.org/2015/
  
   Slots will be handed out on a first come, first serve basis. The best 
   slots will go to those who apply the earliest. The amount of slots is 
   currently not known yet, but i expect there to be around 16 available (8 
   on each day), so act quickly.
  
   As for deadlines, i hope to have a pretty much complete schedule between 
   christmas and the new year. The rockhard printed schedule deadline is 
   probably January 9th, after that you will not be featured in the booklet 
   and you will have a lot less visitors. I will hopefully be able to lock 
   down entries and descriptions after that date.
  
  It's been more than 2 months since the original email, it's less than 
  two months away from the event, and one month away from what usually is 
  the deadline for the booklet. File your talk now, while there are still 
  some useful slots available.
  
  Also, for those who have filed already but who have left their abstracts 
  open, please get those filed in ASAP. Your talk will be only be ordered 
  in when at least the basics are provided.
 
 Hi Luc,
 
 I realize I'm terribly late, but it took quite some time to get travel
 arranged. Looking at the schedule there still seem to be some free
 slots. Does it make sense to still submit a talk? I was asked to give
 one on atomic modesetting from a driver developer's perspective.
 
 Thierry

Yes, but be quick, the hard booklet deadline is thursday evening. I will 
not be accepting talks past tomorrow evening.

Luc Verhaegen.
--
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 16/16] [media] Add MAINTAINERS entry for the adv7180

2015-01-13 Thread Lars-Peter Clausen

On 01/13/2015 01:55 PM, Mats Randgaard (matrandg) wrote:

On 01/13/2015 01:01 PM, Lars-Peter Clausen wrote:

Add myself as the maintainer  for the adv7180 video subdev driver.

 
  Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- MAINTAINERS |
  7 +++ 1 file changed, 7 insertions(+)
 
  diff --git a/MAINTAINERS b/MAINTAINERS index 4318f34..22bb77e 100644
  --- a/MAINTAINERS +++ b/MAINTAINERS @@ -659,6 +659,13 @@ L:
  linux-media@vger.kernel.org S:Maintained F:
  drivers/media/i2c/ad9389b*
 
  +ANALOG DEVICES INC ADV7180 DRIVER +M:Lars-Peter Clausen
  l...@metafoo.de +L:linux-media@vger.kernel.org +W:
  http://ez.analog.com/community/linux-device-drivers

I think the web address should be http://ez.analog.com/community/video

It is written much more about ADV7180 there, and people asking questions
about video devices has been directed to the Video forum in the past.


Well depends on the subject of the question. If you have a question about 
the Linux device driver the correct section is the Linux device driver 
section. If you have question about the chip itself it should be in the 
video section. But this maintainers entry is about the driver not the chip.


- Lars
--
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: FOSDEM15: Graphics DevRoom: call for speakers.

2015-01-13 Thread Thierry Reding
On Tue, Dec 09, 2014 at 03:39:26PM +0100, Luc Verhaegen wrote:
 On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
  Hi,
  
  At FOSDEM on the 31st of january and the 1st of February 2015, there 
  will be another graphics DevRoom. URL: https://fosdem.org/2015/
 
  Slots will be handed out on a first come, first serve basis. The best 
  slots will go to those who apply the earliest. The amount of slots is 
  currently not known yet, but i expect there to be around 16 available (8 
  on each day), so act quickly.
 
  As for deadlines, i hope to have a pretty much complete schedule between 
  christmas and the new year. The rockhard printed schedule deadline is 
  probably January 9th, after that you will not be featured in the booklet 
  and you will have a lot less visitors. I will hopefully be able to lock 
  down entries and descriptions after that date.
 
 It's been more than 2 months since the original email, it's less than 
 two months away from the event, and one month away from what usually is 
 the deadline for the booklet. File your talk now, while there are still 
 some useful slots available.
 
 Also, for those who have filed already but who have left their abstracts 
 open, please get those filed in ASAP. Your talk will be only be ordered 
 in when at least the basics are provided.

Hi Luc,

I realize I'm terribly late, but it took quite some time to get travel
arranged. Looking at the schedule there still seem to be some free
slots. Does it make sense to still submit a talk? I was asked to give
one on atomic modesetting from a driver developer's perspective.

Thierry


pgpxMSAVrv7BR.pgp
Description: PGP signature


Re: [PATCH 00/16] [media] adv7180: Add support for different chip

2015-01-13 Thread Lars-Peter Clausen

On 01/13/2015 02:04 PM, Hans Verkuil wrote:

Hi Lars,

On 01/13/15 13:01, Lars-Peter Clausen wrote:

The adv7180 is part of a larger family of chips which all implement
different features from a feature superset. This patch series step by step
extends the current adv7180 with features from the superset that are
currently not supported and gradually adding support for more variations of
the chip.

The first half of this series contains fixes and cleanups while the second
half adds new features and support for new chips.


For patches 1-7, 9-13 and 16:

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

I need a bit more time to review patches 8 and 15. Ping me if you haven't
heard from me by Friday.


Thanks.



BTW: is the adv7183 part of the same family? There is a separate i2c driver
for it in the kernel, so I was wondering if that could be merged into this
driver eventually.


Yea, I had a look at that, and it appears to be related, but it seems to be 
some early derivative and things weren't fully standardized at that point, 
so while similar there were a few notable differences. And I think the 
adv7183 isn't even produced anymore. So I didn't try to integrate it yet, 
but it might happen at some point.




Did you check with authors of drivers that use the adv7180 to ensure nothing
broke? They should be pinged about this at least.


I tried to make sure that the register write sequence is still the same for 
adv7180 as it was before. The only thing new for the adv7180 is support for 
the new controls.


I'll include a few more people on Cc for v2.

- Lars
--
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 16/16] [media] Add MAINTAINERS entry for the adv7180

2015-01-13 Thread Mats Randgaard (matrandg)

On 01/13/2015 01:01 PM, Lars-Peter Clausen wrote:

Add myself as the maintainer  for the adv7180 video subdev driver.


 Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- MAINTAINERS |
 7 +++ 1 file changed, 7 insertions(+)

 diff --git a/MAINTAINERS b/MAINTAINERS index 4318f34..22bb77e 100644
 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -659,6 +659,13 @@ L:
 linux-media@vger.kernel.org S:Maintained F:
 drivers/media/i2c/ad9389b*

 +ANALOG DEVICES INC ADV7180 DRIVER +M:Lars-Peter Clausen
 l...@metafoo.de +L:linux-media@vger.kernel.org +W:
 http://ez.analog.com/community/linux-device-drivers

I think the web address should be http://ez.analog.com/community/video

It is written much more about ADV7180 there, and people asking questions 
about video devices has been directed to the Video forum in the past.


Regards,

Mats Randgaard




 +S:Supported +F:drivers/media/i2c/adv7180.c + ANALOG DEVICES INC
 ADV7511 DRIVER M:Hans Verkuil hans.verk...@cisco.com L:
 linux-media@vger.kernel.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: Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Francesco Other
Hi Roberto, thanks for your fast reply.

I'm from Italy, a DVB-T region. With Windows the device works fine, it
receives all the channels from multiplexes.
I don't know if my device has the SMS2270 chip, I know the ID,
187f:0600, and the link on the Terratec site:
http://www.terratec.net/details.php?artnr=145258#.VLU5Z2SG9LY

In that site there are the software and the Windows driver, if you
install those driver you can obtain the dvb_rio.inp driver from
system32 folder.
I forced the DVB-T mode because without it in dmesg output I see that
system ask for isdbt_rio.inp, but with DVB-T forced mode the system
ask for dvb_rio.inp.

I can't understand why I can't receive any channels from multiplexes,
the signal is ok, I can see this from many software (Kaffeine, w_scan,
scan, TvHeadend).

Can you help me please?

Best Regards

Francesco


2015-01-13 16:21 GMT+01:00 Roberto Alcântara robe...@eletronica.org:
 Hi Francesco,

 You are using Siano SMS2270, am I right?

 My guess you're using ISDB-T firmware to program your ic, but are you in
 ISDB-T region? I use same firmware name here and works fine (Brazil) and it
 seems loaded ok on your log.

 I never saw an DVB firmware available to sms2270. Your tuner is working fine
 under Windows with provided software ?

 Cheers,
   - Roberto






  - Roberto

 On Tue, Jan 13, 2015 at 11:50 AM, Francesco Other
 francesco.ot...@gmail.com wrote:

 Is there a gentleman that can help me with my problem? On linuxtv.org
 they said that someone here sure will help me.

 I submitted the problem here:
 http://www.spinics.net/lists/linux-media/msg85432.html

 Regards

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


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


Re: [PATCH v2 0/8] ARM: at91: dts: sama5d3: add dt support for atmel isi and ov2640 sensor

2015-01-13 Thread Nicolas Ferre
Le 04/01/2015 10:02, Josh Wu a écrit :
 This patch series add ISI and ov2640 support on dts files.
 
 As the ov2640 driver dt is still in review. The patch is in: 
 https://patchwork.linuxtv.org/patch/27554/
 So I want to send this dt patch early for a review.
 
 v1 - v2:
   1. add one more patch to change the pin name of ISI_MCK
   2. rewrite the commit [4/8] ARM: at91: dts: sama5d3: change name of 
 pinctrl_isi_{power,reset}.
   3. move the common chip parts of ISI node to sama5d3.dtsi.
 
 Bo Shen (3):
   ARM: at91: dts: sama5d3: split isi pinctrl
   ARM: at91: dts: sama5d3: add missing pins of isi
   ARM: at91: dts: sama5d3: move the isi mck pin to mb
 
 Josh Wu (5):
   ARM: at91: dts: sama5d3: add isi clock
   ARM: at91: dts: sama5d3: change name of pinctrl_isi_{power,reset}
   ARM: at91: dts: sama5d3: change name of pinctrl of ISI_MCK
   ARM: at91: dts: sama5d3: add ov2640 camera sensor support
   ARM: at91: sama5: enable atmel-isi and ov2640 in defconfig

Josh,

It seems that this patch doesn't show up in the series: I only received
up to 6/8 patches (2 missing?). Can you please send it(them?)?

Bye,

  arch/arm/boot/dts/sama5d3.dtsi| 24 ++-
  arch/arm/boot/dts/sama5d3xmb.dtsi | 40 
 +++
  arch/arm/configs/sama5_defconfig  |  6 ++
  3 files changed, 61 insertions(+), 9 deletions(-)
 


-- 
Nicolas Ferre
--
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: Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Roberto Alcântara
Hi Francesco,

You are using Siano SMS2270, am I right?

My guess you're using ISDB-T firmware to program your ic, but are you
in ISDB-T region? I use same firmware name here and works fine
(Brazil) and it seems loaded ok on your log.

I never saw an DVB firmware available to sms2270. Your tuner is
working fine under Windows with provided software ?

Cheers,
  - Roberto



On Tue, Jan 13, 2015 at 11:50 AM, Francesco Other
francesco.ot...@gmail.com wrote:
 Is there a gentleman that can help me with my problem? On linuxtv.org
 they said that someone here sure will help me.

 I submitted the problem here:
 http://www.spinics.net/lists/linux-media/msg85432.html

 Regards

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


Re: [PATCH 1/2] mn88473: calculate the IF register values

2015-01-13 Thread Antti Palosaari

On 01/13/2015 01:23 AM, Benjamin Larsson wrote:

Add xtal as a configuration parameter so it can be used
in the IF register value calculation. If not set in the
configuration then use a default value.

Signed-off-by: Benjamin Larsson benja...@southpole.se


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

Antti


---
  drivers/media/dvb-frontends/mn88473.h|  6 ++
  drivers/staging/media/mn88473/mn88473.c  | 26 +++---
  drivers/staging/media/mn88473/mn88473_priv.h |  1 +
  3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/media/dvb-frontends/mn88473.h 
b/drivers/media/dvb-frontends/mn88473.h
index a373ec9..c717ebed 100644
--- a/drivers/media/dvb-frontends/mn88473.h
+++ b/drivers/media/dvb-frontends/mn88473.h
@@ -33,6 +33,12 @@ struct mn88473_config {
 * DVB frontend.
 */
struct dvb_frontend **fe;
+
+   /*
+* Xtal frequency.
+* Hz
+*/
+   u32 xtal;
  };

  #endif
diff --git a/drivers/staging/media/mn88473/mn88473.c 
b/drivers/staging/media/mn88473/mn88473.c
index 1659335..b65e519 100644
--- a/drivers/staging/media/mn88473/mn88473.c
+++ b/drivers/staging/media/mn88473/mn88473.c
@@ -30,6 +30,7 @@ static int mn88473_set_frontend(struct dvb_frontend *fe)
struct dtv_frontend_properties *c = fe-dtv_property_cache;
int ret, i;
u32 if_frequency;
+   u64 tmp;
u8 delivery_system_val, if_val[3], bw_val[7];

dev_dbg(client-dev,
@@ -63,15 +64,12 @@ static int mn88473_set_frontend(struct dvb_frontend *fe)
case SYS_DVBT2:
if (c-bandwidth_hz = 600) {
/* IF 357 Hz, BW 600 Hz */
-   memcpy(if_val, \x24\x8e\x8a, 3);
memcpy(bw_val, \xe9\x55\x55\x1c\x29\x1c\x29, 7);
} else if (c-bandwidth_hz = 700) {
/* IF 457 Hz, BW 700 Hz */
-   memcpy(if_val, \x2e\xcb\xfb, 3);
memcpy(bw_val, \xc8\x00\x00\x17\x0a\x17\x0a, 7);
} else if (c-bandwidth_hz = 800) {
/* IF 457 Hz, BW 800 Hz */
-   memcpy(if_val, \x2e\xcb\xfb, 3);
memcpy(bw_val, \xaf\x00\x00\x11\xec\x11\xec, 7);
} else {
ret = -EINVAL;
@@ -80,7 +78,6 @@ static int mn88473_set_frontend(struct dvb_frontend *fe)
break;
case SYS_DVBC_ANNEX_A:
/* IF 507 Hz, BW 800 Hz */
-   memcpy(if_val, \x33\xea\xb3, 3);
memcpy(bw_val, \xaf\x00\x00\x11\xec\x11\xec, 7);
break;
default:
@@ -105,17 +102,12 @@ static int mn88473_set_frontend(struct dvb_frontend *fe)
if_frequency = 0;
}

-   switch (if_frequency) {
-   case 357:
-   case 457:
-   case 507:
-   break;
-   default:
-   dev_err(client-dev, IF frequency %d not supported\n,
-   if_frequency);
-   ret = -EINVAL;
-   goto err;
-   }
+   /* Calculate IF registers ( (124)*IF / Xtal ) */
+   tmp =  div_u64(if_frequency * (u64)(124) + (dev-xtal / 2),
+  dev-xtal);
+   if_val[0] = ((tmp  16)  0xff);
+   if_val[1] = ((tmp   8)  0xff);
+   if_val[2] = ((tmp   0)  0xff);

ret = regmap_write(dev-regmap[2], 0x05, 0x00);
ret = regmap_write(dev-regmap[2], 0xfb, 0x13);
@@ -352,6 +344,10 @@ static int mn88473_probe(struct i2c_client *client,
}

dev-i2c_wr_max = config-i2c_wr_max;
+   if (!config-xtal)
+   dev-xtal = 2500;
+   else
+   dev-xtal = config-xtal;
dev-client[0] = client;
dev-regmap[0] = regmap_init_i2c(dev-client[0], regmap_config);
if (IS_ERR(dev-regmap[0])) {
diff --git a/drivers/staging/media/mn88473/mn88473_priv.h 
b/drivers/staging/media/mn88473/mn88473_priv.h
index 78af112..ef6f013 100644
--- a/drivers/staging/media/mn88473/mn88473_priv.h
+++ b/drivers/staging/media/mn88473/mn88473_priv.h
@@ -31,6 +31,7 @@ struct mn88473_dev {
u16 i2c_wr_max;
fe_delivery_system_t delivery_system;
bool warm; /* FW running */
+   u32 xtal;
  };

  #endif



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


Re: [PATCH 2/2] mn88473: simplify bandwidth registers setting code

2015-01-13 Thread Antti Palosaari

On 01/13/2015 01:23 AM, Benjamin Larsson wrote:

Signed-off-by: Benjamin Larsson benja...@southpole.se


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

Antti


---
  drivers/staging/media/mn88473/mn88473.c | 27 ++-
  1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/media/mn88473/mn88473.c 
b/drivers/staging/media/mn88473/mn88473.c
index b65e519..994294c 100644
--- a/drivers/staging/media/mn88473/mn88473.c
+++ b/drivers/staging/media/mn88473/mn88473.c
@@ -59,28 +59,13 @@ static int mn88473_set_frontend(struct dvb_frontend *fe)
goto err;
}

-   switch (c-delivery_system) {
-   case SYS_DVBT:
-   case SYS_DVBT2:
-   if (c-bandwidth_hz = 600) {
-   /* IF 357 Hz, BW 600 Hz */
-   memcpy(bw_val, \xe9\x55\x55\x1c\x29\x1c\x29, 7);
-   } else if (c-bandwidth_hz = 700) {
-   /* IF 457 Hz, BW 700 Hz */
-   memcpy(bw_val, \xc8\x00\x00\x17\x0a\x17\x0a, 7);
-   } else if (c-bandwidth_hz = 800) {
-   /* IF 457 Hz, BW 800 Hz */
-   memcpy(bw_val, \xaf\x00\x00\x11\xec\x11\xec, 7);
-   } else {
-   ret = -EINVAL;
-   goto err;
-   }
-   break;
-   case SYS_DVBC_ANNEX_A:
-   /* IF 507 Hz, BW 800 Hz */
+   if (c-bandwidth_hz = 600) {
+   memcpy(bw_val, \xe9\x55\x55\x1c\x29\x1c\x29, 7);
+   } else if (c-bandwidth_hz = 700) {
+   memcpy(bw_val, \xc8\x00\x00\x17\x0a\x17\x0a, 7);
+   } else if (c-bandwidth_hz = 800) {
memcpy(bw_val, \xaf\x00\x00\x11\xec\x11\xec, 7);
-   break;
-   default:
+   } else {
ret = -EINVAL;
goto err;
}



--
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: Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Roberto Alcântara
Good to know about DVB on this chip. This is sms2270 id :-)

I think you can get more  information from module debug messages.

Try
options smsusb debug=3
on /etc/modprobe.d.

Then reload it and try to tzap one of channels found by scan to look
for some lock.  You will have more debug messages now.

Cheers,
 - Roberto




 - Roberto


On Tue, Jan 13, 2015 at 12:35 PM, Francesco Other
francesco.ot...@gmail.com wrote:
 Hi Roberto, thanks for your fast reply.

 I'm from Italy, a DVB-T region. With Windows the device works fine, it
 receives all the channels from multiplexes.
 I don't know if my device has the SMS2270 chip, I know the ID,
 187f:0600, and the link on the Terratec site:
 http://www.terratec.net/details.php?artnr=145258#.VLU5Z2SG9LY

 In that site there are the software and the Windows driver, if you
 install those driver you can obtain the dvb_rio.inp driver from
 system32 folder.
 I forced the DVB-T mode because without it in dmesg output I see that
 system ask for isdbt_rio.inp, but with DVB-T forced mode the system
 ask for dvb_rio.inp.

 I can't understand why I can't receive any channels from multiplexes,
 the signal is ok, I can see this from many software (Kaffeine, w_scan,
 scan, TvHeadend).

 Can you help me please?

 Best Regards

 Francesco


 2015-01-13 16:21 GMT+01:00 Roberto Alcântara robe...@eletronica.org:
 Hi Francesco,

 You are using Siano SMS2270, am I right?

 My guess you're using ISDB-T firmware to program your ic, but are you in
 ISDB-T region? I use same firmware name here and works fine (Brazil) and it
 seems loaded ok on your log.

 I never saw an DVB firmware available to sms2270. Your tuner is working fine
 under Windows with provided software ?

 Cheers,
   - Roberto






  - Roberto

 On Tue, Jan 13, 2015 at 11:50 AM, Francesco Other
 francesco.ot...@gmail.com wrote:

 Is there a gentleman that can help me with my problem? On linuxtv.org
 they said that someone here sure will help me.

 I submitted the problem here:
 http://www.spinics.net/lists/linux-media/msg85432.html

 Regards

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


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


Re: [REGRESSION] media: cx23885 broken by commit 453afdd [media] cx23885: convert to vb2

2015-01-13 Thread Antti Palosaari
I reported a bit similar looking bug few weeks ago. It could be coming 
from same issue.


cx23885 streaming lockdep error (VB2 related?)
http://www.spinics.net/lists/linux-media/msg84733.html

addition of that lockdep slash I saw many times random lockups and was 
forced to hard boot whole machine.


Antti


On 01/12/2015 05:27 PM, Raimonds Cicans wrote:

On 12.01.2015 12:55, Hans Verkuil wrote:

On 01/11/2015 10:33 AM, Raimonds Cicans wrote:

After upgrade from kernel 3.13.10 (do not have commit) to 3.17.7
(have commit) I started receiving following IOMMU related messages:

This makes no sense. The cx23885 driver in 3.17.7 doesn't use vb2.

Are you using the media_build repo perhaps to install the latest media
drivers on a 3.17 kernel?


Sorry for misinforming you. IMHO I saw somewhere that 453afdd
was included in 3.17.0-rc_something.
In last two weeks I did too much tests.

As far as I remember kernel / driver combinations was following
3.13.10 built in driver - not affected
3.17.7 + https://github.com/ljalves/linux_media (media tree + few new
TBS open source drivers) - affected
3.18.1 + https://github.com/ljalves/linux_media (media tree + few new
TBS open source drivers) - affected
3.19.0-rc3 built in driver (+ few new TBS open source drivers injected
by https://github.com/bas-t/saa716x-intree) - affected
Bisection I did on pure 3.13.10 + pure media tree

As you can see bug(s) are kernel version agnostic

1)
AMD-Vi: Event logged [IO_PAGE_FAULT device=0a:00.0 domain=0x001d
address=0x0637c000 flags=0x]

where device=0a:00.0 is TBS6981 card

sometimes this message was followed by storm of following messages:
cx23885[0]: mpeg risc op code error

This looks awfully like the bug that is fixed in commit
7675fe99d280ea83388a4382c54573c80db37cda.


...

2)
   [ cut here ]
   WARNING: CPU: 1 PID: 6946 at drivers/iommu/amd_iommu.c:2637
dma_ops_domain_unmap.part.12+0x55/0x72()
   CPU: 1 PID: 6946 Comm: w_scan Tainted: GW
3.19.0-rc3-myrc01 #1

Hmm, and this says 3.19-rc3.

I really need to know what kernel and media drivers you are using!



Look above



Yesterday I did git bisect on Linux media tree (v3.13 - HEAD)
and found that your commit is guilty in the first message.

Try with commit 7675fe99d280ea83388a4382c54573c80db37cda.


Did not help. Same errors.


I think the only relevant bug is #2. Just before Christmas I found some
issues with the vb2 threading code, although that was for video output
streams,
not video capture. But it may well be that similar problems exist for
capture.

I'll look at that this week or early next week.



I did new checks on 3.18.2 + https://github.com/ljalves/linux_media
(media tree + few new TBS open source drivers)
and found strange coincidence:
I did two tests in following way: started w_scan on first front-end and
after 5-10 seconds on second
and after some time received first bug in both tests.
Than just for fun reversed order.
I did two tests in following way: started w_scan on second front-end and
after 5-10 seconds on first
and after some time received second bug  followed after some time by
first bug in both tests.

Then I wanted to check following sequences:
1) init first front-end - start scan on second - start scan on first
2) init second front-end - start scan on first - start scan on second

By init I mean: run dvb-fe-tool -sDVBS -a0 // or -a1

But on first test of first sequence I received new bug:
[  369.295899] BUG: unable to handle kernel NULL pointer dereference
at(nil)
[  369.295945] IP: [c05173df] cx23885_buf_prepare+0x8c/0xa9
[cx23885]
[  369.295989] PGD 0
[  369.296002] Oops:  [#1] SMP
[  369.296020] Modules linked in: ip6table_filter ip6_tables act_police
cls_basic cls_flow cls_fw cls_u32 sch_fq_codel sch_tbf sch_prio sch_htb
sch_hfsc sch_ingress sch_sfq xt_CHECKSUM ipt_rpfilter xt_statistic xt_CT
xt_realm xt_addrtype xt_nat ipt_MASQUERADE nf_nat_masquerade_ipv4
ipt_ECN ipt_CLUSTERIP ipt_ah xt_set nf_nat_ftp xt_time xt_TCPMSS
xt_tcpmss xt_policy xt_pkttype xt_physdev br_netfilter xt_NFQUEUE
xt_NFLOG xt_mark xt_mac xt_length xt_helper xt_hashlimit xt_DSCP xt_dscp
xt_CLASSIFY xt_AUDIT iptable_raw iptable_nat nf_nat_ipv4 nf_nat
iptable_mangle hwmon_vid bridge stp llc ipv6 cx25840(O)
snd_hda_codec_hdmi snd_usb_audio snd_hwdep uvcvideo(O) snd_usbmidi_lib
videobuf2_vmalloc(O) snd_rawmidi ir_lirc_codec(O) ir_xmp_decoder(O)
lirc_dev(O) ir_mce_kbd_decoder(O) ir_sharp_decoder(O) ir_sanyo_decoder(O)
[  369.296375]  ir_sony_decoder(O) ir_jvc_decoder(O) ir_rc6_decoder(O)
ir_rc5_decoder(O) ir_nec_decoder(O) rc_rc6_mce(O) mceusb(O) cx23885(O)
tveeprom(O) cx2341x(O) tda18271(O) videobuf2_dvb(O) videobuf2_dma_sg(O)
videobuf2_memops(O) videobuf2_core(O) v4l2_common(O) videodev(O) k10temp
rc_core(O) microcode saa716x_core(O) dvb_core(O) cx24117(O) i2c_piix4
snd_hda_intel snd_hda_controller snd_hda_codec r8169 mii nouveau ttm
drm_kms_helper
[  369.296547] CPU: 0 PID: 7016 Comm: vb2-cx23885[0] Tainted:
G  

Re: [PATCH 1/7] tuner-core: properly initialize media controller subdev

2015-01-13 Thread Antti Palosaari

On 01/11/2015 04:25 PM, Mauro Carvalho Chehab wrote:

Em Sun, 11 Jan 2015 16:02:41 +0200
Laurent Pinchart laurent.pinch...@ideasonboard.com escreveu:



I'm not too familiar with tuners, do they all have a single output only and no
input ?


They have an input: the antenna connector. However, I don't see any need
to map it for most tuners, as there's generally just one input, hardwired
into the tuner chip.

There are some hardware with 2 antenna connectors, but for different
functions (FM and TV). They're selected automatically when the V4L2
driver switches between FM and TV.

In any case, the tuner-core doesn't provide any way to select the
antenna input.

So, if a driver would need to select the input, it would either need
to not use tuner-core or some patch will be required to add such
functionality inside tuner-core.


Tuner has antenna as a input and output is intermediate frequency or 
baseband (IF/BB (zero-IF)).


I think most modern silicon tuners actually has more than one physical 
antenna inputs - but those are left unused or same physical antenna 
connector is wired to all those inputs.


Sooner or later there will be receiver having multiple antenna 
connectors which are selectable by software. So let it be at least 
option easy to add later.


regards
Antti

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


Re: [PATCH] mn88472: simplify bandwidth registers setting code

2015-01-13 Thread Antti Palosaari

On 01/03/2015 02:50 AM, Benjamin Larsson wrote:

Signed-off-by: Benjamin Larsson benja...@southpole.se


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

regards
Antti


---
  drivers/staging/media/mn88472/mn88472.c | 41 +++--
  1 file changed, 14 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/media/mn88472/mn88472.c 
b/drivers/staging/media/mn88472/mn88472.c
index 33604dc..ee933c3 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -58,35 +58,22 @@ static int mn88472_set_frontend(struct dvb_frontend *fe)
goto err;
}

-   switch (c-delivery_system) {
-   case SYS_DVBT:
-   case SYS_DVBT2:
-   if (c-bandwidth_hz = 500) {
-   memcpy(bw_val, \xe5\x99\x9a\x1b\xa9\x1b\xa9, 7);
-   bw_val2 = 0x03;
-   } else if (c-bandwidth_hz = 600) {
-   /* IF 357 Hz, BW 600 Hz */
-   memcpy(bw_val, \xbf\x55\x55\x15\x6b\x15\x6b, 7);
-   bw_val2 = 0x02;
-   } else if (c-bandwidth_hz = 700) {
-   /* IF 457 Hz, BW 700 Hz */
-   memcpy(bw_val, \xa4\x00\x00\x0f\x2c\x0f\x2c, 7);
-   bw_val2 = 0x01;
-   } else if (c-bandwidth_hz = 800) {
-   /* IF 457 Hz, BW 800 Hz */
-   memcpy(bw_val, \x8f\x80\x00\x08\xee\x08\xee, 7);
-   bw_val2 = 0x00;
-   } else {
-   ret = -EINVAL;
-   goto err;
-   }
-   break;
-   case SYS_DVBC_ANNEX_A:
-   /* IF 507 Hz, BW 800 Hz */
+   if (c-bandwidth_hz = 500) {
+   memcpy(bw_val, \xe5\x99\x9a\x1b\xa9\x1b\xa9, 7);
+   bw_val2 = 0x03;
+   } else if (c-bandwidth_hz = 600) {
+   /* IF 357 Hz, BW 600 Hz */
+   memcpy(bw_val, \xbf\x55\x55\x15\x6b\x15\x6b, 7);
+   bw_val2 = 0x02;
+   } else if (c-bandwidth_hz = 700) {
+   /* IF 457 Hz, BW 700 Hz */
+   memcpy(bw_val, \xa4\x00\x00\x0f\x2c\x0f\x2c, 7);
+   bw_val2 = 0x01;
+   } else if (c-bandwidth_hz = 800) {
+   /* IF 457 Hz, BW 800 Hz */
memcpy(bw_val, \x8f\x80\x00\x08\xee\x08\xee, 7);
bw_val2 = 0x00;
-   break;
-   default:
+   } else {
ret = -EINVAL;
goto err;
}



--
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] cx23885/vb2 regression: please test this patch

2015-01-13 Thread Jurgen Kramer
Hi Hans,
On Tue, 2015-01-13 at 15:01 +0100, Hans Verkuil wrote:
 Hi Raimonds, Jurgen,
 
 Can you both test this patch? It should (I hope) solve the problems you
 both had with the cx23885 driver.
 
 This patch fixes a race condition in the vb2_thread that occurs when
 the thread is stopped. The crucial fix is calling kthread_stop much
 earlier in vb2_thread_stop(). But I also made the vb2_thread more
 robust.

Thanks. Will test your patch and report back.

Regards,
Jurgen


--
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: Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Francesco Other
Sorry for the previous message, maybe it isn't readable!

I created a file named frequency with this content:

# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy

T 69800 8MHz AUTO AUTO AUTO AUTO AUTO AUTO # Mediaset 4



but when I scan with command

scan frequency  channels.conf

I obtained a blank file.

This is the output:

$ scan frequency  channels.conf
scanning frequency
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 69800 0 9 9 6 2 4 4
 tune to: 
 69800:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_AUTO
WARNING: filter timeout pid 0x0011
WARNING: filter timeout pid 0x
WARNING: filter timeout pid 0x0010
dumping lists (0 services)
Done.



This is the system log when scanning is active (at the end I
disconnected the device):

Jan 13 22:25:01 Linux kernel: [ 2274.543224] smsusb_sendrequest:
sending MSG_SMS_RF_TUNE_REQ(561) size: 20
Jan 13 22:25:01 Linux kernel: [ 2274.581759] smsusb_onresponse:
received MSG_SMS_TRANSMISSION_IND(782) size: 56
Jan 13 22:25:01 Linux kernel: [ 2274.581874] smsusb_onresponse:
received MSG_SMS_RF_TUNE_RES(562) size: 12
Jan 13 22:25:01 Linux kernel: [ 2274.684257] smsusb_onresponse:
received MSG_SMS_HO_INBAND_POWER_IND(631) size: 16
Jan 13 22:25:01 Linux kernel: [ 2274.743291] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:25:01 Linux kernel: [ 2274.743498] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:25:01 Linux kernel: [ 2274.943586] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:25:01 Linux kernel: [ 2274.943758] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:25:01 Linux kernel: [ 2274.980125] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 196
Jan 13 22:25:01 Linux kernel: [ 2275.002873] smsusb_onresponse:
received MSG_SMS_SIGNAL_DETECTED_IND(827) size: 8
Jan 13 22:25:01 Linux kernel: [ 2275.002885] smsusb_onresponse:
received MSG_SMS_TRANSMISSION_IND(782) size: 56
Jan 13 22:25:01 Linux kernel: [ 2275.002999] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:25:01 Linux kernel: [ 2275.003998] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:25:01 Linux kernel: [ 2275.080006] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 760
Jan 13 22:25:01 Linux kernel: [ 2275.143858] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:25:01 Linux kernel: [ 2275.144021] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:25:01 Linux kernel: [ 2275.144108] smsusb_sendrequest:
sending MSG_SMS_ADD_PID_FILTER_REQ(601) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.144255] smsusb_onresponse:
received MSG_SMS_ADD_PID_FILTER_RES(602) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.144381] smsusb_sendrequest:
sending MSG_SMS_ADD_PID_FILTER_REQ(601) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.144503] smsusb_onresponse:
received MSG_SMS_ADD_PID_FILTER_RES(602) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.144531] smsusb_sendrequest:
sending MSG_SMS_ADD_PID_FILTER_REQ(601) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.144628] smsusb_onresponse:
received MSG_SMS_ADD_PID_FILTER_RES(602) size: 12
Jan 13 22:25:01 Linux kernel: [ 2275.179880] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 1512
Jan 13 22:25:01 Linux kernel: [ 2275.279749] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 1324
Jan 13 22:25:02 Linux kernel: [ 2275.302998] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:25:02 Linux kernel: [ 2275.380029] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:25:02 Linux kernel: [ 2275.380748] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 2264
Jan 13 22:25:02 Linux kernel: [ 2275.380997] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:25:02 Linux kernel: [ 2275.480632] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 2640
Jan 13 22:25:02 Linux kernel: [ 2275.580511] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 196
Jan 13 22:25:02 Linux kernel: [ 2275.681380] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 384
Jan 13 22:25:02 Linux kernel: [ 2275.781258] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 384
Jan 13 22:25:02 Linux kernel: [ 2275.882253] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 948
Jan 13 22:25:02 Linux kernel: [ 2275.983128] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 196
Jan 13 22:25:02 Linux kernel: [ 2276.000999] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:25:02 Linux kernel: [ 2276.083004] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 196
Jan 13 

Re: Driver/module in kernel fault. Anyone expert to help me? Siano ID 187f:0600

2015-01-13 Thread Francesco Other
I used another working-device for creating the channels.conf file with
this command:

scan frequency  ~/.tzap/channels.conf



For example this is a line from that file:

Italia1:69800:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:1620:1621:4006



So, this is the output for tzap with the NOT-working-device:

$ tzap -r -c ~/.tzap/channels.conf Italia1
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
reading channels from file '/home/ionic/.tzap/channels.conf'
Version: 5.10   FE_CAN { DVB-T }
tuning to 69800 Hz
video pid 0x0654, audio pid 0x0655
status 00 | signal  | snr  | ber  | unc  |
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 0104 | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
status 1f | signal  | snr 010e | ber  | unc  | FE_HAS_LOCK
^C



That channel, Italia1, obviously working fine with the working-device.

This is the system log during tzap with the not-working-device:

Jan 13 22:53:15 Linux kernel: [ 3968.930540] smsusb_sendrequest:
sending MSG_SMS_RF_TUNE_REQ(561) size: 20
Jan 13 22:53:15 Linux kernel: [ 3968.930579] smsusb_sendrequest:
sending MSG_SMS_ADD_PID_FILTER_REQ(601) size: 12
Jan 13 22:53:15 Linux kernel: [ 3968.939002] smsusb_sendrequest:
sending MSG_SMS_ADD_PID_FILTER_REQ(601) size: 12
Jan 13 22:53:15 Linux kernel: [ 3968.967963] smsusb_onresponse:
received MSG_SMS_TRANSMISSION_IND(782) size: 56
Jan 13 22:53:15 Linux kernel: [ 3968.967976] smsusb_onresponse:
received MSG_SMS_RF_TUNE_RES(562) size: 12
Jan 13 22:53:15 Linux kernel: [ 3968.967987] smsusb_onresponse:
received MSG_SMS_ADD_PID_FILTER_RES(602) size: 12
Jan 13 22:53:15 Linux kernel: [ 3968.968012] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:53:15 Linux kernel: [ 3968.968082] smsusb_onresponse:
received MSG_SMS_ADD_PID_FILTER_RES(602) size: 12
Jan 13 22:53:15 Linux kernel: [ 3968.968325] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:53:15 Linux kernel: [ 3969.070459] smsusb_onresponse:
received MSG_SMS_HO_INBAND_POWER_IND(631) size: 16
Jan 13 22:53:16 Linux kernel: [ 3969.338962] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 3956
Jan 13 22:53:16 Linux kernel: [ 3969.339202] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 3956
Jan 13 22:53:16 Linux kernel: [ 3969.339451] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 3956
Jan 13 22:53:16 Linux kernel: [ 3969.339575] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 3956
Jan 13 22:53:16 Linux kernel: [ 3969.351453] smsusb_onresponse:
received MSG_SMS_SIGNAL_DETECTED_IND(827) size: 8
Jan 13 22:53:16 Linux kernel: [ 3969.351464] smsusb_onresponse:
received MSG_SMS_TRANSMISSION_IND(782) size: 56
Jan 13 22:53:16 Linux kernel: [ 3969.351577] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:53:16 Linux kernel: [ 3969.352576] smsusb_onresponse:
received MSG_SMS_HO_PER_SLICES_IND(630) size: 108
Jan 13 22:53:16 Linux kernel: [ 3969.368052] smsusb_sendrequest:
sending MSG_SMS_GET_STATISTICS_REQ(615) size: 8
Jan 13 22:53:16 Linux kernel: [ 3969.368326] smsusb_onresponse:
received MSG_SMS_GET_STATISTICS_RES(616) size: 224
Jan 13 22:53:16 Linux kernel: [ 3969.376075] smsusb_onresponse:
received MSG_SMS_DAB_CHANNEL(607) size: 3956
Jan 13 22:53:16 Linux kernel: [ 3969.376450] 

[PATCH] bttv: Convert to generic TEA575x interface

2015-01-13 Thread Ondrej Zary
Remove tea575x-specific code from bttv and use the common driver instead.

Only set_frequency is implemented (signal/stereo detection or seek would
require more changes to bttv).

It works fine on Video Highway Xtreme (it actually makes the radio usable as
it currently cannot be tuned properly).

Miro/Pinnacle is untested but seems to be simple and should work.

However, I don't understand the Terratec Active Radio Upgrade code. The HW
seems to need IOR, IOW and CSEL signals that were taken from ISA bus on
older cards (IOR and IOW directly and CSEL from some address decoder) and
are emulated here using GPIOs. But the code manipulating these signals in
bttv seems to be broken - it never asserts the IOR signal. If anyone has
this HW, please test if I got that right.

Signed-off-by: Ondrej Zary li...@rainbow-software.org
---
 drivers/media/pci/bt8xx/Kconfig   |3 +
 drivers/media/pci/bt8xx/bttv-cards.c  |  317 -
 drivers/media/pci/bt8xx/bttv-driver.c |6 +-
 drivers/media/pci/bt8xx/bttvp.h   |   14 +-
 4 files changed, 125 insertions(+), 215 deletions(-)

diff --git a/drivers/media/pci/bt8xx/Kconfig b/drivers/media/pci/bt8xx/Kconfig
index 496cf6b..4a93f6d 100644
--- a/drivers/media/pci/bt8xx/Kconfig
+++ b/drivers/media/pci/bt8xx/Kconfig
@@ -4,12 +4,15 @@ config VIDEO_BT848
select I2C_ALGOBIT
select VIDEOBUF_DMA_SG
depends on RC_CORE
+   depends on MEDIA_RADIO_SUPPORT
select VIDEO_TUNER
select VIDEO_TVEEPROM
select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TVAUDIO if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TDA7432 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_SAA6588 if MEDIA_SUBDRV_AUTOSELECT
+   select RADIO_ADAPTERS
+   select RADIO_TEA575X
---help---
  Support for BT848 based frame grabber/overlay boards. This includes
  the Miro, Hauppauge and STB boards. Please read the material in
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c 
b/drivers/media/pci/bt8xx/bttv-cards.c
index c518677..4654fb6 100644
--- a/drivers/media/pci/bt8xx/bttv-cards.c
+++ b/drivers/media/pci/bt8xx/bttv-cards.c
@@ -84,8 +84,7 @@ static void gv800s_init(struct bttv *btv);
 static void td3116_muxsel(struct bttv *btv, unsigned int input);
 
 static int terratec_active_radio_upgrade(struct bttv *btv);
-static int tea5757_read(struct bttv *btv);
-static int tea5757_write(struct bttv *btv, int value);
+static int tea575x_init(struct bttv *btv);
 static void identify_by_eeprom(struct bttv *btv,
   unsigned char eeprom_data[256]);
 static int pvr_boot(struct bttv *btv);
@@ -3085,12 +3084,12 @@ static void miro_pinnacle_gpio(struct bttv *btv)
if (0 == (gpio  0x20)) {
btv-has_radio = 1;
if (!miro_fmtuner[id]) {
-   btv-has_matchbox = 1;
-   btv-mbox_we= (16);
-   btv-mbox_most  = (17);
-   btv-mbox_clk   = (18);
-   btv-mbox_data  = (19);
-   btv-mbox_mask  = (16)|(17)|(18)|(19);
+   btv-has_tea575x = 1;
+   btv-tea_gpio.wren = 6;
+   btv-tea_gpio.most = 7;
+   btv-tea_gpio.clk  = 8;
+   btv-tea_gpio.data = 9;
+   tea575x_init(btv);
}
} else {
btv-has_radio = 0;
@@ -3104,7 +3103,7 @@ static void miro_pinnacle_gpio(struct bttv *btv)
pr_info(%d: miro: id=%d tuner=%d radio=%s stereo=%s\n,
btv-c.nr, id+1, btv-tuner_type,
!btv-has_radio ? no :
-   (btv-has_matchbox ? matchbox : fmtuner),
+   (btv-has_tea575x ? tea575x : fmtuner),
(-1 == msp) ? no : yes);
} else {
/* new cards with microtune tuner */
@@ -3382,12 +3381,12 @@ void bttv_init_card2(struct bttv *btv)
break;
case BTTV_BOARD_VHX:
btv-has_radio= 1;
-   btv-has_matchbox = 1;
-   btv-mbox_we  = 0x20;
-   btv-mbox_most= 0;
-   btv-mbox_clk = 0x08;
-   btv-mbox_data= 0x10;
-   btv-mbox_mask= 0x38;
+   btv-has_tea575x  = 1;
+   btv-tea_gpio.wren = 5;
+   btv-tea_gpio.most = 6;
+   btv-tea_gpio.clk  = 3;
+   btv-tea_gpio.data = 4;
+   tea575x_init(btv);
break;
case BTTV_BOARD_VOBIS_BOOSTAR:
case BTTV_BOARD_TERRATV:
@@ -3745,33 +3744,112 @@ static void hauppauge_eeprom(struct bttv *btv)
btv-radio_uses_msp_demodulator = 1;
 }
 
-static int 

compile only specific module, dkms

2015-01-13 Thread Dexter Filmore
Hi all,

I have a Technotrend TT S2-3600 on my debian 7 media center. 
Debians stock 3.2 kernel would cause panics when talking to the device unless 
I compile the LinuxTV module. 
Alas, debian has a *lot* of kernel upgrades and I'd like to have only my 
specific module compiled at boot time if it is not there.

I thought maybe manually compile via dkms, but I don't know how to compile 
only one specific set of modules. The 3600 is identical to the pctv452, but 
depends on dvb-usb modules, possibly needs firmware. 
Pointers appreciated.

Dex


-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d--(+)@ s-:+ a C UL++ P+++ L+++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h++ r* y?
--END GEEK CODE BLOCK--


signature.asc
Description: This is a digitally signed message part.