Lines Matching +full:no +full:- +full:autorepeat
1 // SPDX-License-Identifier: GPL-2.0-only
23 MODULE_PARM_DESC(use_low_level_irq, "Use low-level triggered IRQ instead of edge triggered");
30 bool autorepeat; member
52 * Some 2-in-1s which use the soc_button_array driver have this ugly issue in
53 * their DSDT where the _LID method modifies the irq-type settings of the GPIOs
57 * problematic because when re-enabling the irq, which happens whenever _LID
59 * irq-type to IRQ_TYPE_LEVEL_LOW. Where as the gpio-keys driver programs the
61 * To work around this we don't set gpio_keys_button.gpio on these 2-in-1s,
69 * Acer Switch 10 SW5-012. _LID method messes with home- and
70 * power-button GPIO IRQ settings. When (re-)enabling the irq
72 * ones, leading to an irq-type of IRQ_TYPE_LEVEL_LOW |
77 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
81 /* Acer Switch V 10 SW5-017, same issue as Acer Switch 10 SW5-012. */
84 DMI_MATCH(DMI_PRODUCT_NAME, "SW5-017"),
89 * Acer One S1003. _LID method messes with power-button GPIO
90 * IRQ settings, leading to a non working power-button.
99 * Lenovo Yoga Tab2 1051F/1051L, something messes with the home-button
100 * IRQ settings, leading to a non working home-button.
134 bool autorepeat) in soc_button_device_create() argument
143 for (info = button_info; info->name; info++) in soc_button_device_create()
144 if (info->autorepeat == autorepeat) in soc_button_device_create()
147 gpio_keys_pdata = devm_kzalloc(&pdev->dev, in soc_button_device_create()
152 return ERR_PTR(-ENOMEM); in soc_button_device_create()
157 for (info = button_info; info->name; info++) { in soc_button_device_create()
158 if (info->autorepeat != autorepeat) in soc_button_device_create()
161 error = soc_button_lookup_gpio(&pdev->dev, info->acpi_index, &gpio, &irq); in soc_button_device_create()
165 * ignore -EPROBE_DEFER errors here. On some devices in soc_button_device_create()
172 * show up, therefore we ignore -EPROBE_DEFER. in soc_button_device_create()
178 if (!autorepeat && (use_low_level_irq || in soc_button_device_create()
182 gpio_keys[n_buttons].gpio = -ENOENT; in soc_button_device_create()
187 gpio_keys[n_buttons].type = info->event_type; in soc_button_device_create()
188 gpio_keys[n_buttons].code = info->event_code; in soc_button_device_create()
189 gpio_keys[n_buttons].active_low = info->active_low; in soc_button_device_create()
190 gpio_keys[n_buttons].desc = info->name; in soc_button_device_create()
191 gpio_keys[n_buttons].wakeup = info->wakeup; in soc_button_device_create()
198 error = -ENODEV; in soc_button_device_create()
202 gpio_keys_pdata->buttons = gpio_keys; in soc_button_device_create()
203 gpio_keys_pdata->nbuttons = n_buttons; in soc_button_device_create()
204 gpio_keys_pdata->rep = autorepeat; in soc_button_device_create()
206 pd = platform_device_register_resndata(&pdev->dev, "gpio-keys", in soc_button_device_create()
212 dev_err(&pdev->dev, in soc_button_device_create()
213 "failed registering gpio-keys: %d\n", error); in soc_button_device_create()
220 devm_kfree(&pdev->dev, gpio_keys_pdata); in soc_button_device_create()
226 if (obj->type != ACPI_TYPE_INTEGER) in soc_button_get_acpi_object_int()
227 return -1; in soc_button_get_acpi_object_int()
229 return obj->integer.value; in soc_button_get_acpi_object_int()
240 if (desc->type != ACPI_TYPE_PACKAGE || in soc_button_parse_btn_desc()
241 desc->package.count != 5 || in soc_button_parse_btn_desc()
243 soc_button_get_acpi_object_int(&desc->package.elements[0]) != 1 || in soc_button_parse_btn_desc()
245 soc_button_get_acpi_object_int(&desc->package.elements[2]) != in soc_button_parse_btn_desc()
248 return -ENODEV; in soc_button_parse_btn_desc()
251 info->event_type = EV_KEY; in soc_button_parse_btn_desc()
252 info->active_low = true; in soc_button_parse_btn_desc()
253 info->acpi_index = in soc_button_parse_btn_desc()
254 soc_button_get_acpi_object_int(&desc->package.elements[1]); in soc_button_parse_btn_desc()
255 upage = soc_button_get_acpi_object_int(&desc->package.elements[3]); in soc_button_parse_btn_desc()
256 usage = soc_button_get_acpi_object_int(&desc->package.elements[4]); in soc_button_parse_btn_desc()
259 * The UUID: fa6bd625-9ce8-470d-a2c7-b3ca36c4282e descriptors use HID in soc_button_parse_btn_desc()
269 info->name = "power"; in soc_button_parse_btn_desc()
270 info->event_code = KEY_POWER; in soc_button_parse_btn_desc()
271 info->wakeup = true; in soc_button_parse_btn_desc()
273 info->name = "rotation lock switch"; in soc_button_parse_btn_desc()
274 info->event_type = EV_SW; in soc_button_parse_btn_desc()
275 info->event_code = SW_ROTATE_LOCK; in soc_button_parse_btn_desc()
277 info->name = "home"; in soc_button_parse_btn_desc()
278 info->event_code = KEY_LEFTMETA; in soc_button_parse_btn_desc()
279 info->wakeup = true; in soc_button_parse_btn_desc()
281 info->name = "volume_up"; in soc_button_parse_btn_desc()
282 info->event_code = KEY_VOLUMEUP; in soc_button_parse_btn_desc()
283 info->autorepeat = true; in soc_button_parse_btn_desc()
285 info->name = "volume_down"; in soc_button_parse_btn_desc()
286 info->event_code = KEY_VOLUMEDOWN; in soc_button_parse_btn_desc()
287 info->autorepeat = true; in soc_button_parse_btn_desc()
290 info->acpi_index, upage, usage); in soc_button_parse_btn_desc()
291 info->name = "unknown"; in soc_button_parse_btn_desc()
292 info->event_code = KEY_RESERVED; in soc_button_parse_btn_desc()
298 /* ACPI0011 _DSD btns descriptors UUID: fa6bd625-9ce8-470d-a2c7-b3ca36c4282e */
311 int i, btn, collection_uid = -1; in soc_button_get_button_info()
317 return ERR_PTR(-ENODEV); in soc_button_get_button_info()
322 for (i = 0; (i + 1) < desc->package.count; i += 2) { in soc_button_get_button_info()
323 uuid = &desc->package.elements[i]; in soc_button_get_button_info()
325 if (uuid->type != ACPI_TYPE_BUFFER || in soc_button_get_button_info()
326 uuid->buffer.length != 16 || in soc_button_get_button_info()
327 desc->package.elements[i + 1].type != ACPI_TYPE_PACKAGE) { in soc_button_get_button_info()
331 if (memcmp(uuid->buffer.pointer, btns_desc_uuid, 16) == 0) { in soc_button_get_button_info()
332 btns_desc = &desc->package.elements[i + 1]; in soc_button_get_button_info()
339 button_info = ERR_PTR(-ENODEV); in soc_button_get_button_info()
344 el0 = &btns_desc->package.elements[0]; in soc_button_get_button_info()
345 if (el0->type == ACPI_TYPE_PACKAGE && in soc_button_get_button_info()
346 el0->package.count == 5 && in soc_button_get_button_info()
348 soc_button_get_acpi_object_int(&el0->package.elements[0]) == 0 && in soc_button_get_button_info()
350 soc_button_get_acpi_object_int(&el0->package.elements[2]) == 0) { in soc_button_get_button_info()
352 &el0->package.elements[1]); in soc_button_get_button_info()
354 if (collection_uid == -1) { in soc_button_get_button_info()
356 button_info = ERR_PTR(-ENODEV); in soc_button_get_button_info()
360 /* There are package.count - 1 buttons + 1 terminating empty entry */ in soc_button_get_button_info()
361 button_info = devm_kcalloc(dev, btns_desc->package.count, in soc_button_get_button_info()
364 button_info = ERR_PTR(-ENOMEM); in soc_button_get_button_info()
369 for (i = 1, btn = 0; i < btns_desc->package.count; i++, btn++) { in soc_button_get_button_info()
371 &btns_desc->package.elements[i], in soc_button_get_button_info()
374 button_info = ERR_PTR(-ENODEV); in soc_button_get_button_info()
391 if (priv->children[i]) in soc_button_remove()
392 platform_device_unregister(priv->children[i]); in soc_button_remove()
399 struct device *dev = &pdev->dev; in soc_button_probe()
408 if (device_data && device_data->check) { in soc_button_probe()
409 error = device_data->check(dev); in soc_button_probe()
414 if (device_data && device_data->button_info) { in soc_button_probe()
415 button_info = device_data->button_info; in soc_button_probe()
424 dev_dbg(dev, "no GPIO attached, ignoring...\n"); in soc_button_probe()
425 return -ENODEV; in soc_button_probe()
430 return -ENOMEM; in soc_button_probe()
438 if (error != -ENODEV) { in soc_button_probe()
445 priv->children[i] = pd; in soc_button_probe()
448 if (!priv->children[0] && !priv->children[1]) in soc_button_probe()
449 return -ENODEV; in soc_button_probe()
451 if (!device_data || !device_data->button_info) in soc_button_probe()
486 * the PNP0C40 info except that the home button is active-high.
532 oem_platform_rev = result->integer.value; in soc_device_check_MSHW0040()
542 return -ENODEV; in soc_device_check_MSHW0040()