Lines Matching +full:onkey +full:- +full:rising

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) ST-Ericsson SA 2010
5 * Author: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
7 * AB8500 Power-On Key handler
21 * struct ab8500_ponkey - ab8500 ponkey information
25 * @irq_dbr: irq number for rising transition
34 /* AB8500 gives us an interrupt when ONKEY is held */
39 if (irq == ponkey->irq_dbf) in ab8500_ponkey_handler()
40 input_report_key(ponkey->idev, KEY_POWER, true); in ab8500_ponkey_handler()
41 else if (irq == ponkey->irq_dbr) in ab8500_ponkey_handler()
42 input_report_key(ponkey->idev, KEY_POWER, false); in ab8500_ponkey_handler()
44 input_sync(ponkey->idev); in ab8500_ponkey_handler()
51 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); in ab8500_ponkey_probe()
65 ponkey = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_ponkey), in ab8500_ponkey_probe()
68 return -ENOMEM; in ab8500_ponkey_probe()
70 input = devm_input_allocate_device(&pdev->dev); in ab8500_ponkey_probe()
72 return -ENOMEM; in ab8500_ponkey_probe()
74 ponkey->idev = input; in ab8500_ponkey_probe()
75 ponkey->ab8500 = ab8500; in ab8500_ponkey_probe()
76 ponkey->irq_dbf = irq_dbf; in ab8500_ponkey_probe()
77 ponkey->irq_dbr = irq_dbr; in ab8500_ponkey_probe()
79 input->name = "AB8500 POn(PowerOn) Key"; in ab8500_ponkey_probe()
80 input->dev.parent = &pdev->dev; in ab8500_ponkey_probe()
84 error = devm_request_any_context_irq(&pdev->dev, ponkey->irq_dbf, in ab8500_ponkey_probe()
86 "ab8500-ponkey-dbf", ponkey); in ab8500_ponkey_probe()
88 dev_err(ab8500->dev, "Failed to request dbf IRQ#%d: %d\n", in ab8500_ponkey_probe()
89 ponkey->irq_dbf, error); in ab8500_ponkey_probe()
93 error = devm_request_any_context_irq(&pdev->dev, ponkey->irq_dbr, in ab8500_ponkey_probe()
95 "ab8500-ponkey-dbr", ponkey); in ab8500_ponkey_probe()
97 dev_err(ab8500->dev, "Failed to request dbr IRQ#%d: %d\n", in ab8500_ponkey_probe()
98 ponkey->irq_dbr, error); in ab8500_ponkey_probe()
102 error = input_register_device(ponkey->idev); in ab8500_ponkey_probe()
104 dev_err(ab8500->dev, "Can't register input device: %d\n", error); in ab8500_ponkey_probe()
113 { .compatible = "stericsson,ab8500-ponkey", },
121 .name = "ab8500-poweron-key",
130 MODULE_DESCRIPTION("ST-Ericsson AB8500 Power-ON(Pon) Key driver");