Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2cd23ca authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: qcom: Legacy MSM PM support for MSM8909"

parents aa6e6cd6 3cc086cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ config ARCH_MSM8909
	select MAY_HAVE_SPARSE_IRQ
	select PINCTRL_MSM_TLMM
	select USE_PINCTRL_IRQ
	select MSM_PM if PM
	select MSM_PM_LEGACY if PM
	select MSM_RPM_SMD
	select MSM_RPM_STATS_LOG
	select MSM_RPM_LOG
+11 −1
Original line number Diff line number Diff line
@@ -346,6 +346,10 @@ int set_l2_mode(struct low_power_ops *ops, int mode,
		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)
@@ -642,6 +646,9 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
		if (sys_pm_ops && sys_pm_ops->enter)
			if ((sys_pm_ops->enter(nextcpu)))
				return -EBUSY;

		if (cluster->no_saw_devices && !use_psci)
			msm_spm_set_rpm_hs(true);
	}

	/* Notify cluster enter event after successfully config completion */
@@ -773,6 +780,9 @@ static void cluster_unprepare(struct lpm_cluster *cluster,
		 */
		lpm_wa_cx_unvote_send();

		if (cluster->no_saw_devices && !use_psci)
			msm_spm_set_rpm_hs(false);

	}

	update_debug_pc_event(CLUSTER_EXIT, cluster->last_level,
+10 −0
Original line number Diff line number Diff line
@@ -25,6 +25,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
@@ -81,6 +82,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;
@@ -96,6 +103,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;
}

+1 −0
Original line number Diff line number Diff line
@@ -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 */
+21 −5
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -539,10 +541,24 @@ int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
{
	struct msm_spm_device *dev = this_cpu_ptr(&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);

void msm_spm_set_rpm_hs(bool allow_rpm_hs)
{
	struct msm_spm_device *dev = this_cpu_ptr(&msm_cpu_spm_device);

	dev->allow_rpm_hs = allow_rpm_hs;
}
EXPORT_SYMBOL(msm_spm_set_rpm_hs);

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
@@ -586,7 +602,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