ASoC: tegra: Fixes for issues exposed in Linux v7.2
Subsystems (4)
Jon Hunter
maintainercover ASoC: tegra: Fixes for issues exposed in Linux v7.2
Commit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted reg_defaults array") exposed an issue in the Tegra I2S and MIXER drivers and after this commit was added, this underlying issue now causes audio tests that exercise the I2S and MIXER drivers to fail. This series fixes the issue in the I2S and MIXER drivers and also fixes warning observed with the ADMAIF and MBDRC drivers that have unsorted reg_defaults.
Jon Hunter (4):
ASoC: tegra: Fix the I2S enable default value
ASoC: tegra: Fix the MIXER enable default value
ASoC: tegra: Sort ADMAIF register defaults
ASoC: tegra: Sort MBDRC register defaults
sound/soc/tegra/tegra210_admaif.c | 208 ++++++++++++++++++++---------- sound/soc/tegra/tegra210_i2s.c | 20 ++- sound/soc/tegra/tegra210_i2s.h | 1 + sound/soc/tegra/tegra210_mbdrc.c | 42 +++--- sound/soc/tegra/tegra210_mixer.c | 10 +- 5 files changed, 184 insertions(+), 97 deletions(-)
Signature · 1 line
2.43.0
Jon Hunter
maintainerPATCH 1/4 ASoC: tegra: Fix the I2S enable default value
Commit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted reg_defaults array") exposed an issue in the Tegra I2S driver where the register default for the TEGRA210_I2S_ENABLE is specified as 1, but the hardware default is actually 0. After this commit was added the I2S driver is no longer working and so fix this by correcting the default value for this register and explicitly configuring the I2S_ENABLE register when runtime resuming the I2S device.
The I2S_ENABLE register offset is different on Tegra264 devices than other Tegra devices and so add a 'enable_reg' variable to the SoC data structure to specify the offset for different SoC devices.
--- sound/soc/tegra/tegra210_i2s.c | 20 +++++++++++++++++--- sound/soc/tegra/tegra210_i2s.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-)
sound/soc/tegra/tegra210_i2s.c +17 -3
@@ -23,7 +23,7 @@ static const struct reg_default tegra210_i2s_reg_defaults[] = { { TEGRA210_I2S_RX_CIF_CTRL, 0x00007700 }, { TEGRA210_I2S_TX_INT_MASK, 0x00000003 }, { TEGRA210_I2S_TX_CIF_CTRL, 0x00007700 }, - { TEGRA210_I2S_ENABLE, 0x1 }, + { TEGRA210_I2S_ENABLE, 0x0 }, { TEGRA210_I2S_CG, 0x1 }, { TEGRA210_I2S_TIMING, 0x0000001f },/*
@@ -42,7 +42,7 @@ static const struct reg_default tegra264_i2s_reg_defaults[] = { { TEGRA264_I2S_TX_INT_MASK, 0x00000003 }, { TEGRA264_I2S_TX_CIF_CTRL, 0x00003f00 }, { TEGRA264_I2S_TX_FIFO_RD_ACCESS_MODE, 0x1 }, - { TEGRA264_I2S_ENABLE, 0x1 }, + { TEGRA264_I2S_ENABLE, 0x0 }, { TEGRA264_I2S_CG, 0x1 }, { TEGRA264_I2S_TIMING, 0x0000001f }, };
@@ -201,9 +201,21 @@ static int tegra210_i2s_runtime_resume(struct device *dev) }regcache_cache_only (i2s->regmap, false); -regcache_sync (i2s->regmap); + err =regcache_sync (i2s->regmap); +if (err) + goto err; + + err =regmap_write (i2s->regmap, i2s->soc_data->enable_reg,I2S_EN ); +if (err) + goto err;return 0 ; + +err: +regcache_cache_only (i2s->regmap, true); +clk_disable_unprepare (i2s->clk_i2s); + +return err; } static void tegra210_i2s_set_data_offset(struct tegra210_i2s *i2s,
@@ -1133,6 +1145,7 @@ static const struct tegra_i2s_soc_data soc_data_tegra210 = { .regmap_conf = &tegra210_regmap_conf, .i2s_cmpnt = &tegra210_i2s_cmpnt, .max_ch = TEGRA210_I2S_MAX_CHANNEL, + .enable_reg = TEGRA210_I2S_ENABLE, .tx_offset = TEGRA210_I2S_TX_OFFSET, .i2s_ctrl_offset = TEGRA210_I2S_CTRL_OFFSET, .fsync_width_mask = I2S_CTRL_FSYNC_WIDTH_MASK,
@@ -1144,6 +1157,7 @@ static const struct tegra_i2s_soc_data soc_data_tegra264 = { .regmap_conf = &tegra264_regmap_conf, .i2s_cmpnt = &tegra264_i2s_cmpnt, .max_ch = TEGRA264_I2S_MAX_CHANNEL, + .enable_reg = TEGRA264_I2S_ENABLE, .tx_offset = TEGRA264_I2S_TX_OFFSET, .i2s_ctrl_offset = TEGRA264_I2S_CTRL_OFFSET, .fsync_width_mask = TEGRA264_I2S_CTRL_FSYNC_WIDTH_MASK,
sound/soc/tegra/tegra210_i2s.h +1 -0
@@ -150,6 +150,7 @@ struct tegra_i2s_soc_data {const struct regmap_config *regmap_conf;const struct snd_soc_component_driver *i2s_cmpnt;unsigned int max_ch; +unsigned int enable_reg;unsigned int tx_offset;unsigned int i2s_ctrl_offset;unsigned int fsync_width_mask;
Signature · 1 line
2.43.0
Jon Hunter
maintainerPATCH 2/4 ASoC: tegra: Fix the MIXER enable default value
In reply to Jon HunterCommit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted reg_defaults array") exposed an issue in the Tegra MIXER driver where the register default for the TEGRA210_MIXER_ENABLE is specified as 1, but the hardware default is actually 0. After this commit was added the MIXER driver is no longer working and so fix this by correcting the default value for this register and explicitly configuring the MIXER_ENABLE register when runtime resuming the MIXER device.
--- sound/soc/tegra/tegra210_mixer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/soc/tegra/tegra210_mixer.c +7 -3
@@ -57,7 +57,7 @@ static const struct reg_default tegra210_mixer_reg_defaults[] = {MIXER_TX_REG_DEFAULTS (3 ),MIXER_TX_REG_DEFAULTS (4 ), - { TEGRA210_MIXER_ENABLE, 0x1 }, + { TEGRA210_MIXER_ENABLE, 0x0 }, { TEGRA210_MIXER_CG, 0x00000001}, { TEGRA210_MIXER_GAIN_CFG_RAM_CTRL, 0x00004000}, { TEGRA210_MIXER_PEAKM_RAM_CTRL, 0x00004000},
@@ -86,11 +86,15 @@ static int tegra210_mixer_runtime_suspend(struct device *dev)static int tegra210_mixer_runtime_resume (struct device *dev) {struct tegra210_mixer *mixer =dev_get_drvdata (dev); +int err;regcache_cache_only (mixer->regmap, false); -regcache_sync (mixer->regmap); + err =regcache_sync (mixer->regmap); +if (err) +return err; -return 0 ; +return regmap_write (mixer->regmap,TEGRA210_MIXER_ENABLE , +TEGRA210_MIXER_EN ); } static int tegra210_mixer_write_ram(struct tegra210_mixer *mixer,
Signature · 1 line
2.43.0
Jon Hunter
maintainerPATCH 3/4 ASoC: tegra: Sort ADMAIF register defaults
In reply to Jon HunterCommit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted reg_defaults array") exposed an issue in the Tegra ADMAIF driver and now the following warning is observed:
tegra210-admaif 290f000.admaif: Driver needs fixing: Unsorted
reg_defaults, sorting the copy
This warning occurs because register defaults in the structures tegra186_admaif_reg_defaults and tegra264_admaif_reg_defaults are not specified in ascending order which is required by regmap. Fix this by sorting the register defaults according to their address. Note that in order to do this it is necessary to split the macro ADMAIF_REG_DEFAULTS into separate RX and TX macros to the RX and TX registers.
--- sound/soc/tegra/tegra210_admaif.c | 208 ++++++++++++++++++++---------- 1 file changed, 138 insertions(+), 70 deletions(-)
sound/soc/tegra/tegra210_admaif.c +138 -70
@@ -26,94 +26,162 @@#define CH_RX_REG (reg, id) CH_REG(admaif->soc_data->rx_base, reg, id) -#define REG_DEFAULTS (id, rx_ctrl, tx_ctrl, tx_base, rx_base, cif_ctrl) \ +#define RX_REG_DEFAULTS (id, rx_ctrl, rx_base, cif_ctrl) \ { CH_REG(rx_base, TEGRA_ADMAIF_RX_INT_MASK, id), 0x00000001 }, \ { CH_REG(rx_base, TEGRA_ADMAIF_CH_ACIF_RX_CTRL, id), cif_ctrl }, \ - { CH_REG(rx_base, TEGRA_ADMAIF_RX_FIFO_CTRL, id), rx_ctrl }, \ + { CH_REG(rx_base, TEGRA_ADMAIF_RX_FIFO_CTRL, id), rx_ctrl } + +#define TX_REG_DEFAULTS (id, tx_ctrl, tx_base, cif_ctrl) \ { CH_REG(tx_base, TEGRA_ADMAIF_TX_INT_MASK, id), 0x00000001 }, \ { CH_REG(tx_base, TEGRA_ADMAIF_CH_ACIF_TX_CTRL, id), cif_ctrl }, \ { CH_REG(tx_base, TEGRA_ADMAIF_TX_FIFO_CTRL, id), tx_ctrl } -#define ADMAIF_REG_DEFAULTS (id, chip) \ - REG_DEFAULTS((id) - 1, \ +#define ADMAIF_RX_REG_DEFAULTS (id, chip) \ + RX_REG_DEFAULTS((id) - 1, \ chip ## _ADMAIF_RX ## id ## _FIFO_CTRL_REG_DEFAULT, \ + chip ## _ADMAIF_RX_BASE, \ + chip ## _ADMAIF_CIF_REG_DEFAULT) + +#define ADMAIF_TX_REG_DEFAULTS (id, chip) \ + TX_REG_DEFAULTS((id) - 1, \ chip ## _ADMAIF_TX ## id ## _FIFO_CTRL_REG_DEFAULT, \ chip ## _ADMAIF_TX_BASE, \ - chip ## _ADMAIF_RX_BASE, \ chip ## _ADMAIF_CIF_REG_DEFAULT)static const struct reg_default tegra186_admaif_reg_defaults[] = { - {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA186_ADMAIF_GLOBAL_BASE ),0x00000003 }, -ADMAIF_REG_DEFAULTS (1 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (2 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (3 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (4 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (5 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (6 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (7 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (8 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (9 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (10 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (11 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (12 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (13 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (14 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (15 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (16 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (17 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (18 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (19 ,TEGRA186 ), -ADMAIF_REG_DEFAULTS (20 ,TEGRA186 ) +ADMAIF_RX_REG_DEFAULTS (1 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (2 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (3 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (4 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (5 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (6 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (7 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (8 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (9 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (10 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (11 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (12 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (13 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (14 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (15 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (16 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (17 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (18 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (19 ,TEGRA186 ), +ADMAIF_RX_REG_DEFAULTS (20 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (1 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (2 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (3 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (4 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (5 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (6 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (7 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (8 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (9 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (10 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (11 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (12 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (13 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (14 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (15 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (16 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (17 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (18 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (19 ,TEGRA186 ), +ADMAIF_TX_REG_DEFAULTS (20 ,TEGRA186 ), + {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA186_ADMAIF_GLOBAL_BASE ),0x00000003 } };static const struct reg_default tegra210_admaif_reg_defaults[] = { - {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA210_ADMAIF_GLOBAL_BASE ),0x00000003 }, -ADMAIF_REG_DEFAULTS (1 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (2 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (3 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (4 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (5 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (6 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (7 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (8 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (9 ,TEGRA210 ), -ADMAIF_REG_DEFAULTS (10 ,TEGRA210 ) +ADMAIF_RX_REG_DEFAULTS (1 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (2 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (3 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (4 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (5 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (6 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (7 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (8 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (9 ,TEGRA210 ), +ADMAIF_RX_REG_DEFAULTS (10 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (1 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (2 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (3 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (4 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (5 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (6 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (7 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (8 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (9 ,TEGRA210 ), +ADMAIF_TX_REG_DEFAULTS (10 ,TEGRA210 ), + {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA210_ADMAIF_GLOBAL_BASE ),0x00000003 } };static const struct reg_default tegra264_admaif_reg_defaults[] = { - {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA264_ADMAIF_GLOBAL_BASE ),0x00000003 }, -ADMAIF_REG_DEFAULTS (1 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (2 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (3 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (4 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (5 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (6 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (7 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (8 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (9 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (10 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (11 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (12 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (13 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (14 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (15 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (16 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (17 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (18 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (19 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (20 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (21 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (22 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (23 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (24 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (25 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (26 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (27 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (28 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (29 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (30 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (31 ,TEGRA264 ), -ADMAIF_REG_DEFAULTS (32 ,TEGRA264 ) +ADMAIF_RX_REG_DEFAULTS (1 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (2 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (3 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (4 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (5 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (6 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (7 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (8 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (9 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (10 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (11 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (12 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (13 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (14 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (15 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (16 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (17 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (18 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (19 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (20 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (21 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (22 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (23 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (24 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (25 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (26 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (27 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (28 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (29 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (30 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (31 ,TEGRA264 ), +ADMAIF_RX_REG_DEFAULTS (32 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (1 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (2 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (3 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (4 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (5 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (6 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (7 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (8 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (9 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (10 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (11 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (12 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (13 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (14 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (15 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (16 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (17 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (18 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (19 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (20 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (21 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (22 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (23 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (24 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (25 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (26 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (27 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (28 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (29 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (30 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (31 ,TEGRA264 ), +ADMAIF_TX_REG_DEFAULTS (32 ,TEGRA264 ), + {(TEGRA_ADMAIF_GLOBAL_CG_0 +TEGRA264_ADMAIF_GLOBAL_BASE ),0x00000003 } };static bool tegra_admaif_wr_reg (struct device *dev,unsigned int reg)
Signature · 1 line
2.43.0
Jon Hunter
maintainerPATCH 4/4 ASoC: tegra: Sort MBDRC register defaults
In reply to Jon HunterCommit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted reg_defaults array") exposed an issue with the Tegra MBDRC driver and now the following warning is observed:
tegra210-ope 2908000.processing-engine: Driver needs fixing: Unsorted
reg_defaults, sorting the copy
This warning occurs because register defaults in the structure tegra210_mbdrc_reg_defaults are not specified in ascending order which is required by regmap. Fix this by sorting the register defaults according to their address. Note that in order to do this it is necessary to replace the macro MBDRC_FILTER_REG_DEFAULTS with a per register macro MBDRC_FILTER_PARAM_REG_DEFAULTS.
--- sound/soc/tegra/tegra210_mbdrc.c | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-)
sound/soc/tegra/tegra210_mbdrc.c +21 -21
@@ -20,33 +20,33 @@#define MBDRC_FILTER_REG (reg, id) \ ((reg) + ((id) * TEGRA210_MBDRC_FILTER_PARAM_STRIDE)) -#define MBDRC_FILTER_REG_DEFAULTS (id) \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_IIR_CFG, id), 0x00000005}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_IN_ATTACK, id), 0x3e48590c}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_IN_RELEASE, id), 0x08414e9f}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_FAST_ATTACK, id), 0x7fffffff}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_IN_THRESHOLD, id), 0x06145082}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_OUT_THRESHOLD, id), 0x060d379b}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_RATIO_1ST, id), 0x0000a000}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_RATIO_2ND, id), 0x00002000}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_RATIO_3RD, id), 0x00000b33}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_RATIO_4TH, id), 0x00000800}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_RATIO_5TH, id), 0x0000019a}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_MAKEUP_GAIN, id), 0x00000002}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_INIT_GAIN, id), 0x00066666}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_GAIN_ATTACK, id), 0x00d9ba0e}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_GAIN_RELEASE, id), 0x3e48590c}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_FAST_RELEASE, id), 0x7ffff26a}, \ - { MBDRC_FILTER_REG(TEGRA210_MBDRC_CFG_RAM_CTRL, id), 0x4000} +#define MBDRC_FILTER_PARAM_REG_DEFAULTS (reg, val) \ + { MBDRC_FILTER_REG(reg, 0), val}, \ + { MBDRC_FILTER_REG(reg, 1), val}, \ + { MBDRC_FILTER_REG(reg, 2), val}static const struct reg_default tegra210_mbdrc_reg_defaults[] = { {TEGRA210_MBDRC_CFG ,0x0030de51 }, {TEGRA210_MBDRC_CHANNEL_MASK ,0x00000003 }, {TEGRA210_MBDRC_FAST_FACTOR ,0x30000800 }, -MBDRC_FILTER_REG_DEFAULTS (0 ), -MBDRC_FILTER_REG_DEFAULTS (1 ), -MBDRC_FILTER_REG_DEFAULTS (2 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_IIR_CFG ,0x00000005 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_IN_ATTACK ,0x3e48590c ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_IN_RELEASE ,0x08414e9f ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_FAST_ATTACK ,0x7fffffff ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_IN_THRESHOLD ,0x06145082 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_OUT_THRESHOLD ,0x060d379b ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_RATIO_1ST ,0x0000a000 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_RATIO_2ND ,0x00002000 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_RATIO_3RD ,0x00000b33 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_RATIO_4TH ,0x00000800 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_RATIO_5TH ,0x0000019a ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_MAKEUP_GAIN ,0x00000002 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_INIT_GAIN ,0x00066666 ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_GAIN_ATTACK ,0x00d9ba0e ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_GAIN_RELEASE ,0x3e48590c ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_FAST_RELEASE ,0x7ffff26a ), +MBDRC_FILTER_PARAM_REG_DEFAULTS (TEGRA210_MBDRC_CFG_RAM_CTRL ,0x4000 ), };/* Default MBDRC parameters */
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 10 lines · Jon Hunter
ASoC: tegra: Fixes for issues exposed in Linux v7.2
Commit
4b05ccb17f92("regcache: Sort the local copy of an unsortedreg_defaultsarray") exposed an issue in the Tegra I2S and MIXER drivers and after this commit was added, this underlying issue now causes audio tests that exercise the I2S and MIXER drivers to fail. This series fixes the issue in the I2S and MIXER drivers and also fixes warning observed with the ADMAIF and MBDRC drivers that have unsortedreg_defaults.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/4] ASoC: tegra: Fix the I2S enable default value
https://git.kernel.org/broonie/sound/c/53dd1c1de851 [2/4] ASoC: tegra: Fix the MIXER enable default value https://git.kernel.org/broonie/sound/c/5442b8093a2f [3/4] ASoC: tegra: Sort ADMAIF register defaults https://git.kernel.org/broonie/sound/c/18d48bfd1bc1 [4/4] ASoC: tegra: Sort MBDRC register defaults https://git.kernel.org/broonie/sound/c/abb5bed6f48d
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