Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2016, The Linux Foundation. All rights reserved. |
| 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 __CODEC_POWER_SUPPLY_H__ |
| 14 | #define __CODEC_POWER_SUPPLY_H__ |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/slab.h> |
| 18 | #include <linux/regulator/consumer.h> |
| 19 | |
| 20 | struct cdc_regulator { |
| 21 | const char *name; |
| 22 | int min_uV; |
| 23 | int max_uV; |
| 24 | int optimum_uA; |
| 25 | bool ondemand; |
| 26 | struct regulator *regulator; |
| 27 | }; |
| 28 | |
| 29 | extern int msm_cdc_get_power_supplies(struct device *dev, |
| 30 | struct cdc_regulator **cdc_vreg, |
| 31 | int *total_num_supplies); |
| 32 | extern int msm_cdc_disable_static_supplies(struct device *dev, |
| 33 | struct regulator_bulk_data *supplies, |
| 34 | struct cdc_regulator *cdc_vreg, |
| 35 | int num_supplies); |
| 36 | extern int msm_cdc_release_supplies(struct device *dev, |
| 37 | struct regulator_bulk_data *supplies, |
| 38 | struct cdc_regulator *cdc_vreg, |
| 39 | int num_supplies); |
| 40 | extern int msm_cdc_enable_static_supplies(struct device *dev, |
| 41 | struct regulator_bulk_data *supplies, |
| 42 | struct cdc_regulator *cdc_vreg, |
| 43 | int num_supplies); |
| 44 | extern int msm_cdc_init_supplies(struct device *dev, |
| 45 | struct regulator_bulk_data **supplies, |
| 46 | struct cdc_regulator *cdc_vreg, |
| 47 | int num_supplies); |
| 48 | #endif |