summaryrefslogtreecommitdiff
path: root/drivers/media/video/gspca/m5602/m5602_ov9650.c
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2008-12-29 12:49:25 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 21:44:38 -0300
commit3d3ec926e98bc10c4c48ee7422aecdc335ab1222 (patch)
tree59011271e347e155ec64f3f7e577e370dd68d763 /drivers/media/video/gspca/m5602/m5602_ov9650.c
parent4a7581f084ce308a448f4940ed2c664e9e3d78a1 (diff)
downloadlwn-3d3ec926e98bc10c4c48ee7422aecdc335ab1222.tar.gz
lwn-3d3ec926e98bc10c4c48ee7422aecdc335ab1222.zip
V4L/DVB (11409): gspca - m5602-ov9650: Set the ov9650 sensor in soft sleep when inactive.
In order to save energy, put the sensor in soft sleep mode when not active Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_ov9650.c')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 76317e274bf4..bbf91356096c 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -147,8 +147,14 @@ int ov9650_start(struct sd *sd)
int i, err = 0;
struct cam *cam = &sd->gspca_dev.cam;
- for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++)
- err = m5602_write_bridge(sd, res_init_ov9650[i][0], res_init_ov9650[i][1]);
+ for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
+ if (res_init_ov9650[i][0] == BRIDGE)
+ err = m5602_write_bridge(sd, res_init_ov9650[i][1], res_init_ov9650[i][2]);
+ else if (res_init_ov9650[i][0] == SENSOR) {
+ u8 data = res_init_ov9650[i][2];
+ err = m5602_write_sensor(sd, res_init_ov9650[i][1], &data, 1);
+ }
+ }
if (err < 0)
return err;
@@ -217,6 +223,12 @@ int ov9650_start(struct sd *sd)
return err;
}
+int ov9650_stop(struct sd *sd)
+{
+ u8 data = OV9650_SOFT_SLEEP | OV9650_OUTPUT_DRIVE_2X;
+ return m5602_write_sensor(sd, OV9650_COM2, &data, 1);
+}
+
int ov9650_power_down(struct sd *sd)
{
int i, err = 0;