Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76f1ef42 authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab
Browse files

[media] rc/imon: default to key mode instead of mouse mode



My initial thinking was that we should default to mouse mode, so people
could use the mouse function to click on something on a login screen,
but a lot of systems where a remote is useful automatically log in a
user and launch a media center application, some of which hide the
mouse, which can be confusing to users if they punch buttons on the
remote and don't see any feedback. Plus, first and foremost, its a
remote, so lets default to being a remote, and only toggle into mouse
mode when the user explicitly asks for it. As a nice side-effect, this
actually simplifies some of the code a fair bit...

Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5aad7242
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -988,7 +988,6 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
	int retval;
	struct imon_context *ictx = rc->priv;
	struct device *dev = ictx->dev;
	bool pad_mouse;
	unsigned char ir_proto_packet[] = {
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };

@@ -1000,29 +999,20 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
	case RC_TYPE_RC6:
		dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
		ir_proto_packet[0] = 0x01;
		pad_mouse = false;
		break;
	case RC_TYPE_UNKNOWN:
	case RC_TYPE_OTHER:
		dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
		if (pad_stabilize && !nomouse)
			pad_mouse = true;
		else {
		if (!pad_stabilize)
			dev_dbg(dev, "PAD stabilize functionality disabled\n");
			pad_mouse = false;
		}
		/* ir_proto_packet[0] = 0x00; // already the default */
		rc_type = RC_TYPE_OTHER;
		break;
	default:
		dev_warn(dev, "Unsupported IR protocol specified, overriding "
			 "to iMON IR protocol\n");
		if (pad_stabilize && !nomouse)
			pad_mouse = true;
		else {
		if (!pad_stabilize)
			dev_dbg(dev, "PAD stabilize functionality disabled\n");
			pad_mouse = false;
		}
		/* ir_proto_packet[0] = 0x00; // already the default */
		rc_type = RC_TYPE_OTHER;
		break;
@@ -1035,7 +1025,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
		goto out;

	ictx->rc_type = rc_type;
	ictx->pad_mouse = pad_mouse;
	ictx->pad_mouse = false;

out:
	return retval;
@@ -1517,7 +1507,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
			spin_unlock_irqrestore(&ictx->kc_lock, flags);
			return;
		} else {
			ictx->pad_mouse = 0;
			ictx->pad_mouse = false;
			dev_dbg(dev, "mouse mode disabled, passing key value\n");
		}
	}