1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * skl-ssp-clk.h - Skylake ssp clock information and ipc structure
5 * Copyright (C) 2017 Intel Corp
6 * Author: Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>
7 * Author: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 #ifndef SOUND_SOC_SKL_SSP_CLK_H
14 #define SOUND_SOC_SKL_SSP_CLK_H
17 /* xtal/cardinal/pll, parent of ssp clocks and mclk */
18 #define SKL_MAX_CLK_SRC 3
19 #define SKL_MAX_SSP_CLK_TYPES 3 /* mclk, sclk, sclkfs */
21 #define SKL_MAX_CLK_CNT (SKL_MAX_SSP * SKL_MAX_SSP_CLK_TYPES)
23 /* Max number of configurations supported for each clock */
24 #define SKL_MAX_CLK_RATES 10
26 #define SKL_SCLK_OFS SKL_MAX_SSP
27 #define SKL_SCLKFS_OFS (SKL_SCLK_OFS + SKL_MAX_SSP)
35 enum skl_clk_src_type
{
41 struct skl_clk_parent_src
{
45 const char *parent_name
;
53 struct skl_dmactrl_mclk_cfg
{
54 struct skl_tlv_hdr hdr
;
55 /* DMA Clk TLV params */
60 u32 clk_stop_delay
:16;
66 struct skl_dmactrl_sclkfs_cfg
{
67 struct skl_tlv_hdr hdr
;
68 /* DMA SClk&FS TLV params */
69 u32 sampling_frequency
;
73 u32 interleaving_style
;
74 u32 number_of_channels
: 8;
75 u32 valid_bit_depth
: 8;
80 union skl_clk_ctrl_ipc
{
81 struct skl_dmactrl_mclk_cfg mclk
;
82 struct skl_dmactrl_sclkfs_cfg sclk_fs
;
85 struct skl_clk_rate_cfg_table
{
87 union skl_clk_ctrl_ipc dma_ctl_ipc
;
92 * rate for mclk will be in rates[0]. For sclk and sclkfs, rates[] store
93 * all possible clocks ssp can generate for that platform.
97 const char *parent_name
;
98 struct skl_clk_rate_cfg_table rate_cfg
[SKL_MAX_CLK_RATES
];
101 struct skl_clk_pdata
{
102 struct skl_clk_parent_src
*parent_clks
;
104 struct skl_ssp_clk
*ssp_clks
;
108 #endif /* SOUND_SOC_SKL_SSP_CLK_H */