* [PATCH 0/1] ASoC: sti: select player for I2S/TDM TX bus
@ 2016-04-14 13:29 Moise Gergaud
2016-04-14 13:29 ` [PATCH 1/1] " Moise Gergaud
2016-04-14 13:31 ` [PATCH 0/1] " Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Moise Gergaud @ 2016-04-14 13:29 UTC (permalink / raw)
To: arnaud.pouliquen, alsa-devel, broonie, lgirdwood, tiwai
I forgot to include this patch into "[PATCH v2] ASoC: sti: unip tdm mode" serie
that has been applied.
This patch is the same than the one previously sent in
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-March/106391.html
Moise Gergaud (1):
ASoC: sti: select player for I2S/TDM TX bus
sound/soc/sti/uniperif.h | 1 +
sound/soc/sti/uniperif_player.c | 42 +++++++++++++++++++++++++++--------------
2 files changed, 29 insertions(+), 14 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] ASoC: sti: select player for I2S/TDM TX bus
2016-04-14 13:29 [PATCH 0/1] ASoC: sti: select player for I2S/TDM TX bus Moise Gergaud
@ 2016-04-14 13:29 ` Moise Gergaud
2016-04-14 13:31 ` [PATCH 0/1] " Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Moise Gergaud @ 2016-04-14 13:29 UTC (permalink / raw)
To: arnaud.pouliquen, alsa-devel, broonie, lgirdwood, tiwai
By default, player#0 is connected to I2S/TDM TX bus.
This patch connects player#1 to I2S/TDM TX bus.
Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
---
sound/soc/sti/uniperif.h | 1 +
sound/soc/sti/uniperif_player.c | 42 +++++++++++++++++++++++++++--------------
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
index d0e2446..eb9933c 100644
--- a/sound/soc/sti/uniperif.h
+++ b/sound/soc/sti/uniperif.h
@@ -1302,6 +1302,7 @@ struct uniperif {
struct device *dev;
int ver; /* IP version, used by register access macros */
struct regmap_field *clk_sel;
+ struct regmap_field *valid_sel;
/* capabilities */
const struct snd_pcm_hardware *hw;
diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
index ff2d735..ee1c7c2 100644
--- a/sound/soc/sti/uniperif_player.c
+++ b/sound/soc/sti/uniperif_player.c
@@ -21,7 +21,6 @@
/* sys config registers definitions */
#define SYS_CFG_AUDIO_GLUE 0xA4
-#define SYS_CFG_AUDI0_GLUE_PCM_CLKX 8
/*
* Driver specific types.
@@ -29,6 +28,7 @@
#define UNIPERIF_PLAYER_CLK_ADJ_MIN -999999
#define UNIPERIF_PLAYER_CLK_ADJ_MAX 1000000
+#define UNIPERIF_PLAYER_I2S_OUT 1 /* player id connected to I2S/TDM TX bus */
/*
* Note: snd_pcm_hardware is linked to DMA controller but is declared here to
@@ -1013,27 +1013,30 @@ static void uni_player_shutdown(struct snd_pcm_substream *substream,
player->substream = NULL;
}
-static int uni_player_parse_dt_clk_glue(struct platform_device *pdev,
- struct uniperif *player)
+static int uni_player_parse_dt_audio_glue(struct platform_device *pdev,
+ struct uniperif *player)
{
- int bit_offset;
struct device_node *node = pdev->dev.of_node;
struct regmap *regmap;
-
- bit_offset = SYS_CFG_AUDI0_GLUE_PCM_CLKX + player->info->id;
+ struct reg_field regfield[2] = {
+ /* PCM_CLK_SEL */
+ REG_FIELD(SYS_CFG_AUDIO_GLUE,
+ 8 + player->info->id,
+ 8 + player->info->id),
+ /* PCMP_VALID_SEL */
+ REG_FIELD(SYS_CFG_AUDIO_GLUE, 0, 1)
+ };
regmap = syscon_regmap_lookup_by_phandle(node, "st,syscfg");
- if (regmap) {
- struct reg_field regfield =
- REG_FIELD(SYS_CFG_AUDIO_GLUE, bit_offset, bit_offset);
-
- player->clk_sel = regmap_field_alloc(regmap, regfield);
- } else {
+ if (!regmap) {
dev_err(&pdev->dev, "sti-audio-clk-glue syscf not found\n");
return -EINVAL;
}
+ player->clk_sel = regmap_field_alloc(regmap, regfield[0]);
+ player->valid_sel = regmap_field_alloc(regmap, regfield[1]);
+
return 0;
}
@@ -1084,8 +1087,8 @@ static int uni_player_parse_dt(struct platform_device *pdev,
/* Save the info structure */
player->info = info;
- /* Get the PCM_CLK_SEL bit from audio-glue-ctrl SoC register */
- if (uni_player_parse_dt_clk_glue(pdev, player))
+ /* Get PCM_CLK_SEL & PCMP_VALID_SEL from audio-glue-ctrl SoC reg */
+ if (uni_player_parse_dt_audio_glue(pdev, player))
return -EINVAL;
return 0;
@@ -1139,6 +1142,17 @@ int uni_player_init(struct platform_device *pdev,
}
}
+ /* connect to I2S/TDM TX bus */
+ if (player->valid_sel &&
+ (player->info->id == UNIPERIF_PLAYER_I2S_OUT)) {
+ ret = regmap_field_write(player->valid_sel, player->info->id);
+ if (ret) {
+ dev_err(player->dev,
+ "%s: unable to connect to tdm bus", __func__);
+ return ret;
+ }
+ }
+
ret = devm_request_irq(&pdev->dev, player->irq,
uni_player_irq_handler, IRQF_SHARED,
dev_name(&pdev->dev), player);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] ASoC: sti: select player for I2S/TDM TX bus
2016-04-14 13:29 [PATCH 0/1] ASoC: sti: select player for I2S/TDM TX bus Moise Gergaud
2016-04-14 13:29 ` [PATCH 1/1] " Moise Gergaud
@ 2016-04-14 13:31 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-04-14 13:31 UTC (permalink / raw)
To: Moise Gergaud; +Cc: tiwai, alsa-devel, arnaud.pouliquen, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 388 bytes --]
On Thu, Apr 14, 2016 at 03:29:34PM +0200, Moise Gergaud wrote:
> I forgot to include this patch into "[PATCH v2] ASoC: sti: unip tdm mode" serie
> that has been applied.
Please don't send cover letters for single patches, if there is any
useful information in there it should be in the changelog for the patch
(or after the --- for administrative stuff as covered in
SubmittingPatches).
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-14 13:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 13:29 [PATCH 0/1] ASoC: sti: select player for I2S/TDM TX bus Moise Gergaud
2016-04-14 13:29 ` [PATCH 1/1] " Moise Gergaud
2016-04-14 13:31 ` [PATCH 0/1] " 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).