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

Commit 4d0eb9d9 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Add a6xx probe function



Add the a6xx specific probe function. With this we no longer
need the generic helper nor the platform_setup function so
they can be removed.

Change-Id: Ic0dedbadd317f8489f8451541dbb77a76c925719
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent f86d4770
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -1453,26 +1453,6 @@ int adreno_device_probe(struct platform_device *pdev,
	return status;
}

int adreno_target_probe(struct platform_device *pdev,
		u32 chipid, const struct adreno_gpu_core *gpucore)
{
	struct adreno_device *adreno_dev = &device_3d0;
	struct adreno_gpudev *gpudev = gpucore->gpudev;

	memset(adreno_dev, 0, sizeof(*adreno_dev));

	adreno_dev->gpucore = gpucore;
	adreno_dev->chipid = chipid;

	adreno_reg_offset_init(gpudev->reg_offsets);

	/* Do target specific identification */
	if (gpudev->platform_setup)
		gpudev->platform_setup(adreno_dev);

	return adreno_device_probe(pdev, adreno_dev);
}

static int adreno_bind(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
+0 −16
Original line number Diff line number Diff line
@@ -750,7 +750,6 @@ struct adreno_gpudev {
		const struct adreno_gpu_core *gpucore);
	void (*snapshot)(struct adreno_device *adreno_dev,
				struct kgsl_snapshot *snapshot);
	void (*platform_setup)(struct adreno_device *adreno_dev);
	irqreturn_t (*irq_handler)(struct adreno_device *adreno_dev);
	int (*init)(struct adreno_device *adreno_dev);
	void (*remove)(struct adreno_device *adreno_dev);
@@ -1744,19 +1743,4 @@ irqreturn_t adreno_irq_callbacks(struct adreno_device *adreno_dev,
int adreno_device_probe(struct platform_device *pdev,
		struct adreno_device *adreno_dev);

/**
 * adreno_target_probe - Helper function for target specific probe
 * @pdev: Pointer to the platform device
 * @chipid: Chipid for the target
 * @gpucore: Pointer to the GPU core definition for this target
 *
 * This is a generic probe function for targets that don't need any special
 * setup. This function sets up the reg_offsets and platform setup and then
 * calls the generic device probe.
 *
 * Return: 0 on success or negative on failure
 */
int adreno_target_probe(struct platform_device *pdev,
		u32 chipid, const struct adreno_gpu_core *gpucore);

#endif /*__ADRENO_H */
+18 −4
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/of_device.h>
#include <linux/soc/qcom/llcc-qcom.h>

#include "adreno.h"
@@ -2333,9 +2334,21 @@ static struct adreno_perfcounters a6xx_perfcounters = {
	ARRAY_SIZE(a6xx_perfcounter_groups),
};

static void a6xx_platform_setup(struct adreno_device *adreno_dev)
static int a6xx_probe(struct platform_device *pdev,
		u32 chipid, const struct adreno_gpu_core *gpucore)
{
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	struct adreno_device *adreno_dev;
	struct adreno_gpudev *gpudev = gpucore->gpudev;

	adreno_dev = (struct adreno_device *)
		of_device_get_match_data(&pdev->dev);

	memset(adreno_dev, 0, sizeof(*adreno_dev));

	adreno_dev->gpucore = gpucore;
	adreno_dev->chipid = chipid;

	adreno_reg_offset_init(gpudev->reg_offsets);

	adreno_dev->hwcg_enabled = true;

@@ -2372,6 +2385,8 @@ static void a6xx_platform_setup(struct adreno_device *adreno_dev)
	if (ADRENO_FEATURE(adreno_dev, ADRENO_IFPC))
		adreno_dev->perfctr_ifpc_lo =
			A6XX_GMU_CX_GMU_POWER_COUNTER_XOCLK_4_L;

	return adreno_device_probe(pdev, adreno_dev);
}


@@ -2635,10 +2650,9 @@ u64 a6xx_read_alwayson(struct adreno_device *adreno_dev)

struct adreno_gpudev adreno_a6xx_gpudev = {
	.reg_offsets = a6xx_register_offsets,
	.probe = adreno_target_probe,
	.probe = a6xx_probe,
	.start = a6xx_start,
	.snapshot = a6xx_snapshot,
	.platform_setup = a6xx_platform_setup,
	.init = a6xx_init,
	.irq_handler = a6xx_irq_handler,
	.rb_start = a6xx_rb_start,