hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/soc/fsl/qe/qe_tdm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2015 Freescale Semiconductor, Inc. All rights reserved.
34 *
....@@ -5,11 +6,6 @@
56 *
67 * Description:
78 * QE TDM API Set - TDM specific routines implementations.
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
139 */
1410 #include <linux/io.h>
1511 #include <linux/kernel.h>
....@@ -44,10 +40,6 @@
4440 const char *sprop;
4541 int ret = 0;
4642 u32 val;
47
- struct resource *res;
48
- struct device_node *np2;
49
- static int siram_init_flag;
50
- struct platform_device *pdev;
5143
5244 sprop = of_get_property(np, "fsl,rx-sync-clock", NULL);
5345 if (sprop) {
....@@ -124,57 +116,6 @@
124116 utdm->siram_entry_id = val;
125117
126118 set_si_param(utdm, ut_info);
127
-
128
- np2 = of_find_compatible_node(NULL, NULL, "fsl,t1040-qe-si");
129
- if (!np2)
130
- return -EINVAL;
131
-
132
- pdev = of_find_device_by_node(np2);
133
- if (!pdev) {
134
- pr_err("%s: failed to lookup pdev\n", np2->name);
135
- of_node_put(np2);
136
- return -EINVAL;
137
- }
138
-
139
- of_node_put(np2);
140
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
141
- utdm->si_regs = devm_ioremap_resource(&pdev->dev, res);
142
- if (IS_ERR(utdm->si_regs)) {
143
- ret = PTR_ERR(utdm->si_regs);
144
- goto err_miss_siram_property;
145
- }
146
-
147
- np2 = of_find_compatible_node(NULL, NULL, "fsl,t1040-qe-siram");
148
- if (!np2) {
149
- ret = -EINVAL;
150
- goto err_miss_siram_property;
151
- }
152
-
153
- pdev = of_find_device_by_node(np2);
154
- if (!pdev) {
155
- ret = -EINVAL;
156
- pr_err("%s: failed to lookup pdev\n", np2->name);
157
- of_node_put(np2);
158
- goto err_miss_siram_property;
159
- }
160
-
161
- of_node_put(np2);
162
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
163
- utdm->siram = devm_ioremap_resource(&pdev->dev, res);
164
- if (IS_ERR(utdm->siram)) {
165
- ret = PTR_ERR(utdm->siram);
166
- goto err_miss_siram_property;
167
- }
168
-
169
- if (siram_init_flag == 0) {
170
- memset_io(utdm->siram, 0, resource_size(res));
171
- siram_init_flag = 1;
172
- }
173
-
174
- return ret;
175
-
176
-err_miss_siram_property:
177
- devm_iounmap(&pdev->dev, utdm->si_regs);
178119 return ret;
179120 }
180121 EXPORT_SYMBOL(ucc_of_parse_tdm);
....@@ -228,10 +169,10 @@
228169 &siram[siram_entry_id * 32 + 0x200 + i]);
229170 }
230171
231
- setbits16(&siram[(siram_entry_id * 32) + (utdm->num_of_ts - 1)],
232
- SIR_LAST);
233
- setbits16(&siram[(siram_entry_id * 32) + 0x200 + (utdm->num_of_ts - 1)],
234
- SIR_LAST);
172
+ qe_setbits_be16(&siram[(siram_entry_id * 32) + (utdm->num_of_ts - 1)],
173
+ SIR_LAST);
174
+ qe_setbits_be16(&siram[(siram_entry_id * 32) + 0x200 + (utdm->num_of_ts - 1)],
175
+ SIR_LAST);
235176
236177 /* Set SIxMR register */
237178 sixmr = SIMR_SAD(siram_entry_id);