All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: video4linux-list@redhat.com
Subject: Re: [PATCH RFC] soc-camera: add API documentation
Date: Wed, 20 Aug 2008 22:29:13 +0200	[thread overview]
Message-ID: <874p5fzazq.fsf@free.fr> (raw)
In-Reply-To: <Pine.LNX.4.64.0808201138070.7589@axis700.grange> (Guennadi Liakhovetski's message of "Wed\, 20 Aug 2008 11\:40\:39 +0200 \(CEST\)")

Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:

> +Existing drivers
> +----------------
> +
> +Currently there are two host drivers in the mainline: pxa_camera.c for PXA27x
> +SoCs and sh_mobile_ceu_camera.c for SuperH SoCs, and four sensor drivers:
> +mt9m001.c, mt9m111.c, mt9v022.c and a generic soc_camera_platform.c driver.
> +Please, use these driver as examples when developing new ones.
                           ^
                           maybe an s here ?
> +Camera host API
> +---------------
> +
> +A host camera driver is registered using the
> +
> +soc_camera_host_register(struct soc_camera_host *);
> +
> +function. The host object can be initialized as follows:
> +
> +static struct soc_camera_host pxa_soc_camera_host = {
> +	.drv_name	= PXA_CAM_DRV_NAME,
> +	.ops		= &pxa_soc_camera_host_ops,
> +};
> +
> +All camera host methods are passed in a struct soc_camera_host_ops:
> +
> +static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
> +	.owner		= THIS_MODULE,
> +	.add		= pxa_camera_add_device,
> +	.remove		= pxa_camera_remove_device,
> +	.suspend	= pxa_camera_suspend,
> +	.resume		= pxa_camera_resume,
> +	.set_fmt_cap	= pxa_camera_set_fmt_cap,
> +	.try_fmt_cap	= pxa_camera_try_fmt_cap,
> +	.init_videobuf	= pxa_camera_init_videobuf,
> +	.reqbufs	= pxa_camera_reqbufs,
> +	.poll		= pxa_camera_poll,
> +	.querycap	= pxa_camera_querycap,
> +	.try_bus_param	= pxa_camera_try_bus_param,
> +	.set_bus_param	= pxa_camera_set_bus_param,
> +};
> +
> +.add and .remove methods are called when a sensor is attached to or detached
> +from the host, apart from performing host-internal tasks they shall also call
> +sensor driver's .init and .release methods respectively. .suspend and .resume
> +methods implement host's power-management functionality and its their
> +responsibility to call respective sensor's methods. .try_bus_param and
> +.set_bus_param are used to negotiate physical connection parameters between the
> +host and the sensor. .init_videobuf is called by soc-camera core when a
> +video-device is opened, further video-buffer management is implemented completely
> +by the specific camera host driver. The rest of the methods are called from
> +respective V4L2 operations.

Maybe a concrete example to help people with concepts of SoCs, hosts, host
driver, camera driver, and so on ...
Like (to be translated to correct english) :

---
Let's assume our hardware system is :
 - an Intel CPU, the PXA270, which does provide a hardware bus for camera
 - a camera chip, which is a Micron MT9M001 CMOS sensor
 - the wires connecting the camera chip (8 for data + 4 control) to the PXA270

The driver involved in camera management are :
 - the host driver, in pxa_camera.c, which handles any camera attached to the
 pxa270
 - the camera driver, in mt9m001.c, which interacts with the camera giving it
 orders to poweron/poweroff, choose output definition, ...
 - the glue binding the host driver to the camera driver (soc_camera.c)
---

Note that it may be only me, and my personnal obsession of real examples to
illustrate. I really like the explanation in that doc :)

--
Robert

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

  reply	other threads:[~2008-08-20 20:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20  9:40 [PATCH RFC] soc-camera: add API documentation Guennadi Liakhovetski
2008-08-20 20:29 ` Robert Jarzmik [this message]
2008-08-24 11:57 ` Robert Schwebel
2008-08-28 14:49   ` [PATCH v2] " Guennadi Liakhovetski
2008-08-28 18:58     ` Hans Verkuil
2008-08-29 12:17       ` Sakari Ailus
2008-08-29 13:43         ` Hans Verkuil
     [not found]           ` <20080829183420.1fcbfc11@mchehab.chehab.org>
2008-08-30  7:22             ` Jean-Francois Moine
     [not found]               ` <20080830070310.2ec060d7@mchehab.chehab.org>
2008-08-30 14:58                 ` Jean-Francois Moine
2008-08-30 19:41                   ` Hans Verkuil
2008-09-05 16:08           ` Sakari Ailus
2008-09-06 16:40             ` Hans Verkuil
2008-09-29  8:33               ` Interfaces for composite devices (was: Re: [PATCH v2] soc-camera: add API documentation) Sakari Ailus
2008-09-29  9:04                 ` Hans Verkuil
2008-08-29 18:16       ` [PATCH v3] soc-camera: add API documentation Guennadi Liakhovetski
2008-08-29 18:16         ` Hans Verkuil
2008-08-29 18:55           ` Guennadi Liakhovetski
2008-09-27 22:38       ` [PATCH v2] " Guennadi Liakhovetski
2008-09-29  9:25         ` Hans Verkuil
2008-09-29  9:45           ` Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874p5fzazq.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=g.liakhovetski@gmx.de \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.