Lines Matching +full:ldo +full:-
1 // SPDX-License-Identifier: GPL-2.0-only
3 * TI LP8788 MFD - ldo regulator driver
155 struct lp8788_ldo *ldo = rdev_get_drvdata(rdev); in lp8788_ldo_enable_time() local
159 if (lp8788_read_byte(ldo->lp, addr, &val)) in lp8788_ldo_enable_time()
160 return -EINVAL; in lp8788_ldo_enable_time()
462 struct lp8788_ldo *ldo, in lp8788_config_ldo_enable_mode() argument
465 struct lp8788 *lp = ldo->lp; in lp8788_config_ldo_enable_mode()
505 ldo->ena_gpiod = gpiod_get_index_optional(&pdev->dev, in lp8788_config_ldo_enable_mode()
510 if (IS_ERR(ldo->ena_gpiod)) in lp8788_config_ldo_enable_mode()
511 return PTR_ERR(ldo->ena_gpiod); in lp8788_config_ldo_enable_mode()
513 /* if no GPIO for ldo pin, then set default enable mode */ in lp8788_config_ldo_enable_mode()
514 if (!ldo->ena_gpiod) in lp8788_config_ldo_enable_mode()
525 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); in lp8788_dldo_probe()
526 int id = pdev->id; in lp8788_dldo_probe()
527 struct lp8788_ldo *ldo; in lp8788_dldo_probe() local
532 ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); in lp8788_dldo_probe()
533 if (!ldo) in lp8788_dldo_probe()
534 return -ENOMEM; in lp8788_dldo_probe()
536 ldo->lp = lp; in lp8788_dldo_probe()
537 ret = lp8788_config_ldo_enable_mode(pdev, ldo, id); in lp8788_dldo_probe()
541 if (ldo->ena_gpiod) in lp8788_dldo_probe()
542 cfg.ena_gpiod = ldo->ena_gpiod; in lp8788_dldo_probe()
544 cfg.dev = pdev->dev.parent; in lp8788_dldo_probe()
545 cfg.init_data = lp->pdata ? lp->pdata->dldo_data[id] : NULL; in lp8788_dldo_probe()
546 cfg.driver_data = ldo; in lp8788_dldo_probe()
547 cfg.regmap = lp->regmap; in lp8788_dldo_probe()
549 rdev = devm_regulator_register(&pdev->dev, &lp8788_dldo_desc[id], &cfg); in lp8788_dldo_probe()
552 dev_err(&pdev->dev, "DLDO%d regulator register err = %d\n", in lp8788_dldo_probe()
557 ldo->regulator = rdev; in lp8788_dldo_probe()
558 platform_set_drvdata(pdev, ldo); in lp8788_dldo_probe()
573 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); in lp8788_aldo_probe()
574 int id = pdev->id; in lp8788_aldo_probe()
575 struct lp8788_ldo *ldo; in lp8788_aldo_probe() local
580 ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); in lp8788_aldo_probe()
581 if (!ldo) in lp8788_aldo_probe()
582 return -ENOMEM; in lp8788_aldo_probe()
584 ldo->lp = lp; in lp8788_aldo_probe()
585 ret = lp8788_config_ldo_enable_mode(pdev, ldo, id + ALDO1); in lp8788_aldo_probe()
589 if (ldo->ena_gpiod) in lp8788_aldo_probe()
590 cfg.ena_gpiod = ldo->ena_gpiod; in lp8788_aldo_probe()
592 cfg.dev = pdev->dev.parent; in lp8788_aldo_probe()
593 cfg.init_data = lp->pdata ? lp->pdata->aldo_data[id] : NULL; in lp8788_aldo_probe()
594 cfg.driver_data = ldo; in lp8788_aldo_probe()
595 cfg.regmap = lp->regmap; in lp8788_aldo_probe()
597 rdev = devm_regulator_register(&pdev->dev, &lp8788_aldo_desc[id], &cfg); in lp8788_aldo_probe()
600 dev_err(&pdev->dev, "ALDO%d regulator register err = %d\n", in lp8788_aldo_probe()
605 ldo->regulator = rdev; in lp8788_aldo_probe()
606 platform_set_drvdata(pdev, ldo); in lp8788_aldo_probe()
636 MODULE_DESCRIPTION("TI LP8788 LDO Driver");
639 MODULE_ALIAS("platform:lp8788-dldo");
640 MODULE_ALIAS("platform:lp8788-aldo");