aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-5.10/093-drivers-cpufreq-qcom-cpufreq-nvmem-support-specific-.patch
blob: 8a25b17a192ab2de1f2155a3561bd3954c845875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From a206d4061f1cc2c5cd17ee45c53a0ba711e48e6d Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Sun, 7 Feb 2021 16:42:52 +0100
Subject: [PATCH 3/3] drivers: cpufreq: qcom-cpufreq-nvmem: support specific
 cpufreq driver

Add support for specific cpufreq driver for qcom-cpufreq-nvmem driver.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/cpufreq/qcom-cpufreq-nvmem.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -52,6 +52,7 @@ struct qcom_cpufreq_match_data {
 			   char **pvs_name,
 			   struct qcom_cpufreq_drv *drv);
 	const char **genpd_names;
+	const char *cpufreq_driver;
 };
 
 struct qcom_cpufreq_drv {
@@ -253,6 +254,7 @@ static const struct qcom_cpufreq_match_d
 
 static const struct qcom_cpufreq_match_data match_data_krait = {
 	.get_version = qcom_cpufreq_krait_name_version,
+	.cpufreq_driver = "krait-cpufreq",
 };
 
 static const char *qcs404_genpd_names[] = { "cpr", NULL };
@@ -389,6 +391,19 @@ static int qcom_cpufreq_probe(struct pla
 		}
 	}
 
+	if (drv->data->cpufreq_driver) {
+		cpufreq_dt_pdev = platform_device_register_simple(
+			drv->data->cpufreq_driver, -1, NULL, 0);
+		if (!IS_ERR(cpufreq_dt_pdev)) {
+			platform_set_drvdata(pdev, drv);
+			return 0;
+		} else {
+			dev_err(cpu_dev,
+				"Failed to register dedicated %s cpufreq\n",
+				drv->data->cpufreq_driver);
+		}
+	}
+
 	cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1,
 							  NULL, 0);
 	if (!IS_ERR(cpufreq_dt_pdev)) {