From e0afe62f161b20b2252b5589cbfc733618b1ab52 Mon Sep 17 00:00:00 2001 From: Wu Zhigang Date: Fri, 3 Aug 2018 13:22:19 +0800 Subject: [PATCH] ssp:support additional SSP register bits add the code to support additional SSP register bits. 1.the firmware should be changed to support the feature. commit: acbf09215faf09a27e074779c665dfe8f9675516. 2.the tplg should be changed to support this feature, commit: 6ec1ffcd716e88927fdb441254000270e797439b if not, this PR will not take effect. Signed-off-by: Wu Zhigang Reviewed-by: Keyon Jie --- include/uapi/sound/sof-ipc.h | 20 +++++++++++++++++++- include/uapi/sound/sof-topology.h | 2 ++ sound/soc/sof/topology.c | 6 ++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/include/uapi/sound/sof-ipc.h b/include/uapi/sound/sof-ipc.h index c02264a22fe195..ababbe66826353 100644 --- a/include/uapi/sound/sof-ipc.h +++ b/include/uapi/sound/sof-ipc.h @@ -198,6 +198,22 @@ struct sof_ipc_compound_hdr { #define SOF_DAI_FMT_INV_MASK 0x0f00 #define SOF_DAI_FMT_MASTER_MASK 0xf000 + /* ssc1: TINTE */ +#define SOF_DAI_INTEL_SSP_QUIRK_TINTE (1 << 0) + /* ssc1: PINTE */ +#define SOF_DAI_INTEL_SSP_QUIRK_PINTE (1 << 1) + /* ssc2: SMTATF */ +#define SOF_DAI_INTEL_SSP_QUIRK_SMTATF (1 << 2) + /* ssc2: MMRATF */ +#define SOF_DAI_INTEL_SSP_QUIRK_MMRATF (1 << 3) + /* ssc2: PSPSTWFDFD */ +#define SOF_DAI_INTEL_SSP_QUIRK_PSPSTWFDFD (1 << 4) + /* ssc2: PSPSRWFDFD */ +#define SOF_DAI_INTEL_SSP_QUIRK_PSPSRWFDFD (1 << 5) + /* here is the possibility to define others aux macros */ + +#define SOF_DAI_INTEL_SSP_FRAME_PULSE_WIDTH_MAX 38 + /* types of DAI */ enum sof_ipc_dai_type { SOF_DAI_INTEL_NONE = 0, @@ -231,8 +247,10 @@ struct sof_ipc_dai_ssp_params { uint32_t bclk_keep_active; uint32_t fs_keep_active; - //uint32_t quirks; // FIXME: is 32 bits enough ? + uint16_t frame_pulse_width; + uint32_t quirks; // FIXME: is 32 bits enough ? + uint16_t padding; /* private data, e.g. for quirks */ //uint32_t pdata[10]; // FIXME: would really need ~16 u32 } __attribute__((packed)); diff --git a/include/uapi/sound/sof-topology.h b/include/uapi/sound/sof-topology.h index 096aaed4333059..2ae5dd9aeea454 100644 --- a/include/uapi/sound/sof-topology.h +++ b/include/uapi/sound/sof-topology.h @@ -69,6 +69,8 @@ #define SOF_TKN_INTEL_SSP_FS_KEEP_ACTIVE 502 #define SOF_TKN_INTEL_SSP_MCLK_ID 503 #define SOF_TKN_INTEL_SSP_SAMPLE_BITS 504 +#define SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH 505 +#define SOF_TKN_INTEL_SSP_QUIRKS 506 /* DMIC */ #define SOF_TKN_INTEL_DMIC_DRIVER_VERSION 600 diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index d0c4bd9e33cbb2..85e52baafedab7 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -420,6 +420,12 @@ static const struct sof_topology_token ssp_tokens[] = { {SOF_TKN_INTEL_SSP_SAMPLE_BITS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, offsetof(struct sof_ipc_dai_ssp_params, sample_valid_bits), 0}, + {SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH, SND_SOC_TPLG_TUPLE_TYPE_SHORT, + get_token_u16, + offsetof(struct sof_ipc_dai_ssp_params, frame_pulse_width), 0}, + {SOF_TKN_INTEL_SSP_QUIRKS, SND_SOC_TPLG_TUPLE_TYPE_WORD, + get_token_u32, + offsetof(struct sof_ipc_dai_ssp_params, quirks), 0}, }; /* DMIC */