MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 1 | /* |
| 2 | * max8952.c - Voltage and current regulation for the Maxim 8952 |
| 3 | * |
| 4 | * Copyright (C) 2010 Samsung Electronics |
| 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #include <linux/module.h> |
| 23 | #include <linux/init.h> |
| 24 | #include <linux/i2c.h> |
| 25 | #include <linux/err.h> |
| 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/regulator/driver.h> |
| 28 | #include <linux/regulator/max8952.h> |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 29 | #include <linux/gpio.h> |
| 30 | #include <linux/io.h> |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 31 | #include <linux/of.h> |
| 32 | #include <linux/of_gpio.h> |
| 33 | #include <linux/regulator/of_regulator.h> |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 34 | #include <linux/slab.h> |
| 35 | |
| 36 | /* Registers */ |
| 37 | enum { |
| 38 | MAX8952_REG_MODE0, |
| 39 | MAX8952_REG_MODE1, |
| 40 | MAX8952_REG_MODE2, |
| 41 | MAX8952_REG_MODE3, |
| 42 | MAX8952_REG_CONTROL, |
| 43 | MAX8952_REG_SYNC, |
| 44 | MAX8952_REG_RAMP, |
| 45 | MAX8952_REG_CHIP_ID1, |
| 46 | MAX8952_REG_CHIP_ID2, |
| 47 | }; |
| 48 | |
| 49 | struct max8952_data { |
| 50 | struct i2c_client *client; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 51 | struct max8952_platform_data *pdata; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 52 | |
| 53 | bool vid0; |
| 54 | bool vid1; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | static int max8952_read_reg(struct max8952_data *max8952, u8 reg) |
| 58 | { |
| 59 | int ret = i2c_smbus_read_byte_data(max8952->client, reg); |
Sachin Kamat | a5f8f96 | 2014-03-18 15:53:04 +0530 | [diff] [blame] | 60 | |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 61 | if (ret > 0) |
| 62 | ret &= 0xff; |
| 63 | |
| 64 | return ret; |
| 65 | } |
| 66 | |
| 67 | static int max8952_write_reg(struct max8952_data *max8952, |
| 68 | u8 reg, u8 value) |
| 69 | { |
| 70 | return i2c_smbus_write_byte_data(max8952->client, reg, value); |
| 71 | } |
| 72 | |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 73 | static int max8952_list_voltage(struct regulator_dev *rdev, |
| 74 | unsigned int selector) |
| 75 | { |
| 76 | struct max8952_data *max8952 = rdev_get_drvdata(rdev); |
| 77 | |
| 78 | if (rdev_get_id(rdev) != 0) |
| 79 | return -EINVAL; |
| 80 | |
Axel Lin | b9b49af | 2012-04-20 18:36:14 +0800 | [diff] [blame] | 81 | return (max8952->pdata->dvs_mode[selector] * 10 + 770) * 1000; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 82 | } |
| 83 | |
Axel Lin | b9b49af | 2012-04-20 18:36:14 +0800 | [diff] [blame] | 84 | static int max8952_get_voltage_sel(struct regulator_dev *rdev) |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 85 | { |
| 86 | struct max8952_data *max8952 = rdev_get_drvdata(rdev); |
| 87 | u8 vid = 0; |
| 88 | |
| 89 | if (max8952->vid0) |
| 90 | vid += 1; |
| 91 | if (max8952->vid1) |
| 92 | vid += 2; |
| 93 | |
Axel Lin | b9b49af | 2012-04-20 18:36:14 +0800 | [diff] [blame] | 94 | return vid; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 95 | } |
| 96 | |
Axel Lin | 6ea67d0 | 2012-03-26 09:20:58 +0800 | [diff] [blame] | 97 | static int max8952_set_voltage_sel(struct regulator_dev *rdev, |
| 98 | unsigned selector) |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 99 | { |
| 100 | struct max8952_data *max8952 = rdev_get_drvdata(rdev); |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 101 | |
| 102 | if (!gpio_is_valid(max8952->pdata->gpio_vid0) || |
Jonghwan Choi | e2cf313 | 2011-06-15 17:54:12 +0900 | [diff] [blame] | 103 | !gpio_is_valid(max8952->pdata->gpio_vid1)) { |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 104 | /* DVS not supported */ |
| 105 | return -EPERM; |
| 106 | } |
| 107 | |
Axel Lin | 6ea67d0 | 2012-03-26 09:20:58 +0800 | [diff] [blame] | 108 | max8952->vid0 = selector & 0x1; |
| 109 | max8952->vid1 = (selector >> 1) & 0x1; |
| 110 | gpio_set_value(max8952->pdata->gpio_vid0, max8952->vid0); |
| 111 | gpio_set_value(max8952->pdata->gpio_vid1, max8952->vid1); |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 112 | |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | static struct regulator_ops max8952_ops = { |
| 117 | .list_voltage = max8952_list_voltage, |
Axel Lin | b9b49af | 2012-04-20 18:36:14 +0800 | [diff] [blame] | 118 | .get_voltage_sel = max8952_get_voltage_sel, |
Axel Lin | 6ea67d0 | 2012-03-26 09:20:58 +0800 | [diff] [blame] | 119 | .set_voltage_sel = max8952_set_voltage_sel, |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 120 | }; |
| 121 | |
Axel Lin | bd6ff0d | 2012-04-06 08:29:49 +0800 | [diff] [blame] | 122 | static const struct regulator_desc regulator = { |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 123 | .name = "MAX8952_VOUT", |
| 124 | .id = 0, |
| 125 | .n_voltages = MAX8952_NUM_DVS_MODE, |
| 126 | .ops = &max8952_ops, |
| 127 | .type = REGULATOR_VOLTAGE, |
| 128 | .owner = THIS_MODULE, |
| 129 | }; |
| 130 | |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 131 | #ifdef CONFIG_OF |
Jingoo Han | cfe6e33 | 2014-05-07 17:06:34 +0900 | [diff] [blame] | 132 | static const struct of_device_id max8952_dt_match[] = { |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 133 | { .compatible = "maxim,max8952" }, |
| 134 | {}, |
| 135 | }; |
| 136 | MODULE_DEVICE_TABLE(of, max8952_dt_match); |
| 137 | |
| 138 | static struct max8952_platform_data *max8952_parse_dt(struct device *dev) |
| 139 | { |
| 140 | struct max8952_platform_data *pd; |
| 141 | struct device_node *np = dev->of_node; |
| 142 | int ret; |
| 143 | int i; |
| 144 | |
| 145 | pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); |
Sachin Kamat | 7752d96 | 2014-02-20 14:23:08 +0530 | [diff] [blame] | 146 | if (!pd) |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 147 | return NULL; |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 148 | |
| 149 | pd->gpio_vid0 = of_get_named_gpio(np, "max8952,vid-gpios", 0); |
| 150 | pd->gpio_vid1 = of_get_named_gpio(np, "max8952,vid-gpios", 1); |
| 151 | pd->gpio_en = of_get_named_gpio(np, "max8952,en-gpio", 0); |
| 152 | |
| 153 | if (of_property_read_u32(np, "max8952,default-mode", &pd->default_mode)) |
| 154 | dev_warn(dev, "Default mode not specified, assuming 0\n"); |
| 155 | |
| 156 | ret = of_property_read_u32_array(np, "max8952,dvs-mode-microvolt", |
| 157 | pd->dvs_mode, ARRAY_SIZE(pd->dvs_mode)); |
| 158 | if (ret) { |
| 159 | dev_err(dev, "max8952,dvs-mode-microvolt property not specified"); |
| 160 | return NULL; |
| 161 | } |
| 162 | |
| 163 | for (i = 0; i < ARRAY_SIZE(pd->dvs_mode); ++i) { |
| 164 | if (pd->dvs_mode[i] < 770000 || pd->dvs_mode[i] > 1400000) { |
| 165 | dev_err(dev, "DVS voltage %d out of range\n", i); |
| 166 | return NULL; |
| 167 | } |
| 168 | pd->dvs_mode[i] = (pd->dvs_mode[i] - 770000) / 10000; |
| 169 | } |
| 170 | |
| 171 | if (of_property_read_u32(np, "max8952,sync-freq", &pd->sync_freq)) |
| 172 | dev_warn(dev, "max8952,sync-freq property not specified, defaulting to 26MHz\n"); |
| 173 | |
| 174 | if (of_property_read_u32(np, "max8952,ramp-speed", &pd->ramp_speed)) |
| 175 | dev_warn(dev, "max8952,ramp-speed property not specified, defaulting to 32mV/us\n"); |
| 176 | |
Javier Martinez Canillas | 072e78b | 2014-11-10 14:43:53 +0100 | [diff] [blame] | 177 | pd->reg_data = of_get_regulator_init_data(dev, np, ®ulator); |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 178 | if (!pd->reg_data) { |
| 179 | dev_err(dev, "Failed to parse regulator init data\n"); |
| 180 | return NULL; |
| 181 | } |
| 182 | |
| 183 | return pd; |
| 184 | } |
| 185 | #else |
| 186 | static struct max8952_platform_data *max8952_parse_dt(struct device *dev) |
| 187 | { |
| 188 | return NULL; |
| 189 | } |
| 190 | #endif |
| 191 | |
Bill Pemberton | a502357 | 2012-11-19 13:22:22 -0500 | [diff] [blame] | 192 | static int max8952_pmic_probe(struct i2c_client *client, |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 193 | const struct i2c_device_id *i2c_id) |
| 194 | { |
| 195 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
Jingoo Han | dff91d0 | 2013-07-30 17:20:47 +0900 | [diff] [blame] | 196 | struct max8952_platform_data *pdata = dev_get_platdata(&client->dev); |
Mark Brown | c172708 | 2012-04-04 00:50:22 +0100 | [diff] [blame] | 197 | struct regulator_config config = { }; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 198 | struct max8952_data *max8952; |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 199 | struct regulator_dev *rdev; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 200 | |
| 201 | int ret = 0, err = 0; |
| 202 | |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 203 | if (client->dev.of_node) |
| 204 | pdata = max8952_parse_dt(&client->dev); |
| 205 | |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 206 | if (!pdata) { |
| 207 | dev_err(&client->dev, "Require the platform data\n"); |
| 208 | return -EINVAL; |
| 209 | } |
| 210 | |
| 211 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE)) |
| 212 | return -EIO; |
| 213 | |
Axel Lin | 372de4a | 2012-05-16 12:50:47 +0800 | [diff] [blame] | 214 | max8952 = devm_kzalloc(&client->dev, sizeof(struct max8952_data), |
| 215 | GFP_KERNEL); |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 216 | if (!max8952) |
| 217 | return -ENOMEM; |
| 218 | |
| 219 | max8952->client = client; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 220 | max8952->pdata = pdata; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 221 | |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 222 | config.dev = &client->dev; |
Tomasz Figa | 3ec6eb9 | 2013-04-04 18:17:19 +0200 | [diff] [blame] | 223 | config.init_data = pdata->reg_data; |
Mark Brown | c172708 | 2012-04-04 00:50:22 +0100 | [diff] [blame] | 224 | config.driver_data = max8952; |
Axel Lin | 71622e1 | 2013-04-25 22:15:21 +0800 | [diff] [blame] | 225 | config.of_node = client->dev.of_node; |
Mark Brown | c172708 | 2012-04-04 00:50:22 +0100 | [diff] [blame] | 226 | |
Axel Lin | b669e0a | 2012-07-10 06:10:12 +0800 | [diff] [blame] | 227 | config.ena_gpio = pdata->gpio_en; |
Markus Pargmann | 1de3821 | 2014-11-03 19:12:04 +0100 | [diff] [blame] | 228 | if (client->dev.of_node) |
| 229 | config.ena_gpio_initialized = true; |
Tomasz Figa | 3ec6eb9 | 2013-04-04 18:17:19 +0200 | [diff] [blame] | 230 | if (pdata->reg_data->constraints.boot_on) |
Axel Lin | b669e0a | 2012-07-10 06:10:12 +0800 | [diff] [blame] | 231 | config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH; |
| 232 | |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 233 | rdev = devm_regulator_register(&client->dev, ®ulator, &config); |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 234 | if (IS_ERR(rdev)) { |
| 235 | ret = PTR_ERR(rdev); |
| 236 | dev_err(&client->dev, "regulator init failed (%d)\n", ret); |
Axel Lin | 372de4a | 2012-05-16 12:50:47 +0800 | [diff] [blame] | 237 | return ret; |
Axel Lin | da05738 | 2010-10-25 10:11:07 +0800 | [diff] [blame] | 238 | } |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 239 | |
Axel Lin | c8237f0 | 2012-03-15 08:47:48 +0800 | [diff] [blame] | 240 | max8952->vid0 = pdata->default_mode & 0x1; |
| 241 | max8952->vid1 = (pdata->default_mode >> 1) & 0x1; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 242 | |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 243 | if (gpio_is_valid(pdata->gpio_vid0) && |
| 244 | gpio_is_valid(pdata->gpio_vid1)) { |
Axel Lin | d7da152 | 2014-06-16 10:12:25 +0800 | [diff] [blame] | 245 | unsigned long gpio_flags; |
| 246 | |
| 247 | gpio_flags = max8952->vid0 ? |
| 248 | GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; |
| 249 | if (devm_gpio_request_one(&client->dev, pdata->gpio_vid0, |
| 250 | gpio_flags, "MAX8952 VID0")) |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 251 | err = 1; |
| 252 | |
Axel Lin | d7da152 | 2014-06-16 10:12:25 +0800 | [diff] [blame] | 253 | gpio_flags = max8952->vid1 ? |
| 254 | GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; |
| 255 | if (devm_gpio_request_one(&client->dev, pdata->gpio_vid1, |
| 256 | gpio_flags, "MAX8952 VID1")) |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 257 | err = 2; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 258 | } else |
| 259 | err = 3; |
| 260 | |
| 261 | if (err) { |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 262 | dev_warn(&client->dev, "VID0/1 gpio invalid: " |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 263 | "DVS not available.\n"); |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 264 | max8952->vid0 = 0; |
| 265 | max8952->vid1 = 0; |
| 266 | /* Mark invalid */ |
| 267 | pdata->gpio_vid0 = -1; |
| 268 | pdata->gpio_vid1 = -1; |
| 269 | |
| 270 | /* Disable Pulldown of EN only */ |
| 271 | max8952_write_reg(max8952, MAX8952_REG_CONTROL, 0x60); |
| 272 | |
Krzysztof Kozlowski | b874f41 | 2014-03-10 09:32:50 +0100 | [diff] [blame] | 273 | dev_err(&client->dev, "DVS modes disabled because VID0 and VID1" |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 274 | " do not have proper controls.\n"); |
| 275 | } else { |
| 276 | /* |
| 277 | * Disable Pulldown on EN, VID0, VID1 to reduce |
| 278 | * leakage current of MAX8952 assuming that MAX8952 |
| 279 | * is turned on (EN==1). Note that without having VID0/1 |
| 280 | * properly connected, turning pulldown off can be |
| 281 | * problematic. Thus, turn this off only when they are |
| 282 | * controllable by GPIO. |
| 283 | */ |
| 284 | max8952_write_reg(max8952, MAX8952_REG_CONTROL, 0x0); |
| 285 | } |
| 286 | |
| 287 | max8952_write_reg(max8952, MAX8952_REG_MODE0, |
| 288 | (max8952_read_reg(max8952, |
| 289 | MAX8952_REG_MODE0) & 0xC0) | |
| 290 | (pdata->dvs_mode[0] & 0x3F)); |
| 291 | max8952_write_reg(max8952, MAX8952_REG_MODE1, |
| 292 | (max8952_read_reg(max8952, |
| 293 | MAX8952_REG_MODE1) & 0xC0) | |
| 294 | (pdata->dvs_mode[1] & 0x3F)); |
| 295 | max8952_write_reg(max8952, MAX8952_REG_MODE2, |
| 296 | (max8952_read_reg(max8952, |
| 297 | MAX8952_REG_MODE2) & 0xC0) | |
| 298 | (pdata->dvs_mode[2] & 0x3F)); |
| 299 | max8952_write_reg(max8952, MAX8952_REG_MODE3, |
| 300 | (max8952_read_reg(max8952, |
| 301 | MAX8952_REG_MODE3) & 0xC0) | |
| 302 | (pdata->dvs_mode[3] & 0x3F)); |
| 303 | |
| 304 | max8952_write_reg(max8952, MAX8952_REG_SYNC, |
| 305 | (max8952_read_reg(max8952, MAX8952_REG_SYNC) & 0x3F) | |
| 306 | ((pdata->sync_freq & 0x3) << 6)); |
| 307 | max8952_write_reg(max8952, MAX8952_REG_RAMP, |
| 308 | (max8952_read_reg(max8952, MAX8952_REG_RAMP) & 0x1F) | |
| 309 | ((pdata->ramp_speed & 0x7) << 5)); |
| 310 | |
| 311 | i2c_set_clientdata(client, max8952); |
| 312 | |
Axel Lin | da05738 | 2010-10-25 10:11:07 +0800 | [diff] [blame] | 313 | return 0; |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 314 | } |
| 315 | |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 316 | static const struct i2c_device_id max8952_ids[] = { |
| 317 | { "max8952", 0 }, |
| 318 | { }, |
| 319 | }; |
| 320 | MODULE_DEVICE_TABLE(i2c, max8952_ids); |
| 321 | |
| 322 | static struct i2c_driver max8952_pmic_driver = { |
| 323 | .probe = max8952_pmic_probe, |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 324 | .driver = { |
| 325 | .name = "max8952", |
Tomasz Figa | 3ff4aa9 | 2013-04-04 18:17:20 +0200 | [diff] [blame] | 326 | .of_match_table = of_match_ptr(max8952_dt_match), |
MyungJoo Ham | 202f4f5 | 2010-08-20 14:43:56 +0900 | [diff] [blame] | 327 | }, |
| 328 | .id_table = max8952_ids, |
| 329 | }; |
| 330 | |
| 331 | static int __init max8952_pmic_init(void) |
| 332 | { |
| 333 | return i2c_add_driver(&max8952_pmic_driver); |
| 334 | } |
| 335 | subsys_initcall(max8952_pmic_init); |
| 336 | |
| 337 | static void __exit max8952_pmic_exit(void) |
| 338 | { |
| 339 | i2c_del_driver(&max8952_pmic_driver); |
| 340 | } |
| 341 | module_exit(max8952_pmic_exit); |
| 342 | |
| 343 | MODULE_DESCRIPTION("MAXIM 8952 voltage regulator driver"); |
| 344 | MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); |
| 345 | MODULE_LICENSE("GPL"); |