Lines Matching +full:button +full:-
2 * CPCAP Power Button Input Driver
25 #include <linux/mfd/motorola-cpcap.h>
38 struct cpcap_power_button *button = _button; in powerbutton_irq() local
41 val = cpcap_sense_virq(button->regmap, irq); in powerbutton_irq()
43 dev_err(button->dev, "irq read failed: %d", val); in powerbutton_irq()
47 pm_wakeup_event(button->dev, 0); in powerbutton_irq()
48 input_report_key(button->idev, KEY_POWER, val); in powerbutton_irq()
49 input_sync(button->idev); in powerbutton_irq()
56 struct cpcap_power_button *button; in cpcap_power_button_probe() local
60 button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL); in cpcap_power_button_probe()
61 if (!button) in cpcap_power_button_probe()
62 return -ENOMEM; in cpcap_power_button_probe()
64 button->idev = devm_input_allocate_device(&pdev->dev); in cpcap_power_button_probe()
65 if (!button->idev) in cpcap_power_button_probe()
66 return -ENOMEM; in cpcap_power_button_probe()
68 button->regmap = dev_get_regmap(pdev->dev.parent, NULL); in cpcap_power_button_probe()
69 if (!button->regmap) in cpcap_power_button_probe()
70 return -ENODEV; in cpcap_power_button_probe()
72 button->dev = &pdev->dev; in cpcap_power_button_probe()
74 button->idev->name = "cpcap-pwrbutton"; in cpcap_power_button_probe()
75 button->idev->phys = "cpcap-pwrbutton/input0"; in cpcap_power_button_probe()
76 button->idev->dev.parent = button->dev; in cpcap_power_button_probe()
77 input_set_capability(button->idev, EV_KEY, KEY_POWER); in cpcap_power_button_probe()
79 err = devm_request_threaded_irq(&pdev->dev, irq, NULL, in cpcap_power_button_probe()
80 powerbutton_irq, IRQF_ONESHOT, "cpcap_pwrbutton", button); in cpcap_power_button_probe()
82 dev_err(&pdev->dev, "IRQ request failed: %d\n", err); in cpcap_power_button_probe()
86 err = input_register_device(button->idev); in cpcap_power_button_probe()
88 dev_err(&pdev->dev, "Input register failed: %d\n", err); in cpcap_power_button_probe()
92 device_init_wakeup(&pdev->dev, true); in cpcap_power_button_probe()
99 { .compatible = "motorola,cpcap-pwrbutton" },
108 .name = "cpcap-pwrbutton",
114 MODULE_ALIAS("platform:cpcap-pwrbutton");
115 MODULE_DESCRIPTION("CPCAP Power Button");