Beispiel #1
0
static int mt_compute_slot(struct mt_device *td)
{
	__s32 quirks = td->mtclass->quirks;

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTID)
		return td->curdata.contactid;

	if (quirks & MT_QUIRK_CYPRESS)
		return cypress_compute_slot(td);

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTNUMBER)
		return td->num_received;

	return find_slot_from_contactid(td);
}
Beispiel #2
0
static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
{
	__s32 quirks = td->mtclass.quirks;

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTID)
		return td->curdata.contactid;

	if (quirks & MT_QUIRK_CYPRESS)
		return cypress_compute_slot(td);

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTNUMBER)
		return td->num_received;

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE)
		return td->curdata.contactid - 1;

	return input_mt_get_slot_by_key(input, td->curdata.contactid);
}
static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
{
	__s32 quirks = td->mtclass.quirks;

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTID)
		return td->curdata.contactid;

	if (quirks & MT_QUIRK_CYPRESS)
		return cypress_compute_slot(td);

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTNUMBER)
		return td->num_received;

	if (quirks & MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE)
		return td->curdata.contactid - 1;

	if (!show_mt) {
		/* manually compute slot */
		int i;
		int slot = -1;

		if (!td-> mouse_emulation_slot_states)
			return 0;

		for (i = 0; i < td->maxcontacts && slot < 0; i++)
		{
			if (td-> mouse_emulation_slot_states[i] == td->curdata.contactid)
				slot = i;
		}

		for (i = 0; i < td->maxcontacts && slot < 0; i++)
		{
			if (td-> mouse_emulation_slot_states[i] < 0)
				slot = i;
		}
		return slot;
	}
	return input_mt_get_slot_by_key(input, td->curdata.contactid);
}