aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/mceusb.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-10-28 23:07:39 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-20 11:11:05 -0500
commit6f6c625d32852ab2fbfd131ba9a1e5d55ff8032c (patch)
tree3ac94bdc7ec69372a12c7e2ad8ab66507cca4059 /drivers/media/IR/mceusb.c
parent798174ab6257dc2ba2ee91e242e21491c3922355 (diff)
[media] mceusb: add support for Conexant Hybrid TV RDU253S
Another multi-function Conexant device. Interface 0 is IR, though on this model, TX isn't wired up at all, so I've mixed in support for models without TX (and verified that lircd says TX isn't supported when trying to send w/this device). Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/mceusb.c')
-rw-r--r--drivers/media/IR/mceusb.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 9dce684fd231..e453c6bc0c68 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -146,6 +146,7 @@ enum mceusb_model_type {
146 MCE_GEN3, 146 MCE_GEN3,
147 MCE_GEN2_TX_INV, 147 MCE_GEN2_TX_INV,
148 POLARIS_EVK, 148 POLARIS_EVK,
149 CX_HYBRID_TV,
149}; 150};
150 151
151struct mceusb_model { 152struct mceusb_model {
@@ -154,6 +155,7 @@ struct mceusb_model {
154 u32 mce_gen3:1; 155 u32 mce_gen3:1;
155 u32 tx_mask_inverted:1; 156 u32 tx_mask_inverted:1;
156 u32 is_polaris:1; 157 u32 is_polaris:1;
158 u32 no_tx:1;
157 159
158 const char *rc_map; /* Allow specify a per-board map */ 160 const char *rc_map; /* Allow specify a per-board map */
159 const char *name; /* per-board name */ 161 const char *name; /* per-board name */
@@ -183,7 +185,12 @@ static const struct mceusb_model mceusb_model[] = {
183 * to allow testing it 185 * to allow testing it
184 */ 186 */
185 .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, 187 .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW,
186 .name = "cx231xx MCE IR", 188 .name = "Conexant Hybrid TV (cx231xx) MCE IR",
189 },
190 [CX_HYBRID_TV] = {
191 .is_polaris = 1,
192 .no_tx = 1, /* tx isn't wired up at all */
193 .name = "Conexant Hybrid TV (cx231xx) MCE IR",
187 }, 194 },
188}; 195};
189 196
@@ -292,9 +299,12 @@ static struct usb_device_id mceusb_dev_table[] = {
292 { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) }, 299 { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) },
293 /* TiVo PC IR Receiver */ 300 /* TiVo PC IR Receiver */
294 { USB_DEVICE(VENDOR_TIVO, 0x2000) }, 301 { USB_DEVICE(VENDOR_TIVO, 0x2000) },
295 /* Conexant SDK */ 302 /* Conexant Hybrid TV "Shelby" Polaris SDK */
296 { USB_DEVICE(VENDOR_CONEXANT, 0x58a1), 303 { USB_DEVICE(VENDOR_CONEXANT, 0x58a1),
297 .driver_info = POLARIS_EVK }, 304 .driver_info = POLARIS_EVK },
305 /* Conexant Hybrid TV RDU253S Polaris */
306 { USB_DEVICE(VENDOR_CONEXANT, 0x58a5),
307 .driver_info = CX_HYBRID_TV },
298 /* Terminating entry */ 308 /* Terminating entry */
299 { } 309 { }
300}; 310};
@@ -334,6 +344,7 @@ struct mceusb_dev {
334 u32 connected:1; 344 u32 connected:1;
335 u32 tx_mask_inverted:1; 345 u32 tx_mask_inverted:1;
336 u32 microsoft_gen1:1; 346 u32 microsoft_gen1:1;
347 u32 no_tx:1;
337 } flags; 348 } flags;
338 349
339 /* transmit support */ 350 /* transmit support */
@@ -724,7 +735,7 @@ out:
724 return ret ? ret : n; 735 return ret ? ret : n;
725} 736}
726 737
727/* Sets active IR outputs -- mce devices typically (all?) have two */ 738/* Sets active IR outputs -- mce devices typically have two */
728static int mceusb_set_tx_mask(void *priv, u32 mask) 739static int mceusb_set_tx_mask(void *priv, u32 mask)
729{ 740{
730 struct mceusb_dev *ir = priv; 741 struct mceusb_dev *ir = priv;
@@ -984,9 +995,11 @@ static void mceusb_get_parameters(struct mceusb_dev *ir)
984 mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ)); 995 mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ));
985 mce_sync_in(ir, NULL, maxp); 996 mce_sync_in(ir, NULL, maxp);
986 997
987 /* get the transmitter bitmask */ 998 if (!ir->flags.no_tx) {
988 mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK)); 999 /* get the transmitter bitmask */
989 mce_sync_in(ir, NULL, maxp); 1000 mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK));
1001 mce_sync_in(ir, NULL, maxp);
1002 }
990 1003
991 /* get receiver timeout value */ 1004 /* get receiver timeout value */
992 mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT)); 1005 mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT));
@@ -1035,9 +1048,11 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
1035 props->priv = ir; 1048 props->priv = ir;
1036 props->driver_type = RC_DRIVER_IR_RAW; 1049 props->driver_type = RC_DRIVER_IR_RAW;
1037 props->allowed_protos = IR_TYPE_ALL; 1050 props->allowed_protos = IR_TYPE_ALL;
1038 props->s_tx_mask = mceusb_set_tx_mask; 1051 if (!ir->flags.no_tx) {
1039 props->s_tx_carrier = mceusb_set_tx_carrier; 1052 props->s_tx_mask = mceusb_set_tx_mask;
1040 props->tx_ir = mceusb_tx_ir; 1053 props->s_tx_carrier = mceusb_set_tx_carrier;
1054 props->tx_ir = mceusb_tx_ir;
1055 }
1041 1056
1042 ir->props = props; 1057 ir->props = props;
1043 1058
@@ -1151,6 +1166,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
1151 ir->len_in = maxp; 1166 ir->len_in = maxp;
1152 ir->flags.microsoft_gen1 = is_microsoft_gen1; 1167 ir->flags.microsoft_gen1 = is_microsoft_gen1;
1153 ir->flags.tx_mask_inverted = tx_mask_inverted; 1168 ir->flags.tx_mask_inverted = tx_mask_inverted;
1169 ir->flags.no_tx = mceusb_model[model].no_tx;
1154 ir->model = model; 1170 ir->model = model;
1155 1171
1156 init_ir_raw_event(&ir->rawir); 1172 init_ir_raw_event(&ir->rawir);
@@ -1191,7 +1207,8 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
1191 1207
1192 mceusb_get_parameters(ir); 1208 mceusb_get_parameters(ir);
1193 1209
1194 mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK); 1210 if (!ir->flags.no_tx)
1211 mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK);
1195 1212
1196 usb_set_intfdata(intf, ir); 1213 usb_set_intfdata(intf, ir);
1197 1214