From ab6f6d85210c4d0265cf48e9958c04e08595055a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 5 Nov 2012 18:30:38 -0800 Subject: ASoC: fsi: add master clock control functions Current FSI driver required set_rate() platform callback function to set audio clock if it was master mode, because it seemed that CPG/FSI-DIV clocks calculation depend on platform/board/cpu. But it was calculable regardless of platform. This patch supports audio clock calculation method, but the sampling rate under 32kHz is not supported at this point. Old type set_rate() is still supported now, but it will be deleted on next version Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/sh_fsi.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/sound') diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index 906010344dd..27ee1dcc3e2 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h @@ -26,6 +26,7 @@ * A: inversion * B: format mode * C: chip specific + * D: clock selecter if master mode */ /* A: clock inversion */ @@ -44,6 +45,11 @@ #define SH_FSI_OPTION_MASK 0x00000F00 #define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */ +/* D: clock selecter if master mode */ +#define SH_FSI_CLK_MASK 0x0000F000 +#define SH_FSI_CLK_EXTERNAL (1 << 12) +#define SH_FSI_CLK_CPG (2 << 12) /* FSIxCK + FSI-DIV */ + /* * set_rate return value * -- cgit v1.2.3 From ab6340c4ecc21c01a487e9be15754d5f934a003a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 16 Nov 2012 01:17:18 -0800 Subject: ASoC: fsi: master clock selection become independent from platform flags Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch makes master clock selection independent from platform information pointer. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/sh_fsi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index 27ee1dcc3e2..cc1c919c643 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h @@ -47,8 +47,8 @@ /* D: clock selecter if master mode */ #define SH_FSI_CLK_MASK 0x0000F000 -#define SH_FSI_CLK_EXTERNAL (1 << 12) -#define SH_FSI_CLK_CPG (2 << 12) /* FSIxCK + FSI-DIV */ +#define SH_FSI_CLK_EXTERNAL (0 << 12) +#define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */ /* * set_rate return value -- cgit v1.2.3