On Thu, 11 Apr 2013, Barry Song wrote: > 2013/4/11 Guennadi Liakhovetski <g.liakhovetski@xxxxxx>: > > Hi Barry > > > > On Thu, 11 Apr 2013, Barry Song wrote: > > > >> Hi Guennadi, > >> > >> > Typical video devices like camera sensors require an external clock source. > >> > Many such devices cannot even access their hardware registers without a > >> > running clock. These clock sources should be controlled by their consumers. > >> > This should be performed, using the generic clock framework. Unfortunately > >> > so far only very few systems have been ported to that framework. This patch > >> > adds a set of temporary helpers, mimicking the generic clock API, to V4L2. > >> > Platforms, adopting the clock API, should switch to using it. Eventually > >> > this temporary API should be removed. > >> > >> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx> > >> > --- > >> > >> for your patch 1/8 and 3/8, i think it makes a lot of senses to let > >> the object manages its own clock by itself. > >> is it possible for us to implement v4l2-clk.c directly as an instance > >> of standard clk driver for those systems which don't have generic > >> clock, and remove the V4L2 clock APIs like v4l2_clk_get, > >> v4l2_clk_enable from the first day? i mean v4l2-clk.c becomes a temp > >> and fake clock controller driver. finally, after people have > >> generically clk, remove it. > > > > I don't think you can force-enable the CFF on systems, that don't support > > it, e.g. PXA. > > yes. we can. clock is only a framework, has it any limitation to > implement a driver instance on any platform? So, you enable CFF, it provides its own clk_* implementation like clk_get_rate() etc. Now, PXA already has it defined in arch/arm/mach-pxa/clock.c. Don't think this is going to fly. Thanks Guennadi > people have tried to move to common clk and generic framework for a > long time, now you still try to provide a v4l2 specific clock APIs, it > just makes v4l2 unacceptable and much complex. > > > > > Thanks > > Guennadi > > > >> > v8: Updated both (C) dates > >> > >> > drivers/media/v4l2-core/Makefile | 2 +- > >> > drivers/media/v4l2-core/v4l2-clk.c | 177 ++++++++++++++++++++++++++++++++++++ > >> > include/media/v4l2-clk.h | 54 +++++++++++ > >> > 3 files changed, 232 insertions(+), 1 deletions(-) > >> > create mode 100644 drivers/media/v4l2-core/v4l2-clk.c > >> > create mode 100644 include/media/v4l2-clk.h > >> > >> > diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile > >> > index aa50c46..628c630 100644 > >> > --- a/drivers/media/v4l2-core/Makefile > >> > +++ b/drivers/media/v4l2-core/Makefile > >> > @@ -5,7 +5,7 @@ > >> > tuner-objs := tuner-core.o > >> > >> > videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \ > >> > - v4l2-event.o v4l2-ctrls.o v4l2-subdev.o > >> > + v4l2-event.o v4l2-ctrls.o v4l2-subdev.o v4l2-clk.o > >> > ifeq ($(CONFIG_COMPAT),y) > >> > videodev-objs += v4l2-compat-ioctl32.o > >> > endif > >> > diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c > >> > new file mode 100644 > >> > index 0000000..d7cc13e > >> > --- /dev/null > >> > +++ b/drivers/media/v4l2-core/v4l2-clk.c > >> > @@ -0,0 +1,177 @@ > >> > >> -barry > > -barry > --- 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html