• Home
  • Raw
  • Download

Lines Matching full:onkey

3  * OnKey device driver for DA9063, DA9062 and DA9061 PMICs
72 .name = "da9062-onkey",
76 { .compatible = "dlg,da9063-onkey", .data = &da9063_regs },
77 { .compatible = "dlg,da9062-onkey", .data = &da9062_regs },
84 struct da9063_onkey *onkey = container_of(work, in da9063_poll_on() local
87 const struct da906x_chip_config *config = onkey->config; in da9063_poll_on()
94 error = regmap_read(onkey->regmap, in da9063_poll_on()
98 dev_err(onkey->dev, in da9063_poll_on()
104 error = regmap_update_bits(onkey->regmap, in da9063_poll_on()
109 dev_err(onkey->dev, in da9063_poll_on()
114 input_report_key(onkey->input, KEY_POWER, 0); in da9063_poll_on()
115 input_sync(onkey->input); in da9063_poll_on()
124 error = regmap_read(onkey->regmap, in da9063_poll_on()
128 dev_warn(&onkey->input->dev, in da9063_poll_on()
131 error = regmap_write(onkey->regmap, in da9063_poll_on()
135 dev_warn(&onkey->input->dev, in da9063_poll_on()
142 dev_dbg(&onkey->input->dev, in da9063_poll_on()
144 error = regmap_write(onkey->regmap, in da9063_poll_on()
148 dev_err(&onkey->input->dev, in da9063_poll_on()
156 schedule_delayed_work(&onkey->work, msecs_to_jiffies(50)); in da9063_poll_on()
161 struct da9063_onkey *onkey = data; in da9063_onkey_irq_handler() local
162 const struct da906x_chip_config *config = onkey->config; in da9063_onkey_irq_handler()
166 error = regmap_read(onkey->regmap, in da9063_onkey_irq_handler()
169 if (onkey->key_power && !error && (val & config->onkey_nonkey_mask)) { in da9063_onkey_irq_handler()
170 input_report_key(onkey->input, KEY_POWER, 1); in da9063_onkey_irq_handler()
171 input_sync(onkey->input); in da9063_onkey_irq_handler()
172 schedule_delayed_work(&onkey->work, 0); in da9063_onkey_irq_handler()
173 dev_dbg(onkey->dev, "KEY_POWER long press.\n"); in da9063_onkey_irq_handler()
175 input_report_key(onkey->input, KEY_POWER, 1); in da9063_onkey_irq_handler()
176 input_sync(onkey->input); in da9063_onkey_irq_handler()
177 input_report_key(onkey->input, KEY_POWER, 0); in da9063_onkey_irq_handler()
178 input_sync(onkey->input); in da9063_onkey_irq_handler()
179 dev_dbg(onkey->dev, "KEY_POWER short press.\n"); in da9063_onkey_irq_handler()
187 struct da9063_onkey *onkey = data; in da9063_cancel_poll() local
189 cancel_delayed_work_sync(&onkey->work); in da9063_cancel_poll()
194 struct da9063_onkey *onkey; in da9063_onkey_probe() local
204 onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), in da9063_onkey_probe()
206 if (!onkey) { in da9063_onkey_probe()
211 onkey->config = match->data; in da9063_onkey_probe()
212 onkey->dev = &pdev->dev; in da9063_onkey_probe()
214 onkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); in da9063_onkey_probe()
215 if (!onkey->regmap) { in da9063_onkey_probe()
220 onkey->key_power = !of_property_read_bool(pdev->dev.of_node, in da9063_onkey_probe()
223 onkey->input = devm_input_allocate_device(&pdev->dev); in da9063_onkey_probe()
224 if (!onkey->input) { in da9063_onkey_probe()
229 onkey->input->name = onkey->config->name; in da9063_onkey_probe()
230 snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0", in da9063_onkey_probe()
231 onkey->config->name); in da9063_onkey_probe()
232 onkey->input->phys = onkey->phys; in da9063_onkey_probe()
233 onkey->input->dev.parent = &pdev->dev; in da9063_onkey_probe()
235 input_set_capability(onkey->input, EV_KEY, KEY_POWER); in da9063_onkey_probe()
237 INIT_DELAYED_WORK(&onkey->work, da9063_poll_on); in da9063_onkey_probe()
239 error = devm_add_action(&pdev->dev, da9063_cancel_poll, onkey); in da9063_onkey_probe()
247 irq = platform_get_irq_byname(pdev, "ONKEY"); in da9063_onkey_probe()
254 "ONKEY", onkey); in da9063_onkey_probe()
261 error = input_register_device(onkey->input); in da9063_onkey_probe()
281 MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063, DA9062 and DA9061");