All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Mauro Carvalho Chehab" <m.chehab@samsung.com>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Frank Schäfer" <fschaefer.oss@googlemail.com>,
	"Hans Verkuil" <hans.verkuil@cisco.com>
Subject: Re: [PATCH 3/3] V4L2: em28xx: register a V4L2 clock source
Date: Wed, 28 Aug 2013 23:54:04 +0200	[thread overview]
Message-ID: <521E717C.6010602@gmail.com> (raw)
In-Reply-To: <1377696508-3190-4-git-send-email-g.liakhovetski@gmx.de>

Hi Guennadi,

On 08/28/2013 03:28 PM, Guennadi Liakhovetski wrote:
> Camera sensors usually require a master clock for data sampling. This patch
> registers such a clock source for em28xx cameras. This fixes the currently
> broken em28xx ov2640 camera support and can also be used by other camera
> sensors.
>
> Signed-off-by: Guennadi Liakhovetski<g.liakhovetski@gmx.de>
> ---
>
> Actually after thinking a bit more, it'd probably be better to register a
> clock only for the ov2640 based camera, not for all cameras. If all agree,
> I'll redo this.

Not sure, I'd assume it's better to have this clock for all the subdevs.
Currently there are only two sensors handled through regular subdev drivers
though.

>   drivers/media/usb/em28xx/em28xx-camera.c |   41 ++++++++++++++++++++++-------
>   drivers/media/usb/em28xx/em28xx-cards.c  |    3 ++
>   drivers/media/usb/em28xx/em28xx.h        |    1 +
>   3 files changed, 35 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c
> index 73cc50a..2f451e4 100644
> --- a/drivers/media/usb/em28xx/em28xx-camera.c
> +++ b/drivers/media/usb/em28xx/em28xx-camera.c
> @@ -22,6 +22,7 @@
>   #include<linux/i2c.h>
>   #include<media/soc_camera.h>
>   #include<media/mt9v011.h>
> +#include<media/v4l2-clk.h>
>   #include<media/v4l2-common.h>
>
>   #include "em28xx.h"
> @@ -325,13 +326,24 @@ int em28xx_detect_sensor(struct em28xx *dev)
>
>   int em28xx_init_camera(struct em28xx *dev)
>   {
> +	char clk_name[V4L2_SUBDEV_NAME_SIZE];
> +	struct i2c_client *client =&dev->i2c_client[dev->def_i2c_bus];
> +	struct i2c_adapter *adap =&dev->i2c_adap[dev->def_i2c_bus];
> +	int ret = 0;
> +
> +	v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
> +			  i2c_adapter_id(adap), client->addr);
> +	dev->clk = v4l2_clk_register_fixed(clk_name, "mclk", -EINVAL);

Or maybe we could also create even more easy to use helper function, e.g.

v4l2_clk_register_i2c_fixed(int adap_id, unsigned int i2c_addr,
				char *clk_name);

Then clk_name (hmm, actually it's the device name ?) would be filled
inside the helper ?

--
Regards,
Sylwester

  reply	other threads:[~2013-08-28 21:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 13:28 [PATCH 0/3] V4L2: fix em28xx ov2640 support Guennadi Liakhovetski
2013-08-28 13:28 ` [PATCH 1/3] V4L2: add v4l2-clock helpers to register and unregister a fixed-rate clock Guennadi Liakhovetski
2013-08-28 13:33   ` Laurent Pinchart
2013-08-28 14:49     ` Guennadi Liakhovetski
2013-08-28 13:28 ` [PATCH 2/3] V4L2: add a v4l2-clk helper macro to produce an I2C device ID Guennadi Liakhovetski
2013-08-28 13:35   ` Laurent Pinchart
2013-08-28 13:42     ` Guennadi Liakhovetski
2013-08-28 13:28 ` [PATCH 3/3] V4L2: em28xx: register a V4L2 clock source Guennadi Liakhovetski
2013-08-28 21:54   ` Sylwester Nawrocki [this message]
2013-09-02 18:40 ` [PATCH 0/3] V4L2: fix em28xx ov2640 support Frank Schäfer
2013-09-03  6:34   ` Guennadi Liakhovetski
2013-09-05 13:32     ` Guennadi Liakhovetski
2013-09-05 15:22     ` Frank Schäfer
2013-09-05 15:41       ` Mauro Carvalho Chehab
2013-09-05 15:57         ` Guennadi Liakhovetski
2013-09-09 17:27           ` Frank Schäfer
2013-09-09 17:30             ` Frank Schäfer

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=521E717C.6010602@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=fschaefer.oss@googlemail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=s.nawrocki@samsung.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.