Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 1 | /* |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 2 | * sec-core.c |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 3 | * |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 4 | * Copyright (c) 2012 Samsung Electronics Co., Ltd |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 5 | * http://www.samsung.com |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License as published by the |
| 9 | * Free Software Foundation; either version 2 of the License, or (at your |
| 10 | * option) any later version. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/module.h> |
| 15 | #include <linux/moduleparam.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/err.h> |
| 18 | #include <linux/slab.h> |
| 19 | #include <linux/i2c.h> |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 20 | #include <linux/of_irq.h> |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 21 | #include <linux/interrupt.h> |
| 22 | #include <linux/pm_runtime.h> |
| 23 | #include <linux/mutex.h> |
| 24 | #include <linux/mfd/core.h> |
Sangbeom Kim | 54227bc | 2012-07-11 21:07:16 +0900 | [diff] [blame] | 25 | #include <linux/mfd/samsung/core.h> |
| 26 | #include <linux/mfd/samsung/irq.h> |
| 27 | #include <linux/mfd/samsung/rtc.h> |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 28 | #include <linux/regmap.h> |
| 29 | |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 30 | static struct mfd_cell s5m8751_devs[] = { |
| 31 | { |
| 32 | .name = "s5m8751-pmic", |
| 33 | }, { |
| 34 | .name = "s5m-charger", |
| 35 | }, { |
| 36 | .name = "s5m8751-codec", |
| 37 | }, |
| 38 | }; |
| 39 | |
| 40 | static struct mfd_cell s5m8763_devs[] = { |
| 41 | { |
| 42 | .name = "s5m8763-pmic", |
| 43 | }, { |
| 44 | .name = "s5m-rtc", |
| 45 | }, { |
| 46 | .name = "s5m-charger", |
| 47 | }, |
| 48 | }; |
| 49 | |
| 50 | static struct mfd_cell s5m8767_devs[] = { |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 51 | { |
| 52 | .name = "s5m8767-pmic", |
| 53 | }, { |
| 54 | .name = "s5m-rtc", |
| 55 | }, |
| 56 | }; |
| 57 | |
Sangbeom Kim | 9b6d134 | 2012-07-11 21:07:55 +0900 | [diff] [blame] | 58 | static struct mfd_cell s2mps11_devs[] = { |
| 59 | { |
| 60 | .name = "s2mps11-pmic", |
| 61 | }, |
| 62 | }; |
| 63 | |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 64 | #ifdef CONFIG_OF |
| 65 | static struct of_device_id sec_dt_match[] = { |
| 66 | { .compatible = "samsung,s5m8767-pmic", |
| 67 | .data = (void *)S5M8767X, |
| 68 | }, |
| 69 | {}, |
| 70 | }; |
| 71 | #endif |
| 72 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 73 | int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 74 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 75 | return regmap_read(sec_pmic->regmap, reg, dest); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 76 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 77 | EXPORT_SYMBOL_GPL(sec_reg_read); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 78 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 79 | int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 80 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 81 | return regmap_bulk_read(sec_pmic->regmap, reg, buf, count); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 82 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 83 | EXPORT_SYMBOL_GPL(sec_bulk_read); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 84 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 85 | int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 86 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 87 | return regmap_write(sec_pmic->regmap, reg, value); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 88 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 89 | EXPORT_SYMBOL_GPL(sec_reg_write); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 90 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 91 | int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 92 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 93 | return regmap_raw_write(sec_pmic->regmap, reg, buf, count); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 94 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 95 | EXPORT_SYMBOL_GPL(sec_bulk_write); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 96 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 97 | int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 98 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 99 | return regmap_update_bits(sec_pmic->regmap, reg, mask, val); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 100 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 101 | EXPORT_SYMBOL_GPL(sec_reg_update); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 102 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 103 | static struct regmap_config sec_regmap_config = { |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 104 | .reg_bits = 8, |
| 105 | .val_bits = 8, |
| 106 | }; |
| 107 | |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 108 | |
| 109 | #ifdef CONFIG_OF |
| 110 | /* |
| 111 | * Only the common platform data elements for s5m8767 are parsed here from the |
| 112 | * device tree. Other sub-modules of s5m8767 such as pmic, rtc , charger and |
| 113 | * others have to parse their own platform data elements from device tree. |
| 114 | * |
| 115 | * The s5m8767 platform data structure is instantiated here and the drivers for |
| 116 | * the sub-modules need not instantiate another instance while parsing their |
| 117 | * platform data. |
| 118 | */ |
| 119 | static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( |
| 120 | struct device *dev) |
| 121 | { |
| 122 | struct sec_platform_data *pd; |
| 123 | |
| 124 | pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); |
| 125 | if (!pd) { |
| 126 | dev_err(dev, "could not allocate memory for pdata\n"); |
| 127 | return ERR_PTR(-ENOMEM); |
| 128 | } |
| 129 | |
| 130 | /* |
| 131 | * ToDo: the 'wakeup' member in the platform data is more of a linux |
| 132 | * specfic information. Hence, there is no binding for that yet and |
| 133 | * not parsed here. |
| 134 | */ |
| 135 | |
| 136 | return pd; |
| 137 | } |
| 138 | #else |
Mark Brown | 197bf85 | 2013-02-04 18:31:25 +0000 | [diff] [blame] | 139 | static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 140 | struct device *dev) |
| 141 | { |
| 142 | return 0; |
| 143 | } |
| 144 | #endif |
| 145 | |
| 146 | static inline int sec_i2c_get_driver_data(struct i2c_client *i2c, |
| 147 | const struct i2c_device_id *id) |
| 148 | { |
| 149 | #ifdef CONFIG_OF |
| 150 | if (i2c->dev.of_node) { |
| 151 | const struct of_device_id *match; |
| 152 | match = of_match_node(sec_dt_match, i2c->dev.of_node); |
| 153 | return (int)match->data; |
| 154 | } |
| 155 | #endif |
| 156 | return (int)id->driver_data; |
| 157 | } |
| 158 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 159 | static int sec_pmic_probe(struct i2c_client *i2c, |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 160 | const struct i2c_device_id *id) |
| 161 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 162 | struct sec_platform_data *pdata = i2c->dev.platform_data; |
| 163 | struct sec_pmic_dev *sec_pmic; |
Axel Lin | 61a2af3 | 2012-02-28 14:23:55 +0800 | [diff] [blame] | 164 | int ret; |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 165 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 166 | sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), |
Sangbeom Kim | 621210e | 2012-01-20 16:09:11 +0900 | [diff] [blame] | 167 | GFP_KERNEL); |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 168 | if (sec_pmic == NULL) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 169 | return -ENOMEM; |
| 170 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 171 | i2c_set_clientdata(i2c, sec_pmic); |
| 172 | sec_pmic->dev = &i2c->dev; |
| 173 | sec_pmic->i2c = i2c; |
| 174 | sec_pmic->irq = i2c->irq; |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 175 | sec_pmic->type = sec_i2c_get_driver_data(i2c, id); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 176 | |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 177 | if (sec_pmic->dev->of_node) { |
| 178 | pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); |
| 179 | if (IS_ERR(pdata)) { |
| 180 | ret = PTR_ERR(pdata); |
| 181 | return ret; |
| 182 | } |
| 183 | pdata->device_type = sec_pmic->type; |
| 184 | } |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 185 | if (pdata) { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 186 | sec_pmic->device_type = pdata->device_type; |
| 187 | sec_pmic->ono = pdata->ono; |
| 188 | sec_pmic->irq_base = pdata->irq_base; |
| 189 | sec_pmic->wakeup = pdata->wakeup; |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 190 | sec_pmic->pdata = pdata; |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 191 | } |
| 192 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 193 | sec_pmic->regmap = devm_regmap_init_i2c(i2c, &sec_regmap_config); |
| 194 | if (IS_ERR(sec_pmic->regmap)) { |
| 195 | ret = PTR_ERR(sec_pmic->regmap); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 196 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
Axel Lin | 61a2af3 | 2012-02-28 14:23:55 +0800 | [diff] [blame] | 197 | ret); |
Axel Lin | 1092e1c | 2012-04-25 10:03:44 +0800 | [diff] [blame] | 198 | return ret; |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 199 | } |
| 200 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 201 | sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); |
| 202 | i2c_set_clientdata(sec_pmic->rtc, sec_pmic); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 203 | |
Jonghwan Choi | c3ebb30 | 2012-01-16 09:08:42 +0900 | [diff] [blame] | 204 | if (pdata && pdata->cfg_pmic_irq) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 205 | pdata->cfg_pmic_irq(); |
| 206 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 207 | sec_irq_init(sec_pmic); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 208 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 209 | pm_runtime_set_active(sec_pmic->dev); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 210 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 211 | switch (sec_pmic->device_type) { |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 212 | case S5M8751X: |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 213 | ret = mfd_add_devices(sec_pmic->dev, -1, s5m8751_devs, |
Mark Brown | 0848c94 | 2012-09-11 15:16:36 +0800 | [diff] [blame] | 214 | ARRAY_SIZE(s5m8751_devs), NULL, 0, NULL); |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 215 | break; |
| 216 | case S5M8763X: |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 217 | ret = mfd_add_devices(sec_pmic->dev, -1, s5m8763_devs, |
Mark Brown | 0848c94 | 2012-09-11 15:16:36 +0800 | [diff] [blame] | 218 | ARRAY_SIZE(s5m8763_devs), NULL, 0, NULL); |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 219 | break; |
| 220 | case S5M8767X: |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 221 | ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs, |
Mark Brown | 0848c94 | 2012-09-11 15:16:36 +0800 | [diff] [blame] | 222 | ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL); |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 223 | break; |
Sangbeom Kim | 9b6d134 | 2012-07-11 21:07:55 +0900 | [diff] [blame] | 224 | case S2MPS11X: |
| 225 | ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, |
Mark Brown | 0848c94 | 2012-09-11 15:16:36 +0800 | [diff] [blame] | 226 | ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); |
Sangbeom Kim | 9b6d134 | 2012-07-11 21:07:55 +0900 | [diff] [blame] | 227 | break; |
Sangbeom Kim | 88a1cfd | 2012-01-20 16:09:12 +0900 | [diff] [blame] | 228 | default: |
| 229 | /* If this happens the probe function is problem */ |
| 230 | BUG(); |
| 231 | } |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 232 | |
| 233 | if (ret < 0) |
| 234 | goto err; |
| 235 | |
| 236 | return ret; |
| 237 | |
| 238 | err: |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 239 | mfd_remove_devices(sec_pmic->dev); |
| 240 | sec_irq_exit(sec_pmic); |
| 241 | i2c_unregister_device(sec_pmic->rtc); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 242 | return ret; |
| 243 | } |
| 244 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 245 | static int sec_pmic_remove(struct i2c_client *i2c) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 246 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 247 | struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 248 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 249 | mfd_remove_devices(sec_pmic->dev); |
| 250 | sec_irq_exit(sec_pmic); |
| 251 | i2c_unregister_device(sec_pmic->rtc); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 252 | return 0; |
| 253 | } |
| 254 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 255 | static const struct i2c_device_id sec_pmic_id[] = { |
| 256 | { "sec_pmic", 0 }, |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 257 | { } |
| 258 | }; |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 259 | MODULE_DEVICE_TABLE(i2c, sec_pmic_id); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 260 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 261 | static struct i2c_driver sec_pmic_driver = { |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 262 | .driver = { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 263 | .name = "sec_pmic", |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 264 | .owner = THIS_MODULE, |
Amit Daniel Kachhap | 26aec009 | 2013-02-03 15:49:47 -0800 | [diff] [blame] | 265 | .of_match_table = of_match_ptr(sec_dt_match), |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 266 | }, |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 267 | .probe = sec_pmic_probe, |
| 268 | .remove = sec_pmic_remove, |
| 269 | .id_table = sec_pmic_id, |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 270 | }; |
| 271 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 272 | static int __init sec_pmic_init(void) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 273 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 274 | return i2c_add_driver(&sec_pmic_driver); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 275 | } |
| 276 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 277 | subsys_initcall(sec_pmic_init); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 278 | |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 279 | static void __exit sec_pmic_exit(void) |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 280 | { |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 281 | i2c_del_driver(&sec_pmic_driver); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 282 | } |
Sangbeom Kim | 63063bf | 2012-07-11 21:06:55 +0900 | [diff] [blame] | 283 | module_exit(sec_pmic_exit); |
Sangbeom Kim | 0f5f707 | 2011-12-23 17:28:08 +0900 | [diff] [blame] | 284 | |
| 285 | MODULE_AUTHOR("Sangbeom Kim <sbkim73@samsung.com>"); |
| 286 | MODULE_DESCRIPTION("Core support for the S5M MFD"); |
| 287 | MODULE_LICENSE("GPL"); |