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

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

Merge "msm: kgsl: Use an explicit regulator disable for the SP/TP block"

parents f1b11132 a017b7ab
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3335,6 +3335,14 @@ static bool adreno_is_hw_collapsible(struct kgsl_device *device)
				gpudev->is_sptp_idle(adreno_dev) : true);
}

static void adreno_regulator_disable(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_gpudev *gpudev  = ADRENO_GPU_DEVICE(adreno_dev);
	if (gpudev->regulator_disable)
		gpudev->regulator_disable(adreno_dev);
}

static const struct kgsl_functable adreno_functable = {
	/* Mandatory functions */
	.regread = adreno_regread,
@@ -3370,6 +3378,7 @@ static const struct kgsl_functable adreno_functable = {
	.disable_pc = adreno_disable_pc,
	.regulator_enable = adreno_regulator_enable,
	.is_hw_collapsible = adreno_is_hw_collapsible,
	.regulator_disable = adreno_regulator_disable,

};

+1 −0
Original line number Diff line number Diff line
@@ -626,6 +626,7 @@ struct adreno_gpudev {
	void (*enable_pc)(struct adreno_device *);
	void (*disable_pc)(struct adreno_device *);
	void (*regulator_enable)(struct adreno_device *);
	void (*regulator_disable)(struct adreno_device *);
};

#define FT_DETECT_REGS_COUNT 14
+20 −0
Original line number Diff line number Diff line
@@ -352,6 +352,25 @@ static void a4xx_regulator_enable(struct adreno_device *adreno_dev)
	trace_adreno_sp_tp((unsigned long) __builtin_return_address(0));
}

/*
 * a4xx_regulator_disable() - Disable any necessary HW regulators
 * @adreno_dev: The adreno device pointer
 *
 * Some HW blocks may need their regulators explicitly disabled
 * on a power down to prevent current spikes.  Clocks must be on
 * during this call.
 */
static void a4xx_regulator_disable(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = &adreno_dev->dev;
	if (adreno_is_a420(adreno_dev))
		return;

	/* Set the default register values; set SW_COLLAPSE to 1 */
	kgsl_regwrite(device, A4XX_RBBM_POWER_CNTL_IP, 0x778001);
	trace_adreno_sp_tp((unsigned long) __builtin_return_address(0));
}

/*
 * a4xx_enable_pc() - Enable the SP/TP block power collapse
 * @adreno_dev: The adreno device pointer
@@ -1427,4 +1446,5 @@ struct adreno_gpudev adreno_a4xx_gpudev = {
	.enable_pc = a4xx_enable_pc,
	.disable_pc = a4xx_disable_pc,
	.regulator_enable = a4xx_regulator_enable,
	.regulator_disable = a4xx_regulator_disable,
};
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ struct kgsl_functable {
	void (*disable_pc)(struct kgsl_device *);
	void (*regulator_enable)(struct kgsl_device *);
	bool (*is_hw_collapsible)(struct kgsl_device *);
	void (*regulator_disable)(struct kgsl_device *);
};

typedef long (*kgsl_ioctl_func_t)(struct kgsl_device_private *,
+1 −0
Original line number Diff line number Diff line
@@ -1557,6 +1557,7 @@ EXPORT_SYMBOL(kgsl_pwrctrl_enable);
void kgsl_pwrctrl_disable(struct kgsl_device *device)
{
	/* Order pwrrail/clk sequence based upon platform */
	device->ftbl->regulator_disable(device);
	kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_OFF);
	kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_OFF, KGSL_STATE_SLEEP);
	kgsl_pwrctrl_pwrrail(device, KGSL_PWRFLAGS_OFF);