]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: codec: cs42l73: Drop cs42l73.h
authorPeng Fan <peng.fan@nxp.com>
Tue, 6 May 2025 07:29:35 +0000 (15:29 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 6 May 2025 13:48:15 +0000 (22:48 +0900)
There is no in-tree user of "include/sound/cs42l56.h", so move
'struct cs42l73_platform_data ' to cs42l73.c and remove the header file.
And platform data is mostly for legacy platforms that create devices
non using device tree. So drop cs42l73.h to prepare using GPIOD API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-5-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/cs42l73.h [deleted file]
sound/soc/codecs/cs42l73.c

diff --git a/include/sound/cs42l73.h b/include/sound/cs42l73.h
deleted file mode 100644 (file)
index 5a93393..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * linux/sound/cs42l73.h -- Platform data for CS42L73
- *
- * Copyright (c) 2012 Cirrus Logic Inc.
- */
-
-#ifndef __CS42L73_H
-#define __CS42L73_H
-
-struct cs42l73_platform_data {
-       /* RST GPIO */
-       unsigned int reset_gpio;
-       unsigned int chgfreq;
-       int jack_detection;
-       unsigned int mclk_freq;
-};
-
-#endif /* __CS42L73_H */
index 556270befa941a69e17b47a15677e1c4f912b14f..c09c23487d2e73340b8947ed0e1ffadb24414e7c 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <sound/core.h>
-#include <sound/cs42l73.h>
 #include <sound/initval.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include "cirrus_legacy.h"
 #include "cs42l73.h"
 
+struct cs42l73_platform_data {
+       /* RST GPIO */
+       unsigned int reset_gpio;
+       unsigned int chgfreq;
+       int jack_detection;
+       unsigned int mclk_freq;
+};
+
 struct sp_config {
        u8 spc, mmcc, spfs;
        u32 srate;
@@ -1276,7 +1283,7 @@ static const struct regmap_config cs42l73_regmap = {
 static int cs42l73_i2c_probe(struct i2c_client *i2c_client)
 {
        struct cs42l73_private *cs42l73;
-       struct cs42l73_platform_data *pdata = dev_get_platdata(&i2c_client->dev);
+       struct cs42l73_platform_data *pdata;
        int ret, devid;
        unsigned int reg;
        u32 val32;
@@ -1292,23 +1299,16 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client)
                return ret;
        }
 
-       if (pdata) {
-               cs42l73->pdata = *pdata;
-       } else {
-               pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
-                                    GFP_KERNEL);
-               if (!pdata)
-                       return -ENOMEM;
-
-               if (i2c_client->dev.of_node) {
-                       if (of_property_read_u32(i2c_client->dev.of_node,
-                               "chgfreq", &val32) >= 0)
-                               pdata->chgfreq = val32;
-               }
-               pdata->reset_gpio = of_get_named_gpio(i2c_client->dev.of_node,
-                                               "reset-gpio", 0);
-               cs42l73->pdata = *pdata;
+       pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), GFP_KERNEL);
+       if (!pdata)
+               return -ENOMEM;
+
+       if (i2c_client->dev.of_node) {
+               if (of_property_read_u32(i2c_client->dev.of_node, "chgfreq", &val32) >= 0)
+                       pdata->chgfreq = val32;
        }
+       pdata->reset_gpio = of_get_named_gpio(i2c_client->dev.of_node, "reset-gpio", 0);
+       cs42l73->pdata = *pdata;
 
        i2c_set_clientdata(i2c_client, cs42l73);