diff options
| -rw-r--r-- | Documentation/devicetree/bindings/regulator/act8865-regulator.txt | 7 | ||||
| -rw-r--r-- | drivers/regulator/88pm800.c | 1 | ||||
| -rw-r--r-- | drivers/regulator/ab8500.c | 38 | ||||
| -rw-r--r-- | drivers/regulator/act8865-regulator.c | 329 | ||||
| -rw-r--r-- | drivers/regulator/as3722-regulator.c | 4 | ||||
| -rw-r--r-- | drivers/regulator/bcm590xx-regulator.c | 16 | ||||
| -rw-r--r-- | include/linux/regulator/ab8500.h | 14 | ||||
| -rw-r--r-- | include/linux/regulator/act8865.h | 23 |
8 files changed, 231 insertions, 201 deletions
diff --git a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt index bef1fbb647ca..865614b34d6f 100644 --- a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt | |||
| @@ -1,13 +1,16 @@ | |||
| 1 | ACT8865 regulator | 1 | ACT88xx regulators |
| 2 | ------------------- | 2 | ------------------- |
| 3 | 3 | ||
| 4 | Required properties: | 4 | Required properties: |
| 5 | - compatible: "active-semi,act8865" | 5 | - compatible: "active-semi,act8846" or "active-semi,act8865" |
| 6 | - reg: I2C slave address | 6 | - reg: I2C slave address |
| 7 | 7 | ||
| 8 | Any standard regulator properties can be used to configure the single regulator. | 8 | Any standard regulator properties can be used to configure the single regulator. |
| 9 | 9 | ||
| 10 | The valid names for regulators are: | 10 | The valid names for regulators are: |
| 11 | - for act8846: | ||
| 12 | REG1, REG2, REG3, REG4, REG5, REG6, REG7, REG8, REG9, REG10, REG11, REG12 | ||
| 13 | - for act8865: | ||
| 11 | DCDC_REG1, DCDC_REG2, DCDC_REG3, LDO_REG1, LDO_REG2, LDO_REG3, LDO_REG4. | 14 | DCDC_REG1, DCDC_REG2, DCDC_REG3, LDO_REG1, LDO_REG2, LDO_REG3, LDO_REG4. |
| 12 | 15 | ||
| 13 | Example: | 16 | Example: |
diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c index 7a721d67e6ac..4e6c8c611905 100644 --- a/drivers/regulator/88pm800.c +++ b/drivers/regulator/88pm800.c | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #define PM800_BUCK1_3 (0x3F) | 52 | #define PM800_BUCK1_3 (0x3F) |
| 53 | #define PM800_BUCK2 (0x40) | 53 | #define PM800_BUCK2 (0x40) |
| 54 | #define PM800_BUCK3 (0x41) | 54 | #define PM800_BUCK3 (0x41) |
| 55 | #define PM800_BUCK3 (0x41) | ||
| 56 | #define PM800_BUCK4 (0x42) | 55 | #define PM800_BUCK4 (0x42) |
| 57 | #define PM800_BUCK4_1 (0x43) | 56 | #define PM800_BUCK4_1 (0x43) |
| 58 | #define PM800_BUCK4_2 (0x44) | 57 | #define PM800_BUCK4_2 (0x44) |
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index c625468c7f2c..1fda14e12ea8 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
| @@ -3037,28 +3037,12 @@ static int ab8500_regulator_register(struct platform_device *pdev, | |||
| 3037 | return 0; | 3037 | return 0; |
| 3038 | } | 3038 | } |
| 3039 | 3039 | ||
| 3040 | static int | ||
| 3041 | ab8500_regulator_of_probe(struct platform_device *pdev, | ||
| 3042 | struct device_node *np) | ||
| 3043 | { | ||
| 3044 | struct of_regulator_match *match = abx500_regulator.match; | ||
| 3045 | int err, i; | ||
| 3046 | |||
| 3047 | for (i = 0; i < abx500_regulator.info_size; i++) { | ||
| 3048 | err = ab8500_regulator_register( | ||
| 3049 | pdev, match[i].init_data, i, match[i].of_node); | ||
| 3050 | if (err) | ||
| 3051 | return err; | ||
| 3052 | } | ||
| 3053 | |||
| 3054 | return 0; | ||
| 3055 | } | ||
| 3056 | |||
| 3057 | static int ab8500_regulator_probe(struct platform_device *pdev) | 3040 | static int ab8500_regulator_probe(struct platform_device *pdev) |
| 3058 | { | 3041 | { |
| 3059 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); | 3042 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); |
| 3060 | struct device_node *np = pdev->dev.of_node; | 3043 | struct device_node *np = pdev->dev.of_node; |
| 3061 | int err; | 3044 | struct of_regulator_match *match; |
| 3045 | int err, i; | ||
| 3062 | 3046 | ||
| 3063 | if (!ab8500) { | 3047 | if (!ab8500) { |
| 3064 | dev_err(&pdev->dev, "null mfd parent\n"); | 3048 | dev_err(&pdev->dev, "null mfd parent\n"); |
| @@ -3075,24 +3059,20 @@ static int ab8500_regulator_probe(struct platform_device *pdev) | |||
| 3075 | "Error parsing regulator init data: %d\n", err); | 3059 | "Error parsing regulator init data: %d\n", err); |
| 3076 | return err; | 3060 | return err; |
| 3077 | } | 3061 | } |
| 3078 | return ab8500_regulator_of_probe(pdev, np); | ||
| 3079 | } | ||
| 3080 | |||
| 3081 | static int ab8500_regulator_remove(struct platform_device *pdev) | ||
| 3082 | { | ||
| 3083 | int err; | ||
| 3084 | 3062 | ||
| 3085 | /* remove regulator debug */ | 3063 | match = abx500_regulator.match; |
| 3086 | err = ab8500_regulator_debug_exit(pdev); | 3064 | for (i = 0; i < abx500_regulator.info_size; i++) { |
| 3087 | if (err) | 3065 | err = ab8500_regulator_register(pdev, match[i].init_data, i, |
| 3088 | return err; | 3066 | match[i].of_node); |
| 3067 | if (err) | ||
| 3068 | return err; | ||
| 3069 | } | ||
| 3089 | 3070 | ||
| 3090 | return 0; | 3071 | return 0; |
| 3091 | } | 3072 | } |
| 3092 | 3073 | ||
| 3093 | static struct platform_driver ab8500_regulator_driver = { | 3074 | static struct platform_driver ab8500_regulator_driver = { |
| 3094 | .probe = ab8500_regulator_probe, | 3075 | .probe = ab8500_regulator_probe, |
| 3095 | .remove = ab8500_regulator_remove, | ||
| 3096 | .driver = { | 3076 | .driver = { |
| 3097 | .name = "ab8500-regulator", | 3077 | .name = "ab8500-regulator", |
| 3098 | .owner = THIS_MODULE, | 3078 | .owner = THIS_MODULE, |
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index 89f9f0c0f64d..afd06f92dfdf 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * act8865-regulator.c - Voltage regulation for the active-semi ACT8865 | 2 | * act8865-regulator.c - Voltage regulation for active-semi ACT88xx PMUs |
| 3 | * http://www.active-semi.com/sheets/ACT8865_Datasheet.pdf | 3 | * |
| 4 | * http://www.active-semi.com/products/power-management-units/act88xx/ | ||
| 4 | * | 5 | * |
| 5 | * Copyright (C) 2013 Atmel Corporation | 6 | * Copyright (C) 2013 Atmel Corporation |
| 6 | * | 7 | * |
| @@ -28,6 +29,40 @@ | |||
| 28 | #include <linux/regmap.h> | 29 | #include <linux/regmap.h> |
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 32 | * ACT8846 Global Register Map. | ||
| 33 | */ | ||
| 34 | #define ACT8846_SYS0 0x00 | ||
| 35 | #define ACT8846_SYS1 0x01 | ||
| 36 | #define ACT8846_REG1_VSET 0x10 | ||
| 37 | #define ACT8846_REG1_CTRL 0x12 | ||
| 38 | #define ACT8846_REG2_VSET0 0x20 | ||
| 39 | #define ACT8846_REG2_VSET1 0x21 | ||
| 40 | #define ACT8846_REG2_CTRL 0x22 | ||
| 41 | #define ACT8846_REG3_VSET0 0x30 | ||
| 42 | #define ACT8846_REG3_VSET1 0x31 | ||
| 43 | #define ACT8846_REG3_CTRL 0x32 | ||
| 44 | #define ACT8846_REG4_VSET0 0x40 | ||
| 45 | #define ACT8846_REG4_VSET1 0x41 | ||
| 46 | #define ACT8846_REG4_CTRL 0x42 | ||
| 47 | #define ACT8846_REG5_VSET 0x50 | ||
| 48 | #define ACT8846_REG5_CTRL 0x51 | ||
| 49 | #define ACT8846_REG6_VSET 0x58 | ||
| 50 | #define ACT8846_REG6_CTRL 0x59 | ||
| 51 | #define ACT8846_REG7_VSET 0x60 | ||
| 52 | #define ACT8846_REG7_CTRL 0x61 | ||
| 53 | #define ACT8846_REG8_VSET 0x68 | ||
| 54 | #define ACT8846_REG8_CTRL 0x69 | ||
| 55 | #define ACT8846_REG9_VSET 0x70 | ||
| 56 | #define ACT8846_REG9_CTRL 0x71 | ||
| 57 | #define ACT8846_REG10_VSET 0x80 | ||
| 58 | #define ACT8846_REG10_CTRL 0x81 | ||
| 59 | #define ACT8846_REG11_VSET 0x90 | ||
| 60 | #define ACT8846_REG11_CTRL 0x91 | ||
| 61 | #define ACT8846_REG12_VSET 0xa0 | ||
| 62 | #define ACT8846_REG12_CTRL 0xa1 | ||
| 63 | #define ACT8846_REG13_CTRL 0xb1 | ||
| 64 | |||
| 65 | /* | ||
| 31 | * ACT8865 Global Register Map. | 66 | * ACT8865 Global Register Map. |
| 32 | */ | 67 | */ |
| 33 | #define ACT8865_SYS_MODE 0x00 | 68 | #define ACT8865_SYS_MODE 0x00 |
| @@ -70,7 +105,7 @@ static const struct regmap_config act8865_regmap_config = { | |||
| 70 | .val_bits = 8, | 105 | .val_bits = 8, |
| 71 | }; | 106 | }; |
| 72 | 107 | ||
| 73 | static const struct regulator_linear_range act8865_volatge_ranges[] = { | 108 | static const struct regulator_linear_range act8865_voltage_ranges[] = { |
| 74 | REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000), | 109 | REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000), |
| 75 | REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000), | 110 | REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000), |
| 76 | REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000), | 111 | REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000), |
| @@ -86,114 +121,70 @@ static struct regulator_ops act8865_ops = { | |||
| 86 | .is_enabled = regulator_is_enabled_regmap, | 121 | .is_enabled = regulator_is_enabled_regmap, |
| 87 | }; | 122 | }; |
