Lines Matching full:pmic
3 * MFD core driver for Intel Broxton Whiskey Cove PMIC
31 /* PMIC device registers */
69 /* Whiskey Cove PMIC share same ACPI ID between different platforms */
309 struct intel_soc_pmic *pmic = context; in regmap_ipc_byte_reg_read() local
311 if (!pmic) in regmap_ipc_byte_reg_read()
323 ret = intel_scu_ipc_dev_command(pmic->scu, PMC_PMIC_ACCESS, in regmap_ipc_byte_reg_read()
339 struct intel_soc_pmic *pmic = context; in regmap_ipc_byte_reg_write() local
341 if (!pmic) in regmap_ipc_byte_reg_write()
354 return intel_scu_ipc_dev_command(pmic->scu, PMC_PMIC_ACCESS, in regmap_ipc_byte_reg_write()
359 /* sysfs interfaces to r/w PMIC registers, required by initial script */
385 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in val_show() local
387 ret = regmap_read(pmic->regmap, bxtwc_reg_addr, &val); in val_show()
401 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in val_store() local
407 ret = regmap_write(pmic->regmap, bxtwc_reg_addr, val); in val_store()
431 static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic, in bxtwc_add_chained_irq_chip() argument
437 struct device *dev = pmic->dev; in bxtwc_add_chained_irq_chip()
445 ret = devm_regmap_add_irq_chip(dev, pmic->regmap, irq, irq_flags, 0, chip, data); in bxtwc_add_chained_irq_chip()
452 static int bxtwc_add_chained_devices(struct intel_soc_pmic *pmic, in bxtwc_add_chained_devices() argument
459 struct device *dev = pmic->dev; in bxtwc_add_chained_devices()
463 ret = bxtwc_add_chained_irq_chip(pmic, pdata, pirq, irq_flags, chip, data); in bxtwc_add_chained_devices()
478 struct intel_soc_pmic *pmic; in bxtwc_probe() local
482 return dev_err_probe(dev, -ENODEV, "Failed to get PMIC hardware revision\n"); in bxtwc_probe()
484 return dev_err_probe(dev, -ENODEV, "Invalid PMIC hardware revision: %llu\n", hrv); in bxtwc_probe()
486 pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL); in bxtwc_probe()
487 if (!pmic) in bxtwc_probe()
493 pmic->irq = ret; in bxtwc_probe()
495 platform_set_drvdata(pdev, pmic); in bxtwc_probe()
496 pmic->dev = dev; in bxtwc_probe()
498 pmic->scu = devm_intel_scu_ipc_dev_get(dev); in bxtwc_probe()
499 if (!pmic->scu) in bxtwc_probe()
502 pmic->regmap = devm_regmap_init(dev, NULL, pmic, &bxtwc_regmap_config); in bxtwc_probe()
503 if (IS_ERR(pmic->regmap)) in bxtwc_probe()
504 return dev_err_probe(dev, PTR_ERR(pmic->regmap), "Failed to initialise regmap\n"); in bxtwc_probe()
506 ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq, in bxtwc_probe()
509 &pmic->irq_chip_data); in bxtwc_probe()
513 ret = bxtwc_add_chained_devices(pmic, bxt_wc_tmu_dev, ARRAY_SIZE(bxt_wc_tmu_dev), in bxtwc_probe()
514 pmic->irq_chip_data, in bxtwc_probe()
518 &pmic->irq_chip_data_tmu); in bxtwc_probe()
522 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
526 &pmic->irq_chip_data_pwrbtn); in bxtwc_probe()
530 ret = bxtwc_add_chained_devices(pmic, bxt_wc_bcu_dev, ARRAY_SIZE(bxt_wc_bcu_dev), in bxtwc_probe()
531 pmic->irq_chip_data, in bxtwc_probe()
535 &pmic->irq_chip_data_bcu); in bxtwc_probe()
539 ret = bxtwc_add_chained_devices(pmic, bxt_wc_adc_dev, ARRAY_SIZE(bxt_wc_adc_dev), in bxtwc_probe()
540 pmic->irq_chip_data, in bxtwc_probe()
544 &pmic->irq_chip_data_adc); in bxtwc_probe()
548 ret = bxtwc_add_chained_devices(pmic, bxt_wc_chgr_dev, ARRAY_SIZE(bxt_wc_chgr_dev), in bxtwc_probe()
549 pmic->irq_chip_data, in bxtwc_probe()
553 &pmic->irq_chip_data_chgr); in bxtwc_probe()
558 ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data, in bxtwc_probe()
562 &pmic->irq_chip_data_crit); in bxtwc_probe()
578 regmap_update_bits(pmic->regmap, BXTWC_MIRQLVL1, BXTWC_MIRQLVL1_MCHGR, 0); in bxtwc_probe()
585 struct intel_soc_pmic *pmic = platform_get_drvdata(pdev); in bxtwc_shutdown() local
587 disable_irq(pmic->irq); in bxtwc_shutdown()
592 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in bxtwc_suspend() local
594 disable_irq(pmic->irq); in bxtwc_suspend()
601 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); in bxtwc_resume() local
603 enable_irq(pmic->irq); in bxtwc_resume()
628 MODULE_DESCRIPTION("Intel Broxton Whiskey Cove PMIC MFD core driver");