// SPDX-License-Identifier: GPL-2.0-only /* * ASoC machine driver for Intel Broadwell platforms with RT5650 codec * * Copyright 2019, The Chromium OS Authors. All rights reserved.
*/
/* Digital MICs * DMIC Pair1 are the two DMICs connected on the DMICN1 connector. * DMIC Pair2 are the two DMICs connected on the DMICN2 connector. * Facing the camera, DMIC Pair1 are on the left side, DMIC Pair2 * are on the right side.
*/
{"DMIC L1", NULL, "DMIC Pair1"},
{"DMIC R1", NULL, "DMIC Pair1"},
{"DMIC L2", NULL, "DMIC Pair2"},
{"DMIC R2", NULL, "DMIC Pair2"},
/* Workaround: set codec PLL to 19.2MHz that PLL source is * from MCLK(24MHz) to conform 2.4MHz DMIC clock.
*/
ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK,
24000000, 19200000); if (ret < 0) {
dev_err(rtd->dev, "can't set codec pll: %d\n", ret); return ret;
}
/* The actual MCLK freq is 24MHz. The codec is told that MCLK is * 24.576MHz to satisfy the requirement of rl6231_get_clk_info. * ASRC is enabled on AD and DA filters to ensure good audio quality.
*/
ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_PLL1, 24576000,
SND_SOC_CLOCK_IN); if (ret < 0) {
dev_err(rtd->dev, "can't set codec sysclk configuration\n"); return ret;
}
/* Enable codec ASRC function for Stereo DAC/Stereo1 ADC/DMIC/I2S1. * The ASRC clock source is clk_i2s1_asrc.
*/
rt5645_sel_asrc_clk_src(component,
RT5645_DA_STEREO_FILTER |
RT5645_DA_MONO_L_FILTER |
RT5645_DA_MONO_R_FILTER |
RT5645_AD_STEREO_FILTER |
RT5645_AD_MONO_L_FILTER |
RT5645_AD_MONO_R_FILTER,
RT5645_CLK_SEL_I2S1_ASRC);
/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24);
if (ret < 0) {
dev_err(rtd->dev, "can't set codec TDM slot %d\n", ret); return ret;
}
/* Create and initialize headphone jack */ if (snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack",
SND_JACK_HEADPHONE, &headphone_jack,
&headphone_jack_pin, 1)) {
dev_err(component->dev, "Can't create headphone jack\n");
}
/* Create and initialize mic jack */ if (snd_soc_card_jack_new_pins(rtd->card, "Mic Jack",
SND_JACK_MICROPHONE, &mic_jack, &mic_jack_pin, 1)) {
dev_err(component->dev, "Can't create mic jack\n");
}
/* use space before codec name to simplify card ID, and simplify driver name */ #define SOF_CARD_NAME "bdw rt5650"/* card name will be 'sof-bdw rt5650' */ #define SOF_DRIVER_NAME "SOF"
#define CARD_NAME "bdw-rt5650" #define DRIVER_NAME NULL /* card name will be used for driver name */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.