@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-// Copyright(c) 2018-19 Intel Corporation.
+// Copyright(c) 2018-19 Canonical Corporation.
/*
* Intel Kabylake I2S Machine Driver with RT5660 Codec
@@ -61,7 +61,7 @@ static const struct acpi_gpio_params mic_det_gpio = { GPIO_LINEIN_DET_INDEX, 0,
static const struct acpi_gpio_mapping acpi_rt5660_gpios[] = {
- { "lineout-mute-gpios", &lineout_mute_gpio , 1 },
+ { "lineout-mute-gpios", &lineout_mute_gpio, 1 },
{ "lineout-det-gpios", &lineout_det_gpio, 1 },
{ "mic-det-gpios", &mic_det_gpio, 1 },
{ NULL },
@@ -109,8 +109,6 @@ static const struct snd_kcontrol_new kabylake_rt5660_controls[] = {
static const struct snd_soc_dapm_widget kabylake_rt5660_widgets[] = {
SND_SOC_DAPM_MIC("Line In", NULL),
SND_SOC_DAPM_LINE("Line Out", kabylake_5660_event_lineout),
- SND_SOC_DAPM_SPK("DP", NULL),
- SND_SOC_DAPM_SPK("HDMI", NULL),
};
static const struct snd_soc_dapm_route kabylake_rt5660_map[] = {
@@ -127,10 +125,12 @@ static const struct snd_soc_dapm_route kabylake_rt5660_map[] = {
{ "codec0_in", NULL, "ssp0 Rx" },
{ "ssp0 Rx", NULL, "AIF1 Capture" },
- { "hifi2", NULL, "iDisp2 Tx"},
- { "iDisp2 Tx", NULL, "iDisp2_out"},
{ "hifi1", NULL, "iDisp1 Tx"},
{ "iDisp1 Tx", NULL, "iDisp1_out"},
+ { "hifi2", NULL, "iDisp2 Tx"},
+ { "iDisp2 Tx", NULL, "iDisp2_out"},
+ { "hifi3", NULL, "iDisp3 Tx"},
+ { "iDisp3 Tx", NULL, "iDisp3_out"},
};
static int kabylake_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
@@ -164,35 +164,42 @@ static int kabylake_rt5660_codec_init(struct snd_soc_pcm_runtime *rtd)
if (ret)
dev_warn(component->dev, "Failed to add driver gpios\n");
- /* Request rt5660 GPIO for lineout mute control */
+ /* Request rt5660 GPIO for lineout mute control, return if fails */
ctx->gpio_lo_mute = devm_gpiod_get(component->dev, "lineout-mute",
- GPIOD_OUT_HIGH);
+ GPIOD_OUT_HIGH);
if (IS_ERR(ctx->gpio_lo_mute)) {
dev_err(component->dev, "Can't find GPIO_MUTE# gpio\n");
return PTR_ERR(ctx->gpio_lo_mute);
}
- /* Create and initialize headphone jack */
- if (!snd_soc_card_jack_new(rtd->card, "Lineout Jack",
- SND_JACK_LINEOUT, &lineout_jack,
- &lineout_jack_pin, 1)) {
+ /* Create and initialize headphone jack, this jack is not mandatory, don't return if fails */
+ ret = snd_soc_card_jack_new(rtd->card, "Lineout Jack",
+ SND_JACK_LINEOUT, &lineout_jack,
+ &lineout_jack_pin, 1);
+ if (ret)
+ dev_warn(component->dev, "Can't create Lineout jack\n");
+ else {
lineout_jack_gpio.gpiod_dev = component->dev;
- if (snd_soc_jack_add_gpios(&lineout_jack, 1,
- &lineout_jack_gpio))
- dev_err(component->dev, "Can't add Lineout jack gpio\n");
- } else
- dev_err(component->dev, "Can't create Lineout jack\n");
-
- /* Create and initialize mic jack */
- if (!snd_soc_card_jack_new(rtd->card, "Mic Jack",
- SND_JACK_MICROPHONE, &mic_jack,
- &mic_jack_pin, 1)) {
+ ret = snd_soc_jack_add_gpios(&lineout_jack, 1,
+ &lineout_jack_gpio);
+ if (ret)
+ dev_warn(component->dev, "Can't add Lineout jack gpio\n");
+ }
+
+ /* Create and initialize mic jack, this jack is not mandatory, don't return if fails */
+ ret = snd_soc_card_jack_new(rtd->card, "Mic Jack",
+ SND_JACK_MICROPHONE, &mic_jack,
+ &mic_jack_pin, 1);
+ if (ret)
+ dev_warn(component->dev, "Can't create mic jack\n");
+ else {
mic_jack_gpio.gpiod_dev = component->dev;
- if (snd_soc_jack_add_gpios(&mic_jack, 1, &mic_jack_gpio))
- dev_err(component->dev, "Can't add mic jack gpio\n");
- } else
- dev_err(component->dev, "Can't create mic jack\n");
+ ret = snd_soc_jack_add_gpios(&mic_jack, 1, &mic_jack_gpio);
+ if (ret)
+ dev_warn(component->dev, "Can't add mic jack gpio\n");
+ }
+ /* Here we enable some dapms in advance to reduce the pop noise for recording via line-in */
snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1");
snd_soc_dapm_force_enable_pin(dapm, "BST1");
snd_soc_dapm_force_enable_pin(dapm, "BST2");
@@ -96,6 +96,11 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[] = {
.quirk_data = &kbl_7219_98927_codecs,
.pdata = &skl_dmic_data
},
+ {
+ .id = "10EC5660",
+ .drv_name = "kbl_rt5660",
+ .fw_filename = "intel/dsp_fw_kbl.bin",
+ },
{
.id = "10EC3277",
.drv_name = "kbl_rt5660",