Re: Usb digital TV

2011-08-30 Thread Alan Carvalho de Assis
Hi Gabriel,

On 8/30/11, Gabriel Sartori  wrote:
> Thank you Allan!
>
>   Did this device that you use works in 1-seg? I think it is just full-seg!
>

Yes, it support both: 1-seg and full-seg.

In our device we use only 1-seg because your processor cannot decode full-seg.

Best Regards,

Alan
--
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: Usb digital TV

2011-08-29 Thread Alan Carvalho de Assis
Hi Gabriel,

On 8/29/11, Gabriel Sartori  wrote:
> It there some devices that has more chance to work on a 2.6.35 kernel
> version so I can just cross compile the driver to my mx28 board in a
> easier way?
>
> Thanks in advance.
>

I suggest you using a device based on dib0700, I got it working on
Linux <= 2.6.35:
https://acassis.wordpress.com/2009/09/18/watching-digital-tv-sbtvd-in-the-linux/

This same device working on i-MXT (Android 2.2 with Linux kernel 2.6.35):
http://holoscopio.com/misc/androidtv/

Best Regards,

Alan
--
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: soc_camera: OV2640

2009-12-08 Thread Alan Carvalho de Assis
Hi Guennadi,

On 12/7/09, Guennadi Liakhovetski  wrote:
> Hi Alan
>
> On Mon, 7 Dec 2009, Alan Carvalho de Assis wrote:
>
> It's always better to cc a suitable list, in this case it is
>
> Linux Media Mailing List 
>

Sure, here we go.

>
>> I am trying to use an OV2640 camera with soc_camera.
>>
>> I'm using ov772x driver as base, but it needs too much modification to
>> work with ov2640.
>
> I don't know that sensor specifically, but they can be quite different.
>

Yes, in fact ov2640 appears quite different compared to ov772x and ov9640.

>> The OV2640 chip remaps all registers when register 0xFF is 1 or when it is
>> 0.
>
> This is not unusual. There are a few ways to implement this, for example,
> drivers/media/video/rj54n1cb0c.c uses 16-bit addresses, and decodes them
> to bank:register pairs in its reg_read() and reg_write() routines.
>

Ok, I will try to implement it this way, case nobody suggests me a
better approach.

Best Regards,

Alan
--
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: soc_camera: OV2640

2009-12-11 Thread Alan Carvalho de Assis
Hi Guennadi,

On 12/8/09, Alan Carvalho de Assis  wrote:
> Hi Guennadi,
...
>>> I am trying to use an OV2640 camera with soc_camera.
>>>
>>> I'm using ov772x driver as base, but it needs too much modification to
>>> work with ov2640.
>>
>> I don't know that sensor specifically, but they can be quite different.
>>
>
> Yes, in fact ov2640 appears quite different compared to ov772x and ov9640.
>
>>> The OV2640 chip remaps all registers when register 0xFF is 1 or when it
>>> is
>>> 0.
>>
>> This is not unusual. There are a few ways to implement this, for example,
>> drivers/media/video/rj54n1cb0c.c uses 16-bit addresses, and decodes them
>> to bank:register pairs in its reg_read() and reg_write() routines.
>>
>
> Ok, I will try to implement it this way, case nobody suggests me a
> better approach.
>

I got mx27_camera from pengutronix tree and modified it to work with
kernel 2.6.32 (few modifications). I added platform data/device on my
board using pcm970-baseboard.c as example.

In the kernel config I selected:
CONFIG_VIDEO_MX27
CONFIG_SOC_CAMERA_OV9640


I noticed a strange behavior: the ov9640 driver is called before mx27_camera:

Linux video capture interface: v2.00
>>> Probe OK until now, going to ProbeVideo <<<
>>> Probing OV9640 <<<
Parent missing or invalid!
Driver for 1-wire Dallas network protocol.
i.MX SDHC driver
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
mx27-camera mx27-camera.0: initialising
>>> mx27_camera: IRQ request OK!
>>> mx27_camera: pcdev OK!
>>> mx27_camera: clk_csi OK!
mx27-camera mx27-camera.0: Camera clock frequency: 2660
>>> mx27_camera: DMA request OK!
mx27-camera mx27-camera.0: Using EMMA
>>> mx27_camera: probe OK until now!
mx27-camera mx27-camera.0: Non-NULL drvdata on register
>>> mx27_camera: soc_camera_host_register returned 0!

Then ov9640 returns error because icd->dev.parent doesn't exist.

Did you already see this issue?

Best Regards,

Alan
--
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: soc_camera: OV2640

