Lines Matching refs:axp20x_pek

40 struct axp20x_pek {  struct
92 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr() local
96 ret = regmap_read(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, &val); in axp20x_show_attr()
114 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr_startup() local
116 return axp20x_show_attr(dev, axp20x_pek->info->startup_time, in axp20x_show_attr_startup()
117 axp20x_pek->info->startup_mask, buf); in axp20x_show_attr_startup()
124 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr_shutdown() local
126 return axp20x_show_attr(dev, axp20x_pek->info->shutdown_time, in axp20x_show_attr_shutdown()
127 axp20x_pek->info->shutdown_mask, buf); in axp20x_show_attr_shutdown()
135 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr() local
167 ret = regmap_update_bits(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, in axp20x_store_attr()
179 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr_startup() local
181 return axp20x_store_attr(dev, axp20x_pek->info->startup_time, in axp20x_store_attr_startup()
182 axp20x_pek->info->startup_mask, buf, count); in axp20x_store_attr_startup()
189 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr_shutdown() local
191 return axp20x_store_attr(dev, axp20x_pek->info->shutdown_time, in axp20x_store_attr_shutdown()
192 axp20x_pek->info->shutdown_mask, buf, count); in axp20x_store_attr_shutdown()
210 struct axp20x_pek *axp20x_pek = input_get_drvdata(idev); in axp20x_pek_irq() local
216 if (irq == axp20x_pek->irq_dbf) in axp20x_pek_irq()
218 else if (irq == axp20x_pek->irq_dbr) in axp20x_pek_irq()
226 static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, in axp20x_pek_probe_input_device() argument
229 struct axp20x_dev *axp20x = axp20x_pek->axp20x; in axp20x_pek_probe_input_device()
233 axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); in axp20x_pek_probe_input_device()
234 if (axp20x_pek->irq_dbr < 0) in axp20x_pek_probe_input_device()
235 return axp20x_pek->irq_dbr; in axp20x_pek_probe_input_device()
236 axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc, in axp20x_pek_probe_input_device()
237 axp20x_pek->irq_dbr); in axp20x_pek_probe_input_device()
239 axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); in axp20x_pek_probe_input_device()
240 if (axp20x_pek->irq_dbf < 0) in axp20x_pek_probe_input_device()
241 return axp20x_pek->irq_dbf; in axp20x_pek_probe_input_device()
242 axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc, in axp20x_pek_probe_input_device()
243 axp20x_pek->irq_dbf); in axp20x_pek_probe_input_device()
245 axp20x_pek->input = devm_input_allocate_device(&pdev->dev); in axp20x_pek_probe_input_device()
246 if (!axp20x_pek->input) in axp20x_pek_probe_input_device()
249 idev = axp20x_pek->input; in axp20x_pek_probe_input_device()
257 input_set_drvdata(idev, axp20x_pek); in axp20x_pek_probe_input_device()
259 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr, in axp20x_pek_probe_input_device()
264 axp20x_pek->irq_dbr, error); in axp20x_pek_probe_input_device()
268 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf, in axp20x_pek_probe_input_device()
273 axp20x_pek->irq_dbf, error); in axp20x_pek_probe_input_device()
289 static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek) in axp20x_pek_should_register_input() argument
292 axp20x_pek->axp20x->variant == AXP288_ID) { in axp20x_pek_should_register_input()
310 struct axp20x_pek *axp20x_pek; in axp20x_pek_probe() local
319 axp20x_pek = devm_kzalloc(&pdev->dev, sizeof(struct axp20x_pek), in axp20x_pek_probe()
321 if (!axp20x_pek) in axp20x_pek_probe()
324 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_pek_probe()
326 if (axp20x_pek_should_register_input(axp20x_pek)) { in axp20x_pek_probe()
327 error = axp20x_pek_probe_input_device(axp20x_pek, pdev); in axp20x_pek_probe()
332 axp20x_pek->info = (struct axp20x_info *)match->driver_data; in axp20x_pek_probe()
334 platform_set_drvdata(pdev, axp20x_pek); in axp20x_pek_probe()
341 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_pek_suspend() local
348 enable_irq_wake(axp20x_pek->irq_dbf); in axp20x_pek_suspend()
349 enable_irq_wake(axp20x_pek->irq_dbr); in axp20x_pek_suspend()
351 disable_irq(axp20x_pek->irq_dbf); in axp20x_pek_suspend()
352 disable_irq(axp20x_pek->irq_dbr); in axp20x_pek_suspend()
360 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_pek_resume() local
363 disable_irq_wake(axp20x_pek->irq_dbf); in axp20x_pek_resume()
364 disable_irq_wake(axp20x_pek->irq_dbr); in axp20x_pek_resume()
366 enable_irq(axp20x_pek->irq_dbf); in axp20x_pek_resume()
367 enable_irq(axp20x_pek->irq_dbr); in axp20x_pek_resume()
375 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_pek_resume_noirq() local
377 if (axp20x_pek->axp20x->variant != AXP288_ID) in axp20x_pek_resume_noirq()
384 regmap_write(axp20x_pek->axp20x->regmap, in axp20x_pek_resume_noirq()