linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: atmel: one fix and few cleanups
@ 2022-07-25 10:11 Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures Claudiu Beznea
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
@ 2022-07-25 10:11 ` Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 2/5] ASoC: mchp-spdifrx: use single tag indent for structure Claudiu Beznea
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] ASoC: mchp-spdifrx: use single tag indent for structure
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures Claudiu Beznea
@ 2022-07-25 10:11 ` Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 3/5] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps Claudiu Beznea
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 2/5] ASoC: mchp-spdifrx: use single tag indent for structure Claudiu Beznea
@ 2022-07-25 10:11 ` Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 4/5] ASoC: mchp-spdiftx: return directly ret Claudiu Beznea
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] ASoC: mchp-spdiftx: return directly ret
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
                   ` (2 preceding siblings ...)
  2022-07-25 10:11 ` [PATCH 3/5] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps Claudiu Beznea
@ 2022-07-25 10:11 ` Claudiu Beznea
  2022-07-25 10:11 ` [PATCH 5/5] ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE() Claudiu Beznea
  2022-07-26 13:07 ` [PATCH 0/5] ASoC: atmel: one fix and few cleanups Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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 = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE()
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
                   ` (3 preceding siblings ...)
  2022-07-25 10:11 ` [PATCH 4/5] ASoC: mchp-spdiftx: return directly ret Claudiu Beznea
@ 2022-07-25 10:11 ` Claudiu Beznea
  2022-07-26 13:07 ` [PATCH 0/5] ASoC: atmel: one fix and few cleanups Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2022-07-25 10:11 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea

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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] ASoC: atmel: one fix and few cleanups
  2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
                   ` (4 preceding siblings ...)
  2022-07-25 10:11 ` [PATCH 5/5] ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE() Claudiu Beznea
@ 2022-07-26 13:07 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2022-07-26 13:07 UTC (permalink / raw)
  To: tiwai, lgirdwood, alexandre.belloni, perex, nicolas.ferre,
	Claudiu Beznea
  Cc: alsa-devel, linux-kernel, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-26 13:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 10:11 [PATCH 0/5] ASoC: atmel: one fix and few cleanups Claudiu Beznea
2022-07-25 10:11 ` [PATCH 1/5] ASoC: mchp-spdifrx: disable end of block interrupt on failures Claudiu Beznea
2022-07-25 10:11 ` [PATCH 2/5] ASoC: mchp-spdifrx: use single tag indent for structure Claudiu Beznea
2022-07-25 10:11 ` [PATCH 3/5] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps Claudiu Beznea
2022-07-25 10:11 ` [PATCH 4/5] ASoC: mchp-spdiftx: return directly ret Claudiu Beznea
2022-07-25 10:11 ` [PATCH 5/5] ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE() Claudiu Beznea
2022-07-26 13:07 ` [PATCH 0/5] ASoC: atmel: one fix and few cleanups 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).