···11SKY81452 voltage regulator2233Required properties:44+- regulator node named lout.45- any required generic properties defined in regulator.txt5667Optional properties:···109Example:11101211 regulator {1313- /* generic regulator properties */1414- regulator-name = "touch_en";1515- regulator-min-microvolt = <4500000>;1616- regulator-max-microvolt = <8000000>;1212+ lout {1313+ regulator-name = "sky81452-lout";1414+ regulator-min-microvolt = <4500000>;1515+ regulator-max-microvolt = <8000000>;1616+ };1717 };
+1-1
drivers/regulator/Kconfig
···555555556556config REGULATOR_SKY81452557557 tristate "Skyworks Solutions SKY81452 voltage regulator"558558- depends on SKY81452558558+ depends on MFD_SKY81452559559 help560560 This driver supports Skyworks SKY81452 voltage output regulator561561 via I2C bus. SKY81452 has one voltage linear regulator can be
+9-37
drivers/regulator/sky81452-regulator.c
···55 * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>66 *77 * This program is free software; you can redistribute it and/or modify it88- * under the terms of the GNU General Public License as published by the99- * Free Software Foundation; either version 2, or (at your option) any1010- * later version.88+ * under the terms of the GNU General Public License version 299+ * as published by the Free Software Foundation.1110 *1211 * This program is distributed in the hope that it will be useful, but1312 * WITHOUT ANY WARRANTY; without even the implied warranty of···51525253static const struct regulator_desc sky81452_reg = {5354 .name = "LOUT",5555+ .of_match = of_match_ptr("lout"),5656+ .regulators_node = of_match_ptr("regulator"),5457 .ops = &sky81452_reg_ops,5558 .type = REGULATOR_VOLTAGE,5659 .owner = THIS_MODULE,···6564 .enable_mask = SKY81452_LEN,6665};67666868-#ifdef CONFIG_OF6969-static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev)7070-{7171- struct regulator_init_data *init_data;7272- struct device_node *np;7373-7474- np = of_get_child_by_name(dev->parent->of_node, "regulator");7575- if (unlikely(!np)) {7676- dev_err(dev, "regulator node not found");7777- return NULL;7878- }7979-8080- init_data = of_get_regulator_init_data(dev, np, &sky81452_reg);8181-8282- of_node_put(np);8383- return init_data;8484-}8585-#else8686-static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev)8787-{8888- return ERR_PTR(-EINVAL);8989-}9090-#endif9191-9267static int sky81452_reg_probe(struct platform_device *pdev)9368{9469 struct device *dev = &pdev->dev;···7295 struct regulator_config config = { };7396 struct regulator_dev *rdev;74977575- if (!init_data) {7676- init_data = sky81452_reg_parse_dt(dev);7777- if (IS_ERR(init_data))7878- return PTR_ERR(init_data);7979- }8080-8181- config.dev = dev;9898+ config.dev = dev->parent;8299 config.init_data = init_data;83100 config.of_node = dev->of_node;84101 config.regmap = dev_get_drvdata(dev->parent);8510286103 rdev = devm_regulator_register(dev, &sky81452_reg, &config);8787- if (IS_ERR(rdev))104104+ if (IS_ERR(rdev)) {105105+ dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(rdev));88106 return PTR_ERR(rdev);107107+ }8910890109 platform_set_drvdata(pdev, rdev);91110···99126100127MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver");101128MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");102102-MODULE_LICENSE("GPL");103103-MODULE_VERSION("1.0");129129+MODULE_LICENSE("GPL v2");