Skip to content

Commit 43ef0dc

Browse files
MrVanbroonie
authored andcommitted
ASoC: codec: cs42l73: Drop cs42l73.h
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>
1 parent f3e7298 commit 43ef0dc

2 files changed

Lines changed: 18 additions & 37 deletions

File tree

include/sound/cs42l73.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

sound/soc/codecs/cs42l73.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/regmap.h>
2020
#include <linux/slab.h>
2121
#include <sound/core.h>
22-
#include <sound/cs42l73.h>
2322
#include <sound/initval.h>
2423
#include <sound/pcm.h>
2524
#include <sound/pcm_params.h>
@@ -29,6 +28,14 @@
2928
#include "cirrus_legacy.h"
3029
#include "cs42l73.h"
3130

31+
struct cs42l73_platform_data {
32+
/* RST GPIO */
33+
unsigned int reset_gpio;
34+
unsigned int chgfreq;
35+
int jack_detection;
36+
unsigned int mclk_freq;
37+
};
38+
3239
struct sp_config {
3340
u8 spc, mmcc, spfs;
3441
u32 srate;
@@ -1276,7 +1283,7 @@ static const struct regmap_config cs42l73_regmap = {
12761283
static int cs42l73_i2c_probe(struct i2c_client *i2c_client)
12771284
{
12781285
struct cs42l73_private *cs42l73;
1279-
struct cs42l73_platform_data *pdata = dev_get_platdata(&i2c_client->dev);
1286+
struct cs42l73_platform_data *pdata;
12801287
int ret, devid;
12811288
unsigned int reg;
12821289
u32 val32;
@@ -1292,23 +1299,16 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client)
12921299
return ret;
12931300
}
12941301

1295-
if (pdata) {
1296-
cs42l73->pdata = *pdata;
1297-
} else {
1298-
pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
1299-
GFP_KERNEL);
1300-
if (!pdata)
1301-
return -ENOMEM;
1302-
1303-
if (i2c_client->dev.of_node) {
1304-
if (of_property_read_u32(i2c_client->dev.of_node,
1305-
"chgfreq", &val32) >= 0)
1306-
pdata->chgfreq = val32;
1307-
}
1308-
pdata->reset_gpio = of_get_named_gpio(i2c_client->dev.of_node,
1309-
"reset-gpio", 0);
1310-
cs42l73->pdata = *pdata;
1302+
pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), GFP_KERNEL);
1303+
if (!pdata)
1304+
return -ENOMEM;
1305+
1306+
if (i2c_client->dev.of_node) {
1307+
if (of_property_read_u32(i2c_client->dev.of_node, "chgfreq", &val32) >= 0)
1308+
pdata->chgfreq = val32;
13111309
}
1310+
pdata->reset_gpio = of_get_named_gpio(i2c_client->dev.of_node, "reset-gpio", 0);
1311+
cs42l73->pdata = *pdata;
13121312

13131313
i2c_set_clientdata(i2c_client, cs42l73);
13141314

0 commit comments

Comments
 (0)