From 1c63a34167b585f61c9fe7c9f998ee98bb5da5d9 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Nov 2008 20:45:42 -0500 Subject: sms1xxx: turn off LEDs after initialization of Hauppauge WinTV MiniStick From: Michael Krufky Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smsdvb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers/media/dvb/siano/smsdvb.c') diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index f2a6c6f9e..28bce9f85 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -411,6 +411,8 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, sms_info("success"); + sms_board_setup(coredev); + return 0; client_error: -- cgit v1.2.3 From 4a2ed0660fbb4d6312b79d4f822f9fc53e3696ea Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 22 Nov 2008 12:26:37 -0500 Subject: sms1xxx: enable power LED on Hauppauge WinTV MiniStick From: Michael Krufky Enable power LED while the frontend is in use. Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smsdvb.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'linux/drivers/media/dvb/siano/smsdvb.c') 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, -- cgit v1.2.3 From 050475e9486c0de3e3720f2e4a7dfdbe6796d980 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 22 Nov 2008 12:56:37 -0500 Subject: sms1xxx: fix invalid unc readings From: Michael Krufky Add function smsdvb_read_ucblocks to report uncorrectable error counts. Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smsdvb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'linux/drivers/media/dvb/siano/smsdvb.c') diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index 890a586b2..0c48d2c3d 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -60,6 +60,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) client->fe_snr = p->Stat.SNR; client->fe_ber = p->Stat.BER; + client->fe_unc = p->Stat.BERErrorCount; if (p->Stat.InBandPwr < -95) client->fe_signal_strength = 0; @@ -72,6 +73,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) client->fe_status = 0; client->fe_snr = client->fe_ber = + client->fe_unc = client->fe_signal_strength = 0; } @@ -217,6 +219,18 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) return rc; } +static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) +{ + struct smsdvb_client_t *client = + container_of(fe, struct smsdvb_client_t, frontend); + int rc = smsdvb_send_statistics_request(client); + + if (!rc) + *ucblocks = client->fe_unc; + + return rc; +} + static int smsdvb_get_tune_settings(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *tune) { @@ -332,6 +346,7 @@ 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, + .read_ucblocks = smsdvb_read_ucblocks, .init = smsdvb_init, .sleep = smsdvb_sleep, -- cgit v1.2.3 From 7026808ec63b0f4aa67bc7d067510957924dcbb7 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 22 Nov 2008 13:32:19 -0500 Subject: sms1xxx: enable signal quality indicator LEDs on Hauppauge WinTV MiniStick From: Michael Krufky Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smsdvb.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/dvb/siano/smsdvb.c') diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index 0c48d2c3d..bbc87fe2e 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -167,8 +167,18 @@ static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) struct SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ, DVBT_BDA_CONTROL_MSG_ID, HIF_TASK, sizeof(struct SmsMsgHdr_ST), 0 }; - return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), - &client->stat_done); + int ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), + &client->stat_done); + if (ret < 0) + return ret; + + if (client->fe_status & FE_HAS_LOCK) + sms_board_led_feedback(client->coredev, + (client->fe_unc == 0) ? + SMS_LED_HI : SMS_LED_LO); + else + sms_board_led_feedback(client->coredev, SMS_LED_OFF); + return ret; } static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) @@ -309,6 +319,7 @@ static int smsdvb_sleep(struct dvb_frontend *fe) struct smsdvb_client_t *client = container_of(fe, struct smsdvb_client_t, frontend); + sms_board_led_feedback(client->coredev, SMS_LED_OFF); sms_board_power(client->coredev, 0); return 0; -- cgit v1.2.3