if (devm_acpi_dev_add_driver_gpios(codec->dev,
byt_cht_cx2072x_acpi_gpios))
dev_warn(rtd->dev, "Unable to add GPIO mapping table\n");
card->dapm.idle_bias_off = true;
/* set the default PLL rate, the clock is handled by the codec driver */
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), CX2072X_MCLK_EXTERNAL_PLL,
19200000, SND_SOC_CLOCK_IN); if (ret) {
dev_err(rtd->dev, "Could not set sysclk\n"); return ret;
}
ret = snd_soc_card_jack_new_pins(card, "Headset",
SND_JACK_HEADSET | SND_JACK_BTN_0,
&byt_cht_cx2072x_headset,
byt_cht_cx2072x_headset_pins,
ARRAY_SIZE(byt_cht_cx2072x_headset_pins)); if (ret) return ret;
/* The DSP will convert the FE rate to 48k, stereo, 24bits */
rate->min = rate->max = 48000;
channels->min = channels->max = 2;
/* set SSP2 to 24-bit */
params_set_format(params, SNDRV_PCM_FORMAT_S24_LE);
/* * Default mode for SSP configuration is TDM 4 slot, override config * with explicit setting to I2S 2ch 24-bit. The word length is set with * dai_set_tdm_slot() since there is no other API exposed
*/
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_cpu(rtd, 0),
SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_BP_FP); if (ret < 0) {
dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret); return ret;
}
ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_cpu(rtd, 0), 0x3, 0x3, 2, 24); if (ret < 0) {
dev_err(rtd->dev, "can't set I2S config, err %d\n", ret); return ret;
}
/* use space before codec name to simplify card ID, and simplify driver name */ #define SOF_CARD_NAME "bytcht cx2072x"/* card name will be 'sof-bytcht cx2072x' */ #define SOF_DRIVER_NAME "SOF"
#define CARD_NAME "bytcht-cx2072x" #define DRIVER_NAME NULL /* card name will be used for driver name */
/* fix index of codec dai */ for (i = 0; i < ARRAY_SIZE(byt_cht_cx2072x_dais); i++) { if (byt_cht_cx2072x_dais[i].num_codecs &&
!strcmp(byt_cht_cx2072x_dais[i].codecs->name, "i2c-14F10720:00")) {
dai_index = i; break;
}
}
/* fixup codec name based on HID */
adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); if (adev) {
snprintf(codec_name, sizeof(codec_name), "i2c-%s",
acpi_dev_name(adev));
byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
} else {
dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); return -ENOENT;
}
acpi_dev_put(adev);
/* override platform name, if required */
ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_cx2072x_card,
mach->mach_params.platform); if (ret) return ret;
sof_parent = snd_soc_acpi_sof_parent(&pdev->dev);
/* set card and driver name */ if (sof_parent) {
byt_cht_cx2072x_card.name = SOF_CARD_NAME;
byt_cht_cx2072x_card.driver_name = SOF_DRIVER_NAME;
} else {
byt_cht_cx2072x_card.name = CARD_NAME;
byt_cht_cx2072x_card.driver_name = DRIVER_NAME;
}
/* set pm ops */ if (sof_parent)
pdev->dev.driver->pm = &snd_soc_pm_ops;
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.