diff options
| author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-04-16 15:24:32 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-04-16 15:27:07 -0400 |
| commit | 82ea267f7dc853a5e6a724916a70a10656efdfc2 (patch) | |
| tree | 74a0377dbdfc759f813f2ac5d0bef4c5727a0765 /include/linux/mfd | |
| parent | 02269ab10f1130d35dc35db72ab026d16ba31abf (diff) | |
mfd: Fix modular builds of rc5t583 regulator support
The combination of commit 1b1247dd75aa5cf5fae54a3bec7280046e9c7957
"mfd: Add support for RICOH PMIC RC5T583"
and commit 6ffc3270210efa2bea526953a142ffc908f5bd86
"regulator: Add support for RICOH PMIC RC5T583 regulator"
are causing the i386 allmodconfig builds to fail with this:
ERROR: "rc5t583_update" [drivers/regulator/rc5t583-regulator.ko] undefined!
ERROR: "rc5t583_set_bits" [drivers/regulator/rc5t583-regulator.ko] undefined!
ERROR: "rc5t583_clear_bits" [drivers/regulator/rc5t583-regulator.ko] undefined!
ERROR: "rc5t583_read" [drivers/regulator/rc5t583-regulator.ko] undefined!
and this:
ERROR: "rc5t583_ext_power_req_config" [drivers/regulator/rc5t583-regulator.ko] undefined!
For the 1st four, make the simple ops static inline, instead of
polluting the namespace with trivial exports. For the last one,
add an EXPORT_SYMBOL.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd')
| -rw-r--r-- | include/linux/mfd/rc5t583.h | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/include/linux/mfd/rc5t583.h b/include/linux/mfd/rc5t583.h index a2c61609d21d..0b64b19d81ab 100644 --- a/include/linux/mfd/rc5t583.h +++ b/include/linux/mfd/rc5t583.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | #include <linux/regmap.h> | ||
| 29 | 30 | ||
| 30 | #define RC5T583_MAX_REGS 0xF8 | 31 | #define RC5T583_MAX_REGS 0xF8 |
| 31 | 32 | ||
| @@ -279,14 +280,44 @@ struct rc5t583_platform_data { | |||
| 279 | bool enable_shutdown; | 280 | bool enable_shutdown; |
| 280 | }; | 281 | }; |
| 281 | 282 | ||
| 282 | int rc5t583_write(struct device *dev, u8 reg, uint8_t val); | 283 | static inline int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val) |
| 283 | int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val); | 284 | { |
| 284 | int rc5t583_set_bits(struct device *dev, unsigned int reg, | 285 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); |
| 285 | unsigned int bit_mask); | 286 | return regmap_write(rc5t583->regmap, reg, val); |
| 286 | int rc5t583_clear_bits(struct device *dev, unsigned int reg, | 287 | } |
| 287 | unsigned int bit_mask); | 288 | |
| 288 | int rc5t583_update(struct device *dev, unsigned int reg, | 289 | static inline int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val) |
| 289 | unsigned int val, unsigned int mask); | 290 | { |
| 291 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
| 292 | unsigned int ival; | ||
| 293 | int ret; | ||
| 294 | ret = regmap_read(rc5t583->regmap, reg, &ival); | ||
| 295 | if (!ret) | ||
| 296 | *val = (uint8_t)ival; | ||
| 297 | return ret; | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline int rc5t583_set_bits(struct device *dev, unsigned int reg, | ||
| 301 | unsigned int bit_mask) | ||
| 302 | { | ||
| 303 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
| 304 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask); | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int rc5t583_clear_bits(struct device *dev, unsigned int reg, | ||
| 308 | unsigned int bit_mask) | ||
| 309 | { | ||
| 310 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
| 311 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0); | ||
| 312 | } | ||
| 313 | |||
| 314 | static inline int rc5t583_update(struct device *dev, unsigned int reg, | ||
| 315 | unsigned int val, unsigned int mask) | ||
| 316 | { | ||
| 317 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
| 318 | return regmap_update_bits(rc5t583->regmap, reg, mask, val); | ||
| 319 | } | ||
| 320 | |||
| 290 | int rc5t583_ext_power_req_config(struct device *dev, int deepsleep_id, | 321 | int rc5t583_ext_power_req_config(struct device *dev, int deepsleep_id, |
| 291 | int ext_pwr_req, int deepsleep_slot_nr); | 322 | int ext_pwr_req, int deepsleep_slot_nr); |
| 292 | int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base); | 323 | int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base); |
