On Thu, 16 Jun 2011 10:37:37 +0800
Kassey Lee <[email protected]> wrote:
> > +static void mmpcam_power_down(struct mcam_camera *mcam)
> > +{
> > + struct mmp_camera *cam = mcam_to_cam(mcam);
> > + struct mmp_camera_platform_data *pdata;
> > +/*
> > + * Turn off clocks and set reset lines
> > + */
> > + iowrite32(0, cam->power_regs + REG_CCIC_DCGCR);
> > + iowrite32(0, cam->power_regs + REG_CCIC_CRCR);
> > +/*
> > + * Shut down the sensor.
> > + */
> > + pdata = cam->pdev->dev.platform_data;
> > + gpio_set_value(pdata->sensor_power_gpio, 0);
> > + gpio_set_value(pdata->sensor_reset_gpio, 0);
> it is better to have a callback function to controller sensor power on/off.
> and place the callback function in board.c
This is an interesting question, actually. The problem is that board
files are on their way out; it's going to be very hard to get any more
board files into the mainline going forward.
The mmp-camera driver does depend on a board file, but I've been careful
to restrict things to basic platform data which can just as easily be put
into a device tree. Power management callbacks don't really qualify.
So it seems that we need to figure out a way to push this kind of
pin/power management down into the sensor-specific code. Looking at the
subdev stuff, it looks like a bit of thought has been put into that
direction; there's the s_io_pin_config() callback to describe pins to the
sensor. But it's almost entirely unused.
There is no "power up/down" callback, currently. We could ponder on
whether one should be added, or whether this should be handled through the
existing power management code somehow. I honestly don't know what the
best answer is on this one - will have to do some digging. Suggestions
welcome.
Thanks,
jon
--
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