2009-12-11 Thread Alan Carvalho de Assis
Hi Guennadi,

On 12/11/09, Guennadi Liakhovetski  wrote:
> On Fri, 11 Dec 2009, Alan Carvalho de Assis wrote:
>> I got mx27_camera from pengutronix tree and modified it to work with
>> kernel 2.6.32 (few modifications).
>
> Sorry, I cannot help you with an out-of-tree driver, and generally I would
> expect significant changes when going to 2.6.32.
>

Right, I can post a patch to add mx27_camera on mainstream kernel
since Sascha (original author) let me do it.

Sascha, can I submit it?

Best Regards,

Alan
--
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] RFC: mx27: Add soc_camera support

2009-12-15 Thread Alan Carvalho de Assis
This is the soc_camera support developed by Sascha Hauer.
I just modified original driver to get it working on recent kernel.

Signed-off-by: Alan Carvalho de Assis 
---
 arch/arm/mach-mx2/clock_imx27.c  |2 +-
 arch/arm/mach-mx2/devices.c  |   32 +
 arch/arm/mach-mx2/devices.h  |1 +
 arch/arm/plat-mxc/include/mach/imx_cam.h |   47 ++
 drivers/media/video/Kconfig  |   13 +
 drivers/media/video/Makefile |3 +
 drivers/media/video/mx27_camera.c| 1224 ++
 7 files changed, 1321 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-mxc/include/mach/imx_cam.h
 create mode 100644 drivers/media/video/mx27_camera.c

diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index b010bf9..1ad0408 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -642,7 +642,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
_REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
_REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
-   _REGISTER_CLOCK(NULL, "csi", csi_clk)
+   _REGISTER_CLOCK("mx27-camera.0", NULL, csi_clk)
_REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk)
_REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk1)
_REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk)
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 3d398ce..d47ea55 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -39,6 +40,37 @@
 
 #include "devices.h"
 
