* [PATCH 0/8] ASoC: codecs: More const and unused member cleanups
@ 2025-05-28 19:59 Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
` (9 more replies)
0 siblings, 10 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Make static data const for code safety and drop some unused fields in
structs.
This is based on for-v6.16 branch in ASoC tree for context in wcd938x
driver.
Best regards,
Krzysztof
---
Krzysztof Kozlowski (8):
ASoC: codecs: Constify regmap configuration static variables
ASoC: fsl: Constify reg_default array
ASoC: codecs: wcd9335: Drop unused sido_input_src field
ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
ASoC: codecs: wcd938x: Drop unused variant field
ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
sound/soc/codecs/cs35l36.c | 2 +-
sound/soc/codecs/da7218.c | 2 +-
sound/soc/codecs/da7219.c | 4 ++--
sound/soc/codecs/es8375.c | 2 +-
sound/soc/codecs/max98363.c | 2 +-
sound/soc/codecs/max98373-i2c.c | 2 +-
sound/soc/codecs/max98373-sdw.c | 2 +-
sound/soc/codecs/max98388.c | 2 +-
sound/soc/codecs/max98390.c | 2 +-
sound/soc/codecs/max98396.c | 4 ++--
sound/soc/codecs/max98504.c | 2 +-
sound/soc/codecs/max98520.c | 2 +-
sound/soc/codecs/max98927.c | 2 +-
sound/soc/codecs/rt722-sdca-sdw.c | 2 +-
sound/soc/codecs/wcd9335.c | 5 -----
sound/soc/codecs/wcd934x.c | 4 ----
sound/soc/codecs/wcd937x.c | 2 --
sound/soc/codecs/wcd938x.c | 18 ++++++++----------
sound/soc/codecs/wcd939x.c | 2 --
sound/soc/codecs/wsa881x.c | 4 ++--
sound/soc/codecs/wsa883x.c | 2 +-
sound/soc/codecs/wsa884x.c | 2 +-
sound/soc/fsl/fsl_asrc.c | 2 +-
sound/soc/fsl/fsl_sai.c | 4 ++--
24 files changed, 31 insertions(+), 46 deletions(-)
---
base-commit: 22d449bcd69e66f25fe847b678738950dcf9301e
change-id: 20250528-asoc-const-unused-1e39b434e427
prerequisite-change-id: 20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-0ce64398f9cc:v1
prerequisite-patch-id: 104000f7254b9cc81be49af9ca584544718e52f1
prerequisite-patch-id: 230fcd1b712c5a3199e7c9d8250e98e5d55c0a40
prerequisite-patch-id: ecdbe74955eb7b710f72af1e3cf32ccac52890d5
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
@ 2025-05-28 19:59 ` Krzysztof Kozlowski
2025-05-29 9:28 ` Srinivas Kandagatla
2025-05-29 10:09 ` Charles Keepax
2025-05-28 19:59 ` [PATCH 2/8] ASoC: fsl: Constify reg_default array Krzysztof Kozlowski
` (8 subsequent siblings)
9 siblings, 2 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Static arrays/structs for regmap configuration like 'struct
reg_default', 'struct reg_sequence' and others are not modified so can
be changed to const for more safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/cs35l36.c | 2 +-
sound/soc/codecs/da7218.c | 2 +-
sound/soc/codecs/da7219.c | 4 ++--
sound/soc/codecs/es8375.c | 2 +-
sound/soc/codecs/max98363.c | 2 +-
sound/soc/codecs/max98373-i2c.c | 2 +-
sound/soc/codecs/max98373-sdw.c | 2 +-
sound/soc/codecs/max98388.c | 2 +-
sound/soc/codecs/max98390.c | 2 +-
sound/soc/codecs/max98396.c | 4 ++--
sound/soc/codecs/max98504.c | 2 +-
sound/soc/codecs/max98520.c | 2 +-
sound/soc/codecs/max98927.c | 2 +-
sound/soc/codecs/rt722-sdca-sdw.c | 2 +-
sound/soc/codecs/wcd938x.c | 2 +-
sound/soc/codecs/wsa881x.c | 4 ++--
sound/soc/codecs/wsa883x.c | 2 +-
sound/soc/codecs/wsa884x.c | 2 +-
18 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index b49c6905e8727d7c07fd10e668507ca07bf2cff5..b60697ff7a506dccf3dba1b01faa985761bbbc42 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -129,7 +129,7 @@ static const struct cs35l36_pll_config cs35l36_pll_sysclk[] = {
{27000000, 0x3F, 0x0A},
};
-static struct reg_default cs35l36_reg[] = {
+static const struct reg_default cs35l36_reg[] = {
{CS35L36_TESTKEY_CTRL, 0x00000000},
{CS35L36_USERKEY_CTL, 0x00000000},
{CS35L36_OTP_CTRL1, 0x00002460},
diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 5f2f67e3bd29240acfa0d53a0892c8e92f711c1f..a7539e1a18939683558accd207b57324a1ce6aeb 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -3033,7 +3033,7 @@ static const struct snd_soc_component_driver soc_component_dev_da7218 = {
* Regmap configs
*/
-static struct reg_default da7218_reg_defaults[] = {
+static const struct reg_default da7218_reg_defaults[] = {
{ DA7218_SYSTEM_ACTIVE, 0x00 },
{ DA7218_CIF_CTRL, 0x00 },
{ DA7218_SPARE1, 0x00 },
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 3958e88a244563c81b373cab38bc221fc8ba795e..221577574525a5fd60180a4441331d7db88f50e2 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -2312,7 +2312,7 @@ static void da7219_handle_pdata(struct snd_soc_component *component)
* Regmap configs
*/
-static struct reg_default da7219_reg_defaults[] = {
+static const struct reg_default da7219_reg_defaults[] = {
{ DA7219_MIC_1_SELECT, 0x00 },
{ DA7219_CIF_TIMEOUT_CTRL, 0x01 },
{ DA7219_SR_24_48, 0x00 },
@@ -2443,7 +2443,7 @@ static const struct regmap_config da7219_regmap_config = {
.cache_type = REGCACHE_RBTREE,
};
-static struct reg_sequence da7219_rev_aa_patch[] = {
+static const struct reg_sequence da7219_rev_aa_patch[] = {
{ DA7219_REFERENCES, 0x08 },
};
diff --git a/sound/soc/codecs/es8375.c b/sound/soc/codecs/es8375.c
index decc86c92427c0c61a1531fb0fed1d9b853449d5..d12b3dc9e1f7fc03b8737e6b001b44c0d51c1b93 100644
--- a/sound/soc/codecs/es8375.c
+++ b/sound/soc/codecs/es8375.c
@@ -619,7 +619,7 @@ static bool es8375_writeable_register(struct device *dev, unsigned int reg)
}
}
-static struct regmap_config es8375_regmap_config = {
+static const struct regmap_config es8375_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = ES8375_REG_MAX,
diff --git a/sound/soc/codecs/max98363.c b/sound/soc/codecs/max98363.c
index 950105e5bffdc2c7606e10e7af6f3cf97ece5b4c..fd6830a7579d4860c8bc4fdd26d05698834ddcc2 100644
--- a/sound/soc/codecs/max98363.c
+++ b/sound/soc/codecs/max98363.c
@@ -14,7 +14,7 @@
#include "max98363.h"
-static struct reg_default max98363_reg[] = {
+static const struct reg_default max98363_reg[] = {
{MAX98363_R2021_ERR_MON_CTRL, 0x0},
{MAX98363_R2022_SPK_MON_THRESH, 0x0},
{MAX98363_R2023_SPK_MON_DURATION, 0x0},
diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c
index 56c4ba1f37826f279df4007b0de36fa932257b8f..f58b8c8625a7061fc9564c9f84dd95d77df33b72 100644
--- a/sound/soc/codecs/max98373-i2c.c
+++ b/sound/soc/codecs/max98373-i2c.c
@@ -23,7 +23,7 @@ static const u32 max98373_i2c_cache_reg[] = {
MAX98373_R20B6_BDE_CUR_STATE_READBACK,
};
-static struct reg_default max98373_reg[] = {
+static const struct reg_default max98373_reg[] = {
{MAX98373_R2000_SW_RESET, 0x00},
{MAX98373_R2001_INT_RAW1, 0x00},
{MAX98373_R2002_INT_RAW2, 0x00},
diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c
index 6088278e6503dc7ea743ccc439cd6365c7475017..43b52bda6ad5297d856123aa515e0019f4866097 100644
--- a/sound/soc/codecs/max98373-sdw.c
+++ b/sound/soc/codecs/max98373-sdw.c
@@ -26,7 +26,7 @@ static const u32 max98373_sdw_cache_reg[] = {
MAX98373_R20B6_BDE_CUR_STATE_READBACK,
};
-static struct reg_default max98373_reg[] = {
+static const struct reg_default max98373_reg[] = {
{MAX98373_R0040_SCP_INIT_STAT_1, 0x00},
{MAX98373_R0041_SCP_INIT_MASK_1, 0x00},
{MAX98373_R0042_SCP_INIT_STAT_2, 0x00},
diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c
index 99986090b4a63a9759763881f3004d0e509e53cd..076f15a9867e13527324354cd6364ade3bca4846 100644
--- a/sound/soc/codecs/max98388.c
+++ b/sound/soc/codecs/max98388.c
@@ -18,7 +18,7 @@
#include <sound/tlv.h>
#include "max98388.h"
-static struct reg_default max98388_reg[] = {
+static const struct reg_default max98388_reg[] = {
{MAX98388_R2000_SW_RESET, 0x00},
{MAX98388_R2001_INT_RAW1, 0x00},
{MAX98388_R2002_INT_RAW2, 0x00},
diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
index 76296176f9486f72a9d6077a0c69a475e277ed88..a8a282ff9fc5abfbf6c6bdc7fc209ed15bda0cfd 100644
--- a/sound/soc/codecs/max98390.c
+++ b/sound/soc/codecs/max98390.c
@@ -23,7 +23,7 @@
#include "max98390.h"
-static struct reg_default max98390_reg_defaults[] = {
+static const struct reg_default max98390_reg_defaults[] = {
{MAX98390_INT_EN1, 0xf0},
{MAX98390_INT_EN2, 0x00},
{MAX98390_INT_EN3, 0x00},
diff --git a/sound/soc/codecs/max98396.c b/sound/soc/codecs/max98396.c
index c1888cd83dbc6fe2d418012dc1a9b1c58c3ded86..4b4e1fc98a6da5bf3a713133ce974b2f09161ed4 100644
--- a/sound/soc/codecs/max98396.c
+++ b/sound/soc/codecs/max98396.c
@@ -16,7 +16,7 @@ static const char * const max98396_core_supplies[MAX98396_NUM_CORE_SUPPLIES] = {
"dvddio",
};
-static struct reg_default max98396_reg[] = {
+static const struct reg_default max98396_reg[] = {
{MAX98396_R2000_SW_RESET, 0x00},
{MAX98396_R2001_INT_RAW1, 0x00},
{MAX98396_R2002_INT_RAW2, 0x00},
@@ -174,7 +174,7 @@ static struct reg_default max98396_reg[] = {
{MAX98396_R21FF_REVISION_ID, 0x00},
};
-static struct reg_default max98397_reg[] = {
+static const struct reg_default max98397_reg[] = {
{MAX98396_R2000_SW_RESET, 0x00},
{MAX98396_R2001_INT_RAW1, 0x00},
{MAX98396_R2002_INT_RAW2, 0x00},
diff --git a/sound/soc/codecs/max98504.c b/sound/soc/codecs/max98504.c
index 6b6a7ece4cecc3d114da276faf859c8176955300..c94142768c818228aae8b90c636cfd6b496e9859 100644
--- a/sound/soc/codecs/max98504.c
+++ b/sound/soc/codecs/max98504.c
@@ -35,7 +35,7 @@ struct max98504_priv {
unsigned int brownout_release_rate;
};
-static struct reg_default max98504_reg_defaults[] = {
+static const struct reg_default max98504_reg_defaults[] = {
{ 0x01, 0},
{ 0x02, 0},
{ 0x03, 0},
diff --git a/sound/soc/codecs/max98520.c b/sound/soc/codecs/max98520.c
index adf5a898c6df5b10661861f6329ca54db6445f1a..2bf8976c1828210d2e6106f08e571df650640606 100644
--- a/sound/soc/codecs/max98520.c
+++ b/sound/soc/codecs/max98520.c
@@ -16,7 +16,7 @@
#include <sound/tlv.h>
#include "max98520.h"
-static struct reg_default max98520_reg[] = {
+static const struct reg_default max98520_reg[] = {
{MAX98520_R2000_SW_RESET, 0x00},
{MAX98520_R2001_STATUS_1, 0x00},
{MAX98520_R2002_STATUS_2, 0x00},
diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c
index 55cc18451a2d26e0ad72031d5017d68c215240ef..0e9b8970997cf6485a775a3187b1470f93b5c057 100644
--- a/sound/soc/codecs/max98927.c
+++ b/sound/soc/codecs/max98927.c
@@ -19,7 +19,7 @@
#include <sound/tlv.h>
#include "max98927.h"
-static struct reg_default max98927_reg[] = {
+static const struct reg_default max98927_reg[] = {
{MAX98927_R0001_INT_RAW1, 0x00},
{MAX98927_R0002_INT_RAW2, 0x00},
{MAX98927_R0003_INT_RAW3, 0x00},
diff --git a/sound/soc/codecs/rt722-sdca-sdw.c b/sound/soc/codecs/rt722-sdca-sdw.c
index 609ca0d6c83a1f28c73a0981f2a8f857816e5eb2..70700bdb80a14374321d1d8d8744356484ac01ac 100644
--- a/sound/soc/codecs/rt722-sdca-sdw.c
+++ b/sound/soc/codecs/rt722-sdca-sdw.c
@@ -147,7 +147,7 @@ static int rt722_sdca_mbq_size(struct device *dev, unsigned int reg)
}
}
-static struct regmap_sdw_mbq_cfg rt722_mbq_config = {
+static const struct regmap_sdw_mbq_cfg rt722_mbq_config = {
.mbq_size = rt722_sdca_mbq_size,
};
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index d9b61eab029af3d4782620ee017fc84fbd26ce0b..342d1f7d5dee3ac2d703e5b5602aef9ca2987158 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -275,7 +275,7 @@ static const struct regmap_irq wcd938x_irqs[WCD938X_NUM_IRQS] = {
REGMAP_IRQ_REG(WCD938X_IRQ_HPHR_SURGE_DET_INT, 2, 0x08),
};
-static struct regmap_irq_chip wcd938x_regmap_irq_chip = {
+static const struct regmap_irq_chip wcd938x_regmap_irq_chip = {
.name = "wcd938x",
.irqs = wcd938x_irqs,
.num_irqs = ARRAY_SIZE(wcd938x_irqs),
diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index 6627d2da372206eff879f8f3bd5fae9ddc0757d7..d479521a6d504ee45797be8ea99206a4b1787f73 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -202,7 +202,7 @@
SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \
snd_soc_get_volsw, wsa881x_put_pa_gain, tlv_array)
-static struct reg_default wsa881x_defaults[] = {
+static const struct reg_default wsa881x_defaults[] = {
{ WSA881X_CHIP_ID0, 0x00 },
{ WSA881X_CHIP_ID1, 0x00 },
{ WSA881X_CHIP_ID2, 0x00 },
@@ -346,7 +346,7 @@ static const struct reg_sequence wsa881x_vi_txfe_en_2_0[] = {
};
/* Default register reset values for WSA881x rev 2.0 */
-static struct reg_sequence wsa881x_rev_2_0[] = {
+static const struct reg_sequence wsa881x_rev_2_0[] = {
{ WSA881X_RESET_CTL, 0x00, 0x00 },
{ WSA881X_TADC_VALUE_CTL, 0x01, 0x00 },
{ WSA881X_INTR_MASK, 0x1B, 0x00 },
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index f04d99c66f332e18fe4c201f78360416c1607466..13c9d4a6f01537e448a5595f489c1716eb2053f2 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -572,7 +572,7 @@ static const struct sdw_port_config wsa883x_pconfig[WSA883X_MAX_SWR_PORTS] = {
},
};
-static struct reg_default wsa883x_defaults[] = {
+static const struct reg_default wsa883x_defaults[] = {
{ WSA883X_REF_CTRL, 0xD5 },
{ WSA883X_TEST_CTL_0, 0x06 },
{ WSA883X_BIAS_0, 0xD2 },
diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
index fd6ebc25fe894a5981df4e39d10d0f27d21c3a25..07d8a2645404ec49d4b12297d79bbddbe2950a4c 100644
--- a/sound/soc/codecs/wsa884x.c
+++ b/sound/soc/codecs/wsa884x.c
@@ -899,7 +899,7 @@ static const struct sdw_port_config wsa884x_pconfig[WSA884X_MAX_SWR_PORTS] = {
},
};
-static struct reg_default wsa884x_defaults[] = {
+static const struct reg_default wsa884x_defaults[] = {
{ WSA884X_BG_CTRL, 0xa5 },
{ WSA884X_ADC_CTRL, 0x00 },
{ WSA884X_BOP1_PROG, 0x22 },
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 2/8] ASoC: fsl: Constify reg_default array
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
@ 2025-05-28 19:59 ` Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field Krzysztof Kozlowski
` (7 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Static 'struct reg_default' array is not modified so can be changed to
const for more safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/fsl/fsl_asrc.c | 2 +-
sound/soc/fsl/fsl_sai.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 677529916dc0e53a15952c53016930203c56dc9d..637260f306ecab109ed23b92a882cffce1c65421 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -930,7 +930,7 @@ static bool fsl_asrc_writeable_reg(struct device *dev, unsigned int reg)
}
}
-static struct reg_default fsl_asrc_reg[] = {
+static const struct reg_default fsl_asrc_reg[] = {
{ REG_ASRCTR, 0x0000 }, { REG_ASRIER, 0x0000 },
{ REG_ASRCNCR, 0x0000 }, { REG_ASRCFG, 0x0000 },
{ REG_ASRCSR, 0x0000 }, { REG_ASRCDR1, 0x0000 },
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index af1a168d35e379e24ce46715ba53b4a4dac65988..c84e3bb1290fd1188118b220adeb4f8e279a3372 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1059,7 +1059,7 @@ static const struct snd_soc_component_driver fsl_component = {
.legacy_dai_naming = 1,
};
-static struct reg_default fsl_sai_reg_defaults_ofs0[] = {
+static const struct reg_default fsl_sai_reg_defaults_ofs0[] = {
{FSL_SAI_TCR1(0), 0},
{FSL_SAI_TCR2(0), 0},
{FSL_SAI_TCR3(0), 0},
@@ -1082,7 +1082,7 @@ static struct reg_default fsl_sai_reg_defaults_ofs0[] = {
{FSL_SAI_RMR, 0},
};
-static struct reg_default fsl_sai_reg_defaults_ofs8[] = {
+static const struct reg_default fsl_sai_reg_defaults_ofs8[] = {
{FSL_SAI_TCR1(8), 0},
{FSL_SAI_TCR2(8), 0},
{FSL_SAI_TCR3(8), 0},
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 2/8] ASoC: fsl: Constify reg_default array Krzysztof Kozlowski
@ 2025-05-28 19:59 ` Krzysztof Kozlowski
2025-05-29 9:27 ` Srinivas Kandagatla
2025-05-28 19:59 ` [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields Krzysztof Kozlowski
` (6 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Member wcd9335_codec.sido_input_src is not read anywhere after
assignment, so it can be safely dropped.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd9335.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 5e19e813748dfa0d065287494240007d60478dea..1c050b8c19de43cf494583d2c96f50f65aefe567 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -312,7 +312,6 @@ struct wcd9335_codec {
u32 num_rx_port;
u32 num_tx_port;
- int sido_input_src;
enum wcd9335_sido_voltage sido_voltage;
struct wcd_slim_codec_dai_data dai[NUM_CODEC_DAIS];
@@ -4725,8 +4724,6 @@ static const struct snd_soc_dapm_widget wcd9335_dapm_widgets[] = {
static void wcd9335_enable_sido_buck(struct snd_soc_component *component)
{
- struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
-
snd_soc_component_update_bits(component, WCD9335_ANA_RCO,
WCD9335_ANA_RCO_BG_EN_MASK,
WCD9335_ANA_RCO_BG_ENABLE);
@@ -4740,7 +4737,6 @@ static void wcd9335_enable_sido_buck(struct snd_soc_component *component)
WCD9335_ANA_BUCK_CTL_VOUT_D_VREF_EXT);
/* 100us sleep needed after VREF settings */
usleep_range(100, 110);
- wcd->sido_input_src = SIDO_SOURCE_RCO_BG;
}
static int wcd9335_enable_efuse_sensing(struct snd_soc_component *comp)
@@ -4871,7 +4867,6 @@ static int wcd9335_probe(struct wcd9335_codec *wcd)
memcpy(wcd->rx_chs, wcd9335_rx_chs, sizeof(wcd9335_rx_chs));
memcpy(wcd->tx_chs, wcd9335_tx_chs, sizeof(wcd9335_tx_chs));
- wcd->sido_input_src = SIDO_SOURCE_INTERNAL;
wcd->sido_voltage = SIDO_VOLTAGE_NOMINAL_MV;
return devm_snd_soc_register_component(dev, &wcd9335_component_drv,
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (2 preceding siblings ...)
2025-05-28 19:59 ` [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field Krzysztof Kozlowski
@ 2025-05-28 19:59 ` Krzysztof Kozlowski
2025-05-29 9:29 ` Srinivas Kandagatla
2025-05-28 19:59 ` [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields Krzysztof Kozlowski
` (5 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Members wcd934x_codec.num_rx_port and num_tx_port are not read anywhere
after assignment, so they can be safely dropped.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd934x.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index fa69817c97eaf1bf226b140f3a89095a50a128b2..1bb7e1dc7e6b0a5528cbdb7ada943a7d417fb684 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -537,8 +537,6 @@ struct wcd934x_codec {
int rate;
u32 version;
u32 hph_mode;
- int num_rx_port;
- int num_tx_port;
u32 tx_port_value[WCD934X_TX_MAX];
u32 rx_port_value[WCD934X_RX_MAX];
int sido_input_src;
@@ -1928,13 +1926,11 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
return -EINVAL;
}
- wcd->num_rx_port = rx_num;
for (i = 0; i < rx_num; i++) {
wcd->rx_chs[i].ch_num = rx_slot[i];
INIT_LIST_HEAD(&wcd->rx_chs[i].list);
}
- wcd->num_tx_port = tx_num;
for (i = 0; i < tx_num; i++) {
wcd->tx_chs[i].ch_num = tx_slot[i];
INIT_LIST_HEAD(&wcd->tx_chs[i].list);
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (3 preceding siblings ...)
2025-05-28 19:59 ` [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields Krzysztof Kozlowski
@ 2025-05-28 19:59 ` Krzysztof Kozlowski
2025-05-29 9:30 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields Krzysztof Kozlowski
` (4 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 19:59 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd937x_priv' are not used
at all.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd937x.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
index b9df58b86ce953427e01ffb8c7eb7e52f9c2392a..126a29e0b3ff96c12fdaba2b9344a3040b455e44 100644
--- a/sound/soc/codecs/wcd937x.c
+++ b/sound/soc/codecs/wcd937x.c
@@ -88,10 +88,8 @@ struct wcd937x_priv {
struct wcd_mbhc_intr intr_ids;
struct wcd_clsh_ctrl *clsh_info;
struct irq_domain *virq;
- struct regmap_irq_chip *wcd_regmap_irq_chip;
struct regmap_irq_chip_data *irq_chip;
struct regulator_bulk_data supplies[WCD937X_MAX_BULK_SUPPLY];
- struct snd_soc_jack *jack;
unsigned long status_mask;
s32 micb_ref[WCD937X_MAX_MICBIAS];
s32 pullup_ref[WCD937X_MAX_MICBIAS];
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (4 preceding siblings ...)
2025-05-28 19:59 ` [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields Krzysztof Kozlowski
@ 2025-05-28 20:00 ` Krzysztof Kozlowski
2025-05-29 9:30 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field Krzysztof Kozlowski
` (3 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 20:00 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd938x_priv' are not used
at all.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd938x.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 342d1f7d5dee3ac2d703e5b5602aef9ca2987158..43347c14070ca6dd8035b0c290f0dacb0326122b 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -159,10 +159,8 @@ struct wcd938x_priv {
struct wcd_mbhc_intr intr_ids;
struct wcd_clsh_ctrl *clsh_info;
struct irq_domain *virq;
- struct regmap_irq_chip *wcd_regmap_irq_chip;
struct regmap_irq_chip_data *irq_chip;
struct regulator_bulk_data supplies[WCD938X_MAX_SUPPLY];
- struct snd_soc_jack *jack;
unsigned long status_mask;
s32 micb_ref[WCD938X_MAX_MICBIAS];
s32 pullup_ref[WCD938X_MAX_MICBIAS];
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (5 preceding siblings ...)
2025-05-28 20:00 ` [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields Krzysztof Kozlowski
@ 2025-05-28 20:00 ` Krzysztof Kozlowski
2025-05-29 9:31 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields Krzysztof Kozlowski
` (2 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 20:00 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
Member wcd938x_priv.variant is assigned in probe() function and used
immediately thereafter, thus it can be just a local variable for less
variables stored in 'struct wcd938x_priv' device-wide state.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd938x.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 43347c14070ca6dd8035b0c290f0dacb0326122b..5a751056a98a5d4cc5716aafc25af27e3ab22786 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -168,7 +168,6 @@ struct wcd938x_priv {
u32 tx_mode[TX_ADC_MAX];
int flyback_cur_det_disable;
int ear_rx_path;
- int variant;
struct gpio_desc *reset_gpio;
struct gpio_desc *us_euro_gpio;
struct mux_control *us_euro_mux;
@@ -3044,6 +3043,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev;
struct device *dev = component->dev;
unsigned long time_left;
+ unsigned int variant;
int ret, i;
time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete,
@@ -3059,9 +3059,9 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
if (ret < 0)
return ret;
- wcd938x->variant = snd_soc_component_read_field(component,
- WCD938X_DIGITAL_EFUSE_REG_0,
- WCD938X_ID_MASK);
+ variant = snd_soc_component_read_field(component,
+ WCD938X_DIGITAL_EFUSE_REG_0,
+ WCD938X_ID_MASK);
wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X);
if (IS_ERR(wcd938x->clsh_info)) {
@@ -3115,14 +3115,14 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
disable_irq_nosync(wcd938x->hphl_pdm_wd_int);
disable_irq_nosync(wcd938x->aux_pdm_wd_int);
- switch (wcd938x->variant) {
+ switch (variant) {
case WCD9380:
ret = snd_soc_add_component_controls(component, wcd9380_snd_controls,
ARRAY_SIZE(wcd9380_snd_controls));
if (ret < 0) {
dev_err(component->dev,
"%s: Failed to add snd ctrls for variant: %d\n",
- __func__, wcd938x->variant);
+ __func__, variant);
goto err_free_aux_pdm_wd_int;
}
break;
@@ -3132,7 +3132,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
if (ret < 0) {
dev_err(component->dev,
"%s: Failed to add snd ctrls for variant: %d\n",
- __func__, wcd938x->variant);
+ __func__, variant);
goto err_free_aux_pdm_wd_int;
}
break;
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (6 preceding siblings ...)
2025-05-28 20:00 ` [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field Krzysztof Kozlowski
@ 2025-05-28 20:00 ` Krzysztof Kozlowski
2025-05-29 9:31 ` Srinivas Kandagatla
2025-05-29 9:33 ` [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Srinivas Kandagatla
2025-06-09 21:00 ` Mark Brown
9 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 20:00 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev,
Krzysztof Kozlowski
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd939x_priv' are not used
at all.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wcd939x.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
index 067d23c7ecf90ae06da1ad6cc89d273fb7f7f875..bfd4d2c8bdc9bcfcdbf673d20458f779922eb464 100644
--- a/sound/soc/codecs/wcd939x.c
+++ b/sound/soc/codecs/wcd939x.c
@@ -190,10 +190,8 @@ struct wcd939x_priv {
struct wcd_mbhc_intr intr_ids;
struct wcd_clsh_ctrl *clsh_info;
struct irq_domain *virq;
- struct regmap_irq_chip *wcd_regmap_irq_chip;
struct regmap_irq_chip_data *irq_chip;
struct regulator_bulk_data supplies[WCD939X_MAX_SUPPLY];
- struct snd_soc_jack *jack;
unsigned long status_mask;
s32 micb_ref[WCD939X_MAX_MICBIAS];
s32 pullup_ref[WCD939X_MAX_MICBIAS];
--
2.45.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field
2025-05-28 19:59 ` [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field Krzysztof Kozlowski
@ 2025-05-29 9:27 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:27 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
> Member wcd9335_codec.sido_input_src is not read anywhere after
> assignment, so it can be safely dropped.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd9335.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
> index 5e19e813748dfa0d065287494240007d60478dea..1c050b8c19de43cf494583d2c96f50f65aefe567 100644
> --- a/sound/soc/codecs/wcd9335.c
> +++ b/sound/soc/codecs/wcd9335.c
> @@ -312,7 +312,6 @@ struct wcd9335_codec {
> u32 num_rx_port;
> u32 num_tx_port;
>
> - int sido_input_src;
> enum wcd9335_sido_voltage sido_voltage;
>
> struct wcd_slim_codec_dai_data dai[NUM_CODEC_DAIS];
> @@ -4725,8 +4724,6 @@ static const struct snd_soc_dapm_widget wcd9335_dapm_widgets[] = {
>
> static void wcd9335_enable_sido_buck(struct snd_soc_component *component)
> {
> - struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
> -
> snd_soc_component_update_bits(component, WCD9335_ANA_RCO,
> WCD9335_ANA_RCO_BG_EN_MASK,
> WCD9335_ANA_RCO_BG_ENABLE);
> @@ -4740,7 +4737,6 @@ static void wcd9335_enable_sido_buck(struct snd_soc_component *component)
> WCD9335_ANA_BUCK_CTL_VOUT_D_VREF_EXT);
> /* 100us sleep needed after VREF settings */
> usleep_range(100, 110);
> - wcd->sido_input_src = SIDO_SOURCE_RCO_BG;
> }
>
> static int wcd9335_enable_efuse_sensing(struct snd_soc_component *comp)
> @@ -4871,7 +4867,6 @@ static int wcd9335_probe(struct wcd9335_codec *wcd)
> memcpy(wcd->rx_chs, wcd9335_rx_chs, sizeof(wcd9335_rx_chs));
> memcpy(wcd->tx_chs, wcd9335_tx_chs, sizeof(wcd9335_tx_chs));
>
> - wcd->sido_input_src = SIDO_SOURCE_INTERNAL;
> wcd->sido_voltage = SIDO_VOLTAGE_NOMINAL_MV;
>
> return devm_snd_soc_register_component(dev, &wcd9335_component_drv,
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
@ 2025-05-29 9:28 ` Srinivas Kandagatla
2025-05-29 10:09 ` Charles Keepax
1 sibling, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:28 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
> Static arrays/structs for regmap configuration like 'struct
> reg_default', 'struct reg_sequence' and others are not modified so can
> be changed to const for more safety.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> sound/soc/codecs/cs35l36.c | 2 +-
> sound/soc/codecs/da7218.c | 2 +-
> sound/soc/codecs/da7219.c | 4 ++--
> sound/soc/codecs/es8375.c | 2 +-
> sound/soc/codecs/max98363.c | 2 +-
> sound/soc/codecs/max98373-i2c.c | 2 +-
> sound/soc/codecs/max98373-sdw.c | 2 +-
> sound/soc/codecs/max98388.c | 2 +-
> sound/soc/codecs/max98390.c | 2 +-
> sound/soc/codecs/max98396.c | 4 ++--
> sound/soc/codecs/max98504.c | 2 +-
> sound/soc/codecs/max98520.c | 2 +-
> sound/soc/codecs/max98927.c | 2 +-
> sound/soc/codecs/rt722-sdca-sdw.c | 2 +-
> sound/soc/codecs/wcd938x.c | 2 +-
> sound/soc/codecs/wsa881x.c | 4 ++--
> sound/soc/codecs/wsa883x.c | 2 +-
> sound/soc/codecs/wsa884x.c | 2 +-
For sound/soc/codecs/wsa* an sound/soc/codecs/wcd*
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> 18 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
> index b49c6905e8727d7c07fd10e668507ca07bf2cff5..b60697ff7a506dccf3dba1b01faa985761bbbc42 100644
> --- a/sound/soc/codecs/cs35l36.c
> +++ b/sound/soc/codecs/cs35l36.c
> @@ -129,7 +129,7 @@ static const struct cs35l36_pll_config cs35l36_pll_sysclk[] = {
> {27000000, 0x3F, 0x0A},
> };
>
> -static struct reg_default cs35l36_reg[] = {
> +static const struct reg_default cs35l36_reg[] = {
> {CS35L36_TESTKEY_CTRL, 0x00000000},
> {CS35L36_USERKEY_CTL, 0x00000000},
> {CS35L36_OTP_CTRL1, 0x00002460},
> diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
> index 5f2f67e3bd29240acfa0d53a0892c8e92f711c1f..a7539e1a18939683558accd207b57324a1ce6aeb 100644
> --- a/sound/soc/codecs/da7218.c
> +++ b/sound/soc/codecs/da7218.c
> @@ -3033,7 +3033,7 @@ static const struct snd_soc_component_driver soc_component_dev_da7218 = {
> * Regmap configs
> */
>
> -static struct reg_default da7218_reg_defaults[] = {
> +static const struct reg_default da7218_reg_defaults[] = {
> { DA7218_SYSTEM_ACTIVE, 0x00 },
> { DA7218_CIF_CTRL, 0x00 },
> { DA7218_SPARE1, 0x00 },
> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
> index 3958e88a244563c81b373cab38bc221fc8ba795e..221577574525a5fd60180a4441331d7db88f50e2 100644
> --- a/sound/soc/codecs/da7219.c
> +++ b/sound/soc/codecs/da7219.c
> @@ -2312,7 +2312,7 @@ static void da7219_handle_pdata(struct snd_soc_component *component)
> * Regmap configs
> */
>
> -static struct reg_default da7219_reg_defaults[] = {
> +static const struct reg_default da7219_reg_defaults[] = {
> { DA7219_MIC_1_SELECT, 0x00 },
> { DA7219_CIF_TIMEOUT_CTRL, 0x01 },
> { DA7219_SR_24_48, 0x00 },
> @@ -2443,7 +2443,7 @@ static const struct regmap_config da7219_regmap_config = {
> .cache_type = REGCACHE_RBTREE,
> };
>
> -static struct reg_sequence da7219_rev_aa_patch[] = {
> +static const struct reg_sequence da7219_rev_aa_patch[] = {
> { DA7219_REFERENCES, 0x08 },
> };
>
> diff --git a/sound/soc/codecs/es8375.c b/sound/soc/codecs/es8375.c
> index decc86c92427c0c61a1531fb0fed1d9b853449d5..d12b3dc9e1f7fc03b8737e6b001b44c0d51c1b93 100644
> --- a/sound/soc/codecs/es8375.c
> +++ b/sound/soc/codecs/es8375.c
> @@ -619,7 +619,7 @@ static bool es8375_writeable_register(struct device *dev, unsigned int reg)
> }
> }
>
> -static struct regmap_config es8375_regmap_config = {
> +static const struct regmap_config es8375_regmap_config = {
> .reg_bits = 8,
> .val_bits = 8,
> .max_register = ES8375_REG_MAX,
> diff --git a/sound/soc/codecs/max98363.c b/sound/soc/codecs/max98363.c
> index 950105e5bffdc2c7606e10e7af6f3cf97ece5b4c..fd6830a7579d4860c8bc4fdd26d05698834ddcc2 100644
> --- a/sound/soc/codecs/max98363.c
> +++ b/sound/soc/codecs/max98363.c
> @@ -14,7 +14,7 @@
>
> #include "max98363.h"
>
> -static struct reg_default max98363_reg[] = {
> +static const struct reg_default max98363_reg[] = {
> {MAX98363_R2021_ERR_MON_CTRL, 0x0},
> {MAX98363_R2022_SPK_MON_THRESH, 0x0},
> {MAX98363_R2023_SPK_MON_DURATION, 0x0},
> diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c
> index 56c4ba1f37826f279df4007b0de36fa932257b8f..f58b8c8625a7061fc9564c9f84dd95d77df33b72 100644
> --- a/sound/soc/codecs/max98373-i2c.c
> +++ b/sound/soc/codecs/max98373-i2c.c
> @@ -23,7 +23,7 @@ static const u32 max98373_i2c_cache_reg[] = {
> MAX98373_R20B6_BDE_CUR_STATE_READBACK,
> };
>
> -static struct reg_default max98373_reg[] = {
> +static const struct reg_default max98373_reg[] = {
> {MAX98373_R2000_SW_RESET, 0x00},
> {MAX98373_R2001_INT_RAW1, 0x00},
> {MAX98373_R2002_INT_RAW2, 0x00},
> diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c
> index 6088278e6503dc7ea743ccc439cd6365c7475017..43b52bda6ad5297d856123aa515e0019f4866097 100644
> --- a/sound/soc/codecs/max98373-sdw.c
> +++ b/sound/soc/codecs/max98373-sdw.c
> @@ -26,7 +26,7 @@ static const u32 max98373_sdw_cache_reg[] = {
> MAX98373_R20B6_BDE_CUR_STATE_READBACK,
> };
>
> -static struct reg_default max98373_reg[] = {
> +static const struct reg_default max98373_reg[] = {
> {MAX98373_R0040_SCP_INIT_STAT_1, 0x00},
> {MAX98373_R0041_SCP_INIT_MASK_1, 0x00},
> {MAX98373_R0042_SCP_INIT_STAT_2, 0x00},
> diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c
> index 99986090b4a63a9759763881f3004d0e509e53cd..076f15a9867e13527324354cd6364ade3bca4846 100644
> --- a/sound/soc/codecs/max98388.c
> +++ b/sound/soc/codecs/max98388.c
> @@ -18,7 +18,7 @@
> #include <sound/tlv.h>
> #include "max98388.h"
>
> -static struct reg_default max98388_reg[] = {
> +static const struct reg_default max98388_reg[] = {
> {MAX98388_R2000_SW_RESET, 0x00},
> {MAX98388_R2001_INT_RAW1, 0x00},
> {MAX98388_R2002_INT_RAW2, 0x00},
> diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
> index 76296176f9486f72a9d6077a0c69a475e277ed88..a8a282ff9fc5abfbf6c6bdc7fc209ed15bda0cfd 100644
> --- a/sound/soc/codecs/max98390.c
> +++ b/sound/soc/codecs/max98390.c
> @@ -23,7 +23,7 @@
>
> #include "max98390.h"
>
> -static struct reg_default max98390_reg_defaults[] = {
> +static const struct reg_default max98390_reg_defaults[] = {
> {MAX98390_INT_EN1, 0xf0},
> {MAX98390_INT_EN2, 0x00},
> {MAX98390_INT_EN3, 0x00},
> diff --git a/sound/soc/codecs/max98396.c b/sound/soc/codecs/max98396.c
> index c1888cd83dbc6fe2d418012dc1a9b1c58c3ded86..4b4e1fc98a6da5bf3a713133ce974b2f09161ed4 100644
> --- a/sound/soc/codecs/max98396.c
> +++ b/sound/soc/codecs/max98396.c
> @@ -16,7 +16,7 @@ static const char * const max98396_core_supplies[MAX98396_NUM_CORE_SUPPLIES] = {
> "dvddio",
> };
>
> -static struct reg_default max98396_reg[] = {
> +static const struct reg_default max98396_reg[] = {
> {MAX98396_R2000_SW_RESET, 0x00},
> {MAX98396_R2001_INT_RAW1, 0x00},
> {MAX98396_R2002_INT_RAW2, 0x00},
> @@ -174,7 +174,7 @@ static struct reg_default max98396_reg[] = {
> {MAX98396_R21FF_REVISION_ID, 0x00},
> };
>
> -static struct reg_default max98397_reg[] = {
> +static const struct reg_default max98397_reg[] = {
> {MAX98396_R2000_SW_RESET, 0x00},
> {MAX98396_R2001_INT_RAW1, 0x00},
> {MAX98396_R2002_INT_RAW2, 0x00},
> diff --git a/sound/soc/codecs/max98504.c b/sound/soc/codecs/max98504.c
> index 6b6a7ece4cecc3d114da276faf859c8176955300..c94142768c818228aae8b90c636cfd6b496e9859 100644
> --- a/sound/soc/codecs/max98504.c
> +++ b/sound/soc/codecs/max98504.c
> @@ -35,7 +35,7 @@ struct max98504_priv {
> unsigned int brownout_release_rate;
> };
>
> -static struct reg_default max98504_reg_defaults[] = {
> +static const struct reg_default max98504_reg_defaults[] = {
> { 0x01, 0},
> { 0x02, 0},
> { 0x03, 0},
> diff --git a/sound/soc/codecs/max98520.c b/sound/soc/codecs/max98520.c
> index adf5a898c6df5b10661861f6329ca54db6445f1a..2bf8976c1828210d2e6106f08e571df650640606 100644
> --- a/sound/soc/codecs/max98520.c
> +++ b/sound/soc/codecs/max98520.c
> @@ -16,7 +16,7 @@
> #include <sound/tlv.h>
> #include "max98520.h"
>
> -static struct reg_default max98520_reg[] = {
> +static const struct reg_default max98520_reg[] = {
> {MAX98520_R2000_SW_RESET, 0x00},
> {MAX98520_R2001_STATUS_1, 0x00},
> {MAX98520_R2002_STATUS_2, 0x00},
> diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c
> index 55cc18451a2d26e0ad72031d5017d68c215240ef..0e9b8970997cf6485a775a3187b1470f93b5c057 100644
> --- a/sound/soc/codecs/max98927.c
> +++ b/sound/soc/codecs/max98927.c
> @@ -19,7 +19,7 @@
> #include <sound/tlv.h>
> #include "max98927.h"
>
> -static struct reg_default max98927_reg[] = {
> +static const struct reg_default max98927_reg[] = {
> {MAX98927_R0001_INT_RAW1, 0x00},
> {MAX98927_R0002_INT_RAW2, 0x00},
> {MAX98927_R0003_INT_RAW3, 0x00},
> diff --git a/sound/soc/codecs/rt722-sdca-sdw.c b/sound/soc/codecs/rt722-sdca-sdw.c
> index 609ca0d6c83a1f28c73a0981f2a8f857816e5eb2..70700bdb80a14374321d1d8d8744356484ac01ac 100644
> --- a/sound/soc/codecs/rt722-sdca-sdw.c
> +++ b/sound/soc/codecs/rt722-sdca-sdw.c
> @@ -147,7 +147,7 @@ static int rt722_sdca_mbq_size(struct device *dev, unsigned int reg)
> }
> }
>
> -static struct regmap_sdw_mbq_cfg rt722_mbq_config = {
> +static const struct regmap_sdw_mbq_cfg rt722_mbq_config = {
> .mbq_size = rt722_sdca_mbq_size,
> };
>
> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
> index d9b61eab029af3d4782620ee017fc84fbd26ce0b..342d1f7d5dee3ac2d703e5b5602aef9ca2987158 100644
> --- a/sound/soc/codecs/wcd938x.c
> +++ b/sound/soc/codecs/wcd938x.c
> @@ -275,7 +275,7 @@ static const struct regmap_irq wcd938x_irqs[WCD938X_NUM_IRQS] = {
> REGMAP_IRQ_REG(WCD938X_IRQ_HPHR_SURGE_DET_INT, 2, 0x08),
> };
>
> -static struct regmap_irq_chip wcd938x_regmap_irq_chip = {
> +static const struct regmap_irq_chip wcd938x_regmap_irq_chip = {
> .name = "wcd938x",
> .irqs = wcd938x_irqs,
> .num_irqs = ARRAY_SIZE(wcd938x_irqs),
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index 6627d2da372206eff879f8f3bd5fae9ddc0757d7..d479521a6d504ee45797be8ea99206a4b1787f73 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -202,7 +202,7 @@
> SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \
> snd_soc_get_volsw, wsa881x_put_pa_gain, tlv_array)
>
> -static struct reg_default wsa881x_defaults[] = {
> +static const struct reg_default wsa881x_defaults[] = {
> { WSA881X_CHIP_ID0, 0x00 },
> { WSA881X_CHIP_ID1, 0x00 },
> { WSA881X_CHIP_ID2, 0x00 },
> @@ -346,7 +346,7 @@ static const struct reg_sequence wsa881x_vi_txfe_en_2_0[] = {
> };
>
> /* Default register reset values for WSA881x rev 2.0 */
> -static struct reg_sequence wsa881x_rev_2_0[] = {
> +static const struct reg_sequence wsa881x_rev_2_0[] = {
> { WSA881X_RESET_CTL, 0x00, 0x00 },
> { WSA881X_TADC_VALUE_CTL, 0x01, 0x00 },
> { WSA881X_INTR_MASK, 0x1B, 0x00 },
> diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
> index f04d99c66f332e18fe4c201f78360416c1607466..13c9d4a6f01537e448a5595f489c1716eb2053f2 100644
> --- a/sound/soc/codecs/wsa883x.c
> +++ b/sound/soc/codecs/wsa883x.c
> @@ -572,7 +572,7 @@ static const struct sdw_port_config wsa883x_pconfig[WSA883X_MAX_SWR_PORTS] = {
> },
> };
>
> -static struct reg_default wsa883x_defaults[] = {
> +static const struct reg_default wsa883x_defaults[] = {
> { WSA883X_REF_CTRL, 0xD5 },
> { WSA883X_TEST_CTL_0, 0x06 },
> { WSA883X_BIAS_0, 0xD2 },
> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
> index fd6ebc25fe894a5981df4e39d10d0f27d21c3a25..07d8a2645404ec49d4b12297d79bbddbe2950a4c 100644
> --- a/sound/soc/codecs/wsa884x.c
> +++ b/sound/soc/codecs/wsa884x.c
> @@ -899,7 +899,7 @@ static const struct sdw_port_config wsa884x_pconfig[WSA884X_MAX_SWR_PORTS] = {
> },
> };
>
> -static struct reg_default wsa884x_defaults[] = {
> +static const struct reg_default wsa884x_defaults[] = {
> { WSA884X_BG_CTRL, 0xa5 },
> { WSA884X_ADC_CTRL, 0x00 },
> { WSA884X_BOP1_PROG, 0x22 },
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
2025-05-28 19:59 ` [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields Krzysztof Kozlowski
@ 2025-05-29 9:29 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:29 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
> Members wcd934x_codec.num_rx_port and num_tx_port are not read anywhere
> after assignment, so they can be safely dropped.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd934x.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
> index fa69817c97eaf1bf226b140f3a89095a50a128b2..1bb7e1dc7e6b0a5528cbdb7ada943a7d417fb684 100644
> --- a/sound/soc/codecs/wcd934x.c
> +++ b/sound/soc/codecs/wcd934x.c
> @@ -537,8 +537,6 @@ struct wcd934x_codec {
> int rate;
> u32 version;
> u32 hph_mode;
> - int num_rx_port;
> - int num_tx_port;
> u32 tx_port_value[WCD934X_TX_MAX];
> u32 rx_port_value[WCD934X_RX_MAX];
> int sido_input_src;
> @@ -1928,13 +1926,11 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
> return -EINVAL;
> }
>
> - wcd->num_rx_port = rx_num;
> for (i = 0; i < rx_num; i++) {
> wcd->rx_chs[i].ch_num = rx_slot[i];
> INIT_LIST_HEAD(&wcd->rx_chs[i].list);
> }
>
> - wcd->num_tx_port = tx_num;
> for (i = 0; i < tx_num; i++) {
> wcd->tx_chs[i].ch_num = tx_slot[i];
> INIT_LIST_HEAD(&wcd->tx_chs[i].list);
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
2025-05-28 19:59 ` [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields Krzysztof Kozlowski
@ 2025-05-29 9:30 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:30 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
> 'wcd_regmap_irq_chip' and 'jack' in 'struct wcd937x_priv' are not used
> at all.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd937x.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
> index b9df58b86ce953427e01ffb8c7eb7e52f9c2392a..126a29e0b3ff96c12fdaba2b9344a3040b455e44 100644
> --- a/sound/soc/codecs/wcd937x.c
> +++ b/sound/soc/codecs/wcd937x.c
> @@ -88,10 +88,8 @@ struct wcd937x_priv {
> struct wcd_mbhc_intr intr_ids;
> struct wcd_clsh_ctrl *clsh_info;
> struct irq_domain *virq;
> - struct regmap_irq_chip *wcd_regmap_irq_chip;
> struct regmap_irq_chip_data *irq_chip;
> struct regulator_bulk_data supplies[WCD937X_MAX_BULK_SUPPLY];
> - struct snd_soc_jack *jack;
> unsigned long status_mask;
> s32 micb_ref[WCD937X_MAX_MICBIAS];
> s32 pullup_ref[WCD937X_MAX_MICBIAS];
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
2025-05-28 20:00 ` [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields Krzysztof Kozlowski
@ 2025-05-29 9:30 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:30 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 9:00 PM, Krzysztof Kozlowski wrote:
> 'wcd_regmap_irq_chip' and 'jack' in 'struct wcd938x_priv' are not used
> at all.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd938x.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
> index 342d1f7d5dee3ac2d703e5b5602aef9ca2987158..43347c14070ca6dd8035b0c290f0dacb0326122b 100644
> --- a/sound/soc/codecs/wcd938x.c
> +++ b/sound/soc/codecs/wcd938x.c
> @@ -159,10 +159,8 @@ struct wcd938x_priv {
> struct wcd_mbhc_intr intr_ids;
> struct wcd_clsh_ctrl *clsh_info;
> struct irq_domain *virq;
> - struct regmap_irq_chip *wcd_regmap_irq_chip;
> struct regmap_irq_chip_data *irq_chip;
> struct regulator_bulk_data supplies[WCD938X_MAX_SUPPLY];
> - struct snd_soc_jack *jack;
> unsigned long status_mask;
> s32 micb_ref[WCD938X_MAX_MICBIAS];
> s32 pullup_ref[WCD938X_MAX_MICBIAS];
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field
2025-05-28 20:00 ` [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field Krzysztof Kozlowski
@ 2025-05-29 9:31 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:31 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 9:00 PM, Krzysztof Kozlowski wrote:
> Member wcd938x_priv.variant is assigned in probe() function and used
> immediately thereafter, thus it can be just a local variable for less
> variables stored in 'struct wcd938x_priv' device-wide state.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd938x.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
> index 43347c14070ca6dd8035b0c290f0dacb0326122b..5a751056a98a5d4cc5716aafc25af27e3ab22786 100644
> --- a/sound/soc/codecs/wcd938x.c
> +++ b/sound/soc/codecs/wcd938x.c
> @@ -168,7 +168,6 @@ struct wcd938x_priv {
> u32 tx_mode[TX_ADC_MAX];
> int flyback_cur_det_disable;
> int ear_rx_path;
> - int variant;
> struct gpio_desc *reset_gpio;
> struct gpio_desc *us_euro_gpio;
> struct mux_control *us_euro_mux;
> @@ -3044,6 +3043,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
> struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev;
> struct device *dev = component->dev;
> unsigned long time_left;
> + unsigned int variant;
> int ret, i;
>
> time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete,
> @@ -3059,9 +3059,9 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
> if (ret < 0)
> return ret;
>
> - wcd938x->variant = snd_soc_component_read_field(component,
> - WCD938X_DIGITAL_EFUSE_REG_0,
> - WCD938X_ID_MASK);
> + variant = snd_soc_component_read_field(component,
> + WCD938X_DIGITAL_EFUSE_REG_0,
> + WCD938X_ID_MASK);
>
> wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X);
> if (IS_ERR(wcd938x->clsh_info)) {
> @@ -3115,14 +3115,14 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
> disable_irq_nosync(wcd938x->hphl_pdm_wd_int);
> disable_irq_nosync(wcd938x->aux_pdm_wd_int);
>
> - switch (wcd938x->variant) {
> + switch (variant) {
> case WCD9380:
> ret = snd_soc_add_component_controls(component, wcd9380_snd_controls,
> ARRAY_SIZE(wcd9380_snd_controls));
> if (ret < 0) {
> dev_err(component->dev,
> "%s: Failed to add snd ctrls for variant: %d\n",
> - __func__, wcd938x->variant);
> + __func__, variant);
> goto err_free_aux_pdm_wd_int;
> }
> break;
> @@ -3132,7 +3132,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
> if (ret < 0) {
> dev_err(component->dev,
> "%s: Failed to add snd ctrls for variant: %d\n",
> - __func__, wcd938x->variant);
> + __func__, variant);
> goto err_free_aux_pdm_wd_int;
> }
> break;
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
2025-05-28 20:00 ` [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields Krzysztof Kozlowski
@ 2025-05-29 9:31 ` Srinivas Kandagatla
0 siblings, 0 replies; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:31 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 9:00 PM, Krzysztof Kozlowski wrote:
> 'wcd_regmap_irq_chip' and 'jack' in 'struct wcd939x_priv' are not used
> at all.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
--srini
> sound/soc/codecs/wcd939x.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
> index 067d23c7ecf90ae06da1ad6cc89d273fb7f7f875..bfd4d2c8bdc9bcfcdbf673d20458f779922eb464 100644
> --- a/sound/soc/codecs/wcd939x.c
> +++ b/sound/soc/codecs/wcd939x.c
> @@ -190,10 +190,8 @@ struct wcd939x_priv {
> struct wcd_mbhc_intr intr_ids;
> struct wcd_clsh_ctrl *clsh_info;
> struct irq_domain *virq;
> - struct regmap_irq_chip *wcd_regmap_irq_chip;
> struct regmap_irq_chip_data *irq_chip;
> struct regulator_bulk_data supplies[WCD939X_MAX_SUPPLY];
> - struct snd_soc_jack *jack;
> unsigned long status_mask;
> s32 micb_ref[WCD939X_MAX_MICBIAS];
> s32 pullup_ref[WCD939X_MAX_MICBIAS];
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] ASoC: codecs: More const and unused member cleanups
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (7 preceding siblings ...)
2025-05-28 20:00 ` [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields Krzysztof Kozlowski
@ 2025-05-29 9:33 ` Srinivas Kandagatla
2025-05-29 9:38 ` Krzysztof Kozlowski
2025-06-09 21:00 ` Mark Brown
9 siblings, 1 reply; 20+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29 9:33 UTC (permalink / raw)
To: Krzysztof Kozlowski, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
> Make static data const for code safety and drop some unused fields in
> structs.
>
> This is based on for-v6.16 branch in ASoC tree for context in wcd938x
> driver.
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (8):
> ASoC: codecs: Constify regmap configuration static variables
> ASoC: fsl: Constify reg_default array
> ASoC: codecs: wcd9335: Drop unused sido_input_src field
> ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
> ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
> ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
> ASoC: codecs: wcd938x: Drop unused variant field
> ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
Thanks Krzysztof for the cleanups, its surprising to see so many unused
stuct members in qcom codecs. Did you use any static analysis tool to do
this or was this manually done?
--Srini
>
> sound/soc/codecs/cs35l36.c | 2 +-
> sound/soc/codecs/da7218.c | 2 +-
> sound/soc/codecs/da7219.c | 4 ++--
> sound/soc/codecs/es8375.c | 2 +-
> sound/soc/codecs/max98363.c | 2 +-
> sound/soc/codecs/max98373-i2c.c | 2 +-
> sound/soc/codecs/max98373-sdw.c | 2 +-
> sound/soc/codecs/max98388.c | 2 +-
> sound/soc/codecs/max98390.c | 2 +-
> sound/soc/codecs/max98396.c | 4 ++--
> sound/soc/codecs/max98504.c | 2 +-
> sound/soc/codecs/max98520.c | 2 +-
> sound/soc/codecs/max98927.c | 2 +-
> sound/soc/codecs/rt722-sdca-sdw.c | 2 +-
> sound/soc/codecs/wcd9335.c | 5 -----
> sound/soc/codecs/wcd934x.c | 4 ----
> sound/soc/codecs/wcd937x.c | 2 --
> sound/soc/codecs/wcd938x.c | 18 ++++++++----------
> sound/soc/codecs/wcd939x.c | 2 --
> sound/soc/codecs/wsa881x.c | 4 ++--
> sound/soc/codecs/wsa883x.c | 2 +-
> sound/soc/codecs/wsa884x.c | 2 +-
> sound/soc/fsl/fsl_asrc.c | 2 +-
> sound/soc/fsl/fsl_sai.c | 4 ++--
> 24 files changed, 31 insertions(+), 46 deletions(-)
> ---
> base-commit: 22d449bcd69e66f25fe847b678738950dcf9301e
> change-id: 20250528-asoc-const-unused-1e39b434e427
> prerequisite-change-id: 20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-0ce64398f9cc:v1
> prerequisite-patch-id: 104000f7254b9cc81be49af9ca584544718e52f1
> prerequisite-patch-id: 230fcd1b712c5a3199e7c9d8250e98e5d55c0a40
> prerequisite-patch-id: ecdbe74955eb7b710f72af1e3cf32ccac52890d5
>
> Best regards,
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] ASoC: codecs: More const and unused member cleanups
2025-05-29 9:33 ` [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Srinivas Kandagatla
@ 2025-05-29 9:38 ` Krzysztof Kozlowski
0 siblings, 0 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-29 9:38 UTC (permalink / raw)
To: Srinivas Kandagatla, David Rhodes, Richard Fitzgerald,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On 29/05/2025 11:33, Srinivas Kandagatla wrote:
>
>
> On 5/28/25 8:59 PM, Krzysztof Kozlowski wrote:
>> Make static data const for code safety and drop some unused fields in
>> structs.
>>
>> This is based on for-v6.16 branch in ASoC tree for context in wcd938x
>> driver.
>>
>> Best regards,
>> Krzysztof
>>
>> ---
>> Krzysztof Kozlowski (8):
>> ASoC: codecs: Constify regmap configuration static variables
>> ASoC: fsl: Constify reg_default array
>> ASoC: codecs: wcd9335: Drop unused sido_input_src field
>> ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
>> ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
>> ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
>> ASoC: codecs: wcd938x: Drop unused variant field
>> ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
>
>
> Thanks Krzysztof for the cleanups, its surprising to see so many unused
> stuct members in qcom codecs. Did you use any static analysis tool to do
> this or was this manually done?
No, only the tool between seat and keyboard. I should find something
better (more automated), because every 3 months I discover a new unused
field. :) I think now I cleaned them for good, but some new cases are
added when some code is dropped or simplified.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
2025-05-29 9:28 ` Srinivas Kandagatla
@ 2025-05-29 10:09 ` Charles Keepax
1 sibling, 0 replies; 20+ messages in thread
From: Charles Keepax @ 2025-05-29 10:09 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: David Rhodes, Richard Fitzgerald, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Support Opensource, Oder Chiou,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, linux-sound, patches, linux-kernel, linux-arm-msm,
linuxppc-dev
On Wed, May 28, 2025 at 09:59:55PM +0200, Krzysztof Kozlowski wrote:
> Static arrays/structs for regmap configuration like 'struct
> reg_default', 'struct reg_sequence' and others are not modified so can
> be changed to const for more safety.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> sound/soc/codecs/cs35l36.c | 2 +-
>
> diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
> index b49c6905e8727d7c07fd10e668507ca07bf2cff5..b60697ff7a506dccf3dba1b01faa985761bbbc42 100644
> --- a/sound/soc/codecs/cs35l36.c
> +++ b/sound/soc/codecs/cs35l36.c
> -static struct reg_default cs35l36_reg[] = {
> +static const struct reg_default cs35l36_reg[] = {
> {CS35L36_TESTKEY_CTRL, 0x00000000},
> {CS35L36_USERKEY_CTL, 0x00000000},
> {CS35L36_OTP_CTRL1, 0x00002460},
For the cs35l56:
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] ASoC: codecs: More const and unused member cleanups
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
` (8 preceding siblings ...)
2025-05-29 9:33 ` [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Srinivas Kandagatla
@ 2025-06-09 21:00 ` Mark Brown
9 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2025-06-09 21:00 UTC (permalink / raw)
To: David Rhodes, Richard Fitzgerald, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, Support Opensource, Oder Chiou, Srinivas Kandagatla,
Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
Krzysztof Kozlowski
Cc: linux-sound, patches, linux-kernel, linux-arm-msm, linuxppc-dev
On Wed, 28 May 2025 21:59:54 +0200, Krzysztof Kozlowski wrote:
> Make static data const for code safety and drop some unused fields in
> structs.
>
> This is based on for-v6.16 branch in ASoC tree for context in wcd938x
> driver.
>
> Best regards,
> Krzysztof
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/8] ASoC: codecs: Constify regmap configuration static variables
commit: 0045b902ad27f2676c2a5b6444494a8287b80072
[2/8] ASoC: fsl: Constify reg_default array
commit: 239dab898b739f49b1bda8d65163fe4f5c773468
[3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field
commit: 620d9687004ce877b340041b8213da166f329367
[4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
commit: 9afc53569d800f5e3caf9401d49ad2d89f340a54
[5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
commit: 87a2270fd1f560dbfc1b26391ff3b37f56d2a1a3
[6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
commit: fd32bd4467c13254cb52188034fce242f0f6340d
[7/8] ASoC: codecs: wcd938x: Drop unused variant field
commit: ff228b6b9ed8f5d7ef418b6cbece772c6617d789
[8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
commit: ece5d881004f041c2e1493436409dbcbea3ad5f8
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2025-06-09 21:00 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28 19:59 [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 1/8] ASoC: codecs: Constify regmap configuration static variables Krzysztof Kozlowski
2025-05-29 9:28 ` Srinivas Kandagatla
2025-05-29 10:09 ` Charles Keepax
2025-05-28 19:59 ` [PATCH 2/8] ASoC: fsl: Constify reg_default array Krzysztof Kozlowski
2025-05-28 19:59 ` [PATCH 3/8] ASoC: codecs: wcd9335: Drop unused sido_input_src field Krzysztof Kozlowski
2025-05-29 9:27 ` Srinivas Kandagatla
2025-05-28 19:59 ` [PATCH 4/8] ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields Krzysztof Kozlowski
2025-05-29 9:29 ` Srinivas Kandagatla
2025-05-28 19:59 ` [PATCH 5/8] ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields Krzysztof Kozlowski
2025-05-29 9:30 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 6/8] ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields Krzysztof Kozlowski
2025-05-29 9:30 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 7/8] ASoC: codecs: wcd938x: Drop unused variant field Krzysztof Kozlowski
2025-05-29 9:31 ` Srinivas Kandagatla
2025-05-28 20:00 ` [PATCH 8/8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields Krzysztof Kozlowski
2025-05-29 9:31 ` Srinivas Kandagatla
2025-05-29 9:33 ` [PATCH 0/8] ASoC: codecs: More const and unused member cleanups Srinivas Kandagatla
2025-05-29 9:38 ` Krzysztof Kozlowski
2025-06-09 21:00 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).