forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/codecs/jz4740.c
....@@ -1,15 +1,8 @@
1
-/*
2
- * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
8
- * You should have received a copy of the GNU General Public License along
9
- * with this program; if not, write to the Free Software Foundation, Inc.,
10
- * 675 Mass Ave, Cambridge, MA 02139, USA.
11
- *
12
- */
1
+// SPDX-License-Identifier: GPL-2.0
2
+//
3
+// JZ4740 CODEC driver
4
+//
5
+// Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
136
147 #include <linux/kernel.h>
158 #include <linux/module.h>
....@@ -325,7 +318,6 @@
325318 {
326319 int ret;
327320 struct jz4740_codec *jz4740_codec;
328
- struct resource *mem;
329321 void __iomem *base;
330322
331323 jz4740_codec = devm_kzalloc(&pdev->dev, sizeof(*jz4740_codec),
....@@ -333,8 +325,7 @@
333325 if (!jz4740_codec)
334326 return -ENOMEM;
335327
336
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
337
- base = devm_ioremap_resource(&pdev->dev, mem);
328
+ base = devm_platform_ioremap_resource(pdev, 0);
338329 if (IS_ERR(base))
339330 return PTR_ERR(base);
340331
....@@ -353,10 +344,17 @@
353344 return ret;
354345 }
355346
347
+static const struct of_device_id jz4740_codec_of_matches[] = {
348
+ { .compatible = "ingenic,jz4740-codec", },
349
+ { }
350
+};
351
+MODULE_DEVICE_TABLE(of, jz4740_codec_of_matches);
352
+
356353 static struct platform_driver jz4740_codec_driver = {
357354 .probe = jz4740_codec_probe,
358355 .driver = {
359356 .name = "jz4740-codec",
357
+ .of_match_table = jz4740_codec_of_matches,
360358 },
361359 };
362360