diff options
| author | Stefan Ringel <stefan.ringel@arcor.de> | 2010-05-23 14:29:25 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:22:03 -0400 |
| commit | f36cc0342df21fc6820b53cdfba3e98ee5943f46 (patch) | |
| tree | 5e52de3dbb51be6de4f43c8d194101334ebf3dee /drivers | |
| parent | 5a4b55e2c256d78fd86679ee00777c393c87c94a (diff) | |
V4L/DVB: tm6000: Add control to the power led
Turn power led off, if device is disconnected
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/tm6000/tm6000-cards.c | 19 | ||||
| -rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 13 |
2 files changed, 32 insertions, 0 deletions
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 22fbd75a551d..cedd9044022f 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c | |||
| @@ -912,6 +912,25 @@ static void tm6000_usb_disconnect(struct usb_interface *interface) | |||
| 912 | } | 912 | } |
| 913 | #endif | 913 | #endif |
| 914 | 914 | ||
| 915 | if (dev->gpio.power_led) { | ||
| 916 | switch (dev->model) { | ||
| 917 | case TM6010_BOARD_HAUPPAUGE_900H: | ||
| 918 | case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE: | ||
| 919 | case TM6010_BOARD_TWINHAN_TU501: | ||
| 920 | /* Power led off */ | ||
| 921 | tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, | ||
| 922 | dev->gpio.power_led, 0x01); | ||
| 923 | msleep(15); | ||
| 924 | break; | ||
| 925 | case TM6010_BOARD_BEHOLD_WANDER: | ||
| 926 | case TM6010_BOARD_BEHOLD_VOYAGER: | ||
| 927 | /* Power led off */ | ||
| 928 | tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, | ||
| 929 | dev->gpio.power_led, 0x00); | ||
| 930 | msleep(15); | ||
| 931 | break; | ||
| 932 | } | ||
| 933 | } | ||
| 915 | tm6000_v4l2_unregister(dev); | 934 | tm6000_v4l2_unregister(dev); |
| 916 | 935 | ||
| 917 | tm6000_i2c_unregister(dev); | 936 | tm6000_i2c_unregister(dev); |
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 65feb8cb421c..27f3f551b545 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c | |||
| @@ -339,6 +339,12 @@ int tm6000_init_analog_mode (struct tm6000_core *dev) | |||
| 339 | tm6000_set_standard (dev, &dev->norm); | 339 | tm6000_set_standard (dev, &dev->norm); |
| 340 | tm6000_set_audio_bitrate (dev,48000); | 340 | tm6000_set_audio_bitrate (dev,48000); |
| 341 | 341 | ||
| 342 | /* switch dvb led off */ | ||
| 343 | if (dev->gpio.dvb_led) { | ||
| 344 | tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, | ||
| 345 | dev->gpio.dvb_led, 0x01); | ||
| 346 | } | ||
| 347 | |||
| 342 | return 0; | 348 | return 0; |
| 343 | } | 349 | } |
| 344 | 350 | ||
| @@ -391,6 +397,13 @@ int tm6000_init_digital_mode (struct tm6000_core *dev) | |||
| 391 | tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); | 397 | tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); |
| 392 | msleep(100); | 398 | msleep(100); |
| 393 | } | 399 | } |
| 400 | |||
| 401 | /* switch dvb led on */ | ||
| 402 | if (dev->gpio.dvb_led) { | ||
| 403 | tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, | ||
| 404 | dev->gpio.dvb_led, 0x00); | ||
| 405 | } | ||
| 406 | |||
| 394 | return 0; | 407 | return 0; |
| 395 | } | 408 | } |
| 396 | 409 | ||
