diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-22 18:26:37 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 20:53:40 +0100 |
commit | 7a6fbed650cc329ba7094af3278deaea0c80bd7b (patch) | |
tree | 535390179164a10681685e4ca531940bb3627719 | |
parent | V4L/DVB (9735): sms1xxx: turn off LEDs after initialization of Hauppauge WinT... (diff) | |
download | linux-7a6fbed650cc329ba7094af3278deaea0c80bd7b.tar.xz linux-7a6fbed650cc329ba7094af3278deaea0c80bd7b.zip |
V4L/DVB (9736): sms1xxx: enable power LED on Hauppauge WinTV MiniStick
Enable power LED while the frontend is in use.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.c | 15 | ||||
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsdvb.c | 24 |
3 files changed, 41 insertions, 0 deletions
diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index 8eccd33eac30..e17eb35877fc 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c @@ -168,3 +168,18 @@ int sms_board_setup(struct smscore_device_t *coredev) } return 0; } + +int sms_board_power(struct smscore_device_t *coredev, int onoff) +{ + int board_id = smscore_get_board_id(coredev); + struct sms_board *board = sms_get_board(board_id); + + switch (board_id) { + case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: + /* power LED */ + sms_set_gpio(coredev, + board->led_power, onoff ? 1 : 0); + break; + } + return 0; +} diff --git a/drivers/media/dvb/siano/sms-cards.h b/drivers/media/dvb/siano/sms-cards.h index 25820909bf6d..f68da5d77998 100644 --- a/drivers/media/dvb/siano/sms-cards.h +++ b/drivers/media/dvb/siano/sms-cards.h @@ -46,6 +46,8 @@ struct sms_board *sms_get_board(int id); int sms_board_setup(struct smscore_device_t *coredev); +int sms_board_power(struct smscore_device_t *coredev, int onoff); + extern struct usb_device_id smsusb_id_table[]; #endif /* __SMS_CARDS_H__ */ diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c index 592c28403c87..54144a374946 100644 --- a/drivers/media/dvb/siano/smsdvb.c +++ b/drivers/media/dvb/siano/smsdvb.c @@ -273,6 +273,27 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe, /* todo: */ memcpy(fep, &client->fe_params, sizeof(struct dvb_frontend_parameters)); + + return 0; +} + +static int smsdvb_init(struct dvb_frontend *fe) +{ + struct smsdvb_client_t *client = + container_of(fe, struct smsdvb_client_t, frontend); + + sms_board_power(client->coredev, 1); + + return 0; +} + +static int smsdvb_sleep(struct dvb_frontend *fe) +{ + struct smsdvb_client_t *client = + container_of(fe, struct smsdvb_client_t, frontend); + + sms_board_power(client->coredev, 0); + return 0; } @@ -308,6 +329,9 @@ static struct dvb_frontend_ops smsdvb_fe_ops = { .read_ber = smsdvb_read_ber, .read_signal_strength = smsdvb_read_signal_strength, .read_snr = smsdvb_read_snr, + + .init = smsdvb_init, + .sleep = smsdvb_sleep, }; static int smsdvb_hotplug(struct smscore_device_t *coredev, |