mbox series

[00/23] ASoC: codecs: wcd family: cleanups

Message ID 20240612-asoc-wcd9xxx-wide-cleanups-v1-0-0d15885b2a06@linaro.org
Headers show
Series ASoC: codecs: wcd family: cleanups | expand

Message

Krzysztof Kozlowski June 12, 2024, 4:15 p.m. UTC
Hi,

Set of simple cleanups from similar issues in all Qualcomm WCD93xx
codecs.

The first patch "ASoC: codecs: wcd-mbhc: Constify passed MBHC reg
fields" is a requirement for few others, but except this they are
independent.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (23):
      ASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields
      ASoC: codecs: wcd9335: Drop unused state container fields
      ASoC: codecs: wcd9335: Constify static data
      ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe()
      ASoC: codecs: wcd9335: Drop unneeded error message
      ASoC: codecs: wcd9335: Drop unused dmic rate handling
      ASoC: codecs: wcd934x: Drop unused interp path enum
      ASoC: codecs: wcd934x: Constify static data
      ASoC: codecs: wcd934x: Drop unused mic bias voltage fields
      ASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe()
      ASoC: codecs: wcd937x: Constify static data
      ASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info
      ASoC: codecs: wcd937x: Drop unused enums, defines and types
      ASoC: codecs: wcd937x: Drop unused state container fields
      ASoC: codecs: wcd937x: Drop unused chipid member
      ASoC: codecs: wcd938x: Constify static data
      ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info
      ASoC: codecs: wcd938x: Drop unused RX/TX direction enum
      ASoC: codecs: wcd938x: Drop unused num_ports field
      ASoC: codecs: wcd939x: Constify static data
      ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info
      ASoC: codecs: wcd939x: Drop unused RX/TX direction enum
      ASoC: codecs: wcd939x: Drop unused num_ports field

 sound/soc/codecs/wcd-mbhc-v2.c |  4 +-
 sound/soc/codecs/wcd-mbhc-v2.h |  4 +-
 sound/soc/codecs/wcd9335.c     | 98 ++++++++----------------------------------
 sound/soc/codecs/wcd934x.c     | 42 ++++++------------
 sound/soc/codecs/wcd937x-sdw.c |  4 +-
 sound/soc/codecs/wcd937x.c     | 25 +++++------
 sound/soc/codecs/wcd937x.h     | 31 +------------
 sound/soc/codecs/wcd938x-sdw.c |  4 +-
 sound/soc/codecs/wcd938x.c     |  6 +--
 sound/soc/codecs/wcd938x.h     |  7 +--
 sound/soc/codecs/wcd939x-sdw.c |  4 +-
 sound/soc/codecs/wcd939x.c     |  8 ++--
 sound/soc/codecs/wcd939x.h     |  8 +---
 13 files changed, 60 insertions(+), 185 deletions(-)
---
base-commit: f453294266a3f90f72b91c30b76ca67c5dbf6019
change-id: 20240612-asoc-wcd9xxx-wide-cleanups-a3aaf9c4d23b

Best regards,

Comments

