On Thu, 15 Sep 2011, Scott Jiang wrote:

> accually this array is to convert mbus to pixformat. ppi supports any formats.

You mean, it doesn't distinguish formats? It just packs bytes in RAM 
exactly as it ready them from the bus, and doesn't support any formats 
natively, i.e., doesn't offer any data processing?

> Ideally it should contain all formats in v4l2, but it is enough at
> present for our platform.
> If I find someone needs more, I will add it.
> So return -EINVAL means this format is out of range, it can't be supported 
> now.

You might consider using

drivers/media/video/soc_mediabus.c

If your driver were using soc-camera, it could benefit from the 
dynamically built pixel translation table, see

drivers/media/video/soc_camera.c::soc_camera_init_user_formats()

and simpler examples like mx1_camera.c or more complex ones like 
sh_mobile_ceu_camera.c, pxa_camera.c or mx3_camera.c and the use of the 
soc_camera_xlate_by_fourcc() function in them.

> about default format, I think I can only call bcap_g_fmt_vid_cap in
> probe to get this info.
> Dose anybody have a better solution?

In soc-camera we just use .g_mbus_fmt() to get sensor's default format and 
see what we can produce from it for the user.

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

Reply via email to