summaryrefslogtreecommitdiff
path: root/sound/soc/sti/uniperif_reader.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 22:14:28 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 22:14:28 +0300
commitce38207f161513ee3d2bd3860489f07ebe65bc78 (patch)
treeb3ad9e8a5e087b91d9f30a314c55df5fa70c142e /sound/soc/sti/uniperif_reader.c
parenta9042defa29a01cc538b742eab047848e9b5ae14 (diff)
parent995c6a7fd9b9212abdf01160f6ce3193176be503 (diff)
downloadlinux-ce38207f161513ee3d2bd3860489f07ebe65bc78.tar.xz
Merge tag 'sound-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "No dramatic changes are found in this development cycle, but as usual, many commits are applied in a wide range of drivers. Most of big changes are in ASoC, where a few bits of framework work and quite a lot of cleanups and improvements to existing code have been done. The rest are usual stuff, a few HD-audio and USB-audio quirks and fixes, as well as the drop of kthread usages in the whole subsystem. Below are some highlights: ASoC: - support for stereo DAPM controls - some initial work on the of-graph sound card - regmap conversions of the remaining AC'97 drivers - a new version of the topology ABI; this should be backward compatible - updates / cleanups of rsnd, sunxi, sti, nau8825, samsung, arizona, Intel skylake, atom-sst - new drivers for Cirrus Logic CS42L42, Qualcomm MSM8916-WCD, and Realtek RT5665 USB-audio: - yet another race fix at disconnection - tolerated packet size calculation for some Android devices - quirks for Axe-Fx II, QuickCam, TEAC 501/503 HD-audio: - improvement of Dell pin fixup mapping - quirks for HP Z1 Gen3, Alienware 15 R2 2016 and ALC622 headset mic Misc: - replace all kthread usages with simple works" * tag 'sound-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (296 commits) ALSA: hiface: Fix M2Tech hiFace driver sampling rate change ALSA: usb-audio: Eliminate noise at the start of DSD playback. ALSA: usb-audio: Add native DSD support for TEAC 501/503 DAC ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path ASoC: topology: avoid uninitialized kcontrol_type ALSA: usb-audio: Add QuickCam Communicate Deluxe/S7500 to volume_control_quirks ALSA: usb-audio: add implicit fb quirk for Axe-Fx II ASoC: zte: spdif: correct ZX_SPDIF_CLK_RAT define ASoC: zte: spdif and i2s drivers are not zx296702 specific ASoC: rsnd: setup BRGCKR/BRRA/BRRB when starting ASoC: rsnd: enable/disable ADG when suspend/resume timing ASoC: rsnd: tidyup ssi->usrcnt counter check in hw_params ALSA: cs46xx: add a new line ASoC: Intel: update bxt_da7219_max98357a to support quad ch dmic capture ASoC: nau8825: disable sinc filter for high THD of ADC ALSA: usb-audio: more tolerant packetsize ALSA: usb-audio: avoid setting of sample rate multiple times on bus ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiO ALSA: hda: when comparing pin configurations, ignore assoc in addition to seq ...
Diffstat (limited to 'sound/soc/sti/uniperif_reader.c')
-rw-r--r--sound/soc/sti/uniperif_reader.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c
index 0e1c3ee56675..5992c6ab3833 100644
--- a/sound/soc/sti/uniperif_reader.c
+++ b/sound/soc/sti/uniperif_reader.c
@@ -5,10 +5,6 @@
* License terms: GNU General Public License (GPL), version 2
*/
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-
#include <sound/soc.h>
#include "uniperif.h"
@@ -52,7 +48,7 @@ static irqreturn_t uni_reader_irq_handler(int irq, void *dev_id)
if (reader->state == UNIPERIF_STATE_STOPPED) {
/* Unexpected IRQ: do nothing */
- dev_warn(reader->dev, "unexpected IRQ ");
+ dev_warn(reader->dev, "unexpected IRQ\n");
return IRQ_HANDLED;
}
@@ -62,7 +58,7 @@ static irqreturn_t uni_reader_irq_handler(int irq, void *dev_id)
/* Check for fifo overflow error */
if (unlikely(status & UNIPERIF_ITS_FIFO_ERROR_MASK(reader))) {
- dev_err(reader->dev, "FIFO error detected");
+ dev_err(reader->dev, "FIFO error detected\n");
snd_pcm_stream_lock(reader->substream);
snd_pcm_stop(reader->substream, SNDRV_PCM_STATE_XRUN);
@@ -105,7 +101,7 @@ static int uni_reader_prepare_pcm(struct snd_pcm_runtime *runtime,
SET_UNIPERIF_I2S_FMT_DATA_SIZE_16(reader);
break;
default:
- dev_err(reader->dev, "subframe format not supported");
+ dev_err(reader->dev, "subframe format not supported\n");
return -EINVAL;
}
@@ -125,14 +121,14 @@ static int uni_reader_prepare_pcm(struct snd_pcm_runtime *runtime,
break;
default:
- dev_err(reader->dev, "format not supported");
+ dev_err(reader->dev, "format not supported\n");
return -EINVAL;
}
/* Number of channels must be even */
if ((runtime->channels % 2) || (runtime->channels < 2) ||
(runtime->channels > 10)) {
- dev_err(reader->dev, "%s: invalid nb of channels", __func__);
+ dev_err(reader->dev, "%s: invalid nb of channels\n", __func__);
return -EINVAL;
}
@@ -186,11 +182,10 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
struct uniperif *reader = priv->dai_data.uni;
struct snd_pcm_runtime *runtime = substream->runtime;
int transfer_size, trigger_limit, ret;
- int count = 10;
/* The reader should be stopped */
if (reader->state != UNIPERIF_STATE_STOPPED) {
- dev_err(reader->dev, "%s: invalid reader state %d", __func__,
+ dev_err(reader->dev, "%s: invalid reader state %d\n", __func__,
reader->state);
return -EINVAL;
}
@@ -219,7 +214,8 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
if ((!trigger_limit % 2) ||
(trigger_limit != 1 && transfer_size % 2) ||
(trigger_limit > UNIPERIF_CONFIG_DMA_TRIG_LIMIT_MASK(reader))) {
- dev_err(reader->dev, "invalid trigger limit %d", trigger_limit);
+ dev_err(reader->dev, "invalid trigger limit %d\n",
+ trigger_limit);
return -EINVAL;
}
@@ -246,7 +242,7 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
SET_UNIPERIF_I2S_FMT_PADDING_SONY_MODE(reader);
break;
default:
- dev_err(reader->dev, "format not supported");
+ dev_err(reader->dev, "format not supported\n");
return -EINVAL;
}
@@ -287,25 +283,14 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
}
/* Reset uniperipheral reader */
- SET_UNIPERIF_SOFT_RST_SOFT_RST(reader);
-
- while (GET_UNIPERIF_SOFT_RST_SOFT_RST(reader)) {
- udelay(5);
- count--;
- }
- if (!count) {
- dev_err(reader->dev, "Failed to reset uniperif");
- return -EIO;
- }
-
- return 0;
+ return sti_uniperiph_reset(reader);
}
static int uni_reader_start(struct uniperif *reader)
{
/* The reader should be stopped */
if (reader->state != UNIPERIF_STATE_STOPPED) {
- dev_err(reader->dev, "%s: invalid reader state", __func__);
+ dev_err(reader->dev, "%s: invalid reader state\n", __func__);
return -EINVAL;
}
@@ -325,7 +310,7 @@ static int uni_reader_stop(struct uniperif *reader)
{
/* The reader should not be in stopped state */
if (reader->state == UNIPERIF_STATE_STOPPED) {
- dev_err(reader->dev, "%s: invalid reader state", __func__);
+ dev_err(reader->dev, "%s: invalid reader state\n", __func__);
return -EINVAL;
}
@@ -423,7 +408,7 @@ int uni_reader_init(struct platform_device *pdev,
uni_reader_irq_handler, IRQF_SHARED,
dev_name(&pdev->dev), reader);
if (ret < 0) {
- dev_err(&pdev->dev, "Failed to request IRQ");
+ dev_err(&pdev->dev, "Failed to request IRQ\n");
return -EBUSY;
}