David Collins | 8839df2 | 2012-10-15 12:04:18 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Michael Bohan | 9b7ac51 | 2012-02-24 14:42:44 -0800 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __STUB_REGULATOR_H__ |
| 14 | #define __STUB_REGULATOR_H__ |
| 15 | |
| 16 | #include <linux/regulator/machine.h> |
| 17 | |
| 18 | #define STUB_REGULATOR_DRIVER_NAME "stub-regulator" |
| 19 | |
| 20 | /** |
| 21 | * struct stub_regulator_pdata - stub regulator device data |
| 22 | * @init_data: regulator constraints |
| 23 | * @hpm_min_load: minimum load in uA that will result in the regulator |
| 24 | * being set to high power mode |
| 25 | * @system_uA: current drawn from regulator not accounted for by any |
| 26 | * regulator framework consumer |
| 27 | */ |
| 28 | struct stub_regulator_pdata { |
| 29 | struct regulator_init_data init_data; |
| 30 | int hpm_min_load; |
| 31 | int system_uA; |
| 32 | }; |
Michael Bohan | 83b0065 | 2012-03-30 14:19:38 -0700 | [diff] [blame] | 33 | |
David Collins | 8839df2 | 2012-10-15 12:04:18 -0700 | [diff] [blame] | 34 | #ifdef CONFIG_REGULATOR_STUB |
| 35 | |
| 36 | /** |
| 37 | * regulator_stub_init() - register platform driver for stub-regulator |
| 38 | * |
| 39 | * This initialization function should be called in systems in which driver |
| 40 | * registration ordering must be controlled precisely. |
| 41 | */ |
| 42 | |
Michael Bohan | 83b0065 | 2012-03-30 14:19:38 -0700 | [diff] [blame] | 43 | int __init regulator_stub_init(void); |
David Collins | 8839df2 | 2012-10-15 12:04:18 -0700 | [diff] [blame] | 44 | |
| 45 | #else |
| 46 | |
| 47 | static inline int __init regulator_stub_init(void) |
| 48 | { |
| 49 | return -ENODEV; |
| 50 | } |
| 51 | |
| 52 | #endif /* CONFIG_REGULATOR_STUB */ |
| 53 | |
Michael Bohan | 9b7ac51 | 2012-02-24 14:42:44 -0800 | [diff] [blame] | 54 | #endif |