summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2008-12-28 18:09:21 +0100
committerErik Andr?n <erik.andren@gmail.com>2008-12-28 18:09:21 +0100
commit8f763cc5d1872ca6139a91bb7d32dd04c1a70a5c (patch)
treed197e08de8488522c0bb4277056f89f87998bd28 /linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
parent45a8275182889ae4860fd2e7b5f8fe07efcf7567 (diff)
downloadmediapointer-dvb-s2-8f763cc5d1872ca6139a91bb7d32dd04c1a70a5c.tar.gz
mediapointer-dvb-s2-8f763cc5d1872ca6139a91bb7d32dd04c1a70a5c.tar.bz2
gspca - m5602-s5k83a: Add led support to the s5k83a sensor.
From: Lukas Karas <lukas.karas@centrum.cz> This patch toggles the led seen on many laptops having a m5602 connected to a Samsung s5k83a sensor. Priority: normal Signed-off-by: Lukas Karas <lukas.karas@centrum.cz> Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c')
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index 9bea347b9..5ce69d74d 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
@@ -108,6 +108,16 @@ int s5k83a_init(struct sd *sd)
return (err < 0) ? err : 0;
}
+int s5k83a_start(struct sd *sd)
+{
+ return s5k83a_set_led_indication(sd, 1);
+}
+
+int s5k83a_stop(struct sd *sd)
+{
+ return s5k83a_set_led_indication(sd, 0);
+}
+
int s5k83a_power_down(struct sd *sd)
{
return 0;
@@ -345,3 +355,22 @@ int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
return err;
}
+
+int s5k83a_set_led_indication(struct sd *sd, u8 val)
+{
+ int err = 0;
+ u8 data[1];
+
+ err = m5602_read_bridge(sd, M5602_XB_GPIO_DAT, data);
+ if (err < 0)
+ return err;
+
+ if (val)
+ data[0] = data[0] | S5K83A_GPIO_LED_MASK;
+ else
+ data[0] = data[0] & ~S5K83A_GPIO_LED_MASK;
+
+ err = m5602_write_bridge(sd, M5602_XB_GPIO_DAT, data[0]);
+
+ return (err < 0) ? err : 0;
+}