summaryrefslogtreecommitdiffstats
path: root/sound/soc/sti/uniperif_reader.c
diff options
context:
space:
mode:
authorArnaud Pouliquen <arnaud.pouliquen@st.com>2016-09-13 09:58:23 +0200
committerMark Brown <broonie@kernel.org>2016-09-14 19:15:05 +0200
commit5a4326d1c21bc9aa958d5e621e06cd1b13e50711 (patch)
treefb8d1e6bb0d0894a5b183ff6be775f45fdc25e6e /sound/soc/sti/uniperif_reader.c
parentLinux 4.8-rc1 (diff)
downloadlinux-5a4326d1c21bc9aa958d5e621e06cd1b13e50711.tar.xz
linux-5a4326d1c21bc9aa958d5e621e06cd1b13e50711.zip
ASoC: sti: suppress inappropriate DT fields
Update to suppress some DT nodes that can be handled in driver using compatible string. "dai-name", "st,version"and "st,mode" are suppressed "st,tdm-mode" is added to handle TDM mode. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sti/uniperif_reader.c')
-rw-r--r--sound/soc/sti/uniperif_reader.c46
1 files changed, 3 insertions, 43 deletions
diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c
index eb74a328c928..0e1c3ee56675 100644
--- a/sound/soc/sti/uniperif_reader.c
+++ b/sound/soc/sti/uniperif_reader.c
@@ -13,6 +13,7 @@
#include "uniperif.h"
+#define UNIPERIF_READER_I2S_IN 0 /* reader id connected to I2S/TDM TX bus */
/*
* Note: snd_pcm_hardware is linked to DMA controller but is declared here to
* integrate unireader capability in term of rate and supported channels
@@ -195,7 +196,7 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
}
/* Calculate transfer size (in fifo cells and bytes) for frame count */
- if (reader->info->type == SND_ST_UNIPERIF_TYPE_TDM) {
+ if (reader->type == SND_ST_UNIPERIF_TYPE_TDM) {
/* transfer size = unip frame size (in 32 bits FIFO cell) */
transfer_size =
sti_uniperiph_get_user_frame_size(runtime) / 4;
@@ -280,7 +281,7 @@ static int uni_reader_prepare(struct snd_pcm_substream *substream,
SET_UNIPERIF_ITM_BSET_MEM_BLK_READ(reader);
/* Enable underflow recovery interrupts */
- if (reader->info->underflow_enabled) {
+ if (reader->underflow_enabled) {
SET_UNIPERIF_ITM_BSET_UNDERFLOW_REC_DONE(reader);
SET_UNIPERIF_ITM_BSET_UNDERFLOW_REC_FAILED(reader);
}
@@ -394,41 +395,6 @@ static void uni_reader_shutdown(struct snd_pcm_substream *substream,
}
}
-static int uni_reader_parse_dt(struct platform_device *pdev,
- struct uniperif *reader)
-{
- struct uniperif_info *info;
- struct device_node *node = pdev->dev.of_node;
- const char *mode;
-
- /* Allocate memory for the info structure */
- info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
- if (!info)
- return -ENOMEM;
-
- if (of_property_read_u32(node, "st,version", &reader->ver) ||
- reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
- dev_err(&pdev->dev, "Unknown uniperipheral version ");
- return -EINVAL;
- }
-
- /* Read the device mode property */
- if (of_property_read_string(node, "st,mode", &mode)) {
- dev_err(&pdev->dev, "uniperipheral mode not defined");
- return -EINVAL;
- }
-
- if (strcasecmp(mode, "tdm") == 0)
- info->type = SND_ST_UNIPERIF_TYPE_TDM;
- else
- info->type = SND_ST_UNIPERIF_TYPE_PCM;
-
- /* Save the info structure */
- reader->info = info;
-
- return 0;
-}
-
static const struct snd_soc_dai_ops uni_reader_dai_ops = {
.startup = uni_reader_startup,
.shutdown = uni_reader_shutdown,
@@ -448,12 +414,6 @@ int uni_reader_init(struct platform_device *pdev,
reader->state = UNIPERIF_STATE_STOPPED;
reader->dai_ops = &uni_reader_dai_ops;
- ret = uni_reader_parse_dt(pdev, reader);
- if (ret < 0) {
- dev_err(reader->dev, "Failed to parse DeviceTree");
- return ret;
- }
-
if (UNIPERIF_TYPE_IS_TDM(reader))
reader->hw = &uni_tdm_hw;
else