Neil Armstrong June 12, 2024, 4:25 p.m. UTC | #1
On 12/06/2024 18:15, Krzysztof Kozlowski wrote:
> Driver does not modify static wcd939x_sdw_ch_info array, so it can be
> made const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   sound/soc/codecs/wcd939x-sdw.c | 4 ++--
>   sound/soc/codecs/wcd939x.c     | 2 +-
>   sound/soc/codecs/wcd939x.h     | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/wcd939x-sdw.c b/sound/soc/codecs/wcd939x-sdw.c
> index 8acb5651c5bc..94b1e99a3ca0 100644
> --- a/sound/soc/codecs/wcd939x-sdw.c
> +++ b/sound/soc/codecs/wcd939x-sdw.c
> @@ -23,7 +23,7 @@
>   
>   #define SWRS_SCP_HOST_CLK_DIV2_CTL_BANK(m) (0xE0 + 0x10 * (m))
>   
> -static struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
> +static const struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
>   	WCD_SDW_CH(WCD939X_HPH_L, WCD939X_HPH_PORT, BIT(0)),
>   	WCD_SDW_CH(WCD939X_HPH_R, WCD939X_HPH_PORT, BIT(1)),
>   	WCD_SDW_CH(WCD939X_CLSH, WCD939X_CLSH_PORT, BIT(0)),
> @@ -36,7 +36,7 @@ static struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
>   	WCD_SDW_CH(WCD939X_HIFI_PCM_R, WCD939X_HIFI_PCM_PORT, BIT(1)),
>   };
>   
> -static struct wcd939x_sdw_ch_info wcd939x_sdw_tx_ch_info[] = {
> +static const struct wcd939x_sdw_ch_info wcd939x_sdw_tx_ch_info[] = {
>   	WCD_SDW_CH(WCD939X_ADC1, WCD939X_ADC_1_4_PORT, BIT(0)),
>   	WCD_SDW_CH(WCD939X_ADC2, WCD939X_ADC_1_4_PORT, BIT(1)),
>   	WCD_SDW_CH(WCD939X_ADC3, WCD939X_ADC_1_4_PORT, BIT(2)),
> diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
> index 1f94f49f9829..66af035bd0e5 100644
> --- a/sound/soc/codecs/wcd939x.c
> +++ b/sound/soc/codecs/wcd939x.c
> @@ -414,7 +414,7 @@ static int wcd939x_io_init(struct snd_soc_component *component)
>   	return 0;
>   }
>   
> -static int wcd939x_sdw_connect_port(struct wcd939x_sdw_ch_info *ch_info,
> +static int wcd939x_sdw_connect_port(const struct wcd939x_sdw_ch_info *ch_info,
>   				    struct sdw_port_config *port_config,
>   				    u8 enable)
>   {
> diff --git a/sound/soc/codecs/wcd939x.h b/sound/soc/codecs/wcd939x.h
> index 756f497a337c..a6c9c6cee056 100644
> --- a/sound/soc/codecs/wcd939x.h
> +++ b/sound/soc/codecs/wcd939x.h
> @@ -914,7 +914,7 @@ struct wcd939x_sdw_priv {
>   	struct sdw_stream_config sconfig;
>   	struct sdw_stream_runtime *sruntime;
>   	struct sdw_port_config port_config[WCD939X_MAX_SWR_PORTS];
> -	struct wcd939x_sdw_ch_info *ch_info;
> +	const struct wcd939x_sdw_ch_info *ch_info;
>   	bool port_enable[WCD939X_MAX_SWR_CH_IDS];
>   	int active_ports;
>   	int num_ports;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Neil Armstrong June 12, 2024, 4:26 p.m. UTC | #2
On 12/06/2024 18:15, Krzysztof Kozlowski wrote:
> The driver does not use few 'num_ports' in 'struct wcd939x_sdw_priv'.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   sound/soc/codecs/wcd939x.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/wcd939x.h b/sound/soc/codecs/wcd939x.h
> index 0aa4d9d542c6..1571c2120cfc 100644
> --- a/sound/soc/codecs/wcd939x.h
> +++ b/sound/soc/codecs/wcd939x.h
> @@ -912,7 +912,6 @@ struct wcd939x_sdw_priv {
>   	const struct wcd939x_sdw_ch_info *ch_info;
>   	bool port_enable[WCD939X_MAX_SWR_CH_IDS];
>   	int active_ports;
> -	int num_ports;
>   	bool is_tx;
>   	struct wcd939x_priv *wcd939x;
>   	struct irq_domain *slave_irq;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Mark Brown June 23, 2024, 5:21 p.m. UTC | #3
On Wed, 12 Jun 2024 18:15:13 +0200, Krzysztof Kozlowski wrote:
> Set of simple cleanups from similar issues in all Qualcomm WCD93xx
> codecs.
> 
> The first patch "ASoC: codecs: wcd-mbhc: Constify passed MBHC reg
> fields" is a requirement for few others, but except this they are
> independent.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/23] ASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields
        commit: e565ab184946650f19afb9fe74f8be84fcb6d210
[02/23] ASoC: codecs: wcd9335: Drop unused state container fields
        commit: 60ce48f5311103dd7a09e12d0b75d7ec44e291d9
[03/23] ASoC: codecs: wcd9335: Constify static data
        commit: b2ff7c88bf751fa502f5707f0b7b047afcba87dc
[04/23] ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe()
        commit: 4a03b5dbad466c902d522f3405daa4e5d80578c5
[05/23] ASoC: codecs: wcd9335: Drop unneeded error message
        commit: 3ed4beba49463997eb9a4afa0d46ece7dc5dbf19
[06/23] ASoC: codecs: wcd9335: Drop unused dmic rate handling
        commit: 1d1cda22da5db03a0c794d139e06519e3a94f815
[07/23] ASoC: codecs: wcd934x: Drop unused interp path enum
        commit: 1bce5c586ba56dfa6acf8d13f0f608f5f5d717bd
[08/23] ASoC: codecs: wcd934x: Constify static data
        commit: 5ad81bf49a18dc22bd7e1c56f67be9b5eb50267c
[09/23] ASoC: codecs: wcd934x: Drop unused mic bias voltage fields
        commit: a252188244aeff72e4331abba2fee6b9093c847b
[10/23] ASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe()
        commit: 9ea22713227397b56a2b36a68c8bda13f0b43d70
[11/23] ASoC: codecs: wcd937x: Constify static data
        commit: 0ad42c04e9b223d913ad4b1463c0f1cdc00f3cc5
[12/23] ASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info
        commit: c8ed66cbc3b7ccd9e5ae98b06023c1fe3e834ca8
[13/23] ASoC: codecs: wcd937x: Drop unused enums, defines and types
        commit: d8e746719d705427e69c7f0ac2ca20aaf560a03e
[14/23] ASoC: codecs: wcd937x: Drop unused state container fields
        commit: c2d9fd2e94588eb83f8855e942d77b5f539c5a5f
[15/23] ASoC: codecs: wcd937x: Drop unused chipid member
        commit: 6dc7b8a10419a267cd5eb7ac2bb407f7fc7865e2
[16/23] ASoC: codecs: wcd938x: Constify static data
        commit: 424e6bc4328b39a924cc2acb251868cfd23fe369
[17/23] ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info
        commit: af57d5e3b58886ee5efc6ba9d0e25c8d1d3c3c37
[18/23] ASoC: codecs: wcd938x: Drop unused RX/TX direction enum
        commit: 43e7400f6bf51ecedf4ddad942cd812fe351ce74
[19/23] ASoC: codecs: wcd938x: Drop unused num_ports field
        commit: 3f1deca19e68e48bd89a72c4fe648275d9af574b
[20/23] ASoC: codecs: wcd939x: Constify static data
        commit: 8e5d5b2c96fadecdaebff5afcbb7f51580701122
[21/23] ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info
        commit: f49100faccb5d2ffb4c9e5e4bba6173f5ac43d22
[22/23] ASoC: codecs: wcd939x: Drop unused RX/TX direction enum
        commit: 2642b6aa9d0f43c52c83461bc7ae4917336e7643
[23/23] ASoC: codecs: wcd939x: Drop unused num_ports field
        commit: 34935cd4721f0492eafbc516dd1fc7f5f687fa76

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