Lines Matching full:onkey

3  * OnKey device driver for DA9063, DA9062 and DA9061 PMICs
75 .name = "da9062-onkey",
80 struct da9063_onkey *onkey = container_of(work, in da9063_poll_on() local
83 const struct da906x_chip_config *config = onkey->config; in da9063_poll_on()
90 error = regmap_read(onkey->regmap, in da9063_poll_on()
94 dev_err(onkey->dev, in da9063_poll_on()
100 error = regmap_update_bits(onkey->regmap, in da9063_poll_on()
105 dev_err(onkey->dev, in da9063_poll_on()
110 input_report_key(onkey->input, KEY_POWER, 0); in da9063_poll_on()
111 input_sync(onkey->input); in da9063_poll_on()
120 error = regmap_read(onkey->regmap, in da9063_poll_on()
124 dev_warn(&onkey->input->dev, in da9063_poll_on()
127 error = regmap_write(onkey->regmap, in da9063_poll_on()
131 dev_warn(&onkey->input->dev, in da9063_poll_on()
138 dev_dbg(&onkey->input->dev, in da9063_poll_on()
140 error = regmap_write(onkey->regmap, in da9063_poll_on()
144 dev_err(&onkey->input->dev, in da9063_poll_on()
152 schedule_delayed_work(&onkey->work, msecs_to_jiffies(50)); in da9063_poll_on()
157 struct da9063_onkey *onkey = data; in da9063_onkey_irq_handler() local
158 const struct da906x_chip_config *config = onkey->config; in da9063_onkey_irq_handler()
162 error = regmap_read(onkey->regmap, in da9063_onkey_irq_handler()
165 if (onkey->key_power && !error && (val & config->onkey_nonkey_mask)) { in da9063_onkey_irq_handler()
166 input_report_key(onkey->input, KEY_POWER, 1); in da9063_onkey_irq_handler()
167 input_sync(onkey->input); in da9063_onkey_irq_handler()
168 schedule_delayed_work(&onkey->work, 0); in da9063_onkey_irq_handler()
169 dev_dbg(onkey->dev, "KEY_POWER long press.\n"); in da9063_onkey_irq_handler()
171 input_report_key(onkey->input, KEY_POWER, 1); in da9063_onkey_irq_handler()
172 input_sync(onkey->input); in da9063_onkey_irq_handler()
173 input_report_key(onkey->input, KEY_POWER, 0); in da9063_onkey_irq_handler()
174 input_sync(onkey->input); in da9063_onkey_irq_handler()
175 dev_dbg(onkey->dev, "KEY_POWER short press.\n"); in da9063_onkey_irq_handler()
183 struct da9063_onkey *onkey; in da9063_onkey_probe() local
187 onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), in da9063_onkey_probe()
189 if (!onkey) in da9063_onkey_probe()
192 onkey->config = device_get_match_data(&pdev->dev); in da9063_onkey_probe()
193 if (!onkey->config) in da9063_onkey_probe()
196 onkey->dev = &pdev->dev; in da9063_onkey_probe()
198 onkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); in da9063_onkey_probe()
199 if (!onkey->regmap) in da9063_onkey_probe()
203 onkey->key_power = !device_property_read_bool(&pdev->dev, in da9063_onkey_probe()
206 onkey->input = devm_input_allocate_device(&pdev->dev); in da9063_onkey_probe()
207 if (!onkey->input) in da9063_onkey_probe()
210 onkey->input->name = onkey->config->name; in da9063_onkey_probe()
211 snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0", in da9063_onkey_probe()
212 onkey->config->name); in da9063_onkey_probe()
213 onkey->input->phys = onkey->phys; in da9063_onkey_probe()
215 input_set_capability(onkey->input, EV_KEY, KEY_POWER); in da9063_onkey_probe()
217 error = devm_delayed_work_autocancel(&pdev->dev, &onkey->work, in da9063_onkey_probe()
222 irq = platform_get_irq_byname(pdev, "ONKEY"); in da9063_onkey_probe()
229 "ONKEY", onkey); in da9063_onkey_probe()
232 "Failed to allocate onkey IRQ\n"); in da9063_onkey_probe()
242 error = input_register_device(onkey->input); in da9063_onkey_probe()
250 { .compatible = "dlg,da9063-onkey", .data = &da9063_regs },
251 { .compatible = "dlg,da9062-onkey", .data = &da9062_regs },
266 MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063, DA9062 and DA9061");