[PATCH 0/5] ASoC: atmel: one fix and few cleanups
Hi,
The series adds one fix for mchp-spdifrx and few cleanups for mchp-spdifrx and mchp-spdifrx drivers.
Thank you, Claudiu Beznea
Claudiu Beznea (5): ASoC: mchp-spdifrx: disable end of block interrupt on failures ASoC: mchp-spdifrx: use single tag indent for structure ASoC: mchp-spdiftx: remove references to mchp_i2s_caps ASoC: mchp-spdiftx: return directly ret ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE()
sound/soc/atmel/mchp-spdifrx.c | 19 +++++++++++-------- sound/soc/atmel/mchp-spdiftx.c | 21 +++++---------------- 2 files changed, 16 insertions(+), 24 deletions(-)
Disable end of block interrupt in case of wait for completion timeout or errors to undo previously enable operation (done in mchp_spdifrx_isr_blockend_en()). Otherwise we can end up with an unbalanced reference counter for this interrupt.
Fixes: ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX") Signed-off-by: Claudiu Beznea claudiu.beznea@microchip.com --- sound/soc/atmel/mchp-spdifrx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 0d37b78b94a0..b6a753893d90 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -288,15 +288,17 @@ static void mchp_spdifrx_isr_blockend_en(struct mchp_spdifrx_dev *dev) spin_unlock_irqrestore(&dev->blockend_lock, flags); }
-/* called from atomic context only */ +/* called from atomic/non-atomic context */ static void mchp_spdifrx_isr_blockend_dis(struct mchp_spdifrx_dev *dev) { - spin_lock(&dev->blockend_lock); + unsigned int flags; + + spin_lock_irqsave(&dev->blockend_lock); dev->blockend_refcount--; /* don't enable BLOCKEND interrupt if it's already enabled */ if (dev->blockend_refcount == 0) regmap_write(dev->regmap, SPDIFRX_IDR, SPDIFRX_IR_BLOCKEND); - spin_unlock(&dev->blockend_lock); + spin_unlock_irqrestore(&dev->blockend_lock); }
static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id) @@ -575,6 +577,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev, if (ret <= 0) { dev_dbg(dev->dev, "user data for channel %d timeout\n", channel); + mchp_spdifrx_isr_blockend_dis(dev); return ret; }
Use single tab indentation for mchp_spdifrx_mixer_control structure.
Signed-off-by: Claudiu Beznea claudiu.beznea@microchip.com --- sound/soc/atmel/mchp-spdifrx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index b6a753893d90..fcc5ca865d81 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -221,11 +221,11 @@ struct mchp_spdifrx_user_data { };
struct mchp_spdifrx_mixer_control { - struct mchp_spdifrx_ch_stat ch_stat[SPDIFRX_CHANNELS]; - struct mchp_spdifrx_user_data user_data[SPDIFRX_CHANNELS]; - bool ulock; - bool badf; - bool signal; + struct mchp_spdifrx_ch_stat ch_stat[SPDIFRX_CHANNELS]; + struct mchp_spdifrx_user_data user_data[SPDIFRX_CHANNELS]; + bool ulock; + bool badf; + bool signal; };
struct mchp_spdifrx_dev {
Remove references to struct mchp_i2s_caps as they are not used.
Signed-off-by: Claudiu Beznea claudiu.beznea@microchip.com --- sound/soc/atmel/mchp-spdiftx.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index 78d5bcf0819a..20e77b374f7e 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -196,7 +196,6 @@ struct mchp_spdiftx_dev { struct clk *pclk; struct clk *gclk; unsigned int fmt; - const struct mchp_i2s_caps *caps; int gclk_enabled:1; };
@@ -768,7 +767,6 @@ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids); static int mchp_spdiftx_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct mchp_spdiftx_dev *dev; struct resource *mem; struct regmap *regmap; @@ -782,11 +780,6 @@ static int mchp_spdiftx_probe(struct platform_device *pdev) if (!dev) return -ENOMEM;
- /* Get hardware capabilities. */ - match = of_match_node(mchp_spdiftx_dt_ids, np); - if (match) - dev->caps = match->data; - /* Map I/O registers. */ base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); if (IS_ERR(base))
Avoid having patterns like:
int ret;
// ... ret = 0; // ...
ret = call_function(); if (ret) return ret;
return 0;
and return directly ret for all cases.
Signed-off-by: Claudiu Beznea claudiu.beznea@microchip.com --- sound/soc/atmel/mchp-spdiftx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index 20e77b374f7e..74729ec8423b 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -340,12 +340,10 @@ static int mchp_spdiftx_trigger(struct snd_pcm_substream *substream, int cmd,
ret = regmap_write(dev->regmap, SPDIFTX_MR, mr); spin_unlock(&ctrl->lock); - if (ret) { + if (ret) dev_err(dev->dev, "unable to disable TX: %d\n", ret); - return ret; - }
- return 0; + return ret; }
static int mchp_spdiftx_hw_params(struct snd_pcm_substream *substream, @@ -841,12 +839,10 @@ static int mchp_spdiftx_probe(struct platform_device *pdev) err = devm_snd_soc_register_component(&pdev->dev, &mchp_spdiftx_component, &mchp_spdiftx_dai, 1); - if (err) { + if (err) dev_err(&pdev->dev, "failed to register component: %d\n", err); - return err; - }
- return 0; + return err; }
static struct platform_driver mchp_spdiftx_driver = {
Add blank line after MODULE_DEVICE_TABLE() and remove the one before it.
Signed-off-by: Claudiu Beznea claudiu.beznea@microchip.com --- sound/soc/atmel/mchp-spdiftx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index 74729ec8423b..e8f4ff1b7c7c 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -760,8 +760,8 @@ static const struct of_device_id mchp_spdiftx_dt_ids[] = { }, { /* sentinel */ } }; - MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids); + static int mchp_spdiftx_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node;
On Mon, 25 Jul 2022 13:11:25 +0300, Claudiu Beznea wrote:
The series adds one fix for mchp-spdifrx and few cleanups for mchp-spdifrx and mchp-spdifrx drivers.
Thank you, Claudiu Beznea
Claudiu Beznea (5): ASoC: mchp-spdifrx: disable end of block interrupt on failures ASoC: mchp-spdifrx: use single tag indent for structure ASoC: mchp-spdiftx: remove references to mchp_i2s_caps ASoC: mchp-spdiftx: return directly ret ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE()
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures (no commit info) [2/5] ASoC: mchp-spdifrx: use single tag indent for structure (no commit info) [3/5] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps (no commit info) [4/5] ASoC: mchp-spdiftx: return directly ret commit: d346a4ad305bf3f99e5824e0c132fac7e0b53657 [5/5] ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE() commit: 96f6017d652a78e06e34e535526826a22aa69dfa
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
participants (2)
-
Claudiu Beznea
-
Mark Brown