Commit 4a0abfaa authored by Jonathan Corbet's avatar Jonathan Corbet Committed by Mauro Carvalho Chehab

[media] mmp-camera: Don't power up the sensor on resume

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: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f2354dd1
...@@ -106,6 +106,13 @@ static struct mmp_camera *mmpcam_find_device(struct platform_device *pdev) ...@@ -106,6 +106,13 @@ static struct mmp_camera *mmpcam_find_device(struct platform_device *pdev)
/* /*
* Power control. * 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) static void mmpcam_power_up(struct mcam_camera *mcam)
{ {
struct mmp_camera *cam = mcam_to_cam(mcam); struct mmp_camera *cam = mcam_to_cam(mcam);
...@@ -113,9 +120,7 @@ static void mmpcam_power_up(struct mcam_camera *mcam) ...@@ -113,9 +120,7 @@ static void mmpcam_power_up(struct mcam_camera *mcam)
/* /*
* Turn on power and clocks to the controller. * Turn on power and clocks to the controller.
*/ */
iowrite32(0x3f, cam->power_regs + REG_CCIC_DCGCR); mmpcam_power_up_ctlr(cam);
iowrite32(0x3805b, cam->power_regs + REG_CCIC_CRCR);
mdelay(1);
/* /*
* Provide power to the sensor. * Provide power to the sensor.
*/ */
...@@ -335,7 +340,7 @@ static int mmpcam_resume(struct platform_device *pdev) ...@@ -335,7 +340,7 @@ static int mmpcam_resume(struct platform_device *pdev)
* touch a register even if nothing was active before; trust * touch a register even if nothing was active before; trust
* me, it's better this way. * me, it's better this way.
*/ */
mmpcam_power_up(&cam->mcam); mmpcam_power_up_ctlr(cam);
return mccic_resume(&cam->mcam); return mccic_resume(&cam->mcam);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment