summarylogtreecommitdiffstats
path: root/0001-Revert-platform-x86-Enable-Atom-PMC-platform-clocks.patch
blob: 81a586017d8476845b811752eb7156c3ee13a7ab (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
From e1d2638e23c5425a134d2d4ee77592a20f80e5ed Mon Sep 17 00:00:00 2001
From: Nicolas Porcel <nicolasporcel06@gmail.com>
Date: Thu, 25 May 2017 00:25:31 +0200
Subject: [PATCH] Revert "platform/x86: Enable Atom PMC platform clocks"

This reverts commit 282a4e4ce5f99e3c166abac929498885a711e19f.
---
 drivers/platform/x86/Kconfig    |  1 -
 drivers/platform/x86/pmc_atom.c | 79 ++---------------------------------------
 2 files changed, 3 insertions(+), 77 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index bd1b1ff99000..659b33fc2e18 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1081,4 +1081,3 @@ endif # X86_PLATFORM_DEVICES
 config PMC_ATOM
        def_bool y
        depends on PCI
-       select COMMON_CLK
diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
index 77bac859342d..e1dfb1b3632f 100644
--- a/drivers/platform/x86/pmc_atom.c
+++ b/drivers/platform/x86/pmc_atom.c
@@ -19,9 +19,7 @@
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/platform_data/x86/clk-pmc-atom.h>
 #include <linux/platform_data/x86/pmc_atom.h>
-#include <linux/platform_device.h>
 #include <linux/pci.h>
 #include <linux/seq_file.h>
 
@@ -38,11 +36,6 @@ struct pmc_reg_map {
 	const struct pmc_bit_map *pss;
 };
 
-struct pmc_data {
-	const struct pmc_reg_map *map;
-	const struct pmc_clk *clks;
-};
-
 struct pmc_dev {
 	u32 base_addr;
 	void __iomem *regmap;
@@ -56,29 +49,6 @@ struct pmc_dev {
 static struct pmc_dev pmc_device;
 static u32 acpi_base_addr;
 
-static const struct pmc_clk byt_clks[] = {
-	{
-		.name = "xtal",
-		.freq = 25000000,
-		.parent_name = NULL,
-	},
-	{
-		.name = "pll",
-		.freq = 19200000,
-		.parent_name = "xtal",
-	},
-	{},
-};
-
-static const struct pmc_clk cht_clks[] = {
-	{
-		.name = "xtal",
-		.freq = 19200000,
-		.parent_name = NULL,
-	},
-	{},
-};
-
 static const struct pmc_bit_map d3_sts_0_map[] = {
 	{"LPSS1_F0_DMA",	BIT_LPSS1_F0_DMA},
 	{"LPSS1_F1_PWM1",	BIT_LPSS1_F1_PWM1},
@@ -198,16 +168,6 @@ static const struct pmc_reg_map cht_reg_map = {
 	.pss		= cht_pss_map,
 };
 
-static const struct pmc_data byt_data = {
-	.map = &byt_reg_map,
-	.clks = byt_clks,
-};
-
-static const struct pmc_data cht_data = {
-	.map = &cht_reg_map,
-	.clks = cht_clks,
-};
-
 static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset)
 {
 	return readl(pmc->regmap + reg_offset);
@@ -421,37 +381,10 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc)
 }
 #endif /* CONFIG_DEBUG_FS */
 
-static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap,
-			  const struct pmc_data *pmc_data)
-{
-	struct platform_device *clkdev;
-	struct pmc_clk_data *clk_data;
-
-	clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
-	if (!clk_data)
-		return -ENOMEM;
-
-	clk_data->base = pmc_regmap; /* offset is added by client */
-	clk_data->clks = pmc_data->clks;
-
-	clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom",
-					       PLATFORM_DEVID_NONE,
-					       clk_data, sizeof(*clk_data));
-	if (IS_ERR(clkdev)) {
-		kfree(clk_data);
-		return PTR_ERR(clkdev);
-	}
-
-	kfree(clk_data);
-
-	return 0;
-}
-
 static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct pmc_dev *pmc = &pmc_device;
-	const struct pmc_data *data = (struct pmc_data *)ent->driver_data;
-	const struct pmc_reg_map *map = data->map;
+	const struct pmc_reg_map *map = (struct pmc_reg_map *)ent->driver_data;
 	int ret;
 
 	/* Obtain ACPI base address */
@@ -480,12 +413,6 @@ static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		dev_warn(&pdev->dev, "debugfs register failed\n");
 
-	/* Register platform clocks - PMC_PLT_CLK [0..5] */
-	ret = pmc_setup_clks(pdev, pmc->regmap, data);
-	if (ret)
-		dev_warn(&pdev->dev, "platform clocks register failed: %d\n",
-			 ret);
-
 	pmc->init = true;
 	return ret;
 }
@@ -496,8 +423,8 @@ static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent)
  * used by pci_match_id() call below.
  */
 static const struct pci_device_id pmc_pci_ids[] = {
-	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_VLV_PMC), (kernel_ulong_t)&byt_data },
-	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_CHT_PMC), (kernel_ulong_t)&cht_data },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_VLV_PMC), (kernel_ulong_t)&byt_reg_map },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_CHT_PMC), (kernel_ulong_t)&cht_reg_map },
 	{ 0, },
 };
 
-- 
2.13.0