Maheshkumar Sivasubramanian | 4ac2376 | 2011-11-02 10:03:06 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [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 | #ifndef __ARCH_ARM_MACH_MSM_SPM_DEVICES_H |
| 13 | #define __ARCH_ARM_MACH_MSM_SPM_DEVICES_H |
| 14 | |
| 15 | #include "spm.h" |
| 16 | |
| 17 | struct msm_spm_driver_data { |
Praveen Chidambaram | aa9d52b | 2012-04-02 11:09:47 -0600 | [diff] [blame] | 18 | uint32_t major; |
| 19 | uint32_t minor; |
| 20 | uint32_t ver_reg; |
| 21 | uint32_t vctl_port; |
| 22 | uint32_t phase_port; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | void __iomem *reg_base_addr; |
| 24 | uint32_t vctl_timeout_us; |
Praveen Chidambaram | aa9d52b | 2012-04-02 11:09:47 -0600 | [diff] [blame] | 25 | uint32_t avs_timeout_us; |
Maheshkumar Sivasubramanian | 059e091 | 2011-09-29 12:56:39 -0600 | [diff] [blame] | 26 | uint32_t reg_shadow[MSM_SPM_REG_NR]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | uint32_t *reg_seq_entry_shadow; |
Praveen Chidambaram | aa9d52b | 2012-04-02 11:09:47 -0600 | [diff] [blame] | 28 | uint32_t *reg_offsets; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | int msm_spm_drv_init(struct msm_spm_driver_data *dev, |
| 32 | struct msm_spm_platform_data *data); |
Maheshkumar Sivasubramanian | 4ac2376 | 2011-11-02 10:03:06 -0600 | [diff] [blame] | 33 | void msm_spm_drv_reinit(struct msm_spm_driver_data *dev); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 34 | int msm_spm_drv_set_low_power_mode(struct msm_spm_driver_data *dev, |
| 35 | uint32_t addr); |
| 36 | int msm_spm_drv_set_vdd(struct msm_spm_driver_data *dev, |
| 37 | unsigned int vlevel); |
Praveen Chidambaram | 4133ba1 | 2012-09-29 22:27:03 -0600 | [diff] [blame] | 38 | uint32_t msm_spm_drv_get_sts_curr_pmic_data( |
| 39 | struct msm_spm_driver_data *dev); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | int msm_spm_drv_write_seq_data(struct msm_spm_driver_data *dev, |
Praveen Chidambaram | aa9d52b | 2012-04-02 11:09:47 -0600 | [diff] [blame] | 41 | uint8_t *cmd, uint32_t *offset); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | void msm_spm_drv_flush_seq_entry(struct msm_spm_driver_data *dev); |
| 43 | int msm_spm_drv_set_spm_enable(struct msm_spm_driver_data *dev, |
| 44 | bool enable); |
Praveen Chidambaram | aa9d52b | 2012-04-02 11:09:47 -0600 | [diff] [blame] | 45 | int msm_spm_drv_set_phase(struct msm_spm_driver_data *dev, |
| 46 | unsigned int phase_cnt); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | #endif |