Commit 2525fdcb authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 447dcc0c
...@@ -1110,18 +1110,18 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto) ...@@ -1110,18 +1110,18 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
ir_proto_packet[0] = 0x01; ir_proto_packet[0] = 0x01;
*rc_proto = RC_PROTO_BIT_RC6_MCE; *rc_proto = RC_PROTO_BIT_RC6_MCE;
} else if (*rc_proto & RC_PROTO_BIT_OTHER) { } else if (*rc_proto & RC_PROTO_BIT_IMON) {
dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
if (!pad_stabilize) if (!pad_stabilize)
dev_dbg(dev, "PAD stabilize functionality disabled\n"); dev_dbg(dev, "PAD stabilize functionality disabled\n");
/* ir_proto_packet[0] = 0x00; // already the default */ /* ir_proto_packet[0] = 0x00; // already the default */
*rc_proto = RC_PROTO_BIT_OTHER; *rc_proto = RC_PROTO_BIT_IMON;
} else { } else {
dev_warn(dev, "Unsupported IR protocol specified, overriding to iMON IR protocol\n"); dev_warn(dev, "Unsupported IR protocol specified, overriding to iMON IR protocol\n");
if (!pad_stabilize) if (!pad_stabilize)
dev_dbg(dev, "PAD stabilize functionality disabled\n"); dev_dbg(dev, "PAD stabilize functionality disabled\n");
/* ir_proto_packet[0] = 0x00; // already the default */ /* ir_proto_packet[0] = 0x00; // already the default */
*rc_proto = RC_PROTO_BIT_OTHER; *rc_proto = RC_PROTO_BIT_IMON;
} }
memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); 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,7 +1388,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
rel_x = buf[2]; rel_x = buf[2];
rel_y = buf[3]; rel_y = buf[3];
if (ictx->rc_proto == RC_PROTO_BIT_OTHER && pad_stabilize) { if (ictx->rc_proto == RC_PROTO_BIT_IMON && pad_stabilize) {
if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) { if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) {
dir = stabilize((int)rel_x, (int)rel_y, dir = stabilize((int)rel_x, (int)rel_y,
timeout, threshold); timeout, threshold);
...@@ -1455,7 +1455,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf) ...@@ -1455,7 +1455,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
buf[0] = 0x01; buf[0] = 0x01;
buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0; buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0;
if (ictx->rc_proto == RC_PROTO_BIT_OTHER && pad_stabilize) { if (ictx->rc_proto == RC_PROTO_BIT_IMON && pad_stabilize) {
dir = stabilize((int)rel_x, (int)rel_y, dir = stabilize((int)rel_x, (int)rel_y,
timeout, threshold); timeout, threshold);
if (!dir) { if (!dir) {
...@@ -1639,11 +1639,18 @@ static void imon_incoming_packet(struct imon_context *ictx, ...@@ -1639,11 +1639,18 @@ static void imon_incoming_packet(struct imon_context *ictx,
if (press_type == 0) if (press_type == 0)
rc_keyup(ictx->rdev); rc_keyup(ictx->rdev);
else { else {
if (ictx->rc_proto == RC_PROTO_BIT_RC6_MCE || enum rc_proto proto;
ictx->rc_proto == RC_PROTO_BIT_OTHER)
rc_keydown(ictx->rdev, if (ictx->rc_proto == RC_PROTO_BIT_RC6_MCE)
ictx->rc_proto == RC_PROTO_BIT_RC6_MCE ? RC_PROTO_RC6_MCE : RC_PROTO_OTHER, proto = RC_PROTO_RC6_MCE;
ictx->rc_scancode, ictx->rc_toggle); else if (ictx->rc_proto == RC_PROTO_BIT_IMON)
proto = RC_PROTO_IMON;
else
return;
rc_keydown(ictx->rdev, proto, ictx->rc_scancode,
ictx->rc_toggle);
spin_lock_irqsave(&ictx->kc_lock, flags); spin_lock_irqsave(&ictx->kc_lock, flags);
ictx->last_keycode = ictx->kc; ictx->last_keycode = ictx->kc;
spin_unlock_irqrestore(&ictx->kc_lock, flags); spin_unlock_irqrestore(&ictx->kc_lock, flags);
...@@ -1800,7 +1807,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx) ...@@ -1800,7 +1807,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
{ {
u8 ffdc_cfg_byte = ictx->usb_rx_buf[6]; u8 ffdc_cfg_byte = ictx->usb_rx_buf[6];
u8 detected_display_type = IMON_DISPLAY_TYPE_NONE; u8 detected_display_type = IMON_DISPLAY_TYPE_NONE;
u64 allowed_protos = RC_PROTO_BIT_OTHER; u64 allowed_protos = RC_PROTO_BIT_IMON;
switch (ffdc_cfg_byte) { switch (ffdc_cfg_byte) {
/* iMON Knob, no display, iMON IR + vol knob */ /* iMON Knob, no display, iMON IR + vol knob */
...@@ -1848,8 +1855,10 @@ static void imon_get_ffdc_type(struct imon_context *ictx) ...@@ -1848,8 +1855,10 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
default: default:
dev_info(ictx->dev, "Unknown 0xffdc device, defaulting to VFD and iMON IR"); dev_info(ictx->dev, "Unknown 0xffdc device, defaulting to VFD and iMON IR");
detected_display_type = IMON_DISPLAY_TYPE_VFD; detected_display_type = IMON_DISPLAY_TYPE_VFD;
/* We don't know which one it is, allow user to set the /*
* RC6 one from userspace if OTHER wasn't correct. */ * We don't know which one it is, allow user to set the
* RC6 one from userspace if IMON wasn't correct.
*/
allowed_protos |= RC_PROTO_BIT_RC6_MCE; allowed_protos |= RC_PROTO_BIT_RC6_MCE;
break; break;
} }
...@@ -1936,7 +1945,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) ...@@ -1936,7 +1945,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
rdev->priv = ictx; rdev->priv = ictx;
/* iMON PAD or MCE */ /* iMON PAD or MCE */
rdev->allowed_protocols = RC_PROTO_BIT_OTHER | RC_PROTO_BIT_RC6_MCE; rdev->allowed_protocols = RC_PROTO_BIT_IMON | RC_PROTO_BIT_RC6_MCE;
rdev->change_protocol = imon_ir_change_protocol; rdev->change_protocol = imon_ir_change_protocol;
rdev->driver_name = MOD_NAME; rdev->driver_name = MOD_NAME;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment