Lines Matching +full:product +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0
23 input_dev->name = "Test input device"; in input_test_init()
24 input_dev->id.bustype = BUS_VIRTUAL; in input_test_init()
25 input_dev->id.vendor = 1; in input_test_init()
26 input_dev->id.product = 1; in input_test_init()
27 input_dev->id.version = 1; in input_test_init()
37 test->priv = input_dev; in input_test_init()
44 struct input_dev *input_dev = test->priv; in input_test_exit()
54 struct input_dev *input_dev = test->priv; in input_test_polling()
56 /* Must fail because a poll handler has not been set-up yet */ in input_test_polling()
57 KUNIT_ASSERT_EQ(test, input_get_poll_interval(input_dev), -EINVAL); in input_test_polling()
63 /* Must succeed because poll handler was set-up and poll interval set */ in input_test_polling()
70 struct input_dev *input_dev = test->priv; in input_test_timestamp()
89 struct input_dev *input_dev = test->priv; in input_test_match_device_id()
90 struct input_device_id id = { 0 }; in input_test_match_device_id() local
93 * Must match when the input device bus, vendor, product, version in input_test_match_device_id()
97 id.flags = INPUT_DEVICE_ID_MATCH_BUS; in input_test_match_device_id()
98 id.bustype = BUS_VIRTUAL; in input_test_match_device_id()
99 KUNIT_ASSERT_TRUE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
101 id.bustype = BUS_I2C; in input_test_match_device_id()
102 KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
104 id.flags = INPUT_DEVICE_ID_MATCH_VENDOR; in input_test_match_device_id()
105 id.vendor = 1; in input_test_match_device_id()
106 KUNIT_ASSERT_TRUE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
108 id.vendor = 2; in input_test_match_device_id()
109 KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
111 id.flags = INPUT_DEVICE_ID_MATCH_PRODUCT; in input_test_match_device_id()
112 id.product = 1; in input_test_match_device_id()
113 KUNIT_ASSERT_TRUE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
115 id.product = 2; in input_test_match_device_id()
116 KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
118 id.flags = INPUT_DEVICE_ID_MATCH_VERSION; in input_test_match_device_id()
119 id.version = 1; in input_test_match_device_id()
120 KUNIT_ASSERT_TRUE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
122 id.version = 2; in input_test_match_device_id()
123 KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
125 id.flags = INPUT_DEVICE_ID_MATCH_EVBIT; in input_test_match_device_id()
126 __set_bit(EV_KEY, id.evbit); in input_test_match_device_id()
127 KUNIT_ASSERT_TRUE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
129 __set_bit(EV_ABS, id.evbit); in input_test_match_device_id()
130 KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id)); in input_test_match_device_id()
135 struct input_dev *input_dev = test->priv; in input_test_grab()
139 struct input_device_id id; in input_test_grab() local
143 handler.id_table = &id; in input_test_grab()
146 handle.name = dev_name(&input_dev->dev); in input_test_grab()
152 test_handle.name = dev_name(&input_dev->dev); in input_test_grab()
155 KUNIT_ASSERT_EQ(test, res, -EBUSY); in input_test_grab()