diff mbox

Clock problems in i.MX27 Visstrim M10 (linux-3.5-rc5).

Message ID CAOMZO5A0YXcZOB+ov+dD0MVJr0XSr=Ufg5snGDLvZ9=GyK=xMw@mail.gmail.com
State New
Headers show

Commit Message

Fabio Estevam July 4, 2012, 6:23 p.m. UTC
On Wed, Jul 4, 2012 at 8:41 AM, Fabio Estevam <festevam@gmail.com> wrote:

> So the original mx2_camera patch i sent you plus the clk-imx27.c
> changes (calling clk_register_clkdev again with the
> second name) fixes the issue for you?

Ok, I have tested the mx2_camera patch I sent you plus the one below:


,and I get the following on probe:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
mx2-camera mx2-camera.0: Camera driver attached to camera 0
ov2640 0-0030: Product ID error fb:fb
mx2-camera mx2-camera.0: Camera driver detached from camera 0
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 665000

Looks like an i2c error when trying to read the ov2640 ID.

Is your camera connected to i2c? Do you get it probed correctly?

Any suggestions are welcome.

Thanks,

Fabio Estevam

Comments

Fabio Estevam July 4, 2012, 7:55 p.m. UTC | #1
On Wed, Jul 4, 2012 at 3:23 PM, Fabio Estevam <festevam@gmail.com> wrote:

> ,and I get the following on probe:
>
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 665000
>
> Looks like an i2c error when trying to read the ov2640 ID.

Just for comparison, here is the log from a 3.4.4 kernel:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
mx2-camera mx2-camera.0: Camera driver attached to camera 0
ov2640 0-0030: ov2640 Product ID 26:42 Manufacturer ID 7f:a2
i2c i2c-0: OV2640 Probed
mx2-camera mx2-camera.0: Camera driver detached from camera 0
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 443333
Driver for 1-wire Dallas network protocol

i2detetc also sees 0x30 (camera address) on 3.4.4:

root@freescale /$ i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- 1d -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --

,but on 3.5-rc5 (or linux-next) the camera address is not detected via
i2cdetect.

Wolfram,

Have you seen any issues lately with mx27 i2c?

Regards,

Fabio Estevam
Javier Martin July 6, 2012, 6:44 a.m. UTC | #2
The attached patch solves mx2_camera clock problems.

It can be also found by the following subject in the lists:

media: i.MX27: Fix emma-prp clocks in mx2_camera.c
Fabio Estevam July 6, 2012, 12:32 p.m. UTC | #3
On Fri, Jul 6, 2012 at 3:44 AM, javier Martin
<javier.martin@vista-silicon.com> wrote:
> The attached patch solves mx2_camera clock problems.
>
> It can be also found by the following subject in the lists:
>
> media: i.MX27: Fix emma-prp clocks in mx2_camera.c

Just tried your patch against today's linux-next and I still get the
following on a mx27pdk:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
mx2-camera mx2-camera.0: Camera driver attached to camera 0
ov2640 0-0030: Product ID error fb:fb
mx2-camera mx2-camera.0: Camera driver detached from camera 0
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 665000

Are you able to probe i2c correctly on your board?
Javier Martin July 9, 2012, 7 a.m. UTC | #4
On 6 July 2012 14:32, Fabio Estevam <festevam@gmail.com> wrote:
> On Fri, Jul 6, 2012 at 3:44 AM, javier Martin
> <javier.martin@vista-silicon.com> wrote:
>> The attached patch solves mx2_camera clock problems.
>>
>> It can be also found by the following subject in the lists:
>>
>> media: i.MX27: Fix emma-prp clocks in mx2_camera.c
>
> Just tried your patch against today's linux-next and I still get the
> following on a mx27pdk:
>
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 665000
>
> Are you able to probe i2c correctly on your board?

Yes, I am and my patch does not touch any of the I2C settings or clocks.
diff mbox

Patch

--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -250,8 +250,10 @@  int __init mx27_clocks_init(unsigned long fref)
        clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx-i2c.1");
        clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
        clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
-       clk_register_clkdev(clk[emma_ahb_gate], "ahb", "imx-emma");
-       clk_register_clkdev(clk[emma_ipg_gate], "ipg", "imx-emma");
+       clk_register_clkdev(clk[emma_ahb_gate], "ahb", "mx2-camera.0");
+       clk_register_clkdev(clk[emma_ipg_gate], "ipg", "mx2-camera.0");
+       clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
+       clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
        clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
        clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
        clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);