Krzysztof Kozlowski | 5e9384c | 2018-08-07 18:18:25 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // |
| 3 | // max77686.c - Regulator driver for the Maxim 77686 |
| 4 | // |
| 5 | // Copyright (C) 2012 Samsung Electronics |
| 6 | // Chiwoong Byun <woong.byun@samsung.com> |
| 7 | // Jonghwa Lee <jonghwa3.lee@samsung.com> |
| 8 | // |
| 9 | // This driver is based on max8997.c |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/bug.h> |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 13 | #include <linux/err.h> |
Linus Walleij | 96392c3 | 2018-11-15 09:01:19 +0100 | [diff] [blame] | 14 | #include <linux/gpio/consumer.h> |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 15 | #include <linux/slab.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/regulator/driver.h> |
| 18 | #include <linux/regulator/machine.h> |
Yadwinder Singh Brar | 4706fca | 2012-07-05 09:28:25 +0530 | [diff] [blame] | 19 | #include <linux/regulator/of_regulator.h> |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 20 | #include <linux/mfd/max77686.h> |
| 21 | #include <linux/mfd/max77686-private.h> |
| 22 | |
| 23 | #define MAX77686_LDO_MINUV 800000 |
| 24 | #define MAX77686_LDO_UVSTEP 50000 |
| 25 | #define MAX77686_LDO_LOW_MINUV 800000 |
| 26 | #define MAX77686_LDO_LOW_UVSTEP 25000 |
| 27 | #define MAX77686_BUCK_MINUV 750000 |
| 28 | #define MAX77686_BUCK_UVSTEP 50000 |
Krzysztof Kozlowski | a959730 | 2016-04-29 12:59:51 +0200 | [diff] [blame] | 29 | #define MAX77686_BUCK_ENABLE_TIME 40 /* us */ |
| 30 | #define MAX77686_DVS_ENABLE_TIME 22 /* us */ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 31 | #define MAX77686_RAMP_DELAY 100000 /* uV/us */ |
| 32 | #define MAX77686_DVS_RAMP_DELAY 27500 /* uV/us */ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 33 | #define MAX77686_DVS_MINUV 600000 |
| 34 | #define MAX77686_DVS_UVSTEP 12500 |
| 35 | |
Krzysztof Kozlowski | 7636f19 | 2014-10-27 13:11:47 +0100 | [diff] [blame] | 36 | /* |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 37 | * Value for configuring buck[89] and LDO{20,21,22} as GPIO control. |
| 38 | * It is the same as 'off' for other regulators. |
| 39 | */ |
| 40 | #define MAX77686_GPIO_CONTROL 0x0 |
| 41 | /* |
Krzysztof Kozlowski | 7636f19 | 2014-10-27 13:11:47 +0100 | [diff] [blame] | 42 | * Values used for configuring LDOs and bucks. |
| 43 | * Forcing low power mode: LDO1, 3-5, 9, 13, 17-26 |
| 44 | */ |
| 45 | #define MAX77686_LDO_LOWPOWER 0x1 |
| 46 | /* |
| 47 | * On/off controlled by PWRREQ: |
| 48 | * - LDO2, 6-8, 10-12, 14-16 |
| 49 | * - buck[1234] |
| 50 | */ |
| 51 | #define MAX77686_OFF_PWRREQ 0x1 |
| 52 | /* Low power mode controlled by PWRREQ: All LDOs */ |
| 53 | #define MAX77686_LDO_LOWPOWER_PWRREQ 0x2 |
| 54 | /* Forcing low power mode: buck[234] */ |
| 55 | #define MAX77686_BUCK_LOWPOWER 0x2 |
| 56 | #define MAX77686_NORMAL 0x3 |
| 57 | |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 58 | #define MAX77686_OPMODE_SHIFT 6 |
| 59 | #define MAX77686_OPMODE_BUCK234_SHIFT 4 |
| 60 | #define MAX77686_OPMODE_MASK 0x3 |
| 61 | |
| 62 | #define MAX77686_VSEL_MASK 0x3F |
| 63 | #define MAX77686_DVS_VSEL_MASK 0xFF |
| 64 | |
| 65 | #define MAX77686_RAMP_RATE_MASK 0xC0 |
| 66 | |
| 67 | #define MAX77686_REGULATORS MAX77686_REG_MAX |
| 68 | #define MAX77686_LDOS 26 |
| 69 | |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 70 | struct max77686_data { |
Linus Walleij | 96392c3 | 2018-11-15 09:01:19 +0100 | [diff] [blame] | 71 | struct device *dev; |
Joe Perches | c53403a | 2015-05-18 10:01:03 -0700 | [diff] [blame] | 72 | DECLARE_BITMAP(gpio_enabled, MAX77686_REGULATORS); |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 73 | |
Krzysztof Kozlowski | eca29da | 2014-11-04 09:49:41 +0100 | [diff] [blame] | 74 | /* Array indexed by regulator id */ |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 75 | unsigned int opmode[MAX77686_REGULATORS]; |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 76 | }; |
| 77 | |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 78 | static unsigned int max77686_get_opmode_shift(int id) |
| 79 | { |
| 80 | switch (id) { |
| 81 | case MAX77686_BUCK1: |
| 82 | case MAX77686_BUCK5 ... MAX77686_BUCK9: |
| 83 | return 0; |
| 84 | case MAX77686_BUCK2 ... MAX77686_BUCK4: |
| 85 | return MAX77686_OPMODE_BUCK234_SHIFT; |
| 86 | default: |
| 87 | /* all LDOs */ |
| 88 | return MAX77686_OPMODE_SHIFT; |
| 89 | } |
| 90 | } |
| 91 | |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 92 | /* |
| 93 | * When regulator is configured for GPIO control then it |
| 94 | * replaces "normal" mode. Any change from low power mode to normal |
| 95 | * should actually change to GPIO control. |
| 96 | * Map normal mode to proper value for such regulators. |
| 97 | */ |
| 98 | static unsigned int max77686_map_normal_mode(struct max77686_data *max77686, |
| 99 | int id) |
| 100 | { |
| 101 | switch (id) { |
| 102 | case MAX77686_BUCK8: |
| 103 | case MAX77686_BUCK9: |
| 104 | case MAX77686_LDO20 ... MAX77686_LDO22: |
Joe Perches | c53403a | 2015-05-18 10:01:03 -0700 | [diff] [blame] | 105 | if (test_bit(id, max77686->gpio_enabled)) |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 106 | return MAX77686_GPIO_CONTROL; |
| 107 | } |
| 108 | |
| 109 | return MAX77686_NORMAL; |
| 110 | } |
| 111 | |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 112 | /* Some BUCKs and LDOs supports Normal[ON/OFF] mode during suspend */ |
| 113 | static int max77686_set_suspend_disable(struct regulator_dev *rdev) |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 114 | { |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 115 | unsigned int val, shift; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 116 | struct max77686_data *max77686 = rdev_get_drvdata(rdev); |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 117 | int ret, id = rdev_get_id(rdev); |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 118 | |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 119 | shift = max77686_get_opmode_shift(id); |
| 120 | val = MAX77686_OFF_PWRREQ; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 121 | |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 122 | ret = regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 123 | rdev->desc->enable_mask, val << shift); |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 124 | if (ret) |
| 125 | return ret; |
| 126 | |
Thiago Farina | 40e7214 | 2013-02-13 17:52:26 -0200 | [diff] [blame] | 127 | max77686->opmode[id] = val; |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 128 | return 0; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | /* Some LDOs supports [LPM/Normal]ON mode during suspend state */ |
| 132 | static int max77686_set_suspend_mode(struct regulator_dev *rdev, |
| 133 | unsigned int mode) |
| 134 | { |
| 135 | struct max77686_data *max77686 = rdev_get_drvdata(rdev); |
| 136 | unsigned int val; |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 137 | int ret, id = rdev_get_id(rdev); |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 138 | |
| 139 | /* BUCK[5-9] doesn't support this feature */ |
Thiago Farina | 40e7214 | 2013-02-13 17:52:26 -0200 | [diff] [blame] | 140 | if (id >= MAX77686_BUCK5) |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 141 | return 0; |
| 142 | |
| 143 | switch (mode) { |
| 144 | case REGULATOR_MODE_IDLE: /* ON in LP Mode */ |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 145 | val = MAX77686_LDO_LOWPOWER_PWRREQ; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 146 | break; |
| 147 | case REGULATOR_MODE_NORMAL: /* ON in Normal Mode */ |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 148 | val = max77686_map_normal_mode(max77686, id); |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 149 | break; |
| 150 | default: |
| 151 | pr_warn("%s: regulator_suspend_mode : 0x%x not supported\n", |
| 152 | rdev->desc->name, mode); |
| 153 | return -EINVAL; |
| 154 | } |
| 155 | |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 156 | ret = regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 157 | rdev->desc->enable_mask, |
| 158 | val << MAX77686_OPMODE_SHIFT); |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 159 | if (ret) |
| 160 | return ret; |
| 161 | |
Thiago Farina | 40e7214 | 2013-02-13 17:52:26 -0200 | [diff] [blame] | 162 | max77686->opmode[id] = val; |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 163 | return 0; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | /* Some LDOs supports LPM-ON/OFF/Normal-ON mode during suspend state */ |
| 167 | static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev, |
| 168 | unsigned int mode) |
| 169 | { |
| 170 | unsigned int val; |
| 171 | struct max77686_data *max77686 = rdev_get_drvdata(rdev); |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 172 | int ret, id = rdev_get_id(rdev); |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 173 | |
| 174 | switch (mode) { |
| 175 | case REGULATOR_MODE_STANDBY: /* switch off */ |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 176 | val = MAX77686_OFF_PWRREQ; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 177 | break; |
| 178 | case REGULATOR_MODE_IDLE: /* ON in LP Mode */ |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 179 | val = MAX77686_LDO_LOWPOWER_PWRREQ; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 180 | break; |
| 181 | case REGULATOR_MODE_NORMAL: /* ON in Normal Mode */ |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 182 | val = max77686_map_normal_mode(max77686, id); |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 183 | break; |
| 184 | default: |
| 185 | pr_warn("%s: regulator_suspend_mode : 0x%x not supported\n", |
| 186 | rdev->desc->name, mode); |
| 187 | return -EINVAL; |
| 188 | } |
| 189 | |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 190 | ret = regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 191 | rdev->desc->enable_mask, |
| 192 | val << MAX77686_OPMODE_SHIFT); |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 193 | if (ret) |
| 194 | return ret; |
| 195 | |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 196 | max77686->opmode[id] = val; |
Axel Lin | 3ecf198 | 2013-04-27 16:18:16 +0800 | [diff] [blame] | 197 | return 0; |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 198 | } |
| 199 | |
Yadwinder Singh Brar | 38d3403 | 2012-10-22 09:39:28 +0530 | [diff] [blame] | 200 | static int max77686_enable(struct regulator_dev *rdev) |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 201 | { |
| 202 | struct max77686_data *max77686 = rdev_get_drvdata(rdev); |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 203 | unsigned int shift; |
| 204 | int id = rdev_get_id(rdev); |
| 205 | |
| 206 | shift = max77686_get_opmode_shift(id); |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 207 | |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 208 | if (max77686->opmode[id] == MAX77686_OFF_PWRREQ) |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 209 | max77686->opmode[id] = max77686_map_normal_mode(max77686, id); |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 210 | |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 211 | return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, |
| 212 | rdev->desc->enable_mask, |
Krzysztof Kozlowski | 68c5d18 | 2014-10-27 13:11:48 +0100 | [diff] [blame] | 213 | max77686->opmode[id] << shift); |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 214 | } |
| 215 | |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 216 | static int max77686_of_parse_cb(struct device_node *np, |
| 217 | const struct regulator_desc *desc, |
| 218 | struct regulator_config *config) |
| 219 | { |
| 220 | struct max77686_data *max77686 = config->driver_data; |
Linus Walleij | d03c63d | 2018-12-06 13:43:43 +0100 | [diff] [blame] | 221 | int ret; |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 222 | |
| 223 | switch (desc->id) { |
| 224 | case MAX77686_BUCK8: |
| 225 | case MAX77686_BUCK9: |
| 226 | case MAX77686_LDO20 ... MAX77686_LDO22: |
Dmitry Torokhov | 0b2ba81 | 2019-10-04 16:10:17 -0700 | [diff] [blame] | 227 | config->ena_gpiod = fwnode_gpiod_get_index( |
| 228 | of_fwnode_handle(np), |
| 229 | "maxim,ena", |
Linus Walleij | 96392c3 | 2018-11-15 09:01:19 +0100 | [diff] [blame] | 230 | 0, |
| 231 | GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, |
| 232 | "max77686-regulator"); |
| 233 | if (IS_ERR(config->ena_gpiod)) |
| 234 | config->ena_gpiod = NULL; |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 235 | break; |
| 236 | default: |
| 237 | return 0; |
| 238 | } |
| 239 | |
Linus Walleij | 96392c3 | 2018-11-15 09:01:19 +0100 | [diff] [blame] | 240 | if (config->ena_gpiod) { |
Joe Perches | c53403a | 2015-05-18 10:01:03 -0700 | [diff] [blame] | 241 | set_bit(desc->id, max77686->gpio_enabled); |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 242 | |
Linus Walleij | d03c63d | 2018-12-06 13:43:43 +0100 | [diff] [blame] | 243 | ret = regmap_update_bits(config->regmap, desc->enable_reg, |
| 244 | desc->enable_mask, |
| 245 | MAX77686_GPIO_CONTROL); |
| 246 | if (ret) { |
| 247 | gpiod_put(config->ena_gpiod); |
| 248 | config->ena_gpiod = NULL; |
| 249 | } |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | return 0; |
| 253 | } |
| 254 | |
Axel Lin | 3c37d89 | 2021-06-05 09:34:24 +0800 | [diff] [blame] | 255 | static const unsigned int max77686_buck_dvs_ramp_table[] = { |
| 256 | 13750, 27500, 55000, 100000 |
| 257 | }; |
| 258 | |
Bhumika Goyal | 404826c | 2017-01-28 19:52:24 +0530 | [diff] [blame] | 259 | static const struct regulator_ops max77686_ops = { |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 260 | .list_voltage = regulator_list_voltage_linear, |
Axel Lin | 2e3f7f2 | 2012-06-03 22:46:14 +0800 | [diff] [blame] | 261 | .map_voltage = regulator_map_voltage_linear, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 262 | .is_enabled = regulator_is_enabled_regmap, |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 263 | .enable = max77686_enable, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 264 | .disable = regulator_disable_regmap, |
| 265 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 266 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 267 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 268 | .set_suspend_mode = max77686_set_suspend_mode, |
| 269 | }; |
| 270 | |
Bhumika Goyal | 404826c | 2017-01-28 19:52:24 +0530 | [diff] [blame] | 271 | static const struct regulator_ops max77686_ldo_ops = { |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 272 | .list_voltage = regulator_list_voltage_linear, |
| 273 | .map_voltage = regulator_map_voltage_linear, |
| 274 | .is_enabled = regulator_is_enabled_regmap, |
| 275 | .enable = max77686_enable, |
| 276 | .disable = regulator_disable_regmap, |
| 277 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 278 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 279 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
| 280 | .set_suspend_mode = max77686_ldo_set_suspend_mode, |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 281 | .set_suspend_disable = max77686_set_suspend_disable, |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 282 | }; |
| 283 | |
Bhumika Goyal | 404826c | 2017-01-28 19:52:24 +0530 | [diff] [blame] | 284 | static const struct regulator_ops max77686_buck1_ops = { |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 285 | .list_voltage = regulator_list_voltage_linear, |
| 286 | .map_voltage = regulator_map_voltage_linear, |
| 287 | .is_enabled = regulator_is_enabled_regmap, |
| 288 | .enable = max77686_enable, |
| 289 | .disable = regulator_disable_regmap, |
| 290 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 291 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 292 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 293 | .set_suspend_disable = max77686_set_suspend_disable, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 294 | }; |
| 295 | |
Bhumika Goyal | 404826c | 2017-01-28 19:52:24 +0530 | [diff] [blame] | 296 | static const struct regulator_ops max77686_buck_dvs_ops = { |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 297 | .list_voltage = regulator_list_voltage_linear, |
Axel Lin | 2e3f7f2 | 2012-06-03 22:46:14 +0800 | [diff] [blame] | 298 | .map_voltage = regulator_map_voltage_linear, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 299 | .is_enabled = regulator_is_enabled_regmap, |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 300 | .enable = max77686_enable, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 301 | .disable = regulator_disable_regmap, |
| 302 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 303 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 304 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
Axel Lin | 3c37d89 | 2021-06-05 09:34:24 +0800 | [diff] [blame] | 305 | .set_ramp_delay = regulator_set_ramp_delay_regmap, |
Krzysztof Kozlowski | 78ce612 | 2014-10-29 12:14:52 +0100 | [diff] [blame] | 306 | .set_suspend_disable = max77686_set_suspend_disable, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | #define regulator_desc_ldo(num) { \ |
| 310 | .name = "LDO"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 311 | .of_match = of_match_ptr("LDO"#num), \ |
| 312 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 313 | .of_parse_cb = max77686_of_parse_cb, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 314 | .id = MAX77686_LDO##num, \ |
| 315 | .ops = &max77686_ops, \ |
| 316 | .type = REGULATOR_VOLTAGE, \ |
| 317 | .owner = THIS_MODULE, \ |
| 318 | .min_uV = MAX77686_LDO_MINUV, \ |
| 319 | .uV_step = MAX77686_LDO_UVSTEP, \ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 320 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 321 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 322 | .vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 323 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 324 | .enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 325 | .enable_mask = MAX77686_OPMODE_MASK \ |
| 326 | << MAX77686_OPMODE_SHIFT, \ |
| 327 | } |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 328 | #define regulator_desc_lpm_ldo(num) { \ |
| 329 | .name = "LDO"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 330 | .of_match = of_match_ptr("LDO"#num), \ |
| 331 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 332 | .id = MAX77686_LDO##num, \ |
| 333 | .ops = &max77686_ldo_ops, \ |
| 334 | .type = REGULATOR_VOLTAGE, \ |
| 335 | .owner = THIS_MODULE, \ |
| 336 | .min_uV = MAX77686_LDO_MINUV, \ |
| 337 | .uV_step = MAX77686_LDO_UVSTEP, \ |
| 338 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
| 339 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 340 | .vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 341 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 342 | .enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 343 | .enable_mask = MAX77686_OPMODE_MASK \ |
| 344 | << MAX77686_OPMODE_SHIFT, \ |
| 345 | } |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 346 | #define regulator_desc_ldo_low(num) { \ |
| 347 | .name = "LDO"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 348 | .of_match = of_match_ptr("LDO"#num), \ |
| 349 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 350 | .id = MAX77686_LDO##num, \ |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 351 | .ops = &max77686_ldo_ops, \ |
| 352 | .type = REGULATOR_VOLTAGE, \ |
| 353 | .owner = THIS_MODULE, \ |
| 354 | .min_uV = MAX77686_LDO_LOW_MINUV, \ |
| 355 | .uV_step = MAX77686_LDO_LOW_UVSTEP, \ |
| 356 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
| 357 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 358 | .vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 359 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 360 | .enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 361 | .enable_mask = MAX77686_OPMODE_MASK \ |
| 362 | << MAX77686_OPMODE_SHIFT, \ |
| 363 | } |
| 364 | #define regulator_desc_ldo1_low(num) { \ |
| 365 | .name = "LDO"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 366 | .of_match = of_match_ptr("LDO"#num), \ |
| 367 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 368 | .id = MAX77686_LDO##num, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 369 | .ops = &max77686_ops, \ |
| 370 | .type = REGULATOR_VOLTAGE, \ |
| 371 | .owner = THIS_MODULE, \ |
| 372 | .min_uV = MAX77686_LDO_LOW_MINUV, \ |
| 373 | .uV_step = MAX77686_LDO_LOW_UVSTEP, \ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 374 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 375 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 376 | .vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 377 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 378 | .enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \ |
| 379 | .enable_mask = MAX77686_OPMODE_MASK \ |
| 380 | << MAX77686_OPMODE_SHIFT, \ |
| 381 | } |
| 382 | #define regulator_desc_buck(num) { \ |
| 383 | .name = "BUCK"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 384 | .of_match = of_match_ptr("BUCK"#num), \ |
| 385 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Krzysztof Kozlowski | 3307e90 | 2015-01-05 12:48:43 +0100 | [diff] [blame] | 386 | .of_parse_cb = max77686_of_parse_cb, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 387 | .id = MAX77686_BUCK##num, \ |
| 388 | .ops = &max77686_ops, \ |
| 389 | .type = REGULATOR_VOLTAGE, \ |
| 390 | .owner = THIS_MODULE, \ |
| 391 | .min_uV = MAX77686_BUCK_MINUV, \ |
| 392 | .uV_step = MAX77686_BUCK_UVSTEP, \ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 393 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
Krzysztof Kozlowski | a959730 | 2016-04-29 12:59:51 +0200 | [diff] [blame] | 394 | .enable_time = MAX77686_BUCK_ENABLE_TIME, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 395 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 396 | .vsel_reg = MAX77686_REG_BUCK5OUT + (num - 5) * 2, \ |
| 397 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 398 | .enable_reg = MAX77686_REG_BUCK5CTRL + (num - 5) * 2, \ |
| 399 | .enable_mask = MAX77686_OPMODE_MASK, \ |
| 400 | } |
| 401 | #define regulator_desc_buck1(num) { \ |
| 402 | .name = "BUCK"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 403 | .of_match = of_match_ptr("BUCK"#num), \ |
| 404 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 405 | .id = MAX77686_BUCK##num, \ |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 406 | .ops = &max77686_buck1_ops, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 407 | .type = REGULATOR_VOLTAGE, \ |
| 408 | .owner = THIS_MODULE, \ |
| 409 | .min_uV = MAX77686_BUCK_MINUV, \ |
| 410 | .uV_step = MAX77686_BUCK_UVSTEP, \ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 411 | .ramp_delay = MAX77686_RAMP_DELAY, \ |
Krzysztof Kozlowski | a959730 | 2016-04-29 12:59:51 +0200 | [diff] [blame] | 412 | .enable_time = MAX77686_BUCK_ENABLE_TIME, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 413 | .n_voltages = MAX77686_VSEL_MASK + 1, \ |
| 414 | .vsel_reg = MAX77686_REG_BUCK1OUT, \ |
| 415 | .vsel_mask = MAX77686_VSEL_MASK, \ |
| 416 | .enable_reg = MAX77686_REG_BUCK1CTRL, \ |
| 417 | .enable_mask = MAX77686_OPMODE_MASK, \ |
| 418 | } |
| 419 | #define regulator_desc_buck_dvs(num) { \ |
| 420 | .name = "BUCK"#num, \ |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 421 | .of_match = of_match_ptr("BUCK"#num), \ |
| 422 | .regulators_node = of_match_ptr("voltage-regulators"), \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 423 | .id = MAX77686_BUCK##num, \ |
Axel Lin | 74adfee5 | 2012-06-04 10:19:18 +0800 | [diff] [blame] | 424 | .ops = &max77686_buck_dvs_ops, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 425 | .type = REGULATOR_VOLTAGE, \ |
| 426 | .owner = THIS_MODULE, \ |
| 427 | .min_uV = MAX77686_DVS_MINUV, \ |
| 428 | .uV_step = MAX77686_DVS_UVSTEP, \ |
Yadwinder Singh Brar | 852abad | 2012-06-19 13:23:42 +0530 | [diff] [blame] | 429 | .ramp_delay = MAX77686_DVS_RAMP_DELAY, \ |
Krzysztof Kozlowski | a959730 | 2016-04-29 12:59:51 +0200 | [diff] [blame] | 430 | .enable_time = MAX77686_DVS_ENABLE_TIME, \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 431 | .n_voltages = MAX77686_DVS_VSEL_MASK + 1, \ |
| 432 | .vsel_reg = MAX77686_REG_BUCK2DVS1 + (num - 2) * 10, \ |
| 433 | .vsel_mask = MAX77686_DVS_VSEL_MASK, \ |
| 434 | .enable_reg = MAX77686_REG_BUCK2CTRL1 + (num - 2) * 10, \ |
| 435 | .enable_mask = MAX77686_OPMODE_MASK \ |
| 436 | << MAX77686_OPMODE_BUCK234_SHIFT, \ |
Axel Lin | 3c37d89 | 2021-06-05 09:34:24 +0800 | [diff] [blame] | 437 | .ramp_reg = MAX77686_REG_BUCK2CTRL1 + (num - 2) * 10, \ |
| 438 | .ramp_mask = MAX77686_RAMP_RATE_MASK, \ |
| 439 | .ramp_delay_table = max77686_buck_dvs_ramp_table, \ |
| 440 | .n_ramp_values = ARRAY_SIZE(max77686_buck_dvs_ramp_table), \ |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 441 | } |
| 442 | |
Krzysztof Kozlowski | 73dbdf8 | 2014-10-27 16:03:42 +0100 | [diff] [blame] | 443 | static const struct regulator_desc regulators[] = { |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 444 | regulator_desc_ldo1_low(1), |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 445 | regulator_desc_ldo_low(2), |
| 446 | regulator_desc_ldo(3), |
| 447 | regulator_desc_ldo(4), |
| 448 | regulator_desc_ldo(5), |
| 449 | regulator_desc_ldo_low(6), |
| 450 | regulator_desc_ldo_low(7), |
| 451 | regulator_desc_ldo_low(8), |
| 452 | regulator_desc_ldo(9), |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 453 | regulator_desc_lpm_ldo(10), |
| 454 | regulator_desc_lpm_ldo(11), |
| 455 | regulator_desc_lpm_ldo(12), |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 456 | regulator_desc_ldo(13), |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 457 | regulator_desc_lpm_ldo(14), |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 458 | regulator_desc_ldo_low(15), |
Yadwinder Singh Brar | 15282ba | 2012-10-16 17:24:19 +0530 | [diff] [blame] | 459 | regulator_desc_lpm_ldo(16), |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 460 | regulator_desc_ldo(17), |
| 461 | regulator_desc_ldo(18), |
| 462 | regulator_desc_ldo(19), |
| 463 | regulator_desc_ldo(20), |
| 464 | regulator_desc_ldo(21), |
| 465 | regulator_desc_ldo(22), |
| 466 | regulator_desc_ldo(23), |
| 467 | regulator_desc_ldo(24), |
| 468 | regulator_desc_ldo(25), |
| 469 | regulator_desc_ldo(26), |
| 470 | regulator_desc_buck1(1), |
| 471 | regulator_desc_buck_dvs(2), |
| 472 | regulator_desc_buck_dvs(3), |
| 473 | regulator_desc_buck_dvs(4), |
| 474 | regulator_desc_buck(5), |
| 475 | regulator_desc_buck(6), |
| 476 | regulator_desc_buck(7), |
| 477 | regulator_desc_buck(8), |
| 478 | regulator_desc_buck(9), |
| 479 | }; |
| 480 | |
Bill Pemberton | a502357 | 2012-11-19 13:22:22 -0500 | [diff] [blame] | 481 | static int max77686_pmic_probe(struct platform_device *pdev) |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 482 | { |
| 483 | struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent); |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 484 | struct max77686_data *max77686; |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 485 | int i; |
Axel Lin | c59d2a6 | 2012-06-20 15:01:25 +0800 | [diff] [blame] | 486 | struct regulator_config config = { }; |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 487 | |
| 488 | dev_dbg(&pdev->dev, "%s\n", __func__); |
| 489 | |
| 490 | max77686 = devm_kzalloc(&pdev->dev, sizeof(struct max77686_data), |
| 491 | GFP_KERNEL); |
| 492 | if (!max77686) |
| 493 | return -ENOMEM; |
| 494 | |
Linus Walleij | 96392c3 | 2018-11-15 09:01:19 +0100 | [diff] [blame] | 495 | max77686->dev = &pdev->dev; |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 496 | config.dev = iodev->dev; |
Yadwinder Singh Brar | f503071 | 2012-06-20 10:50:51 +0530 | [diff] [blame] | 497 | config.regmap = iodev->regmap; |
Yadwinder Singh Brar | 6d2c896 | 2012-10-16 17:24:18 +0530 | [diff] [blame] | 498 | config.driver_data = max77686; |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 499 | platform_set_drvdata(pdev, max77686); |
| 500 | |
Axel Lin | ab0d1cb | 2012-06-08 12:03:04 +0800 | [diff] [blame] | 501 | for (i = 0; i < MAX77686_REGULATORS; i++) { |
Krzysztof Kozlowski | b0c13e8 | 2014-03-10 09:32:45 +0100 | [diff] [blame] | 502 | struct regulator_dev *rdev; |
Krzysztof Kozlowski | eca29da | 2014-11-04 09:49:41 +0100 | [diff] [blame] | 503 | int id = regulators[i].id; |
Krzysztof Kozlowski | b0c13e8 | 2014-03-10 09:32:45 +0100 | [diff] [blame] | 504 | |
Krzysztof Kozlowski | 4524df8 | 2014-11-04 09:49:42 +0100 | [diff] [blame] | 505 | max77686->opmode[id] = MAX77686_NORMAL; |
Krzysztof Kozlowski | b0c13e8 | 2014-03-10 09:32:45 +0100 | [diff] [blame] | 506 | rdev = devm_regulator_register(&pdev->dev, |
Sachin Kamat | 44815b4 | 2013-09-04 11:07:54 +0530 | [diff] [blame] | 507 | ®ulators[i], &config); |
Krzysztof Kozlowski | b0c13e8 | 2014-03-10 09:32:45 +0100 | [diff] [blame] | 508 | if (IS_ERR(rdev)) { |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 509 | int ret = PTR_ERR(rdev); |
Yadwinder Singh Brar | f503071 | 2012-06-20 10:50:51 +0530 | [diff] [blame] | 510 | dev_err(&pdev->dev, |
Krzysztof Kozlowski | 0480395 | 2014-11-05 10:47:50 +0100 | [diff] [blame] | 511 | "regulator init failed for %d: %d\n", i, ret); |
| 512 | return ret; |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 513 | } |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 514 | } |
Axel Lin | ab0d1cb | 2012-06-08 12:03:04 +0800 | [diff] [blame] | 515 | |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 516 | return 0; |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | static const struct platform_device_id max77686_pmic_id[] = { |
| 520 | {"max77686-pmic", 0}, |
| 521 | { }, |
| 522 | }; |
| 523 | MODULE_DEVICE_TABLE(platform, max77686_pmic_id); |
| 524 | |
| 525 | static struct platform_driver max77686_pmic_driver = { |
| 526 | .driver = { |
| 527 | .name = "max77686-pmic", |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 528 | }, |
| 529 | .probe = max77686_pmic_probe, |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 530 | .id_table = max77686_pmic_id, |
| 531 | }; |
| 532 | |
Javier Martinez Canillas | 314a820 | 2016-04-06 09:49:47 -0400 | [diff] [blame] | 533 | module_platform_driver(max77686_pmic_driver); |
Jonghwa Lee | 133d401 | 2012-06-01 13:17:14 +0900 | [diff] [blame] | 534 | |
| 535 | MODULE_DESCRIPTION("MAXIM 77686 Regulator Driver"); |
| 536 | MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>"); |
| 537 | MODULE_LICENSE("GPL"); |