Lines Matching refs:pmic
282 struct intel_soc_pmic *pmic = context; in regmap_ipc_byte_reg_read() local
284 if (!pmic) in regmap_ipc_byte_reg_read()
296 ret = intel_scu_ipc_dev_command(pmic->scu, PMC_PMIC_ACCESS, in regmap_ipc_byte_reg_read()
312 struct intel_soc_pmic *pmic = context; in regmap_ipc_byte_reg_write() local
314 if (!pmic) in regmap_ipc_byte_reg_write()
327 return intel_scu_ipc_dev_command(pmic->scu, PMC_PMIC_ACCESS, in regmap_ipc_byte_reg_write()
357 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in val_show() local
359 ret = regmap_read(pmic->regmap, bxtwc_reg_addr, &val); in val_show()
373 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in val_store() local
379 ret = regmap_write(pmic->regmap, bxtwc_reg_addr, val); in val_store()
412 static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic, in bxtwc_add_chained_irq_chip() argument
422 return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n", in bxtwc_add_chained_irq_chip()
425 return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags, in bxtwc_add_chained_irq_chip()
435 struct intel_soc_pmic *pmic; in bxtwc_probe() local
443 pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL); in bxtwc_probe()
444 if (!pmic) in bxtwc_probe()
450 pmic->irq = ret; in bxtwc_probe()
452 platform_set_drvdata(pdev, pmic); in bxtwc_probe()
453 pmic->dev = dev; in bxtwc_probe()
455 pmic->scu = devm_intel_scu_ipc_dev_get(dev); in bxtwc_probe()
456 if (!pmic->scu) in bxtwc_probe()
459 pmic->regmap = devm_regmap_init(dev, NULL, pmic, &bxtwc_regmap_config); in bxtwc_probe()
460 if (IS_ERR(pmic->regmap)) in bxtwc_probe()
461 return dev_err_probe(dev, PTR_ERR(pmic->regmap), "Failed to initialise regmap\n"); in bxtwc_probe()
463 ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq, in bxtwc_probe()
466 &pmic->irq_chip_data); in bxtwc_probe()
470 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
474 &pmic->irq_chip_data_pwrbtn); in bxtwc_probe()
478 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
482 &pmic->irq_chip_data_tmu); in bxtwc_probe()
487 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
491 &pmic->irq_chip_data_bcu); in bxtwc_probe()
496 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
500 &pmic->irq_chip_data_adc); in bxtwc_probe()
505 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
509 &pmic->irq_chip_data_chgr); in bxtwc_probe()
514 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
518 &pmic->irq_chip_data_crit); in bxtwc_probe()
534 regmap_update_bits(pmic->regmap, BXTWC_MIRQLVL1, BXTWC_MIRQLVL1_MCHGR, 0); in bxtwc_probe()
541 struct intel_soc_pmic *pmic = platform_get_drvdata(pdev); in bxtwc_shutdown() local
543 disable_irq(pmic->irq); in bxtwc_shutdown()
548 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in bxtwc_suspend() local
550 disable_irq(pmic->irq); in bxtwc_suspend()
557 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in bxtwc_resume() local
559 enable_irq(pmic->irq); in bxtwc_resume()