diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-22 12:26:37 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-22 12:26:37 -0500 |
commit | 4a2ed0660fbb4d6312b79d4f822f9fc53e3696ea (patch) | |
tree | ad25c33c741212ffcf89c26f22094761fab802c6 /linux/drivers/media/dvb | |
parent | 1c63a34167b585f61c9fe7c9f998ee98bb5da5d9 (diff) | |
download | mediapointer-dvb-s2-4a2ed0660fbb4d6312b79d4f822f9fc53e3696ea.tar.gz mediapointer-dvb-s2-4a2ed0660fbb4d6312b79d4f822f9fc53e3696ea.tar.bz2 |
sms1xxx: enable power LED on Hauppauge WinTV MiniStick
From: Michael Krufky <mkrufky@linuxtv.org>
Enable power LED while the frontend is in use.
Priority: normal
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/siano/sms-cards.c | 15 | ||||
-rw-r--r-- | linux/drivers/media/dvb/siano/sms-cards.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/siano/smsdvb.c | 24 |
3 files changed, 41 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index eb4bb03b2..f6b12da67 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -161,3 +161,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/linux/drivers/media/dvb/siano/sms-cards.h b/linux/drivers/media/dvb/siano/sms-cards.h index 25820909b..f68da5d77 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.h +++ b/linux/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/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index 28bce9f85..890a586b2 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -276,6 +276,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; } @@ -311,6 +332,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, |