Lines Matching +full:regulator +full:- +full:over +full:- +full:current +full:- +full:protection
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd.
7 * Copyright (c) <2013-2017> Linaro Ltd.
16 #include <linux/mfd/hi6421-pmic.h>
24 { .name = "hi6421-regulator", },
28 { .name = "hi6421v530-regulator", },
40 .compatible = "hisilicon,hi6421-pmic",
44 .compatible = "hisilicon,hi6421v530-pmic",
59 type = (uintptr_t)device_get_match_data(&pdev->dev); in hi6421_pmic_probe()
61 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); in hi6421_pmic_probe()
63 return -ENOMEM; in hi6421_pmic_probe()
69 pmic->regmap = devm_regmap_init_mmio_clk(&pdev->dev, NULL, base, in hi6421_pmic_probe()
71 if (IS_ERR(pmic->regmap)) { in hi6421_pmic_probe()
72 dev_err(&pdev->dev, "Failed to initialise Regmap: %ld\n", in hi6421_pmic_probe()
73 PTR_ERR(pmic->regmap)); in hi6421_pmic_probe()
74 return PTR_ERR(pmic->regmap); in hi6421_pmic_probe()
81 /* set over-current protection debounce 8ms */ in hi6421_pmic_probe()
82 regmap_update_bits(pmic->regmap, HI6421_OCP_DEB_CTRL_REG, in hi6421_pmic_probe()
97 dev_err(&pdev->dev, "Unknown device type %d\n", in hi6421_pmic_probe()
99 return -EINVAL; in hi6421_pmic_probe()
102 ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, in hi6421_pmic_probe()
105 dev_err(&pdev->dev, "Failed to add child devices: %d\n", ret); in hi6421_pmic_probe()