A lot of the clocking and wh is driving is generated automatically depending on DTS settings. The driver will only drive the clocks, if set to Master at the DTS level. The following shows the driver code routine that reads this from the ALSA driver: static int aic31xx_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { struct snd_soc_component *component = codec_dai->component; u8 iface_reg1 = 0; u8 iface_reg2 = 0; u8 dsp_a_val = 0; dev_dbg(component->dev, "## %s: fmt = 0x%x\n", __func__, fmt); /* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: iface_reg1 |= AIC31XX_BCLK_MASTER | AIC31XX_WCLK_MASTER; break; case SND_SOC_DAIFMT_CBS_CFM: iface_reg1 |= AIC31XX_WCLK_MASTER; break; case SND_SOC_DAIFMT_CBM_CFS: iface_reg1 |= AIC31XX_BCLK_MASTER; break; case SND_SOC_DAIFMT_CBS_CFS: break; default: dev_err(component->dev, "Invalid DAI master/slave interface\n"); return -EINVAL; } The SND_SOC_DAIFMT_MASTER_MASK is set by the ALSA driver, it offers: /* 62 * DAI hardware clock masters. 63 * 64 * This is wrt the codec, the inverse is true for the interface 65 * i.e. if the codec is clk and FRM master then the interface is 66 * clk and frame slave. 67 */ 68 #define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */ 69 #define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */ 70 #define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */ 71 #define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */ 72 73 #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f 74 #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 75 #define SND_SOC_DAIFMT_INV_MASK 0x0f00 76 #define SND_SOC_DAIFMT_MASTER_MASK 0xf000 In Summary, this is obtained from system configuration including DTS that indicates which clocks are master. In the following DTS example, the CPU is master and codec is slave: simple-audio-card,dai-link@1 { format = "dsp_a"; bitclock-master = <&sound0_1_master>; frame-master = <&sound0_1_master>; sound0_1_master: cpu { sound-dai = <&mcasp0>; clocks = <&clk_mcasp0>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; dai-tdm-slot-tx-mask = <1 1 1 1 1 1 1 1>; dai-tdm-slot-rx-mask = <1 1 1 1 1 1 1 1>; }; codec { sound-dai = <&tlv320adc5140>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; dai-tdm-slot-tx-mask = <1 1 1 1 1 1 1 1>; dai-tdm-slot-rx-mask = <1 1 1 1 1 1 1 1>; }; }; If If wanting the codec as master, then it would be like: sound0_1_master: codec { sound-dai = <&tlv320adc5140>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; dai-tdm-slot-tx-mask = <1 1 1 1 1 1 1 1>; dai-tdm-slot-rx-mask = <1 1 1 1 1 1 1 1>; };