diff options
| author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-27 04:24:21 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-06-01 06:55:07 -0400 |
| commit | d8ced4793f3f114fa82fb423b71c2899caf8b7b0 (patch) | |
| tree | c6d25a84fa7cf6587448f4bf43bcbf0e4e24214e | |
| parent | 8dd51e23a1ef3b5f22eeff4827260b75bafba620 (diff) | |
ASoC: fsl-ssi: remove unnecessary spinlock
The baudclock_locked variable is only used in functions which
are serialized anyway from the core. No need to have a lock
around the variable, so remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
| -rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 930095b1b72a..b3033d9108b2 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
| @@ -163,7 +163,6 @@ struct fsl_ssi_private { | |||
| 163 | bool baudclk_locked; | 163 | bool baudclk_locked; |
| 164 | bool use_dual_fifo; | 164 | bool use_dual_fifo; |
| 165 | u8 i2s_mode; | 165 | u8 i2s_mode; |
| 166 | spinlock_t baudclk_lock; | ||
| 167 | struct clk *baudclk; | 166 | struct clk *baudclk; |
| 168 | struct clk *clk; | 167 | struct clk *clk; |
| 169 | unsigned int bitclk_freq; | 168 | unsigned int bitclk_freq; |
| @@ -495,13 +494,9 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
| 495 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 494 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 496 | struct fsl_ssi_private *ssi_private = | 495 | struct fsl_ssi_private *ssi_private = |
| 497 | snd_soc_dai_get_drvdata(rtd->cpu_dai); | 496 | snd_soc_dai_get_drvdata(rtd->cpu_dai); |
| 498 | unsigned long flags; | ||
| 499 | 497 | ||
| 500 | if (!dai->active && !fsl_ssi_is_ac97(ssi_private)) { | 498 | if (!dai->active && !fsl_ssi_is_ac97(ssi_private)) |
| 501 | spin_lock_irqsave(&ssi_private->baudclk_lock, flags); | ||
| 502 | ssi_private->baudclk_locked = false; | 499 | ssi_private->baudclk_locked = false; |
| 503 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, flags); | ||
| 504 | } | ||
| 505 | 500 | ||
| 506 | /* When using dual fifo mode, it is safer to ensure an even period | 501 | /* When using dual fifo mode, it is safer to ensure an even period |
| 507 | * size. If appearing to an odd number while DMA always starts its | 502 | * size. If appearing to an odd number while DMA always starts its |
| @@ -532,7 +527,7 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream, | |||
| 532 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 527 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
| 533 | int synchronous = ssi_private->cpu_dai_drv.symmetric_rates, ret; | 528 | int synchronous = ssi_private->cpu_dai_drv.symmetric_rates, ret; |
| 534 | u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i; | 529 | u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i; |
| 535 | unsigned long flags, clkrate, baudrate, tmprate; | 530 | unsigned long clkrate, baudrate, tmprate; |
| 536 | u64 sub, savesub = 100000; | 531 | u64 sub, savesub = 100000; |
| 537 | unsigned int freq; | 532 | unsigned int freq; |
| 538 | 533 | ||
| @@ -603,18 +598,14 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream, | |||
| 603 | else | 598 | else |
| 604 | write_ssi_mask(&ssi->srccr, mask, stccr); | 599 | write_ssi_mask(&ssi->srccr, mask, stccr); |
| 605 | 600 | ||
| 606 | spin_lock_irqsave(&ssi_private->baudclk_lock, flags); | ||
| 607 | if (!ssi_private->baudclk_locked) { | 601 | if (!ssi_private->baudclk_locked) { |
| 608 | ret = clk_set_rate(ssi_private->baudclk, baudrate); | 602 | ret = clk_set_rate(ssi_private->baudclk, baudrate); |
| 609 | if (ret) { | 603 | if (ret) { |
| 610 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, | ||
| 611 | flags); | ||
| 612 | dev_err(cpu_dai->dev, "failed to set baudclk rate\n"); | 604 | dev_err(cpu_dai->dev, "failed to set baudclk rate\n"); |
| 613 | return -EINVAL; | 605 | return -EINVAL; |
| 614 | } | 606 | } |
| 615 | ssi_private->baudclk_locked = true; | 607 | ssi_private->baudclk_locked = true; |
| 616 | } | 608 | } |
| 617 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, flags); | ||
| 618 | 609 | ||
| 619 | return 0; | 610 | return 0; |
| 620 | } | 611 | } |
| @@ -899,7 +890,6 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 899 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 890 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 900 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); | 891 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
| 901 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 892 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
| 902 | unsigned long flags; | ||
| 903 | 893 | ||
| 904 | switch (cmd) { | 894 | switch (cmd) { |
| 905 | case SNDRV_PCM_TRIGGER_START: | 895 | case SNDRV_PCM_TRIGGER_START: |
| @@ -920,11 +910,9 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 920 | fsl_ssi_rx_config(ssi_private, false); | 910 | fsl_ssi_rx_config(ssi_private, false); |
| 921 | 911 | ||
| 922 | if (!fsl_ssi_is_ac97(ssi_private) && (read_ssi(&ssi->scr) & | 912 | if (!fsl_ssi_is_ac97(ssi_private) && (read_ssi(&ssi->scr) & |
| 923 | (CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0) { | 913 | (CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0) |
| 924 | spin_lock_irqsave(&ssi_private->baudclk_lock, flags); | ||
| 925 | ssi_private->baudclk_locked = false; | 914 | ssi_private->baudclk_locked = false; |
| 926 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, flags); | 915 | |
| 927 | } | ||
| 928 | break; | 916 | break; |
| 929 | 917 | ||
| 930 | default: | 918 | default: |
| @@ -1257,7 +1245,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
| 1257 | ssi_private->fifo_depth = 8; | 1245 | ssi_private->fifo_depth = 8; |
| 1258 | 1246 | ||
| 1259 | ssi_private->baudclk_locked = false; | 1247 | ssi_private->baudclk_locked = false; |
| 1260 | spin_lock_init(&ssi_private->baudclk_lock); | ||
| 1261 | 1248 | ||
| 1262 | dev_set_drvdata(&pdev->dev, ssi_private); | 1249 | dev_set_drvdata(&pdev->dev, ssi_private); |
| 1263 | 1250 | ||
