Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f17c13ca authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: sh: fsi: modify selection method of I2S/PCM/SPDIF format



Current format selection of FSI-codecs depended on platform information for FSI,
and chip default settings for codecs. It is not understandable/formal method.
This patch modify FSI and FSI-codecs to use snd_soc_dai_set_fmt.

But FSI can use I2S/PCM and SPDIF format today.
It can be selected to I2S/PCM by snd_soc_dai_set_fmt, but can not select SPDIF.
So, this patch change FSI platform information to have DAI/SPDIF mode.

If platform selects DAI mode (default),
FSI-codecs can select I2S/PCM by snd_soc_dai_set_fmt,
and if it is SPDIF mode, FSI become SPDIF format.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d7c5762b
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -118,11 +118,6 @@ static struct platform_device keysc_device = {
};

/* FSI A */
static struct sh_fsi_platform_info fsi_info = {
	.porta_flags = SH_FSI_OFMT(I2S)		|
		       SH_FSI_IFMT(I2S),
};

static struct resource fsi_resources[] = {
	[0] = {
		.name	= "FSI",
@@ -141,9 +136,6 @@ static struct platform_device fsi_device = {
	.id		= -1,
	.num_resources	= ARRAY_SIZE(fsi_resources),
	.resource	= fsi_resources,
	.dev	= {
		.platform_data	= &fsi_info,
	},
};

static struct resource sh_mmcif_resources[] = {
+2 −4
Original line number Diff line number Diff line
@@ -673,14 +673,12 @@ static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
}

static struct sh_fsi_platform_info fsi_info = {
	.porta_flags = SH_FSI_BRS_INV |
		       SH_FSI_OFMT(PCM) |
		       SH_FSI_IFMT(PCM),
	.porta_flags = SH_FSI_BRS_INV,

	.portb_flags = SH_FSI_BRS_INV |
		       SH_FSI_BRM_INV |
		       SH_FSI_LRS_INV |
		       SH_FSI_OFMT(SPDIF),
		       SH_FSI_FMT_SPDIF,
	.set_rate = fsi_set_rate,
};

+2 −4
Original line number Diff line number Diff line
@@ -614,14 +614,12 @@ static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
}

static struct sh_fsi_platform_info fsi_info = {
	.porta_flags =	SH_FSI_BRS_INV		|
			SH_FSI_OFMT(PCM)	|
			SH_FSI_IFMT(PCM),
	.porta_flags =	SH_FSI_BRS_INV,

	.portb_flags =	SH_FSI_BRS_INV	|
			SH_FSI_BRM_INV	|
			SH_FSI_LRS_INV	|
			SH_FSI_OFMT(SPDIF),
			SH_FSI_FMT_SPDIF,

	.set_rate = fsi_set_rate,
};
+1 −3
Original line number Diff line number Diff line
@@ -723,9 +723,7 @@ static struct platform_device camera_devices[] = {

/* FSI */
static struct sh_fsi_platform_info fsi_info = {
	.portb_flags = SH_FSI_BRS_INV |
		       SH_FSI_OFMT(I2S) |
		       SH_FSI_IFMT(I2S),
	.portb_flags = SH_FSI_BRS_INV,
};

static struct resource fsi_resources[] = {
+1 −3
Original line number Diff line number Diff line
@@ -286,9 +286,7 @@ static struct platform_device ceu1_device = {
/* FSI */
/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
static struct sh_fsi_platform_info fsi_info = {
	.porta_flags = SH_FSI_BRS_INV |
		       SH_FSI_OFMT(PCM) |
		       SH_FSI_IFMT(PCM),
	.porta_flags = SH_FSI_BRS_INV,
};

static struct resource fsi_resources[] = {
Loading