Skip to content

Commit 86f6e47

Browse files
MrVanbroonie
authored andcommitted
ASoC: codec: cs42l56: Drop cs42l56.h
There is no in-tree user of "include/sound/cs42l56.h", so move 'struct cs42l56_platform_data' to cs42l56.c and remove the header file. And platform data is mostly for platforms that create devices non using device tree. CS42L56 is a discontinued product, there is less possibility that new users will use legacy method to create devices. So drop cs42l56.h to prepare using GPIOD API. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20250506-csl42x-v3-2-e9496db544c4@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4060ebd commit 86f6e47

2 files changed

Lines changed: 37 additions & 57 deletions

File tree

include/sound/cs42l56.h

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

sound/soc/codecs/cs42l56.c

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/slab.h>
2424
#include <linux/workqueue.h>
2525
#include <sound/core.h>
26-
#include <sound/cs42l56.h>
2726
#include <sound/initval.h>
2827
#include <sound/pcm.h>
2928
#include <sound/pcm_params.h>
@@ -33,6 +32,39 @@
3332
#include "cs42l56.h"
3433

3534
#define CS42L56_NUM_SUPPLIES 3
35+
36+
struct cs42l56_platform_data {
37+
/* GPIO for Reset */
38+
unsigned int gpio_nreset;
39+
40+
/* MICBIAS Level. Check datasheet Pg48 */
41+
unsigned int micbias_lvl;
42+
43+
/* Analog Input 1A Reference 0=Single 1=Pseudo-Differential */
44+
unsigned int ain1a_ref_cfg;
45+
46+
/* Analog Input 2A Reference 0=Single 1=Pseudo-Differential */
47+
unsigned int ain2a_ref_cfg;
48+
49+
/* Analog Input 1B Reference 0=Single 1=Pseudo-Differential */
50+
unsigned int ain1b_ref_cfg;
51+
52+
/* Analog Input 2B Reference 0=Single 1=Pseudo-Differential */
53+
unsigned int ain2b_ref_cfg;
54+
55+
/* Charge Pump Freq. Check datasheet Pg62 */
56+
unsigned int chgfreq;
57+
58+
/* HighPass Filter Right Channel Corner Frequency */
59+
unsigned int hpfb_freq;
60+
61+
/* HighPass Filter Left Channel Corner Frequency */
62+
unsigned int hpfa_freq;
63+
64+
/* Adaptive Power Control for LO/HP */
65+
unsigned int adaptive_pwr;
66+
};
67+
3668
static const char *const cs42l56_supply_names[CS42L56_NUM_SUPPLIES] = {
3769
"VA",
3870
"VCP",
@@ -1169,8 +1201,6 @@ static int cs42l56_handle_of_data(struct i2c_client *i2c_client,
11691201
static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
11701202
{
11711203
struct cs42l56_private *cs42l56;
1172-
struct cs42l56_platform_data *pdata =
1173-
dev_get_platdata(&i2c_client->dev);
11741204
int ret, i;
11751205
unsigned int devid;
11761206
unsigned int alpha_rev, metal_rev;
@@ -1188,15 +1218,10 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
11881218
return ret;
11891219
}
11901220

1191-
if (pdata) {
1192-
cs42l56->pdata = *pdata;
1193-
} else {
1194-
if (i2c_client->dev.of_node) {
1195-
ret = cs42l56_handle_of_data(i2c_client,
1196-
&cs42l56->pdata);
1197-
if (ret != 0)
1198-
return ret;
1199-
}
1221+
if (i2c_client->dev.of_node) {
1222+
ret = cs42l56_handle_of_data(i2c_client, &cs42l56->pdata);
1223+
if (ret != 0)
1224+
return ret;
12001225
}
12011226

12021227
if (cs42l56->pdata.gpio_nreset) {

0 commit comments

Comments
 (0)