Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 1 | /* |
| 2 | * reg-virtual-consumer.c |
| 3 | * |
| 4 | * Copyright 2008 Wolfson Microelectronics PLC. |
| 5 | * |
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of the |
| 11 | * License, or (at your option) any later version. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/err.h> |
| 15 | #include <linux/mutex.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/regulator/consumer.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 18 | #include <linux/slab.h> |
Paul Gortmaker | 65602c3 | 2011-07-17 16:28:23 -0400 | [diff] [blame] | 19 | #include <linux/module.h> |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 20 | |
| 21 | struct virtual_consumer_data { |
| 22 | struct mutex lock; |
| 23 | struct regulator *regulator; |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 24 | bool enabled; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 25 | int min_uV; |
| 26 | int max_uV; |
| 27 | int min_uA; |
| 28 | int max_uA; |
| 29 | unsigned int mode; |
| 30 | }; |
| 31 | |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 32 | static void update_voltage_constraints(struct device *dev, |
| 33 | struct virtual_consumer_data *data) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 34 | { |
| 35 | int ret; |
| 36 | |
| 37 | if (data->min_uV && data->max_uV |
| 38 | && data->min_uV <= data->max_uV) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 39 | dev_dbg(dev, "Requesting %d-%duV\n", |
| 40 | data->min_uV, data->max_uV); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 41 | ret = regulator_set_voltage(data->regulator, |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 42 | data->min_uV, data->max_uV); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 43 | if (ret != 0) { |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 44 | dev_err(dev, |
| 45 | "regulator_set_voltage() failed: %d\n", ret); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 46 | return; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | if (data->min_uV && data->max_uV && !data->enabled) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 51 | dev_dbg(dev, "Enabling regulator\n"); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 52 | ret = regulator_enable(data->regulator); |
| 53 | if (ret == 0) |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 54 | data->enabled = true; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 55 | else |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 56 | dev_err(dev, "regulator_enable() failed: %d\n", |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 57 | ret); |
| 58 | } |
| 59 | |
| 60 | if (!(data->min_uV && data->max_uV) && data->enabled) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 61 | dev_dbg(dev, "Disabling regulator\n"); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 62 | ret = regulator_disable(data->regulator); |
| 63 | if (ret == 0) |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 64 | data->enabled = false; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 65 | else |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 66 | dev_err(dev, "regulator_disable() failed: %d\n", |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 67 | ret); |
| 68 | } |
| 69 | } |
| 70 | |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 71 | static void update_current_limit_constraints(struct device *dev, |
| 72 | struct virtual_consumer_data *data) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 73 | { |
| 74 | int ret; |
| 75 | |
| 76 | if (data->max_uA |
| 77 | && data->min_uA <= data->max_uA) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 78 | dev_dbg(dev, "Requesting %d-%duA\n", |
| 79 | data->min_uA, data->max_uA); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 80 | ret = regulator_set_current_limit(data->regulator, |
| 81 | data->min_uA, data->max_uA); |
| 82 | if (ret != 0) { |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 83 | dev_err(dev, |
| 84 | "regulator_set_current_limit() failed: %d\n", |
| 85 | ret); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 86 | return; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | if (data->max_uA && !data->enabled) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 91 | dev_dbg(dev, "Enabling regulator\n"); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 92 | ret = regulator_enable(data->regulator); |
| 93 | if (ret == 0) |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 94 | data->enabled = true; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 95 | else |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 96 | dev_err(dev, "regulator_enable() failed: %d\n", |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 97 | ret); |
| 98 | } |
| 99 | |
| 100 | if (!(data->min_uA && data->max_uA) && data->enabled) { |
Mark Brown | a5d2abc | 2009-06-17 15:45:07 +0100 | [diff] [blame] | 101 | dev_dbg(dev, "Disabling regulator\n"); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 102 | ret = regulator_disable(data->regulator); |
| 103 | if (ret == 0) |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 104 | data->enabled = false; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 105 | else |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 106 | dev_err(dev, "regulator_disable() failed: %d\n", |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 107 | ret); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | static ssize_t show_min_uV(struct device *dev, |
| 112 | struct device_attribute *attr, char *buf) |
| 113 | { |
| 114 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 115 | return sprintf(buf, "%d\n", data->min_uV); |
| 116 | } |
| 117 | |
| 118 | static ssize_t set_min_uV(struct device *dev, struct device_attribute *attr, |
| 119 | const char *buf, size_t count) |
| 120 | { |
| 121 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 122 | long val; |
| 123 | |
Axel Lin | 85960e7 | 2012-04-19 09:03:45 +0800 | [diff] [blame] | 124 | if (kstrtol(buf, 10, &val) != 0) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 125 | return count; |
| 126 | |
| 127 | mutex_lock(&data->lock); |
| 128 | |
| 129 | data->min_uV = val; |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 130 | update_voltage_constraints(dev, data); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 131 | |
| 132 | mutex_unlock(&data->lock); |
| 133 | |
| 134 | return count; |
| 135 | } |
| 136 | |
| 137 | static ssize_t show_max_uV(struct device *dev, |
| 138 | struct device_attribute *attr, char *buf) |
| 139 | { |
| 140 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 141 | return sprintf(buf, "%d\n", data->max_uV); |
| 142 | } |
| 143 | |
| 144 | static ssize_t set_max_uV(struct device *dev, struct device_attribute *attr, |
| 145 | const char *buf, size_t count) |
| 146 | { |
| 147 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 148 | long val; |
| 149 | |
Axel Lin | 85960e7 | 2012-04-19 09:03:45 +0800 | [diff] [blame] | 150 | if (kstrtol(buf, 10, &val) != 0) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 151 | return count; |
| 152 | |
| 153 | mutex_lock(&data->lock); |
| 154 | |
| 155 | data->max_uV = val; |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 156 | update_voltage_constraints(dev, data); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 157 | |
| 158 | mutex_unlock(&data->lock); |
| 159 | |
| 160 | return count; |
| 161 | } |
| 162 | |
| 163 | static ssize_t show_min_uA(struct device *dev, |
| 164 | struct device_attribute *attr, char *buf) |
| 165 | { |
| 166 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 167 | return sprintf(buf, "%d\n", data->min_uA); |
| 168 | } |
| 169 | |
| 170 | static ssize_t set_min_uA(struct device *dev, struct device_attribute *attr, |
| 171 | const char *buf, size_t count) |
| 172 | { |
| 173 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 174 | long val; |
| 175 | |
Axel Lin | 85960e7 | 2012-04-19 09:03:45 +0800 | [diff] [blame] | 176 | if (kstrtol(buf, 10, &val) != 0) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 177 | return count; |
| 178 | |
| 179 | mutex_lock(&data->lock); |
| 180 | |
| 181 | data->min_uA = val; |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 182 | update_current_limit_constraints(dev, data); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 183 | |
| 184 | mutex_unlock(&data->lock); |
| 185 | |
| 186 | return count; |
| 187 | } |
| 188 | |
| 189 | static ssize_t show_max_uA(struct device *dev, |
| 190 | struct device_attribute *attr, char *buf) |
| 191 | { |
| 192 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 193 | return sprintf(buf, "%d\n", data->max_uA); |
| 194 | } |
| 195 | |
| 196 | static ssize_t set_max_uA(struct device *dev, struct device_attribute *attr, |
| 197 | const char *buf, size_t count) |
| 198 | { |
| 199 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 200 | long val; |
| 201 | |
Axel Lin | 85960e7 | 2012-04-19 09:03:45 +0800 | [diff] [blame] | 202 | if (kstrtol(buf, 10, &val) != 0) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 203 | return count; |
| 204 | |
| 205 | mutex_lock(&data->lock); |
| 206 | |
| 207 | data->max_uA = val; |
Mark Brown | a07ac21 | 2009-06-17 15:45:06 +0100 | [diff] [blame] | 208 | update_current_limit_constraints(dev, data); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 209 | |
| 210 | mutex_unlock(&data->lock); |
| 211 | |
| 212 | return count; |
| 213 | } |
| 214 | |
| 215 | static ssize_t show_mode(struct device *dev, |
| 216 | struct device_attribute *attr, char *buf) |
| 217 | { |
| 218 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 219 | |
| 220 | switch (data->mode) { |
| 221 | case REGULATOR_MODE_FAST: |
| 222 | return sprintf(buf, "fast\n"); |
| 223 | case REGULATOR_MODE_NORMAL: |
| 224 | return sprintf(buf, "normal\n"); |
| 225 | case REGULATOR_MODE_IDLE: |
| 226 | return sprintf(buf, "idle\n"); |
| 227 | case REGULATOR_MODE_STANDBY: |
| 228 | return sprintf(buf, "standby\n"); |
| 229 | default: |
| 230 | return sprintf(buf, "unknown\n"); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | static ssize_t set_mode(struct device *dev, struct device_attribute *attr, |
| 235 | const char *buf, size_t count) |
| 236 | { |
| 237 | struct virtual_consumer_data *data = dev_get_drvdata(dev); |
| 238 | unsigned int mode; |
| 239 | int ret; |
| 240 | |
Andrew Morton | 9485397 | 2009-01-15 16:13:01 -0800 | [diff] [blame] | 241 | /* |
| 242 | * sysfs_streq() doesn't need the \n's, but we add them so the strings |
| 243 | * will be shared with show_mode(), above. |
| 244 | */ |
Mike Rapoport | aa61d55 | 2009-04-26 11:49:30 +0300 | [diff] [blame] | 245 | if (sysfs_streq(buf, "fast\n")) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 246 | mode = REGULATOR_MODE_FAST; |
Mike Rapoport | aa61d55 | 2009-04-26 11:49:30 +0300 | [diff] [blame] | 247 | else if (sysfs_streq(buf, "normal\n")) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 248 | mode = REGULATOR_MODE_NORMAL; |
Mike Rapoport | aa61d55 | 2009-04-26 11:49:30 +0300 | [diff] [blame] | 249 | else if (sysfs_streq(buf, "idle\n")) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 250 | mode = REGULATOR_MODE_IDLE; |
Mike Rapoport | aa61d55 | 2009-04-26 11:49:30 +0300 | [diff] [blame] | 251 | else if (sysfs_streq(buf, "standby\n")) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 252 | mode = REGULATOR_MODE_STANDBY; |
| 253 | else { |
| 254 | dev_err(dev, "Configuring invalid mode\n"); |
| 255 | return count; |
| 256 | } |
| 257 | |
| 258 | mutex_lock(&data->lock); |
| 259 | ret = regulator_set_mode(data->regulator, mode); |
| 260 | if (ret == 0) |
| 261 | data->mode = mode; |
| 262 | else |
| 263 | dev_err(dev, "Failed to configure mode: %d\n", ret); |
| 264 | mutex_unlock(&data->lock); |
| 265 | |
| 266 | return count; |
| 267 | } |
| 268 | |
Rusty Russell | 71e06af | 2014-05-14 10:33:49 +0930 | [diff] [blame] | 269 | static DEVICE_ATTR(min_microvolts, 0664, show_min_uV, set_min_uV); |
| 270 | static DEVICE_ATTR(max_microvolts, 0664, show_max_uV, set_max_uV); |
| 271 | static DEVICE_ATTR(min_microamps, 0664, show_min_uA, set_min_uA); |
| 272 | static DEVICE_ATTR(max_microamps, 0664, show_max_uA, set_max_uA); |
| 273 | static DEVICE_ATTR(mode, 0664, show_mode, set_mode); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 274 | |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 275 | static struct attribute *regulator_virtual_attributes[] = { |
| 276 | &dev_attr_min_microvolts.attr, |
| 277 | &dev_attr_max_microvolts.attr, |
| 278 | &dev_attr_min_microamps.attr, |
| 279 | &dev_attr_max_microamps.attr, |
| 280 | &dev_attr_mode.attr, |
| 281 | NULL |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 282 | }; |
| 283 | |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 284 | static const struct attribute_group regulator_virtual_attr_group = { |
| 285 | .attrs = regulator_virtual_attributes, |
| 286 | }; |
| 287 | |
Bill Pemberton | a502357 | 2012-11-19 13:22:22 -0500 | [diff] [blame] | 288 | static int regulator_virtual_probe(struct platform_device *pdev) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 289 | { |
Jingoo Han | dff91d0 | 2013-07-30 17:20:47 +0900 | [diff] [blame] | 290 | char *reg_id = dev_get_platdata(&pdev->dev); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 291 | struct virtual_consumer_data *drvdata; |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 292 | int ret; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 293 | |
Axel Lin | a81edbd | 2012-04-18 09:35:35 +0800 | [diff] [blame] | 294 | drvdata = devm_kzalloc(&pdev->dev, sizeof(struct virtual_consumer_data), |
| 295 | GFP_KERNEL); |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 296 | if (drvdata == NULL) |
Mark Brown | 72b86876 | 2009-07-21 16:00:27 +0100 | [diff] [blame] | 297 | return -ENOMEM; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 298 | |
| 299 | mutex_init(&drvdata->lock); |
| 300 | |
Axel Lin | a81edbd | 2012-04-18 09:35:35 +0800 | [diff] [blame] | 301 | drvdata->regulator = devm_regulator_get(&pdev->dev, reg_id); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 302 | if (IS_ERR(drvdata->regulator)) { |
| 303 | ret = PTR_ERR(drvdata->regulator); |
Mark Brown | d61c3d5 | 2009-06-15 20:01:01 +0100 | [diff] [blame] | 304 | dev_err(&pdev->dev, "Failed to obtain supply '%s': %d\n", |
| 305 | reg_id, ret); |
Axel Lin | a81edbd | 2012-04-18 09:35:35 +0800 | [diff] [blame] | 306 | return ret; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 307 | } |
| 308 | |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 309 | ret = sysfs_create_group(&pdev->dev.kobj, |
| 310 | ®ulator_virtual_attr_group); |
| 311 | if (ret != 0) { |
| 312 | dev_err(&pdev->dev, |
| 313 | "Failed to create attribute group: %d\n", ret); |
Axel Lin | a81edbd | 2012-04-18 09:35:35 +0800 | [diff] [blame] | 314 | return ret; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | drvdata->mode = regulator_get_mode(drvdata->regulator); |
| 318 | |
| 319 | platform_set_drvdata(pdev, drvdata); |
| 320 | |
| 321 | return 0; |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 322 | } |
| 323 | |
Bill Pemberton | 8dc995f | 2012-11-19 13:26:10 -0500 | [diff] [blame] | 324 | static int regulator_virtual_remove(struct platform_device *pdev) |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 325 | { |
| 326 | struct virtual_consumer_data *drvdata = platform_get_drvdata(pdev); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 327 | |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 328 | sysfs_remove_group(&pdev->dev.kobj, ®ulator_virtual_attr_group); |
| 329 | |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 330 | if (drvdata->enabled) |
| 331 | regulator_disable(drvdata->regulator); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 332 | |
| 333 | return 0; |
| 334 | } |
| 335 | |
| 336 | static struct platform_driver regulator_virtual_consumer_driver = { |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 337 | .probe = regulator_virtual_probe, |
Bill Pemberton | 5eb9f2b | 2012-11-19 13:20:42 -0500 | [diff] [blame] | 338 | .remove = regulator_virtual_remove, |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 339 | .driver = { |
| 340 | .name = "reg-virt-consumer", |
Dmitry Torokhov | 4cf9566 | 2010-02-23 23:37:44 -0800 | [diff] [blame] | 341 | .owner = THIS_MODULE, |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 342 | }, |
| 343 | }; |
| 344 | |
Axel Lin | 005d610 | 2011-11-28 11:38:39 +0800 | [diff] [blame] | 345 | module_platform_driver(regulator_virtual_consumer_driver); |
Mark Brown | c080909 | 2008-04-30 17:05:33 +0100 | [diff] [blame] | 346 | |
| 347 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
| 348 | MODULE_DESCRIPTION("Virtual regulator consumer"); |
| 349 | MODULE_LICENSE("GPL"); |
Mark Brown | 38c53c8 | 2009-04-28 11:13:55 +0100 | [diff] [blame] | 350 | MODULE_ALIAS("platform:reg-virt-consumer"); |