Lines Matching +full:key +full:- +full:press
1 // SPDX-License-Identifier: GPL-2.0-only
30 error = regmap_read(priv->regmap, RT5120_REG_INTSTAT, &stat); in rt5120_pwrkey_handler()
34 input_report_key(priv->input, KEY_POWER, in rt5120_pwrkey_handler()
36 input_sync(priv->input); in rt5120_pwrkey_handler()
44 struct device *dev = &pdev->dev; in rt5120_pwrkey_probe()
50 return -ENOMEM; in rt5120_pwrkey_probe()
52 priv->regmap = dev_get_regmap(dev->parent, NULL); in rt5120_pwrkey_probe()
53 if (!priv->regmap) { in rt5120_pwrkey_probe()
55 return -ENODEV; in rt5120_pwrkey_probe()
58 press_irq = platform_get_irq_byname(pdev, "pwrkey-press"); in rt5120_pwrkey_probe()
62 release_irq = platform_get_irq_byname(pdev, "pwrkey-release"); in rt5120_pwrkey_probe()
67 priv->input = devm_input_allocate_device(dev); in rt5120_pwrkey_probe()
68 if (!priv->input) in rt5120_pwrkey_probe()
69 return -ENOMEM; in rt5120_pwrkey_probe()
71 priv->input->name = "rt5120_pwrkey"; in rt5120_pwrkey_probe()
72 priv->input->phys = "rt5120_pwrkey/input0"; in rt5120_pwrkey_probe()
73 priv->input->id.bustype = BUS_I2C; in rt5120_pwrkey_probe()
74 input_set_capability(priv->input, EV_KEY, KEY_POWER); in rt5120_pwrkey_probe()
76 error = input_register_device(priv->input); in rt5120_pwrkey_probe()
84 0, "pwrkey-press", priv); in rt5120_pwrkey_probe()
87 "Failed to register pwrkey press irq: %d\n", error); in rt5120_pwrkey_probe()
93 0, "pwrkey-release", priv); in rt5120_pwrkey_probe()
104 { .compatible = "richtek,rt5120-pwrkey" },
111 .name = "rt5120-pwrkey",
119 MODULE_DESCRIPTION("Richtek RT5120 power key driver");