From d90ba6c8b53e541913a181638c353cf7a0856256 Mon Sep 17 00:00:00 2001 From: Adam Thomson Date: Tue, 19 Mar 2019 17:49:31 +0000 Subject: ASoC: da7219: Expose BCLK and WCLK control through CCF For the purposes of platforms which use the codec as DAI clock master for the CPU and other codec devices, there is the need to not only expose the clock gating of BCLK and WCLK but also the ability to set those rates without going through the ASoC APIs. To make this possible, the previous CCF implementation in the driver has been extended to separate BCLK and WCLK out. WCLK is the parent clock to BCLK, and is also the clock gate for both. BCLK in HW is a factor/multiplier of WCLK so derives from whatever SR is chosen for WCLK, hence the need to make it a child of WCLK for the purposes of CCF. Enabling/disabling either BCLK or WCLK will result in clocks being ungated/gated accordingly. To simplify matters, these clocks can only be configured if the codec is set as master, otherwise CCF control is disallowed. Signed-off-by: Adam Thomson Signed-off-by: Mark Brown --- include/sound/da7219.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/da7219.h b/include/sound/da7219.h index 1bfcb16f2d10..4a36954c86c5 100644 --- a/include/sound/da7219.h +++ b/include/sound/da7219.h @@ -33,10 +33,16 @@ enum da7219_mic_amp_in_sel { struct da7219_aad_pdata; +enum da7219_dai_clks { + DA7219_DAI_WCLK_IDX = 0, + DA7219_DAI_BCLK_IDX, + DA7219_DAI_NUM_CLKS, +}; + struct da7219_pdata { bool wakeup_source; - const char *dai_clks_name; + const char *dai_clk_names[DA7219_DAI_NUM_CLKS]; /* Mic */ enum da7219_micbias_voltage micbias_lvl; -- cgit v1.2.3-59-g8ed1b