aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-11-22 12:26:37 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:40 -0500
commit7a6fbed650cc329ba7094af3278deaea0c80bd7b (patch)
tree535390179164a10681685e4ca531940bb3627719 /drivers/media/dvb
parent250fa674fdcaa64ba17cdb6d3ef0bdf2fa15af90 (diff)
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>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/siano/sms-cards.c15
-rw-r--r--drivers/media/dvb/siano/sms-cards.h2
-rw-r--r--drivers/media/dvb/siano/smsdvb.c24
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)
168 } 168 }
169 return 0; 169 return 0;
170} 170}
171
172int sms_board_power(struct smscore_device_t *coredev, int onoff)
173{
174 int board_id = smscore_get_board_id(coredev);
175 struct sms_board *board = sms_get_board(board_id);
176
177 switch (board_id) {
178 case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
179 /* power LED */
180 sms_set_gpio(coredev,
181 board->led_power, onoff ? 1 : 0);
182 break;
183 }
184 return 0;
185}
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);
46 46
47int sms_board_setup(struct smscore_device_t *coredev); 47int sms_board_setup(struct smscore_device_t *coredev);
48 48
49int sms_board_power(struct smscore_device_t *coredev, int onoff);
50
49extern struct usb_device_id smsusb_id_table[]; 51extern struct usb_device_id smsusb_id_table[];
50 52
51#endif /* __SMS_CARDS_H__ */ 53#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,
273 /* todo: */ 273 /* todo: */
274 memcpy(fep, &client->fe_params, 274 memcpy(fep, &client->fe_params,
275 sizeof(struct dvb_frontend_parameters)); 275 sizeof(struct dvb_frontend_parameters));
276
277 return 0;
278}
279
280static int smsdvb_init(struct dvb_frontend *fe)
281{
282 struct smsdvb_client_t *client =
283 container_of(fe, struct smsdvb_client_t, frontend);
284
285 sms_board_power(client->coredev, 1);
286
287 return 0;
288}
289
290static int smsdvb_sleep(struct dvb_frontend *fe)
291{
292 struct smsdvb_client_t *client =
293 container_of(fe, struct smsdvb_client_t, frontend);
294
295 sms_board_power(client->coredev, 0);
296
276 return 0; 297 return 0;
277} 298}
278 299
@@ -308,6 +329,9 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
308 .read_ber = smsdvb_read_ber, 329 .read_ber = smsdvb_read_ber,
309 .read_signal_strength = smsdvb_read_signal_strength, 330 .read_signal_strength = smsdvb_read_signal_strength,
310 .read_snr = smsdvb_read_snr, 331 .read_snr = smsdvb_read_snr,
332
333 .init = smsdvb_init,
334 .sleep = smsdvb_sleep,
311}; 335};
312 336
313static int smsdvb_hotplug(struct smscore_device_t *coredev, 337static int smsdvb_hotplug(struct smscore_device_t *coredev,