2014-02-07 08:49:14 +01:00
|
|
|
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
|
2013-02-20 03:59:40 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
|
|
* only version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_ARM_MACH_MSM_SPM_H
|
|
|
|
#define __ARCH_ARM_MACH_MSM_SPM_H
|
2014-04-01 17:38:02 +02:00
|
|
|
|
2013-02-20 03:59:40 +01:00
|
|
|
enum {
|
|
|
|
MSM_SPM_MODE_DISABLED,
|
|
|
|
MSM_SPM_MODE_CLOCK_GATING,
|
2014-02-06 18:06:30 +01:00
|
|
|
MSM_SPM_MODE_RETENTION,
|
|
|
|
MSM_SPM_MODE_GDHS,
|
2013-02-20 03:59:40 +01:00
|
|
|
MSM_SPM_MODE_POWER_COLLAPSE,
|
|
|
|
MSM_SPM_MODE_NR
|
|
|
|
};
|
|
|
|
|
2014-02-07 19:42:29 +01:00
|
|
|
struct msm_spm_device;
|
2014-07-18 01:04:58 +02:00
|
|
|
struct device_node;
|
2014-02-07 19:42:29 +01:00
|
|
|
|
2014-08-28 22:04:08 +02:00
|
|
|
#if defined(CONFIG_MSM_SPM)
|
2013-02-20 03:59:40 +01:00
|
|
|
|
|
|
|
int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm);
|
2014-02-07 08:49:14 +01:00
|
|
|
int msm_spm_probe_done(void);
|
2013-02-20 03:59:40 +01:00
|
|
|
int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel);
|
2012-09-30 06:27:03 +02:00
|
|
|
unsigned int msm_spm_get_vdd(unsigned int cpu);
|
2014-07-18 01:04:58 +02:00
|
|
|
int msm_spm_turn_on_cpu_rail(struct device_node *l2ccc_node,
|
|
|
|
unsigned int val, int cpu, int vctl_offset);
|
2014-02-07 19:42:29 +01:00
|
|
|
struct msm_spm_device *msm_spm_get_device_by_name(const char *name);
|
|
|
|
int msm_spm_config_low_power_mode(struct msm_spm_device *dev,
|
|
|
|
unsigned int mode, bool notify_rpm);
|
2013-02-20 03:59:40 +01:00
|
|
|
int msm_spm_device_init(void);
|
2014-06-30 23:06:39 +02:00
|
|
|
bool msm_spm_is_mode_avail(unsigned int mode);
|
2014-06-17 23:21:08 +02:00
|
|
|
void msm_spm_dump_regs(unsigned int cpu);
|
2013-02-20 03:59:40 +01:00
|
|
|
#if defined(CONFIG_MSM_L2_SPM)
|
|
|
|
|
2014-04-04 22:12:59 +02:00
|
|
|
/* Public functions */
|
|
|
|
|
|
|
|
int msm_spm_apcs_set_phase(int cpu, unsigned int phase_cnt);
|
|
|
|
int msm_spm_enable_fts_lpm(int cpu, uint32_t mode);
|
2012-10-04 01:06:02 +02:00
|
|
|
|
2013-02-20 03:59:40 +01:00
|
|
|
#else
|
|
|
|
|
2014-04-04 22:12:59 +02:00
|
|
|
static inline int msm_spm_apcs_set_phase(int cpu, unsigned int phase_cnt)
|
2013-02-20 03:59:40 +01:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2012-10-04 01:06:02 +02:00
|
|
|
|
2014-04-04 22:12:59 +02:00
|
|
|
static inline int msm_spm_enable_fts_lpm(int cpu, uint32_t mode)
|
2012-10-04 01:06:02 +02:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2013-02-20 03:59:40 +01:00
|
|
|
#endif /* defined(CONFIG_MSM_L2_SPM) */
|
2014-08-28 22:04:08 +02:00
|
|
|
#else /* defined(CONFIG_MSM_SPM) */
|
2013-02-20 03:59:40 +01:00
|
|
|
static inline int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
2014-02-07 08:49:14 +01:00
|
|
|
static inline int msm_spm_probe_done(void)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
2013-02-20 03:59:40 +01:00
|
|
|
static inline int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
2012-09-30 06:27:03 +02:00
|
|
|
static inline unsigned int msm_spm_get_vdd(unsigned int cpu)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-07-18 01:04:58 +02:00
|
|
|
static inline int msm_spm_turn_on_cpu_rail(struct device_node *l2ccc_node,
|
|
|
|
unsigned int val, int cpu, int vctl_offset)
|
2013-02-20 03:59:40 +01:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int msm_spm_device_init(void)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2014-06-17 23:21:08 +02:00
|
|
|
|
2014-08-07 02:50:27 +02:00
|
|
|
static inline void msm_spm_dump_regs(unsigned int cpu)
|
2014-06-17 23:21:08 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-02-07 19:42:29 +01:00
|
|
|
int msm_spm_config_low_power_mode(struct msm_spm_device *dev,
|
|
|
|
unsigned int mode, bool notify_rpm)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
struct msm_spm_device *msm_spm_get_device_by_name(const char *name)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-02-20 03:59:40 +01:00
|
|
|
|
2014-06-30 23:06:39 +02:00
|
|
|
bool msm_spm_is_mode_avail(unsigned int mode)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-08-28 22:04:08 +02:00
|
|
|
#endif /* defined (CONFIG_MSM_SPM) */
|
2013-02-20 03:59:40 +01:00
|
|
|
#endif /* __ARCH_ARM_MACH_MSM_SPM_H */
|