diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-22 12:26:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:40 -0500 |
commit | 7a6fbed650cc329ba7094af3278deaea0c80bd7b (patch) | |
tree | 535390179164a10681685e4ca531940bb3627719 /drivers/media/dvb | |
parent | 250fa674fdcaa64ba17cdb6d3ef0bdf2fa15af90 (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.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) | |||
168 | } | 168 | } |
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
171 | |||
172 | int 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 | ||
47 | int sms_board_setup(struct smscore_device_t *coredev); | 47 | int sms_board_setup(struct smscore_device_t *coredev); |
48 | 48 | ||
49 | int sms_board_power(struct smscore_device_t *coredev, int onoff); | ||
50 | |||
49 | extern struct usb_device_id smsusb_id_table[]; | 51 | extern 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 | |||
280 | static 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 | |||
290 | static 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 | ||
313 | static int smsdvb_hotplug(struct smscore_device_t *coredev, | 337 | static int smsdvb_hotplug(struct smscore_device_t *coredev, |