Lines Matching refs:axp20x_pek

39 struct axp20x_pek {  struct
91 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr() local
95 ret = regmap_read(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, &val); in axp20x_show_attr()
113 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr_startup() local
115 return axp20x_show_attr(dev, axp20x_pek->info->startup_time, in axp20x_show_attr_startup()
116 axp20x_pek->info->startup_mask, buf); in axp20x_show_attr_startup()
123 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_show_attr_shutdown() local
125 return axp20x_show_attr(dev, axp20x_pek->info->shutdown_time, in axp20x_show_attr_shutdown()
126 axp20x_pek->info->shutdown_mask, buf); in axp20x_show_attr_shutdown()
134 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr() local
166 ret = regmap_update_bits(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, in axp20x_store_attr()
178 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr_startup() local
180 return axp20x_store_attr(dev, axp20x_pek->info->startup_time, in axp20x_store_attr_startup()
181 axp20x_pek->info->startup_mask, buf, count); in axp20x_store_attr_startup()
188 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_store_attr_shutdown() local
190 return axp20x_store_attr(dev, axp20x_pek->info->shutdown_time, in axp20x_store_attr_shutdown()
191 axp20x_pek->info->shutdown_mask, buf, count); in axp20x_store_attr_shutdown()
208 struct axp20x_pek *axp20x_pek = input_get_drvdata(idev); in axp20x_pek_irq() local
214 if (irq == axp20x_pek->irq_dbf) in axp20x_pek_irq()
216 else if (irq == axp20x_pek->irq_dbr) in axp20x_pek_irq()
224 static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, in axp20x_pek_probe_input_device() argument
227 struct axp20x_dev *axp20x = axp20x_pek->axp20x; in axp20x_pek_probe_input_device()
231 axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); in axp20x_pek_probe_input_device()
232 if (axp20x_pek->irq_dbr < 0) in axp20x_pek_probe_input_device()
233 return axp20x_pek->irq_dbr; in axp20x_pek_probe_input_device()
234 axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc, in axp20x_pek_probe_input_device()
235 axp20x_pek->irq_dbr); in axp20x_pek_probe_input_device()
237 axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); in axp20x_pek_probe_input_device()
238 if (axp20x_pek->irq_dbf < 0) in axp20x_pek_probe_input_device()
239 return axp20x_pek->irq_dbf; in axp20x_pek_probe_input_device()
240 axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc, in axp20x_pek_probe_input_device()
241 axp20x_pek->irq_dbf); in axp20x_pek_probe_input_device()
243 axp20x_pek->input = devm_input_allocate_device(&pdev->dev); in axp20x_pek_probe_input_device()
244 if (!axp20x_pek->input) in axp20x_pek_probe_input_device()
247 idev = axp20x_pek->input; in axp20x_pek_probe_input_device()
255 input_set_drvdata(idev, axp20x_pek); in axp20x_pek_probe_input_device()
257 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr, in axp20x_pek_probe_input_device()
262 axp20x_pek->irq_dbr, error); in axp20x_pek_probe_input_device()
266 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf, in axp20x_pek_probe_input_device()
271 axp20x_pek->irq_dbf, error); in axp20x_pek_probe_input_device()
282 if (axp20x_pek->axp20x->variant == AXP288_ID) in axp20x_pek_probe_input_device()
283 enable_irq_wake(axp20x_pek->irq_dbr); 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
296 axp20x_pek->axp20x->variant == AXP288_ID) { in axp20x_pek_should_register_input()
317 static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek, in axp20x_pek_should_register_input() argument
326 struct axp20x_pek *axp20x_pek; in axp20x_pek_probe() local
335 axp20x_pek = devm_kzalloc(&pdev->dev, sizeof(struct axp20x_pek), in axp20x_pek_probe()
337 if (!axp20x_pek) in axp20x_pek_probe()
340 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); in axp20x_pek_probe()
342 if (axp20x_pek_should_register_input(axp20x_pek, pdev)) { in axp20x_pek_probe()
343 error = axp20x_pek_probe_input_device(axp20x_pek, pdev); in axp20x_pek_probe()
348 axp20x_pek->info = (struct axp20x_info *)match->driver_data; in axp20x_pek_probe()
350 platform_set_drvdata(pdev, axp20x_pek); in axp20x_pek_probe()
357 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); in axp20x_pek_resume_noirq() local
359 if (axp20x_pek->axp20x->variant != AXP288_ID) in axp20x_pek_resume_noirq()
366 regmap_write(axp20x_pek->axp20x->regmap, in axp20x_pek_resume_noirq()