From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fldsmtpe03.verizon.com ([140.108.26.142]:59238 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932297AbdDDTe6 (ORCPT ); Tue, 4 Apr 2017 15:34:58 -0400 From: alexander.levin@verizon.com To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [PATCH for 4.9 71/98] ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10 Date: Tue, 4 Apr 2017 19:32:28 +0000 Message-ID: <20170404193158.19041-72-alexander.levin@verizon.com> References: <20170404193158.19041-1-alexander.levin@verizon.com> In-Reply-To: <20170404193158.19041-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Pierre-Louis Bossart [ Upstream commit fd0138dc5d17c636477b371d99265c406437c583 ] the BIOS reports this codec as RT5640 but it's a rt5670. Use the quirk mechanism to use the cht_bsw_rt5672 machine driver Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/atom/sst/sst_acpi.c | 37 +++++++++++++++++++++++++++++++++= +++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst= /sst_acpi.c index 0a88537..0bfa688 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -400,6 +400,7 @@ static int sst_acpi_remove(struct platform_device *pdev= ) static unsigned long cht_machine_id; =20 #define CHT_SURFACE_MACH 1 +#define BYT_THINKPAD_10 2 =20 static int cht_surface_quirk_cb(const struct dmi_system_id *id) { @@ -407,6 +408,23 @@ static int cht_surface_quirk_cb(const struct dmi_syste= m_id *id) return 1; } =20 +static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id) +{ + cht_machine_id =3D BYT_THINKPAD_10; + return 1; +} + + +static const struct dmi_system_id byt_table[] =3D { + { + .callback =3D byt_thinkpad10_quirk_cb, + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "20C3001VHH"), + }, + }, + { } +}; =20 static const struct dmi_system_id cht_table[] =3D { { @@ -424,6 +442,10 @@ static struct sst_acpi_mach cht_surface_mach =3D { "10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, &chv_platform_data }; =20 +static struct sst_acpi_mach byt_thinkpad_10 =3D { + "10EC5640", "cht-bsw-rt5672", "intel/fw_sst_0f28.bin", "cht-bsw", NULL, + &byt_rvp_platform= _data }; + static struct sst_acpi_mach *cht_quirk(void *arg) { struct sst_acpi_mach *mach =3D arg; @@ -436,8 +458,21 @@ static struct sst_acpi_mach *cht_quirk(void *arg) return mach; } =20 +static struct sst_acpi_mach *byt_quirk(void *arg) +{ + struct sst_acpi_mach *mach =3D arg; + + dmi_check_system(byt_table); + + if (cht_machine_id =3D=3D BYT_THINKPAD_10) + return &byt_thinkpad_10; + else + return mach; +} + + static struct sst_acpi_mach sst_acpi_bytcr[] =3D { - {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NUL= L, + {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", byt= _quirk, &byt_rvp_platform_data }, {"10EC5642", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NUL= L, &byt_rvp_platform_data }, --=20 2.9.3