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

Commit bfa7e0ba authored by Kyle Piefer's avatar Kyle Piefer Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Remove SPTP headswitch controls for new targets



Starting from sdm855, the SPTPRAC headswitch is removed
from the GPU. Add a check to functions that touch the
relevant registers to make sure we do not proceed if
we are not a615 or a630.

Change-Id: I84c3cf615b2cac0b56a303603afb29a91caaff1b
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
parent 51a0318e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2008-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2018, 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
@@ -1869,6 +1869,14 @@ static inline void adreno_perfcntr_active_oob_put(
	kgsl_active_count_put(KGSL_DEVICE(adreno_dev));
}

static inline bool adreno_has_sptprac_gdsc(struct adreno_device *adreno_dev)
{
	if (adreno_is_a615(adreno_dev) || adreno_is_a630(adreno_dev))
		return true;
	else
		return false;
}

static inline bool adreno_has_gbif(struct adreno_device *adreno_dev)
{
	if (adreno_is_a615(adreno_dev))
+4 −2
Original line number Diff line number Diff line
@@ -1501,6 +1501,8 @@ static int a6xx_sptprac_enable(struct adreno_device *adreno_dev)

	if (!gmu->pdev)
		return -EINVAL;
	if (!adreno_has_sptprac_gdsc(adreno_dev))
		return 0;

	kgsl_gmu_regwrite(device, A6XX_GMU_GX_SPTPRAC_POWER_CONTROL,
			SPTPRAC_POWERON_CTRL_MASK);
@@ -1526,7 +1528,7 @@ static void a6xx_sptprac_disable(struct adreno_device *adreno_dev)
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct gmu_device *gmu = &device->gmu;

	if (!gmu->pdev)
	if (!gmu->pdev || !adreno_has_sptprac_gdsc(adreno_dev))
		return;

	/* Ensure that retention is on */
@@ -1578,7 +1580,7 @@ static bool a6xx_sptprac_is_on(struct adreno_device *adreno_dev)
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	unsigned int val;

	if (!kgsl_gmu_isenabled(device))
	if (!kgsl_gmu_isenabled(device) || !adreno_has_sptprac_gdsc(adreno_dev))
		return true;

	kgsl_gmu_regread(device, A6XX_GMU_SPTPRAC_PWR_CLK_STATUS, &val);