Lines Matching +full:power +full:- +full:off +full:- +full:time +full:- +full:sec
1 // SPDX-License-Identifier: GPL-2.0
15 * struct stpmic1_onkey - OnKey data
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()
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()
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()
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()
125 error = devm_request_threaded_irq(dev, onkey->irq_rising, NULL, in stpmic1_onkey_probe()
135 dev_err(dev, "Can't register power button: %d\n", error); in stpmic1_onkey_probe()
151 enable_irq_wake(onkey->irq_falling); in stpmic1_onkey_suspend()
152 enable_irq_wake(onkey->irq_rising); in stpmic1_onkey_suspend()
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" },