aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/siano
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/siano')
-rw-r--r--drivers/media/dvb/siano/sms-cards.c47
-rw-r--r--drivers/media/dvb/siano/sms-cards.h5
-rw-r--r--drivers/media/dvb/siano/smsdvb.c2
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
134static 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
156int 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 @@
37struct sms_board { 37struct 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
42struct sms_board *sms_get_board(int id); 45struct sms_board *sms_get_board(int id);
43 46
47int sms_board_setup(struct smscore_device_t *coredev);
48
44extern struct usb_device_id smsusb_id_table[]; 49extern 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
407client_error: 409client_error: