Skip to contentSkip to conversation

New SOC Camera hardware

DISCUSSION Gilles 2 participants 4 messages Aug 24, 2011 – Sep 27, 2011 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

Gilles

author
#1 lore raw
In reply to a message not in the archive

Folks,

I am currently trying to add V4L2 SOC Camera support for an embedded board (Blackfin 527 EZKIT-V2). Trying to learn from the few existing examples and was wondering if anyone could shed some light on this:

More specifically, I'm looking at:

arch/sh/boards/mach-ap325rxa/setup.c

arch/arm/mach-mx3/mach-pcm037.c
drivers/media/video/mx3_camera.c

I have the feeling that mx3 appears to be incomplete (or untested?) because of this statement in

static int __devinit mx3_camera_probe(struct platform_device *pdev) {
[...]
soc_host = &mx3_cam->soc_host;

Where mx3->soc_host appears to never be initialized since it's allocation (followed by a memzero).

Anyway, my question is: the ap325 board setup appears to do the job without a dedicated SOC driver. Am I reading this correctly or is there a SOC driver for the ap325 I'm not seeing?

This is all so very hard with the total lack of comments in the code as well as the convoluted Kconfig/makefiles.

I'd appreciate any help anyone is willing to offer. Even after reading soc-camera.txt and a few others I still don't know what is *really* necessary.

I've pretty much come to the conclusion that in order to add SOC support for camera on a board I need to:

1) add a I2C_BOARD_INFO entry with the camera I2C address (in the board specific setup based on the appropriate CONFIG_...)

2) add a soc_camera_link for the camera sensor with that I2C info.

[...]

)) Add the device in the board __init. In my case in arch/blackfin/mach-bf527/boards/ezkit.c in __init ezkit_init()

add a call to platform_add_device

I know I'm missiong a lot of pieces to this puzzle.
I'm seeing other boards allocate DMA regions first and then only add the camera if it succeeded.
Then I'm seeing the ap325 which creates TWO soc_camera_link (I'm assuming one is for the SOC driver which does not exist elsewhere?...)

Can anyone please shed some light on all this or point me to a SOC drivers for dummy document I may have missed???

I'd appreciate any input anyone is willing to lend.

Thanks,
Gilles
.

#2 lore raw

Hi Gilles,

If you want to write a driver for blackfin, you can visit
http://blackfin.uclinux.org/ and find linux kernel repo url. I have written a blackfin bridge driver, vs6624 sensor driver and adv7183 decoder driver. You can reference vs6624 driver.
I didn't use soc camera framework because it can't support decoder well. These patch hasn't uploaded to mainline, I hope it is helpful for you.

Regards,
Scott

2011/8/24 Gilles <[email protected]>:

Quoted 58 lines

Folks,

I am currently trying to add V4L2 SOC Camera support for an embedded board (Blackfin 527 EZKIT-V2). Trying to learn from the few existing examples and was wondering if anyone could shed some light on this:

More specifically, I'm looking at:

arch/sh/boards/mach-ap325rxa/setup.c

arch/arm/mach-mx3/mach-pcm037.c
drivers/media/video/mx3_camera.c

I have the feeling that mx3 appears to be incomplete (or untested?) because of this statement in

static int __devinit mx3_camera_probe(struct platform_device *pdev) {
 [...]
 soc_host              = &mx3_cam->soc_host;

Where mx3->soc_host appears to never be initialized since it's allocation (followed by a memzero).

Anyway, my question is: the ap325 board setup appears to do the job without a dedicated SOC driver. Am I reading this correctly or is there a SOC driver for the ap325 I'm not seeing?

This is all so very hard with the total lack of comments in the code as well as the convoluted Kconfig/makefiles.

I'd appreciate any help anyone is willing to offer. Even after reading soc-camera.txt and a few others I still don't know what is *really* necessary.

I've pretty much come to the conclusion that in order to add SOC support for camera on a board I need to:

1) add a I2C_BOARD_INFO entry with the camera I2C address (in the board specific setup based on the appropriate CONFIG_...)

2) add a soc_camera_link for the camera sensor with that I2C info.

[...]

)) Add the device in the board __init. In my case in arch/blackfin/mach-bf527/boards/ezkit.c in __init ezkit_init()