+#ifdef CONFIG_MACH_MX27
+static struct resource mx27_camera_resources[] = {
+   {
+  .start = CSI_BASE_ADDR,
+  .end = CSI_BASE_ADDR + 0x1f,
+  .flags = IORESOURCE_MEM,
+   }, {
+  .start = EMMA_PRP_BASE_ADDR,
+  .end = EMMA_PRP_BASE_ADDR + 0x1f,
+  .flags = IORESOURCE_MEM,
+   }, {
+  .start = MXC_INT_CSI,
+  .end = MXC_INT_CSI,
+  .flags = IORESOURCE_IRQ,
+   },{
+  .start = MXC_INT_EMMAPRP,
+  .end = MXC_INT_EMMAPRP,
+  .flags = IORESOURCE_IRQ,
+   },
+};
+struct platform_device mx27_camera_device = {
+   .name = "mx27-camera",
+   .id = 0,
+   .num_resources = ARRAY_SIZE(mx27_camera_resources),
+   .resource = mx27_camera_resources,
+   .dev = {
+   .coherent_dma_mask = 0x,
+   },
+};
+#endif
+
 /*
  * SPI master controller
  *
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index 97306aa..58ce4dc 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -20,6 +20,7 @@ extern struct platform_device mxc_i2c_device1;
 extern struct platform_device mxc_sdhc_device0;
 extern struct platform_device mxc_sdhc_device1;
 extern struct platform_device mxc_otg_udc_device;
+extern struct platform_device mx27_camera_device;
 extern struct platform_device mxc_otg_host;
 extern struct platform_device mxc_usbh1;
 extern struct platform_device mxc_usbh2;
diff --git a/arch/arm/plat-mxc/include/mach/imx_cam.h 
b/arch/arm/plat-mxc/include/mach/imx_cam.h
new file mode 100644
index 000..2d704ae
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/imx_cam.h
@@ -0,0 +1,47 @@
+/*
+imx-cam.h - i.MX27 camera driver header file
+
+Copyright (C) 2003, Intel Corporation
+Copyright (C) 2008, Sascha Hauer 
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __ASM_ARCH_CAMERA_H_
+#define __ASM_ARCH_CAMERA_H_
+
+#define MX27_CAMERA_SWAP16 (1 << 0)
+#define MX27_CAMERA_EXT_VSYNC  (1 << 1)
+#define MX27_CAMERA_CCIR   (1 << 2)
+#define MX27_CAMERA_CCIR_INTERLACE (1 << 3)
+#define MX27_CAMERA_HSYNC_HIGH (1 << 4)
+#define MX27_CAMERA_GATED_CLOCK(1 << 5)
+#define MX27_CAMERA_INV_DATA   (1 << 6)
+#define MX27_CAMERA_PCLK_SAMPLE_RISING (1 << 7)
+#define MX27_CAMERA_PACK_DIR_MSB   (1 << 8)
+

Re: [PATCH] RFC: mx27: Add soc_camera support

2009-12-15 Thread Alan Carvalho de Assis
Please note: I just get it compiling and loaded correctly on the
mainline kernel.

If you have a board powered by i.MX27 and with a camera supported by
soc_camera driver, I will be glad case you can do a try.

On 12/15/09, Alan Carvalho de Assis  wrote:
> This is the soc_camera support developed by Sascha Hauer.
> I just modified original driver to get it working on recent kernel.
>
> Signed-off-by: Alan Carvalho de Assis 
> ---
>  arch/arm/mach-mx2/clock_imx27.c  |2 +-
>  arch/arm/mach-mx2/devices.c  |   32 +
>  arch/arm/mach-mx2/devices.h  |1 +
>  arch/arm/plat-mxc/include/mach/imx_cam.h |   47 ++
>  drivers/media/video/Kconfig  |   13 +
>  drivers/media/video/Makefile |3 +
>  drivers/media/video/mx27_camera.c| 1224
> ++
>  7 files changed, 1321 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/plat-mxc/include/mach/imx_cam.h
>  create mode 100644 drivers/media/video/mx27_camera.c
>
> diff --git a/arch/arm/mach-mx2/clock_imx27.c
> b/arch/arm/mach-mx2/clock_imx27.c
> index b010bf9..1ad0408 100644
> --- a/arch/arm/mach-mx2/clock_imx27.c
> +++ b/arch/arm/mach-mx2/clock_imx27.c
> @@ -642,7 +642,7 @@ static struct clk_lookup lookups[] = {
>   _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
>   _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
>   _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
> - _REGISTER_CLOCK(NULL, "csi", csi_clk)
> + _REGISTER_CLOCK("mx27-camera.0", NULL, csi_clk)
>   _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk)
>   _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk1)
>   _REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk)
> diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
> index 3d398ce..d47ea55 100644
> --- a/arch/arm/mach-mx2/devices.c
> +++ b/arch/arm/mach-mx2/devices.c
> @@ -31,6 +31,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -39,6 +40,37 @@
>
>  #include "devices.h"
>
> +#ifdef CONFIG_MACH_MX27
> +static struct resource mx27_camera_resources[] = {
> + {
> +.start = CSI_BASE_ADDR,
> +.end = CSI_BASE_ADDR + 0x1f,
> +.flags = IORESOURCE_MEM,
> + }, {
> +.start = EMMA_PRP_BASE_ADDR,
> +.end = EMMA_PRP_BASE_ADDR + 0x1f,
> +.flags = IORESOURCE_MEM,
> + }, {
> +.start = MXC_INT_CSI,
> +.end = MXC_INT_CSI,
> +.flags = IORESOURCE_IRQ,
> + },{
> +.start = MXC_INT_EMMAPRP,
> +.end = MXC_INT_EMMAPRP,
> +.flags = IORESOURCE_IRQ,
> + },
> +};
> +struct platform_device mx27_camera_device = {
> + .name = "mx27-camera",
> + .id = 0,
> + .num_resources = ARRAY_SIZE(mx27_camera_resources),
> + .resource = mx27_camera_resources,
> + .dev = {
> + .coherent_dma_mask = 0x,
> + },
> +};
> +#endif
> +
>  /*
>   * SPI master controller
>   *
> diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
> index 97306aa..58ce4dc 100644
> --- a/arch/arm/mach-mx2/devices.h
> +++ b/arch/arm/mach-mx2/devices.h
> @@ -20,6 +20,7 @@ extern struct platform_device mxc_i2c_device1;
>  extern struct platform_device mxc_sdhc_device0;
>  extern struct platform_device mxc_sdhc_device1;
>  extern struct platform_device mxc_otg_udc_device;
> +extern struct platform_device mx27_camera_device;
>  extern struct platform_device mxc_otg_host;
>  extern struct platform_device mxc_usbh1;
>  extern struct platform_device mxc_usbh2;
> diff --git a/arch/arm/plat-mxc/include/mach/imx_cam.h
> b/arch/arm/plat-mxc/include/mach/imx_cam.h
> new file mode 100644
> index 000..2d704ae
> --- /dev/null
> +++ b/arch/arm/plat-mxc/include/mach/imx_cam.h
> @@ -0,0 +1,47 @@
> +/*
> +imx-cam.h - i.MX27 camera driver header file
> +
> +Copyright (C) 2003, Intel Corporation
> +Copyright (C) 2008, Sascha Hauer 
> +
> +This program is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2 of the License, or
> +(at your option) any later version.
> +
> +This program is distributed in the hope that it will be useful,
> +but WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +GNU General Public License for more details.
> +
> + 

Re: [PATCH] RFC: mx27: Add soc_camera support

2010-01-04 Thread Alan Carvalho de Assis
Hi Javier,

On 1/4/10, javier Martin  wrote:
> Alan,
> please, could you point me against which kernel version did you exactly test
> this patch?

It applies on current kernel from git.pengutronix.de/git/imx/linux-2.6.git

> Also it would be fine to know which video sensor did you use.
>

I'm planning to use an OV2640 camera.

> We are planning to improve this if it works.
>

Yes, this is the idea :)

> Thank you.
>

You are welcome,

Alan
--
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: ISDB-T Tuning

2010-06-24 Thread Alan Carvalho de Assis
Hi Reynaldo,

On 6/24/10, Reynaldo H. Verdejo Pinochet  wrote:
> Hi guys
>
> I have been trying to get a siano based 1seg ISDB-T USB dongle
> to scan and tune under Linux to no avail. Asking around it has
> been brought to my attention there might be no app available
> that would do this successfully even with an adapter currently
> supported by the kernel like the one I'm using. Facing that
> scenario and assuming my lack of luck trying to find such an
> application supports that claim, I'm wondering if there is
> anyone reading this that might be working on writing such an
> application and/or in extending an existing one like 'scan'
> to be able to work with ISDB-T. Just to avoid duplicating the
> effort.
>

If you have all frequencies supported in your country you can the
"scan" command to detected all transmitted channels.

More info:
http://acassis.wordpress.com/2009/09/18/watching-digital-tv-sbtvd-in-the-linux/

Best Regards,

Alan
--
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: mx27: Add soc_camera support

2010-01-13 Thread Alan Carvalho de Assis
Hi Javier,

On 1/4/10, javier Martin  wrote:
> 2010/1/4 javier Martin 
>
>>
>>
>> 2010/1/4 Alan Carvalho de Assis 
>>
>> Hi Javier,
>>>
>>> On 1/4/10, javier Martin  wrote:
>>> > Alan,
>>> > please, could you point me against which kernel version did you exactly
>>> test
>>> > this patch?
>>>
>>> It applies on current kernel from
>>> git.pengutronix.de/git/imx/linux-2.6.git
>>>
>>> Thank you for your feedback Alan.
>>
>>> > Also it would be fine to know which video sensor did you use.
>>> >
>>>
>>> I'm planning to use an OV2640 camera.
>>>
>> Does this mean that this patch you are sending has been only
>> compile-tested?
>>
>
> Argh, sorry, you pointed this in your previous mail.
>
> Too bad we don't have any sensor available currently in mainline to do a
> fast test.
>

Unfortunately my camera is not responding to I2C commands, I already
slow it down to 10kbps with no success. I can see on oscilloscope
i.MX27 send I2C commands, but the camera doesn't respond to it.

Then I tested using the MT9T31 driver and change the it to my I2C
commands, as I2C is failing I force the probe to return 0. But the
soc_camera still failing:

Linux video capture interface: v2.00
write: -5
MT9T31 Read register 0xFF = -5
Forcing mt9t031_video_probe to return OK!
mx27-camera mx27-camera.0: initialising
mx27-camera: probe of mx27-camera.0 failed with error -2

Best Regards,

Alan
--
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: mx27: Add soc_camera support

2010-01-14 Thread Alan Carvalho de Assis
Hi Javier,

On 1/14/10, javier Martin  wrote:
> No idea what can be causing this. Maybe I2C address is bad in board specific
> code?
>

I don't know, I will check carefully.

>> Linux video capture interface: v2.00
>> write: -5
>> MT9T31 Read register 0xFF = -5
>> Forcing mt9t031_video_probe to return OK!
>> mx27-camera mx27-camera.0: initialising
>> mx27-camera: probe of mx27-camera.0 failed with error -2
>>
>
> As far as I know, video buffers are allocated in probe() function. Maybe you
> have a memory fragmentation problem and you need to move buffer allocation
> to init().
> We have faced this problem many times in the past.
>

Hmm, great Javier, in fact it could be the issue!

Thank you very much.

Best Regards,

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