Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 1 | /* |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 2 | * max77693.c - Regulator driver for the Maxim 77693 and 77843 |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 3 | * |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 4 | * Copyright (C) 2013-2015 Samsung Electronics |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 5 | * Jonghwa Lee <jonghwa3.lee@samsung.com> |
Krzysztof Kozlowski | cea8aa3 | 2016-08-17 14:07:46 +0200 | [diff] [blame] | 6 | * Krzysztof Kozlowski <krzk@kernel.org> |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | * This driver is based on max77686.c |
| 23 | */ |
| 24 | |
| 25 | #include <linux/err.h> |
| 26 | #include <linux/slab.h> |
| 27 | #include <linux/platform_device.h> |
| 28 | #include <linux/module.h> |
| 29 | #include <linux/export.h> |
| 30 | #include <linux/regulator/driver.h> |
| 31 | #include <linux/regulator/machine.h> |
| 32 | #include <linux/mfd/max77693.h> |
Krzysztof Kozlowski | 61b305c | 2015-07-15 21:59:50 +0900 | [diff] [blame] | 33 | #include <linux/mfd/max77693-common.h> |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 34 | #include <linux/mfd/max77693-private.h> |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 35 | #include <linux/mfd/max77843-private.h> |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 36 | #include <linux/regulator/of_regulator.h> |
Robert Baldyga | d0540f9 | 2014-05-21 08:52:47 +0200 | [diff] [blame] | 37 | #include <linux/regmap.h> |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 38 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 39 | /* |
| 40 | * ID for MAX77843 regulators. |
| 41 | * There is no need for such for MAX77693. |
| 42 | */ |
| 43 | enum max77843_regulator_type { |
| 44 | MAX77843_SAFEOUT1 = 0, |
| 45 | MAX77843_SAFEOUT2, |
| 46 | MAX77843_CHARGER, |
| 47 | |
| 48 | MAX77843_NUM, |
| 49 | }; |
| 50 | |
| 51 | /* Register differences between chargers: MAX77693 and MAX77843 */ |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 52 | struct chg_reg_data { |
| 53 | unsigned int linear_reg; |
| 54 | unsigned int linear_mask; |
| 55 | unsigned int uA_step; |
| 56 | unsigned int min_sel; |
| 57 | }; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 58 | |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 59 | /* |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 60 | * MAX77693 CHARGER regulator - Min : 20mA, Max : 2580mA, step : 20mA |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 61 | * 0x00, 0x01, 0x2, 0x03 = 60 mA |
| 62 | * 0x04 ~ 0x7E = (60 + (X - 3) * 20) mA |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 63 | * Actually for MAX77693 the driver manipulates the maximum input current, |
| 64 | * not the fast charge current (output). This should be fixed. |
| 65 | * |
| 66 | * On MAX77843 the calculation formula is the same (except values). |
| 67 | * Fortunately it properly manipulates the fast charge current. |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 68 | */ |
| 69 | static int max77693_chg_get_current_limit(struct regulator_dev *rdev) |
| 70 | { |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 71 | const struct chg_reg_data *reg_data = rdev_get_drvdata(rdev); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 72 | unsigned int chg_min_uA = rdev->constraints->min_uA; |
| 73 | unsigned int chg_max_uA = rdev->constraints->max_uA; |
Robert Baldyga | d0540f9 | 2014-05-21 08:52:47 +0200 | [diff] [blame] | 74 | unsigned int reg, sel; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 75 | unsigned int val; |
| 76 | int ret; |
| 77 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 78 | ret = regmap_read(rdev->regmap, reg_data->linear_reg, ®); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 79 | if (ret < 0) |
| 80 | return ret; |
| 81 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 82 | sel = reg & reg_data->linear_mask; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 83 | |
| 84 | /* the first four codes for charger current are all 60mA */ |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 85 | if (sel <= reg_data->min_sel) |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 86 | sel = 0; |
| 87 | else |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 88 | sel -= reg_data->min_sel; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 89 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 90 | val = chg_min_uA + reg_data->uA_step * sel; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 91 | if (val > chg_max_uA) |
| 92 | return -EINVAL; |
| 93 | |
| 94 | return val; |
| 95 | } |
| 96 | |
| 97 | static int max77693_chg_set_current_limit(struct regulator_dev *rdev, |
| 98 | int min_uA, int max_uA) |
| 99 | { |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 100 | const struct chg_reg_data *reg_data = rdev_get_drvdata(rdev); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 101 | unsigned int chg_min_uA = rdev->constraints->min_uA; |
| 102 | int sel = 0; |
| 103 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 104 | while (chg_min_uA + reg_data->uA_step * sel < min_uA) |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 105 | sel++; |
| 106 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 107 | if (chg_min_uA + reg_data->uA_step * sel > max_uA) |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 108 | return -EINVAL; |
| 109 | |
| 110 | /* the first four codes for charger current are all 60mA */ |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 111 | sel += reg_data->min_sel; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 112 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 113 | return regmap_write(rdev->regmap, reg_data->linear_reg, sel); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 114 | } |
| 115 | /* end of CHARGER regulator ops */ |
| 116 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 117 | /* Returns regmap suitable for given regulator on chosen device */ |
| 118 | static struct regmap *max77693_get_regmap(enum max77693_types type, |
| 119 | struct max77693_dev *max77693, |
| 120 | int reg_id) |
| 121 | { |
| 122 | if (type == TYPE_MAX77693) |
| 123 | return max77693->regmap; |
| 124 | |
| 125 | /* Else: TYPE_MAX77843 */ |
| 126 | switch (reg_id) { |
| 127 | case MAX77843_SAFEOUT1: |
| 128 | case MAX77843_SAFEOUT2: |
| 129 | return max77693->regmap; |
| 130 | case MAX77843_CHARGER: |
| 131 | return max77693->regmap_chg; |
| 132 | default: |
| 133 | return max77693->regmap; |
| 134 | } |
| 135 | } |
| 136 | |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 137 | static const unsigned int max77693_safeout_table[] = { |
| 138 | 4850000, |
| 139 | 4900000, |
| 140 | 4950000, |
| 141 | 3300000, |
| 142 | }; |
| 143 | |
Bhumika Goyal | b68f907 | 2017-01-28 19:54:09 +0530 | [diff] [blame] | 144 | static const struct regulator_ops max77693_safeout_ops = { |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 145 | .list_voltage = regulator_list_voltage_table, |
| 146 | .is_enabled = regulator_is_enabled_regmap, |
| 147 | .enable = regulator_enable_regmap, |
| 148 | .disable = regulator_disable_regmap, |
| 149 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 150 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 151 | }; |
| 152 | |
Krzysztof Kozlowski | a08904f | 2017-03-11 21:01:19 +0200 | [diff] [blame] | 153 | static const struct regulator_ops max77693_charger_ops = { |
Krzysztof Kozlowski | 39d2330 | 2015-04-29 19:58:28 +0900 | [diff] [blame] | 154 | .is_enabled = regulator_is_enabled_regmap, |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 155 | .enable = regulator_enable_regmap, |
| 156 | .disable = regulator_disable_regmap, |
| 157 | .get_current_limit = max77693_chg_get_current_limit, |
| 158 | .set_current_limit = max77693_chg_set_current_limit, |
| 159 | }; |
| 160 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 161 | #define max77693_regulator_desc_esafeout(_num) { \ |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 162 | .name = "ESAFEOUT"#_num, \ |
| 163 | .id = MAX77693_ESAFEOUT##_num, \ |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 164 | .of_match = of_match_ptr("ESAFEOUT"#_num), \ |
| 165 | .regulators_node = of_match_ptr("regulators"), \ |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 166 | .n_voltages = 4, \ |
| 167 | .ops = &max77693_safeout_ops, \ |
| 168 | .type = REGULATOR_VOLTAGE, \ |
Axel Lin | 52f48bf | 2013-12-24 21:37:50 +0800 | [diff] [blame] | 169 | .owner = THIS_MODULE, \ |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 170 | .volt_table = max77693_safeout_table, \ |
| 171 | .vsel_reg = MAX77693_CHG_REG_SAFEOUT_CTRL, \ |
| 172 | .vsel_mask = SAFEOUT_CTRL_SAFEOUT##_num##_MASK, \ |
| 173 | .enable_reg = MAX77693_CHG_REG_SAFEOUT_CTRL, \ |
| 174 | .enable_mask = SAFEOUT_CTRL_ENSAFEOUT##_num##_MASK , \ |
| 175 | } |
| 176 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 177 | static const struct regulator_desc max77693_supported_regulators[] = { |
| 178 | max77693_regulator_desc_esafeout(1), |
| 179 | max77693_regulator_desc_esafeout(2), |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 180 | { |
| 181 | .name = "CHARGER", |
| 182 | .id = MAX77693_CHARGER, |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 183 | .of_match = of_match_ptr("CHARGER"), |
| 184 | .regulators_node = of_match_ptr("regulators"), |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 185 | .ops = &max77693_charger_ops, |
| 186 | .type = REGULATOR_CURRENT, |
| 187 | .owner = THIS_MODULE, |
| 188 | .enable_reg = MAX77693_CHG_REG_CHG_CNFG_00, |
| 189 | .enable_mask = CHG_CNFG_00_CHG_MASK | |
| 190 | CHG_CNFG_00_BUCK_MASK, |
Krzysztof Kozlowski | 39d2330 | 2015-04-29 19:58:28 +0900 | [diff] [blame] | 191 | .enable_val = CHG_CNFG_00_CHG_MASK | CHG_CNFG_00_BUCK_MASK, |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 192 | }, |
| 193 | }; |
| 194 | |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 195 | static const struct chg_reg_data max77693_chg_reg_data = { |
| 196 | .linear_reg = MAX77693_CHG_REG_CHG_CNFG_09, |
| 197 | .linear_mask = CHG_CNFG_09_CHGIN_ILIM_MASK, |
| 198 | .uA_step = 20000, |
| 199 | .min_sel = 3, |
| 200 | }; |
| 201 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 202 | #define max77843_regulator_desc_esafeout(num) { \ |
| 203 | .name = "SAFEOUT" # num, \ |
| 204 | .id = MAX77843_SAFEOUT ## num, \ |
| 205 | .ops = &max77693_safeout_ops, \ |
| 206 | .of_match = of_match_ptr("SAFEOUT" # num), \ |
| 207 | .regulators_node = of_match_ptr("regulators"), \ |
| 208 | .type = REGULATOR_VOLTAGE, \ |
| 209 | .owner = THIS_MODULE, \ |
| 210 | .n_voltages = ARRAY_SIZE(max77693_safeout_table), \ |
| 211 | .volt_table = max77693_safeout_table, \ |
| 212 | .enable_reg = MAX77843_SYS_REG_SAFEOUTCTRL, \ |
| 213 | .enable_mask = MAX77843_REG_SAFEOUTCTRL_ENSAFEOUT ## num, \ |
| 214 | .vsel_reg = MAX77843_SYS_REG_SAFEOUTCTRL, \ |
| 215 | .vsel_mask = MAX77843_REG_SAFEOUTCTRL_SAFEOUT ## num ## _MASK, \ |
| 216 | } |
| 217 | |
| 218 | static const struct regulator_desc max77843_supported_regulators[] = { |
| 219 | [MAX77843_SAFEOUT1] = max77843_regulator_desc_esafeout(1), |
| 220 | [MAX77843_SAFEOUT2] = max77843_regulator_desc_esafeout(2), |
| 221 | [MAX77843_CHARGER] = { |
| 222 | .name = "CHARGER", |
| 223 | .id = MAX77843_CHARGER, |
| 224 | .ops = &max77693_charger_ops, |
| 225 | .of_match = of_match_ptr("CHARGER"), |
| 226 | .regulators_node = of_match_ptr("regulators"), |
| 227 | .type = REGULATOR_CURRENT, |
| 228 | .owner = THIS_MODULE, |
| 229 | .enable_reg = MAX77843_CHG_REG_CHG_CNFG_00, |
| 230 | .enable_mask = MAX77843_CHG_MASK, |
| 231 | .enable_val = MAX77843_CHG_MASK, |
| 232 | }, |
| 233 | }; |
| 234 | |
| 235 | static const struct chg_reg_data max77843_chg_reg_data = { |
| 236 | .linear_reg = MAX77843_CHG_REG_CHG_CNFG_02, |
| 237 | .linear_mask = MAX77843_CHG_FAST_CHG_CURRENT_MASK, |
| 238 | .uA_step = MAX77843_CHG_FAST_CHG_CURRENT_STEP, |
| 239 | .min_sel = 2, |
| 240 | }; |
| 241 | |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 242 | static int max77693_pmic_probe(struct platform_device *pdev) |
| 243 | { |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 244 | enum max77693_types type = platform_get_device_id(pdev)->driver_data; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 245 | struct max77693_dev *iodev = dev_get_drvdata(pdev->dev.parent); |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 246 | const struct regulator_desc *regulators; |
| 247 | unsigned int regulators_size; |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 248 | int i; |
Krzysztof Kozlowski | ca0c37a | 2014-11-03 15:07:05 +0100 | [diff] [blame] | 249 | struct regulator_config config = { }; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 250 | |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 251 | config.dev = iodev->dev; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 252 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 253 | switch (type) { |
| 254 | case TYPE_MAX77693: |
| 255 | regulators = max77693_supported_regulators; |
| 256 | regulators_size = ARRAY_SIZE(max77693_supported_regulators); |
| 257 | config.driver_data = (void *)&max77693_chg_reg_data; |
| 258 | break; |
| 259 | case TYPE_MAX77843: |
| 260 | regulators = max77843_supported_regulators; |
| 261 | regulators_size = ARRAY_SIZE(max77843_supported_regulators); |
| 262 | config.driver_data = (void *)&max77843_chg_reg_data; |
| 263 | break; |
| 264 | default: |
| 265 | dev_err(&pdev->dev, "Unsupported device type: %u\n", type); |
| 266 | return -ENODEV; |
| 267 | } |
| 268 | |
| 269 | for (i = 0; i < regulators_size; i++) { |
Krzysztof Kozlowski | 640c24a | 2014-03-10 09:32:46 +0100 | [diff] [blame] | 270 | struct regulator_dev *rdev; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 271 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 272 | config.regmap = max77693_get_regmap(type, iodev, |
| 273 | regulators[i].id); |
| 274 | |
Krzysztof Kozlowski | 640c24a | 2014-03-10 09:32:46 +0100 | [diff] [blame] | 275 | rdev = devm_regulator_register(&pdev->dev, |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 276 | ®ulators[i], &config); |
Krzysztof Kozlowski | 640c24a | 2014-03-10 09:32:46 +0100 | [diff] [blame] | 277 | if (IS_ERR(rdev)) { |
| 278 | dev_err(&pdev->dev, |
Krzysztof Kozlowski | 222d0f0 | 2015-03-26 11:35:58 +0100 | [diff] [blame] | 279 | "Failed to initialize regulator-%d\n", i); |
Krzysztof Kozlowski | 640c24a | 2014-03-10 09:32:46 +0100 | [diff] [blame] | 280 | return PTR_ERR(rdev); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | |
| 284 | return 0; |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | static const struct platform_device_id max77693_pmic_id[] = { |
Krzysztof Kozlowski | 5b5e771 | 2015-07-15 21:59:49 +0900 | [diff] [blame] | 288 | { "max77693-pmic", TYPE_MAX77693 }, |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 289 | { "max77843-regulator", TYPE_MAX77843 }, |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 290 | {}, |
| 291 | }; |
| 292 | |
| 293 | MODULE_DEVICE_TABLE(platform, max77693_pmic_id); |
| 294 | |
| 295 | static struct platform_driver max77693_pmic_driver = { |
| 296 | .driver = { |
| 297 | .name = "max77693-pmic", |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 298 | }, |
| 299 | .probe = max77693_pmic_probe, |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 300 | .id_table = max77693_pmic_id, |
| 301 | }; |
| 302 | |
Marek Szyprowski | ee3010d | 2015-08-21 14:38:39 +0200 | [diff] [blame] | 303 | static int __init max77693_pmic_init(void) |
| 304 | { |
| 305 | return platform_driver_register(&max77693_pmic_driver); |
| 306 | } |
| 307 | subsys_initcall(max77693_pmic_init); |
| 308 | |
| 309 | static void __exit max77693_pmic_cleanup(void) |
| 310 | { |
| 311 | platform_driver_unregister(&max77693_pmic_driver); |
| 312 | } |
| 313 | module_exit(max77693_pmic_cleanup); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 314 | |
Krzysztof Kozlowski | 9e9a08e | 2015-07-15 21:59:54 +0900 | [diff] [blame] | 315 | MODULE_DESCRIPTION("MAXIM 77693/77843 regulator driver"); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 316 | MODULE_AUTHOR("Jonghwa Lee <jonghwa3.lee@samsung.com>"); |
Krzysztof Kozlowski | cea8aa3 | 2016-08-17 14:07:46 +0200 | [diff] [blame] | 317 | MODULE_AUTHOR("Krzysztof Kozlowski <krzk@kernel.org>"); |
Jonghwa Lee | 80b022e | 2013-06-25 10:08:38 +0900 | [diff] [blame] | 318 | MODULE_LICENSE("GPL"); |