Commit dac1c142 authored by Kyle Williams's avatar Kyle Williams Committed by Commit Bot

[Peripheral] Flare as primary OOBE display

This CL allows the Flare touch device to be recognized as a primary
touch device on during the OOBE screen, by white-listing it for OOBE use
and blacklisting additional unused interfaces.

Bug: b/124839645
Test: manually
Signed-off-by: default avatarKyle Williams <kdgwill@chromium.org>
Change-Id: I5f088c27b43eb2a3a3efb69c2ea2b4bb42800b81
Reviewed-on: https://chromium-review.googlesource.com/c/1479635Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Reviewed-by: default avatarMalay Keshav <malaykeshav@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634415}
parent 4b6b4dc9
...@@ -32,7 +32,7 @@ bool TouchSupportAvailable(const display::Display& display) { ...@@ -32,7 +32,7 @@ bool TouchSupportAvailable(const display::Display& display) {
} }
// TODO(felixe): More context at crbug.com/738885 // TODO(felixe): More context at crbug.com/738885
const uint16_t kDeviceIds[] = {0x0457, 0x266e}; const uint16_t kDeviceIds[] = {0x0457, 0x266e, 0x222a};
// Returns true if |vendor_id| is a valid vendor id that may be made the primary // Returns true if |vendor_id| is a valid vendor id that may be made the primary
// display. // display.
......
...@@ -118,6 +118,24 @@ void AssignBitset(const unsigned long* src, ...@@ -118,6 +118,24 @@ void AssignBitset(const unsigned long* src,
memset(&dst[src_len], 0, (dst_len - src_len) * sizeof(unsigned long)); memset(&dst[src_len], 0, (dst_len - src_len) * sizeof(unsigned long));
} }
bool IsBlacklistedAbsoluteMouseDevice(const input_id& id) {
static constexpr struct {
uint16_t vid;
uint16_t pid;
} kUSBLegacyBlackListedDevices[] = {
{0x222a, 0x0001}, // ILITEK ILITEK-TP
};
for (size_t i = 0; i < base::size(kUSBLegacyBlackListedDevices); ++i) {
if (id.vendor == kUSBLegacyBlackListedDevices[i].vid &&
id.product == kUSBLegacyBlackListedDevices[i].pid) {
return true;
}
}
return false;
}
} // namespace } // namespace
EventDeviceInfo::EventDeviceInfo() { EventDeviceInfo::EventDeviceInfo() {
...@@ -506,7 +524,8 @@ EventDeviceInfo::ProbeLegacyAbsoluteDevice() const { ...@@ -506,7 +524,8 @@ EventDeviceInfo::ProbeLegacyAbsoluteDevice() const {
return LegacyAbsoluteDeviceType::TOUCHSCREEN; return LegacyAbsoluteDeviceType::TOUCHSCREEN;
// ABS_Z mitigation for extra device on some Elo devices. // ABS_Z mitigation for extra device on some Elo devices.
if (HasKeyEvent(BTN_LEFT) && !HasAbsEvent(ABS_Z)) if (HasKeyEvent(BTN_LEFT) && !HasAbsEvent(ABS_Z) &&
!IsBlacklistedAbsoluteMouseDevice(input_id_))
return LegacyAbsoluteDeviceType::TOUCHSCREEN; return LegacyAbsoluteDeviceType::TOUCHSCREEN;
return LegacyAbsoluteDeviceType::NONE; return LegacyAbsoluteDeviceType::NONE;
......
...@@ -225,4 +225,32 @@ TEST(EventDeviceInfoTest, HammerTouchpad) { ...@@ -225,4 +225,32 @@ TEST(EventDeviceInfoTest, HammerTouchpad) {
EXPECT_EQ(ui::InputDeviceType::INPUT_DEVICE_INTERNAL, devinfo.device_type()); EXPECT_EQ(ui::InputDeviceType::INPUT_DEVICE_INTERNAL, devinfo.device_type());
} }
TEST(EventDeviceInfoTest, IllitekTP_Mouse) {
EventDeviceInfo devinfo;
EXPECT_TRUE(CapabilitiesToDeviceInfo(kIlitekTP_Mouse, &devinfo));
EXPECT_FALSE(devinfo.HasKeyboard());
EXPECT_FALSE(devinfo.HasMouse());
EXPECT_FALSE(devinfo.HasTouchpad());
EXPECT_FALSE(devinfo.HasTouchscreen());
EXPECT_FALSE(devinfo.HasTablet());
EXPECT_FALSE(devinfo.HasGamepad());
EXPECT_EQ(ui::InputDeviceType::INPUT_DEVICE_USB, devinfo.device_type());
}
TEST(EventDeviceInfoTest, IllitekTP) {
EventDeviceInfo devinfo;
EXPECT_TRUE(CapabilitiesToDeviceInfo(kIlitekTP, &devinfo));
EXPECT_FALSE(devinfo.HasKeyboard());
EXPECT_FALSE(devinfo.HasMouse());
EXPECT_FALSE(devinfo.HasTouchpad());
EXPECT_TRUE(devinfo.HasTouchscreen());
EXPECT_FALSE(devinfo.HasTablet());
EXPECT_FALSE(devinfo.HasGamepad());
EXPECT_EQ(ui::InputDeviceType::INPUT_DEVICE_USB, devinfo.device_type());
}
} // namespace ui } // namespace ui
...@@ -700,6 +700,66 @@ const DeviceCapabilities kHammerTouchpad = { ...@@ -700,6 +700,66 @@ const DeviceCapabilities kHammerTouchpad = {
base::size(kHammerTouchpadAbsAxes), base::size(kHammerTouchpadAbsAxes),
}; };
// Captured from Logitech Tap touch controller
const DeviceAbsoluteAxis kIlitekTP_Mouse_AbsAxes[] = {
{ABS_X, {0, 0, 16384, 0, 0, 76}},
{ABS_Y, {0, 0, 9600, 0, 0, 71}},
};
const DeviceCapabilities kIlitekTP_Mouse = {
/* path */
"/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1.4/"
"1-2.1.1.4.2/1-2.1.1.4.2:1.1/0003:222A:0001.0015/input/input19/event9",
/* name */ "ILITEK ILITEK-TP",
/* phys */ "usb-0000:00:14.0-2.1.1.4.2/input1",
/* uniq */ "",
/* bustype */ "0003",
/* vendor */ "222a",
/* product */ "0001",
/* version */ "0110",
/* prop */ "0",
/* ev */ "1b",
/* key */ "1f0000 0 0 0 0",
/* rel */ "0",
/* abs */ "3",
/* msc */ "10",
/* sw */ "0",
/* led */ "0",
/* ff */ "0",
kIlitekTP_Mouse_AbsAxes,
base::size(kIlitekTP_Mouse_AbsAxes),
};
const DeviceAbsoluteAxis kIlitekTPAbsAxes[] = {
{ABS_X, {0, 0, 16384, 0, 0, 76}},
{ABS_Y, {0, 0, 9600, 0, 0, 71}},
{ABS_MT_SLOT, {0, 0, 9, 0, 0, 0}},
{ABS_MT_POSITION_X, {0, 0, 16384, 0, 0, 76}},
{ABS_MT_POSITION_Y, {0, 0, 9600, 0, 0, 71}},
{ABS_MT_TRACKING_ID, {0, 0, 65535, 0, 0, 0}},
};
const DeviceCapabilities kIlitekTP = {
/* path */
"/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1.4/"
"1-2.1.1.4.2/1-2.1.1.4.2:1.0/0003:222A:0001.0014/input/input18/event8",
/* name */ "ILITEK ILITEK-TP",
/* phys */ "usb-0000:00:14.0-2.1.1.4.2/input0",
/* uniq */ "",
/* bustype */ "0003",
/* vendor */ "222a",
/* product */ "0001",
/* version */ "0110",
/* prop */ "2",
/* ev */ "1b",
/* key */ "400 0 0 0 0 0",
/* rel */ "0",
/* abs */ "260800000000003",
/* msc */ "20",
/* sw */ "0",
/* led */ "0",
/* ff */ "0",
kIlitekTPAbsAxes,
base::size(kIlitekTPAbsAxes),
};
// NB: Please use the capture_device_capabilities.py script to add more // NB: Please use the capture_device_capabilities.py script to add more
// test data here. This will help ensure the data matches what the kernel // test data here. This will help ensure the data matches what the kernel
// reports for a real device and is entered correctly. // reports for a real device and is entered correctly.
......
...@@ -79,6 +79,8 @@ extern const DeviceCapabilities kWilsonBeachActiveStylus; ...@@ -79,6 +79,8 @@ extern const DeviceCapabilities kWilsonBeachActiveStylus;
extern const DeviceCapabilities kEveStylus; extern const DeviceCapabilities kEveStylus;
extern const DeviceCapabilities kHammerKeyboard; extern const DeviceCapabilities kHammerKeyboard;
extern const DeviceCapabilities kHammerTouchpad; extern const DeviceCapabilities kHammerTouchpad;
extern const DeviceCapabilities kIlitekTP_Mouse;
extern const DeviceCapabilities kIlitekTP;
} // namspace ui } // namspace ui
......
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