diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-16 20:45:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:40 -0500 |
commit | 250fa674fdcaa64ba17cdb6d3ef0bdf2fa15af90 (patch) | |
tree | ae4e906bdca8b41e428d7043a94d74a8187f1e96 /drivers/media | |
parent | 3f7d99f65a044785804ef65b3588da0640ed1c37 (diff) |
V4L/DVB (9735): sms1xxx: turn off LEDs after initialization of Hauppauge WinTV MiniStick
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.c | 47 | ||||
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.h | 5 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsdvb.c | 2 |
3 files changed, 54 insertions, 0 deletions
diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index 4344efb3e858..8eccd33eac30 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c | |||
@@ -106,11 +106,21 @@ static struct sms_board sms_boards[] = { | |||
106 | .name = "Hauppauge WinTV MiniStick", | 106 | .name = "Hauppauge WinTV MiniStick", |
107 | .type = SMS_NOVA_B0, | 107 | .type = SMS_NOVA_B0, |
108 | .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", | 108 | .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", |
109 | .led_power = 26, | ||
110 | .led_lo = 27, | ||
111 | .led_hi = 28, | ||
109 | }, | 112 | }, |
110 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = { | 113 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = { |
111 | .name = "Hauppauge WinTV MiniCard", | 114 | .name = "Hauppauge WinTV MiniCard", |
112 | .type = SMS_NOVA_B0, | 115 | .type = SMS_NOVA_B0, |
113 | .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", | 116 | .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", |
117 | .lna_ctrl = 29, | ||
118 | }, | ||
119 | [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = { | ||
120 | .name = "Hauppauge WinTV MiniCard", | ||
121 | .type = SMS_NOVA_B0, | ||
122 | .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", | ||
123 | .lna_ctrl = 1, | ||
114 | }, | 124 | }, |
115 | }; | 125 | }; |
116 | 126 | ||
@@ -121,3 +131,40 @@ struct sms_board *sms_get_board(int id) | |||
121 | return &sms_boards[id]; | 131 | return &sms_boards[id]; |
122 | } | 132 | } |
123 | 133 | ||
134 | static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable) | ||
135 | { | ||
136 | int ret; | ||
137 | struct smscore_gpio_config gpioconfig = { | ||
138 | .direction = SMS_GPIO_DIRECTION_OUTPUT, | ||
139 | .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, | ||
140 | .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, | ||
141 | .outputslewrate = SMS_GPIO_OUTPUTSLEWRATE_FAST, | ||
142 | .outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA, | ||
143 | }; | ||
144 | |||
145 | if (pin == 0) | ||
146 | return -EINVAL; | ||
147 | |||
148 | ret = smscore_configure_gpio(coredev, pin, &gpioconfig); | ||
149 | |||
150 | if (ret < 0) | ||
151 | return ret; | ||
152 | |||
153 | return smscore_set_gpio(coredev, pin, enable); | ||
154 | } | ||
155 | |||
156 | int sms_board_setup(struct smscore_device_t *coredev) | ||
157 | { | ||
158 | int board_id = smscore_get_board_id(coredev); | ||
159 | struct sms_board *board = sms_get_board(board_id); | ||
160 | |||
161 | switch (board_id) { | ||
162 | case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: | ||
163 | /* turn off all LEDs */ | ||
164 | sms_set_gpio(coredev, board->led_power, 0); | ||
165 | sms_set_gpio(coredev, board->led_hi, 0); | ||
166 | sms_set_gpio(coredev, board->led_lo, 0); | ||
167 | break; | ||
168 | } | ||
169 | return 0; | ||
170 | } | ||
diff --git a/drivers/media/dvb/siano/sms-cards.h b/drivers/media/dvb/siano/sms-cards.h index 240d8b359d5a..25820909bf6d 100644 --- a/drivers/media/dvb/siano/sms-cards.h +++ b/drivers/media/dvb/siano/sms-cards.h | |||
@@ -37,10 +37,15 @@ | |||
37 | struct sms_board { | 37 | struct sms_board { |
38 | enum sms_device_type_st type; | 38 | enum sms_device_type_st type; |
39 | char *name, *fw[DEVICE_MODE_MAX]; | 39 | char *name, *fw[DEVICE_MODE_MAX]; |
40 | |||
41 | /* gpios */ | ||
42 | int led_power, led_hi, led_lo; | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | struct sms_board *sms_get_board(int id); | 45 | struct sms_board *sms_get_board(int id); |
43 | 46 | ||
47 | int sms_board_setup(struct smscore_device_t *coredev); | ||
48 | |||
44 | extern struct usb_device_id smsusb_id_table[]; | 49 | extern struct usb_device_id smsusb_id_table[]; |
45 | 50 | ||
46 | #endif /* __SMS_CARDS_H__ */ | 51 | #endif /* __SMS_CARDS_H__ */ |
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c index 8d490e133f35..592c28403c87 100644 --- a/drivers/media/dvb/siano/smsdvb.c +++ b/drivers/media/dvb/siano/smsdvb.c | |||
@@ -402,6 +402,8 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, | |||
402 | 402 | ||
403 | sms_info("success"); | 403 | sms_info("success"); |
404 | 404 | ||
405 | sms_board_setup(coredev); | ||
406 | |||
405 | return 0; | 407 | return 0; |
406 | 408 | ||
407 | client_error: | 409 | client_error: |