Lines Matching +full:onkey +full:- +full:falling

1 // SPDX-License-Identifier: GPL-2.0
15 * struct stpmic1_onkey - OnKey data
28 struct stpmic1_onkey *onkey = ponkey; in onkey_falling_irq() local
29 struct input_dev *input_dev = onkey->input_dev; in onkey_falling_irq()
32 pm_wakeup_event(input_dev->dev.parent, 0); in onkey_falling_irq()
40 struct stpmic1_onkey *onkey = ponkey; in onkey_rising_irq() local
41 struct input_dev *input_dev = onkey->input_dev; in onkey_rising_irq()
44 pm_wakeup_event(input_dev->dev.parent, 0); in onkey_rising_irq()
52 struct stpmic1 *pmic = dev_get_drvdata(pdev->dev.parent); in stpmic1_onkey_probe()
53 struct device *dev = &pdev->dev; in stpmic1_onkey_probe()
55 struct stpmic1_onkey *onkey; in stpmic1_onkey_probe() local
59 onkey = devm_kzalloc(dev, sizeof(*onkey), GFP_KERNEL); in stpmic1_onkey_probe()
60 if (!onkey) in stpmic1_onkey_probe()
61 return -ENOMEM; in stpmic1_onkey_probe()
63 onkey->irq_falling = platform_get_irq_byname(pdev, "onkey-falling"); in stpmic1_onkey_probe()
64 if (onkey->irq_falling < 0) in stpmic1_onkey_probe()
65 return onkey->irq_falling; in stpmic1_onkey_probe()
67 onkey->irq_rising = platform_get_irq_byname(pdev, "onkey-rising"); in stpmic1_onkey_probe()
68 if (onkey->irq_rising < 0) in stpmic1_onkey_probe()
69 return onkey->irq_rising; in stpmic1_onkey_probe()
71 if (!device_property_read_u32(dev, "power-off-time-sec", &val)) { in stpmic1_onkey_probe()
73 dev_dbg(dev, "power-off-time=%d seconds\n", val); in stpmic1_onkey_probe()
75 reg |= ((16 - val) & PONKEY_TURNOFF_TIMER_MASK); in stpmic1_onkey_probe()
77 dev_err(dev, "power-off-time-sec out of range\n"); in stpmic1_onkey_probe()
78 return -EINVAL; in stpmic1_onkey_probe()
82 if (device_property_present(dev, "st,onkey-clear-cc-flag")) in stpmic1_onkey_probe()
85 error = regmap_update_bits(pmic->regmap, PKEY_TURNOFF_CR, in stpmic1_onkey_probe()
92 if (device_property_present(dev, "st,onkey-pu-inactive")) { in stpmic1_onkey_probe()
93 error = regmap_update_bits(pmic->regmap, PADS_PULL_CR, in stpmic1_onkey_probe()
97 dev_err(dev, "ONKEY Pads configuration failed: %d\n", in stpmic1_onkey_probe()
105 dev_err(dev, "Can't allocate Pwr Onkey Input Device\n"); in stpmic1_onkey_probe()
106 return -ENOMEM; in stpmic1_onkey_probe()
109 input_dev->name = "pmic_onkey"; in stpmic1_onkey_probe()
110 input_dev->phys = "pmic_onkey/input0"; in stpmic1_onkey_probe()
114 onkey->input_dev = input_dev; in stpmic1_onkey_probe()
117 error = devm_request_threaded_irq(dev, onkey->irq_falling, NULL, in stpmic1_onkey_probe()
119 dev_name(dev), onkey); in stpmic1_onkey_probe()
121 dev_err(dev, "Can't get IRQ Onkey Falling: %d\n", error); in stpmic1_onkey_probe()
125 error = devm_request_threaded_irq(dev, onkey->irq_rising, NULL, in stpmic1_onkey_probe()
127 dev_name(dev), onkey); in stpmic1_onkey_probe()
129 dev_err(dev, "Can't get IRQ Onkey Rising: %d\n", error); in stpmic1_onkey_probe()
139 platform_set_drvdata(pdev, onkey); in stpmic1_onkey_probe()
148 struct stpmic1_onkey *onkey = platform_get_drvdata(pdev); in stpmic1_onkey_suspend() local
151 enable_irq_wake(onkey->irq_falling); in stpmic1_onkey_suspend()
152 enable_irq_wake(onkey->irq_rising); in stpmic1_onkey_suspend()
160 struct stpmic1_onkey *onkey = platform_get_drvdata(pdev); in stpmic1_onkey_resume() local
163 disable_irq_wake(onkey->irq_falling); in stpmic1_onkey_resume()
164 disable_irq_wake(onkey->irq_rising); in stpmic1_onkey_resume()
174 { .compatible = "st,stpmic1-onkey" },
190 MODULE_DESCRIPTION("Onkey driver for STPMIC1");