Lines Matching +full:button +full:-
1 // SPDX-License-Identifier: GPL-2.0-only
3 * CPCAP Power Button Input Driver
17 #include <linux/mfd/motorola-cpcap.h>
30 struct cpcap_power_button *button = _button; in powerbutton_irq() local
33 val = cpcap_sense_virq(button->regmap, irq); in powerbutton_irq()
35 dev_err(button->dev, "irq read failed: %d", val); in powerbutton_irq()
39 pm_wakeup_event(button->dev, 0); in powerbutton_irq()
40 input_report_key(button->idev, KEY_POWER, val); in powerbutton_irq()
41 input_sync(button->idev); in powerbutton_irq()
48 struct cpcap_power_button *button; in cpcap_power_button_probe() local
56 button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL); in cpcap_power_button_probe()
57 if (!button) in cpcap_power_button_probe()
58 return -ENOMEM; in cpcap_power_button_probe()
60 button->idev = devm_input_allocate_device(&pdev->dev); in cpcap_power_button_probe()
61 if (!button->idev) in cpcap_power_button_probe()
62 return -ENOMEM; in cpcap_power_button_probe()
64 button->regmap = dev_get_regmap(pdev->dev.parent, NULL); in cpcap_power_button_probe()
65 if (!button->regmap) in cpcap_power_button_probe()
66 return -ENODEV; in cpcap_power_button_probe()
68 button->dev = &pdev->dev; in cpcap_power_button_probe()
70 button->idev->name = "cpcap-pwrbutton"; in cpcap_power_button_probe()
71 button->idev->phys = "cpcap-pwrbutton/input0"; in cpcap_power_button_probe()
72 input_set_capability(button->idev, EV_KEY, KEY_POWER); in cpcap_power_button_probe()
74 err = devm_request_threaded_irq(&pdev->dev, irq, NULL, in cpcap_power_button_probe()
75 powerbutton_irq, IRQF_ONESHOT, "cpcap_pwrbutton", button); in cpcap_power_button_probe()
77 dev_err(&pdev->dev, "IRQ request failed: %d\n", err); in cpcap_power_button_probe()
81 err = input_register_device(button->idev); in cpcap_power_button_probe()
83 dev_err(&pdev->dev, "Input register failed: %d\n", err); in cpcap_power_button_probe()
87 device_init_wakeup(&pdev->dev, true); in cpcap_power_button_probe()
94 { .compatible = "motorola,cpcap-pwrbutton" },
103 .name = "cpcap-pwrbutton",
109 MODULE_ALIAS("platform:cpcap-pwrbutton");
110 MODULE_DESCRIPTION("CPCAP Power Button");