add a call to platform_add_device

I know I'm missiong a lot of pieces to this puzzle.
I'm seeing other boards allocate DMA regions first and then only add the camera if it succeeded.
Then I'm seeing the ap325 which creates TWO soc_camera_link (I'm assuming one is for the SOC driver which does not exist elsewhere?...)

Can anyone please shed some light on all this or point me to a SOC drivers for dummy document I may have missed???

I'd appreciate any input anyone is willing to lend.

Thanks,
Gilles
.

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

author
#3 lore raw

Scott,

A late echo. I am just now getting into the heart of this project and realize I missed your answer here from back in August. Just grabbed the trunk from the repo and trying to compile it.

I'm not sure I understand why it would work with one sensor driver and not another. I thought the whole point of an adapter driver was to separate the camera sensor functions from the hardware. I guess the reason why I ask is because I currently need to get it to work with the Micron MT9V022 (which has a sensor driver).

Thanks,
Gilles
.

Quoted 75 lines · Scott Jiang

Hi Gilles,

If you want to write a driver for blackfin, you can visit
http://blackfin.uclinux.org/ and find linux kernel repo url. I have written a blackfin bridge driver, vs6624 sensor driver and adv7183 decoder driver. You can reference vs6624 driver.
I didn't use soc camera framework because it can't support decoder well. These patch hasn't uploaded to mainline, I hope it is helpful for you.

Regards,
Scott

2011/8/24 Gilles <[email protected]>:

Quoted 49 lines

Folks,

I am currently trying to add V4L2 SOC Camera support for an embedded board (Blackfin 527 EZKIT-V2). Trying to learn from the few existing examples and was wondering if anyone could shed some light on this:

More specifically, I'm looking at:

arch/sh/boards/mach-ap325rxa/setup.c

arch/arm/mach-mx3/mach-pcm037.c
drivers/media/video/mx3_camera.c

I have the feeling that mx3 appears to be incomplete (or untested?) because of this statement in

static int __devinit mx3_camera_probe(struct platform_device *pdev) {
[...]
soc_host = &mx3_cam->soc_host;

Where mx3->soc_host appears to never be initialized since it's allocation (followed by a memzero).

Anyway, my question is: the ap325 board setup appears to do the job without a dedicated SOC driver. Am I reading this correctly or is there a SOC driver for the ap325 I'm not seeing?

This is all so very hard with the total lack of comments in the code as well as the convoluted Kconfig/makefiles.

I'd appreciate any help anyone is willing to offer. Even after reading soc-camera.txt and a few others I still don't know what is *really* necessary.

I've pretty much come to the conclusion that in order to add SOC support for camera on a board I need to:

1) add a I2C_BOARD_INFO entry with the camera I2C address (in the board specific setup based on the appropriate CONFIG_...)

2) add a soc_camera_link for the camera sensor with that I2C info.

[...]

)) Add the device in the board __init. In my case in arch/blackfin/mach-bf527/boards/ezkit.c in __init ezkit_init()

add a call to platform_add_device

I know I'm missiong a lot of pieces to this puzzle.
I'm seeing other boards allocate DMA regions first and then only add the camera if it succeeded.
Then I'm seeing the ap325 which creates TWO soc_camera_link (I'm assuming one is for the SOC driver which does not exist elsewhere?...)

Can anyone please shed some light on all this or point me to a SOC drivers for dummy document I may have missed???

I'd appreciate any input anyone is willing to lend.

Quoted 9 lines

Thanks,
Gilles
.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

2011/9/27 Gilles <[email protected]>:

Quoted 6 lines

Scott,

A late echo. I am just now getting into the heart of this project and realize I missed your answer here from back in August. Just grabbed the trunk from the repo and trying to compile it.

I'm not sure I understand why it would work with one sensor driver and not another. I thought the whole point of an adapter driver was to separate the camera sensor functions from the hardware. I guess the reason why I ask is because I currently need to get it to work with the Micron MT9V022 (which has a sensor driver).

If you prefer soc, you can convert my bridge driver to soc framework, but you need add some patches to soc if you want soc support decoder well. Guennadi Liakhovetski can give you more advice on this. If not, my bridge driver already supports sensor driver, vs6624 is an example. You just need care about the ops sensor driver must implement.