diff options
author | Lukas Karas <lukas.karas@centrum.cz> | 2008-12-28 14:09:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 21:44:37 -0300 |
commit | 4a7581f084ce308a448f4940ed2c664e9e3d78a1 (patch) | |
tree | 6ebb4b8f8bfc41a938e111cd42c7377253d126c7 /drivers/media/video/gspca/m5602/m5602_s5k83a.c | |
parent | dc913258ffb3dd90d6bafdd9111565777b5aad08 (diff) | |
download | blackbird-op-linux-4a7581f084ce308a448f4940ed2c664e9e3d78a1.tar.gz blackbird-op-linux-4a7581f084ce308a448f4940ed2c664e9e3d78a1.zip |
V4L/DVB (11408): gspca - m5602-s5k83a: Add led support to the s5k83a sensor.
This patch toggles the led seen on many laptops having a m5602 connected
to a Samsung s5k83a sensor.
Signed-off-by: Lukas Karas <lukas.karas@centrum.cz>
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_s5k83a.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k83a.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c index 9bea347b9ef1..5ce69d74dac9 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c +++ b/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; +} |