Skip to content

Commit

Permalink
[media] mmp-camera: Don't power up the sensor on resume
Browse files Browse the repository at this point in the history
We still need to power up the controller to avoid unsightly self-immolation
should something try to access its registers, but the sensor can stay
powered down unless the camera was actually operating at suspend time.
This gets rid of the camera LED flash on resume, fixing OLPC bug #11644.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jonathan Corbet authored and Mauro Carvalho Chehab committed Mar 20, 2012
1 parent f2354dd commit 4a0abfa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/media/video/marvell-ccic/mmp-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,21 @@ static struct mmp_camera *mmpcam_find_device(struct platform_device *pdev)
/*
* Power control.
*/
static void mmpcam_power_up_ctlr(struct mmp_camera *cam)
{
iowrite32(0x3f, cam->power_regs + REG_CCIC_DCGCR);
iowrite32(0x3805b, cam->power_regs + REG_CCIC_CRCR);
mdelay(1);
}

static void mmpcam_power_up(struct mcam_camera *mcam)
{
struct mmp_camera *cam = mcam_to_cam(mcam);
struct mmp_camera_platform_data *pdata;
/*
* Turn on power and clocks to the controller.
*/
iowrite32(0x3f, cam->power_regs + REG_CCIC_DCGCR);
iowrite32(0x3805b, cam->power_regs + REG_CCIC_CRCR);
mdelay(1);
mmpcam_power_up_ctlr(cam);
/*
* Provide power to the sensor.
*/
Expand Down Expand Up @@ -335,7 +340,7 @@ static int mmpcam_resume(struct platform_device *pdev)
* touch a register even if nothing was active before; trust
* me, it's better this way.
*/
mmpcam_power_up(&cam->mcam);
mmpcam_power_up_ctlr(cam);
return mccic_resume(&cam->mcam);
}

Expand Down

0 comments on commit 4a0abfa

Please sign in to comment.