Loading drivers/cpuidle/lpm-levels.c +6 −1 Original line number Diff line number Diff line Loading @@ -381,6 +381,11 @@ int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm) lpm = MSM_SPM_MODE_DISABLED; break; } if (lpm_wa_get_skip_l2_spm()) rc = msm_spm_config_low_power_mode_addr(ops->spm, lpm, notify_rpm); else rc = msm_spm_config_low_power_mode(ops->spm, lpm, notify_rpm); if (rc) Loading drivers/cpuidle/lpm-workarounds.c +11 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * 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 Loading @@ -24,6 +24,7 @@ static struct regulator *lpm_cx_reg; static struct work_struct dummy_vote_work; static struct workqueue_struct *lpm_wa_wq; static bool lpm_wa_cx_turbo_unvote; static bool skip_l2_spm; /* While exiting from RPM assisted power collapse on some targets like MSM8939 * the CX is bumped to turbo mode by RPM. To reduce the power impact, APSS Loading Loading @@ -80,6 +81,12 @@ static int lpm_wa_cx_unvote_exit(void) return 0; } bool lpm_wa_get_skip_l2_spm(void) { return skip_l2_spm; } EXPORT_SYMBOL(lpm_wa_get_skip_l2_spm); static int lpm_wa_probe(struct platform_device *pdev) { int ret = 0; Loading @@ -95,6 +102,9 @@ static int lpm_wa_probe(struct platform_device *pdev) } } skip_l2_spm = of_property_read_bool(pdev->dev.of_node, "qcom,lpm-wa-skip-l2-spm"); return ret; } Loading drivers/cpuidle/lpm-workarounds.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * 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 Loading @@ -15,5 +15,6 @@ #define __LPM_WA_H void lpm_wa_cx_unvote_send(void); bool lpm_wa_get_skip_l2_spm(void); #endif /* __LPM_WA_H */ drivers/soc/qcom/spm_devices.c +13 −5 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ static void msm_spm_config_slpreq(struct msm_spm_device *dev, } static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) unsigned int mode, bool notify_rpm, bool set_spm_enable) { uint32_t i; int ret = -EINVAL; Loading @@ -251,9 +251,11 @@ static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, if (!dev->num_modes) return 0; if (mode == MSM_SPM_MODE_DISABLED) { if (mode == MSM_SPM_MODE_DISABLED && set_spm_enable) { ret = msm_spm_drv_set_spm_enable(&dev->reg_data, false); } else if (!msm_spm_drv_set_spm_enable(&dev->reg_data, true)) { } else { if (set_spm_enable) ret = msm_spm_drv_set_spm_enable(&dev->reg_data, true); for (i = 0; i < dev->num_modes; i++) { if (dev->modes[i].mode != mode) continue; Loading Loading @@ -537,10 +539,16 @@ EXPORT_SYMBOL(msm_spm_avs_clear_irq); int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm) { struct msm_spm_device *dev = &__get_cpu_var(msm_cpu_spm_device); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, true); } EXPORT_SYMBOL(msm_spm_set_low_power_mode); int msm_spm_config_low_power_mode_addr(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) { return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, false); } /** * msm_spm_init(): Board initalization function * @data: platform specific SPM register configuration data Loading Loading @@ -582,7 +590,7 @@ 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) { return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, true); } #ifdef CONFIG_MSM_L2_SPM Loading include/soc/qcom/spm.h +10 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved. * * 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 Loading Loading @@ -43,6 +43,8 @@ int msm_spm_turn_on_cpu_rail(struct device_node *l2ccc_node, 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); int msm_spm_config_low_power_mode_addr(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm); int msm_spm_device_init(void); bool msm_spm_is_mode_avail(unsigned int mode); void msm_spm_dump_regs(unsigned int cpu); Loading Loading @@ -116,6 +118,13 @@ static inline int msm_spm_config_low_power_mode(struct msm_spm_device *dev, { return -ENODEV; } static inline int msm_spm_config_low_power_mode_addr( struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) { return -ENODEV; } static inline struct msm_spm_device *msm_spm_get_device_by_name(const char *name) { return NULL; Loading Loading
drivers/cpuidle/lpm-levels.c +6 −1 Original line number Diff line number Diff line Loading @@ -381,6 +381,11 @@ int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm) lpm = MSM_SPM_MODE_DISABLED; break; } if (lpm_wa_get_skip_l2_spm()) rc = msm_spm_config_low_power_mode_addr(ops->spm, lpm, notify_rpm); else rc = msm_spm_config_low_power_mode(ops->spm, lpm, notify_rpm); if (rc) Loading
drivers/cpuidle/lpm-workarounds.c +11 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * 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 Loading @@ -24,6 +24,7 @@ static struct regulator *lpm_cx_reg; static struct work_struct dummy_vote_work; static struct workqueue_struct *lpm_wa_wq; static bool lpm_wa_cx_turbo_unvote; static bool skip_l2_spm; /* While exiting from RPM assisted power collapse on some targets like MSM8939 * the CX is bumped to turbo mode by RPM. To reduce the power impact, APSS Loading Loading @@ -80,6 +81,12 @@ static int lpm_wa_cx_unvote_exit(void) return 0; } bool lpm_wa_get_skip_l2_spm(void) { return skip_l2_spm; } EXPORT_SYMBOL(lpm_wa_get_skip_l2_spm); static int lpm_wa_probe(struct platform_device *pdev) { int ret = 0; Loading @@ -95,6 +102,9 @@ static int lpm_wa_probe(struct platform_device *pdev) } } skip_l2_spm = of_property_read_bool(pdev->dev.of_node, "qcom,lpm-wa-skip-l2-spm"); return ret; } Loading
drivers/cpuidle/lpm-workarounds.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * 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 Loading @@ -15,5 +15,6 @@ #define __LPM_WA_H void lpm_wa_cx_unvote_send(void); bool lpm_wa_get_skip_l2_spm(void); #endif /* __LPM_WA_H */
drivers/soc/qcom/spm_devices.c +13 −5 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ static void msm_spm_config_slpreq(struct msm_spm_device *dev, } static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) unsigned int mode, bool notify_rpm, bool set_spm_enable) { uint32_t i; int ret = -EINVAL; Loading @@ -251,9 +251,11 @@ static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, if (!dev->num_modes) return 0; if (mode == MSM_SPM_MODE_DISABLED) { if (mode == MSM_SPM_MODE_DISABLED && set_spm_enable) { ret = msm_spm_drv_set_spm_enable(&dev->reg_data, false); } else if (!msm_spm_drv_set_spm_enable(&dev->reg_data, true)) { } else { if (set_spm_enable) ret = msm_spm_drv_set_spm_enable(&dev->reg_data, true); for (i = 0; i < dev->num_modes; i++) { if (dev->modes[i].mode != mode) continue; Loading Loading @@ -537,10 +539,16 @@ EXPORT_SYMBOL(msm_spm_avs_clear_irq); int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm) { struct msm_spm_device *dev = &__get_cpu_var(msm_cpu_spm_device); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, true); } EXPORT_SYMBOL(msm_spm_set_low_power_mode); int msm_spm_config_low_power_mode_addr(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) { return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, false); } /** * msm_spm_init(): Board initalization function * @data: platform specific SPM register configuration data Loading Loading @@ -582,7 +590,7 @@ 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) { return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm); return msm_spm_dev_set_low_power_mode(dev, mode, notify_rpm, true); } #ifdef CONFIG_MSM_L2_SPM Loading
include/soc/qcom/spm.h +10 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved. * * 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 Loading Loading @@ -43,6 +43,8 @@ int msm_spm_turn_on_cpu_rail(struct device_node *l2ccc_node, 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); int msm_spm_config_low_power_mode_addr(struct msm_spm_device *dev, unsigned int mode, bool notify_rpm); int msm_spm_device_init(void); bool msm_spm_is_mode_avail(unsigned int mode); void msm_spm_dump_regs(unsigned int cpu); Loading Loading @@ -116,6 +118,13 @@ static inline int msm_spm_config_low_power_mode(struct msm_spm_device *dev, { return -ENODEV; } static inline int msm_spm_config_low_power_mode_addr( struct msm_spm_device *dev, unsigned int mode, bool notify_rpm) { return -ENODEV; } static inline struct msm_spm_device *msm_spm_get_device_by_name(const char *name) { return NULL; Loading