aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-03-07 05:55:38 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-21 11:13:15 -0400
commit2525fdcb6e8211ee9dbc270a7f882fbfb6433b55 (patch)
treed32c5e4f992e149f4c420e9d0455f0736e00b4ca
parent447dcc0cf12922fcda67731559dd970bde7b35a6 (diff)
media: imon: rename protocol from other to imon
This renames the protocol for the imon rc driver from other to imon, since it is now an known protocol. Although different name will show up in the sysfs protocol file, loading a keymap using existing ir-keytable versions still works. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/rc/imon.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 527920a59d99..1041c056854d 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1110,18 +1110,18 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
1110 dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); 1110 dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
1111 ir_proto_packet[0] = 0x01; 1111 ir_proto_packet[0] = 0x01;
1112 *rc_proto = RC_PROTO_BIT_RC6_MCE; 1112 *rc_proto = RC_PROTO_BIT_RC6_MCE;
1113 } else if (*rc_proto & RC_PROTO_BIT_OTHER) { 1113 } else if (*rc_proto & RC_PROTO_BIT_IMON) {
1114 dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); 1114 dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
1115 if (!pad_stabilize) 1115 if (!pad_stabilize)
1116 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1116 dev_dbg(dev, "PAD stabilize functionality disabled\n");
1117 /* ir_proto_packet[0] = 0x00; // already the default */ 1117 /* ir_proto_packet[0] = 0x00; // already the default */
1118 *rc_proto = RC_PROTO_BIT_OTHER; 1118 *rc_proto = RC_PROTO_BIT_IMON;
1119 } else { 1119 } else {
1120 dev_warn(dev, "Unsupported IR protocol specified, overriding to iMON IR protocol\n"); 1120 dev_warn(dev, "Unsupported IR protocol specified, overriding to iMON IR protocol\n");
1121 if (!pad_stabilize) 1121 if (!pad_stabilize)
1122 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1122 dev_dbg(dev, "PAD stabilize functionality disabled\n");
1123 /* ir_proto_packet[0] = 0x00; // already the default */ 1123 /* ir_proto_packet[0] = 0x00; // already the default */
1124 *rc_proto = RC_PROTO_BIT_OTHER; 1124 *rc_proto = RC_PROTO_BIT_IMON;
1125 } 1125 }
1126 1126
1127 memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); 1127 memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet));
@@ -1388,7 +1388,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
1388 rel_x = buf[2]; 1388 rel_x = buf[2];
1389 rel_y = buf[3]; 1389 rel_y = buf[3];
1390 1390
1391 if (ictx->rc_proto == RC_PROTO_BIT_OTHER && pad_stabilize) { 1391 if (ictx->rc_proto == RC_PROTO_BIT_IMON && pad_stabilize) {
1392 if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) { 1392 if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) {
1393 dir = stabilize((int)rel_x, (int)rel_y, 1393 dir = stabilize((int)rel_x, (int)rel_y,
1394 timeout, threshold); 1394 timeout, threshold);
@@ -1455,7 +1455,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
1455 buf[0] = 0x01; 1455 buf[0] = 0x01;
1456 buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0; 1456 buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0;
1457 1457
1458 if (ictx->rc_proto == RC_PROTO_BIT_OTHER && pad_stabilize) { 1458 if (ictx->rc_proto == RC_PROTO_BIT_IMON && pad_stabilize) {
1459 dir = stabilize((int)rel_x, (int)rel_y, 1459 dir = stabilize((int)rel_x, (int)rel_y,
1460 timeout, threshold); 1460 timeout, threshold);
1461 if (!dir) { 1461 if (!dir) {
@@ -1639,11 +1639,18 @@ static void imon_incoming_packet(struct imon_context *ictx,
1639 if (press_type == 0) 1639 if (press_type == 0)
1640 rc_keyup(ictx->rdev); 1640 rc_keyup(ictx->rdev);
1641 else { 1641 else {
1642 if (ictx->rc_proto == RC_PROTO_BIT_RC6_MCE || 1642 enum rc_proto proto;
1643 ictx->rc_proto == RC_PROTO_BIT_OTHER) 1643
1644 rc_keydown(ictx->rdev, 1644 if (ictx->rc_proto == RC_PROTO_BIT_RC6_MCE)
1645 ictx->rc_proto == RC_PROTO_BIT_RC6_MCE ? RC_PROTO_RC6_MCE : RC_PROTO_OTHER, 1645 proto = RC_PROTO_RC6_MCE;
1646 ictx->rc_scancode, ictx->rc_toggle); 1646 else if (ictx->rc_proto == RC_PROTO_BIT_IMON)
1647 proto = RC_PROTO_IMON;
1648 else
1649 return;
1650
1651 rc_keydown(ictx->rdev, proto, ictx->rc_scancode,
1652 ictx->rc_toggle);
1653
1647 spin_lock_irqsave(&ictx->kc_lock, flags); 1654 spin_lock_irqsave(&ictx->kc_lock, flags);
1648 ictx->last_keycode = ictx->kc; 1655 ictx->last_keycode = ictx->kc;
1649 spin_unlock_irqrestore(&ictx->kc_lock, flags); 1656 spin_unlock_irqrestore(&ictx->kc_lock, flags);
@@ -1800,7 +1807,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
1800{ 1807{
1801 u8 ffdc_cfg_byte = ictx->usb_rx_buf[6]; 1808 u8 ffdc_cfg_byte = ictx->usb_rx_buf[6];
1802 u8 detected_display_type = IMON_DISPLAY_TYPE_NONE; 1809 u8 detected_display_type = IMON_DISPLAY_TYPE_NONE;
1803 u64 allowed_protos = RC_PROTO_BIT_OTHER; 1810 u64 allowed_protos = RC_PROTO_BIT_IMON;
1804 1811
1805 switch (ffdc_cfg_byte) { 1812 switch (ffdc_cfg_byte) {
1806 /* iMON Knob, no display, iMON IR + vol knob */ 1813 /* iMON Knob, no display, iMON IR + vol knob */
@@ -1848,8 +1855,10 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
1848 default: 1855 default:
1849 dev_info(ictx->dev, "Unknown 0xffdc device, defaulting to VFD and iMON IR"); 1856 dev_info(ictx->dev, "Unknown 0xffdc device, defaulting to VFD and iMON IR");
1850 detected_display_type = IMON_DISPLAY_TYPE_VFD; 1857 detected_display_type = IMON_DISPLAY_TYPE_VFD;
1851 /* We don't know which one it is, allow user to set the 1858 /*
1852 * RC6 one from userspace if OTHER wasn't correct. */ 1859 * We don't know which one it is, allow user to set the
1860 * RC6 one from userspace if IMON wasn't correct.
1861 */
1853 allowed_protos |= RC_PROTO_BIT_RC6_MCE; 1862 allowed_protos |= RC_PROTO_BIT_RC6_MCE;
1854 break; 1863 break;
1855 } 1864 }
@@ -1936,7 +1945,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
1936 1945
1937 rdev->priv = ictx; 1946 rdev->priv = ictx;
1938 /* iMON PAD or MCE */ 1947 /* iMON PAD or MCE */
1939 rdev->allowed_protocols = RC_PROTO_BIT_OTHER | RC_PROTO_BIT_RC6_MCE; 1948 rdev->allowed_protocols = RC_PROTO_BIT_IMON | RC_PROTO_BIT_RC6_MCE;
1940 rdev->change_protocol = imon_ir_change_protocol; 1949 rdev->change_protocol = imon_ir_change_protocol;
1941 rdev->driver_name = MOD_NAME; 1950 rdev->driver_name = MOD_NAME;
1942 1951