@@ -92,7 +92,6 @@ struct imon_usb_dev_descr {
92
92
__u16 flags ;
93
93
#define IMON_NO_FLAGS 0
94
94
#define IMON_NEED_20MS_PKT_DELAY 1
95
- #define IMON_IR_RAW 2
96
95
struct imon_panel_key_table key_table [];
97
96
};
98
97
@@ -123,12 +122,6 @@ struct imon_context {
123
122
unsigned char usb_tx_buf [8 ];
124
123
unsigned int send_packet_delay ;
125
124
126
- struct rx_data {
127
- int count ; /* length of 0 or 1 sequence */
128
- int prev_bit ; /* logic level of sequence */
129
- int initial_space ; /* initial space flag */
130
- } rx ;
131
-
132
125
struct tx_t {
133
126
unsigned char data_buf [35 ]; /* user data buffer */
134
127
struct completion finished ; /* wait for write to finish */
@@ -331,10 +324,6 @@ static const struct imon_usb_dev_descr imon_DH102 = {
331
324
}
332
325
};
333
326
334
- static const struct imon_usb_dev_descr imon_ir_raw = {
335
- .flags = IMON_IR_RAW ,
336
- };
337
-
338
327
/*
339
328
* USB Device ID for iMON USB Control Boards
340
329
*
@@ -418,18 +407,6 @@ static const struct usb_device_id imon_usb_id_table[] = {
418
407
/* device specifics unknown */
419
408
{ USB_DEVICE (0x15c2 , 0x0046 ),
420
409
.driver_info = (unsigned long )& imon_default_table },
421
- /* TriGem iMON (IR only) -- TG_iMON.inf */
422
- { USB_DEVICE (0x0aa8 , 0x8001 ),
423
- .driver_info = (unsigned long )& imon_ir_raw },
424
- /* SoundGraph iMON (IR only) -- sg_imon.inf */
425
- { USB_DEVICE (0x04e8 , 0xff30 ),
426
- .driver_info = (unsigned long )& imon_ir_raw },
427
- /* SoundGraph iMON VFD (IR & VFD) -- iMON_VFD.inf */
428
- { USB_DEVICE (0x0aa8 , 0xffda ),
429
- .driver_info = (unsigned long )& imon_ir_raw },
430
- /* SoundGraph iMON SS (IR & VFD) -- iMON_SS.inf */
431
- { USB_DEVICE (0x15c2 , 0xffda ),
432
- .driver_info = (unsigned long )& imon_ir_raw },
433
410
{}
434
411
};
435
412
@@ -1572,91 +1549,8 @@ static int imon_parse_press_type(struct imon_context *ictx,
1572
1549
/*
1573
1550
* Process the incoming packet
1574
1551
*/
1575
- /*
1576
- * Convert bit count to time duration (in us) and submit
1577
- * the value to lirc_dev.
1578
- */
1579
- static void submit_data (struct imon_context * context )
1580
- {
1581
- DEFINE_IR_RAW_EVENT (ev );
1582
-
1583
- ev .pulse = context -> rx .prev_bit ;
1584
- ev .duration = US_TO_NS (context -> rx .count * BIT_DURATION );
1585
- ir_raw_event_store_with_filter (context -> rdev , & ev );
1586
- }
1587
-
1588
- /*
1589
- * Process the incoming packet
1590
- */
1591
- static void imon_incoming_ir_raw (struct imon_context * context ,
1552
+ static void imon_incoming_packet (struct imon_context * ictx ,
1592
1553
struct urb * urb , int intf )
1593
- {
1594
- int len = urb -> actual_length ;
1595
- unsigned char * buf = urb -> transfer_buffer ;
1596
- struct device * dev = context -> dev ;
1597
- int octet , bit ;
1598
- unsigned char mask ;
1599
-
1600
- if (len != 8 ) {
1601
- dev_warn (dev , "imon %s: invalid incoming packet size (len = %d, intf%d)\n" ,
1602
- __func__ , len , intf );
1603
- return ;
1604
- }
1605
-
1606
- if (debug )
1607
- dev_info (dev , "raw packet: %*ph\n" , len , buf );
1608
- /*
1609
- * Translate received data to pulse and space lengths.
1610
- * Received data is active low, i.e. pulses are 0 and
1611
- * spaces are 1.
1612
- *
1613
- * My original algorithm was essentially similar to
1614
- * Changwoo Ryu's with the exception that he switched
1615
- * the incoming bits to active high and also fed an
1616
- * initial space to LIRC at the start of a new sequence
1617
- * if the previous bit was a pulse.
1618
- *
1619
- * I've decided to adopt his algorithm.
1620
- */
1621
-
1622
- if (buf [7 ] == 1 && context -> rx .initial_space ) {
1623
- /* LIRC requires a leading space */
1624
- context -> rx .prev_bit = 0 ;
1625
- context -> rx .count = 4 ;
1626
- submit_data (context );
1627
- context -> rx .count = 0 ;
1628
- }
1629
-
1630
- for (octet = 0 ; octet < 5 ; ++ octet ) {
1631
- mask = 0x80 ;
1632
- for (bit = 0 ; bit < 8 ; ++ bit ) {
1633
- int curr_bit = !(buf [octet ] & mask );
1634
-
1635
- if (curr_bit != context -> rx .prev_bit ) {
1636
- if (context -> rx .count ) {
1637
- submit_data (context );
1638
- context -> rx .count = 0 ;
1639
- }
1640
- context -> rx .prev_bit = curr_bit ;
1641
- }
1642
- ++ context -> rx .count ;
1643
- mask >>= 1 ;
1644
- }
1645
- }
1646
-
1647
- if (buf [7 ] == 10 ) {
1648
- if (context -> rx .count ) {
1649
- submit_data (context );
1650
- context -> rx .count = 0 ;
1651
- }
1652
- context -> rx .initial_space = context -> rx .prev_bit ;
1653
- }
1654
-
1655
- ir_raw_event_handle (context -> rdev );
1656
- }
1657
-
1658
- static void imon_incoming_scancode (struct imon_context * ictx ,
1659
- struct urb * urb , int intf )
1660
1554
{
1661
1555
int len = urb -> actual_length ;
1662
1556
unsigned char * buf = urb -> transfer_buffer ;
@@ -1839,10 +1733,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
1839
1733
break ;
1840
1734
1841
1735
case 0 :
1842
- if (ictx -> rdev -> driver_type == RC_DRIVER_IR_RAW )
1843
- imon_incoming_ir_raw (ictx , urb , intfnum );
1844
- else
1845
- imon_incoming_scancode (ictx , urb , intfnum );
1736
+ imon_incoming_packet (ictx , urb , intfnum );
1846
1737
break ;
1847
1738
1848
1739
default :
@@ -1883,10 +1774,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
1883
1774
break ;
1884
1775
1885
1776
case 0 :
1886
- if (ictx -> rdev -> driver_type == RC_DRIVER_IR_RAW )
1887
- imon_incoming_ir_raw (ictx , urb , intfnum );
1888
- else
1889
- imon_incoming_scancode (ictx , urb , intfnum );
1777
+ imon_incoming_packet (ictx , urb , intfnum );
1890
1778
break ;
1891
1779
1892
1780
default :
@@ -2000,14 +1888,11 @@ static void imon_set_display_type(struct imon_context *ictx)
2000
1888
case 0x0041 :
2001
1889
case 0x0042 :
2002
1890
case 0x0043 :
2003
- case 0x8001 :
2004
- case 0xff30 :
2005
1891
configured_display_type = IMON_DISPLAY_TYPE_NONE ;
2006
1892
ictx -> display_supported = false;
2007
1893
break ;
2008
1894
case 0x0036 :
2009
1895
case 0x0044 :
2010
- case 0xffda :
2011
1896
default :
2012
1897
configured_display_type = IMON_DISPLAY_TYPE_VFD ;
2013
1898
break ;
@@ -2032,8 +1917,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
2032
1917
static const unsigned char fp_packet [] = {
2033
1918
0x40 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x88 };
2034
1919
2035
- rdev = rc_allocate_device (ictx -> dev_descr -> flags & IMON_IR_RAW ?
2036
- RC_DRIVER_IR_RAW : RC_DRIVER_SCANCODE );
1920
+ rdev = rc_allocate_device (RC_DRIVER_SCANCODE );
2037
1921
if (!rdev ) {
2038
1922
dev_err (ictx -> dev , "remote control dev allocation failed\n" );
2039
1923
goto out ;
@@ -2051,12 +1935,8 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
2051
1935
rdev -> dev .parent = ictx -> dev ;
2052
1936
2053
1937
rdev -> priv = ictx ;
2054
- if (ictx -> dev_descr -> flags & IMON_IR_RAW )
2055
- rdev -> allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER ;
2056
- else
2057
- /* iMON PAD or MCE */
2058
- rdev -> allowed_protocols = RC_PROTO_BIT_OTHER |
2059
- RC_PROTO_BIT_RC6_MCE ;
1938
+ /* iMON PAD or MCE */
1939
+ rdev -> allowed_protocols = RC_PROTO_BIT_OTHER | RC_PROTO_BIT_RC6_MCE ;
2060
1940
rdev -> change_protocol = imon_ir_change_protocol ;
2061
1941
rdev -> driver_name = MOD_NAME ;
2062
1942
@@ -2074,8 +1954,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
2074
1954
2075
1955
imon_set_display_type (ictx );
2076
1956
2077
- if (ictx -> rc_proto == RC_PROTO_BIT_RC6_MCE ||
2078
- ictx -> dev_descr -> flags & IMON_IR_RAW )
1957
+ if (ictx -> rc_proto == RC_PROTO_BIT_RC6_MCE )
2079
1958
rdev -> map_name = RC_MAP_IMON_MCE ;
2080
1959
else
2081
1960
rdev -> map_name = RC_MAP_IMON_PAD ;
0 commit comments