Lines Matching +full:bd71837 +full:- +full:pmic
1 // SPDX-License-Identifier: GPL-2.0
3 // bd71837-regulator.c ROHM BD71837MWV regulator driver
10 #include <linux/mfd/rohm-bd718x7.h>
20 struct bd71837 *mfd;
36 struct bd71837_pmic *pmic = rdev_get_drvdata(rdev); in bd71837_buck1234_set_ramp_delay() local
37 struct bd71837 *mfd = pmic->mfd; in bd71837_buck1234_set_ramp_delay()
38 int id = rdev->desc->id; in bd71837_buck1234_set_ramp_delay()
41 dev_dbg(&pmic->pdev->dev, "Buck[%d] Set Ramp = %d\n", id + 1, in bd71837_buck1234_set_ramp_delay()
58 dev_err(&pmic->pdev->dev, in bd71837_buck1234_set_ramp_delay()
60 rdev->desc->name, ramp_delay); in bd71837_buck1234_set_ramp_delay()
63 return regmap_update_bits(mfd->regmap, BD71837_REG_BUCK1_CTRL + id, in bd71837_buck1234_set_ramp_delay()
69 * is changed. Hence we return -EBUSY for these if voltage is changed
76 return -EBUSY; in bd71837_set_voltage_sel_restricted()
492 struct bd71837_pmic *pmic; in bd71837_probe() local
545 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); in bd71837_probe()
546 if (!pmic) in bd71837_probe()
547 return -ENOMEM; in bd71837_probe()
549 memcpy(pmic->descs, bd71837_regulators, sizeof(pmic->descs)); in bd71837_probe()
551 pmic->pdev = pdev; in bd71837_probe()
552 pmic->mfd = dev_get_drvdata(pdev->dev.parent); in bd71837_probe()
554 if (!pmic->mfd) { in bd71837_probe()
555 dev_err(&pdev->dev, "No MFD driver data\n"); in bd71837_probe()
556 err = -EINVAL; in bd71837_probe()
559 platform_set_drvdata(pdev, pmic); in bd71837_probe()
562 err = regmap_update_bits(pmic->mfd->regmap, BD71837_REG_REGLOCK, in bd71837_probe()
565 dev_err(&pmic->pdev->dev, "Failed to unlock PMIC (%d)\n", err); in bd71837_probe()
568 dev_dbg(&pmic->pdev->dev, "Unlocked lock register 0x%x\n", in bd71837_probe()
573 * There is a HW quirk in BD71837. The shutdown sequence timings for in bd71837_probe()
575 * At PMIC poweroff the voltage for BUCK6/7 is cut immediately at the in bd71837_probe()
576 * beginning of shut-down sequence. As bucks 6 and 7 are parent in bd71837_probe()
577 * supplies for LDO5 and LDO6 - this causes LDO5/6 voltage in bd71837_probe()
578 * monitoring to errorneously detect under voltage and force PMIC to in bd71837_probe()
582 err = regmap_update_bits(pmic->mfd->regmap, BD718XX_REG_MVRFLTMASK2, in bd71837_probe()
586 dev_err(&pmic->pdev->dev, in bd71837_probe()
596 desc = &pmic->descs[i]; in bd71837_probe()
598 config.dev = pdev->dev.parent; in bd71837_probe()
599 config.driver_data = pmic; in bd71837_probe()
600 config.regmap = pmic->mfd->regmap; in bd71837_probe()
602 rdev = devm_regulator_register(&pdev->dev, desc, &config); in bd71837_probe()
604 dev_err(pmic->mfd->dev, in bd71837_probe()
606 desc->name); in bd71837_probe()
613 * can now switch the control from PMIC state machine to the in bd71837_probe()
616 err = regmap_update_bits(pmic->mfd->regmap, in bd71837_probe()
621 dev_err(&pmic->pdev->dev, in bd71837_probe()
623 desc->name); in bd71837_probe()
627 pmic->rdev[i] = rdev; in bd71837_probe()
636 .name = "bd71837-pmic",
644 MODULE_DESCRIPTION("BD71837 voltage regulator driver");