From patchwork Fri May 24 17:03:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VGFtw6FzIEtvdsOhY3M=?= X-Patchwork-Id: 10960165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 347016C5 for ; Fri, 24 May 2019 17:12:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F9528660 for ; Fri, 24 May 2019 17:12:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16E14289DA; Fri, 24 May 2019 17:12:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A26F628660 for ; Fri, 24 May 2019 17:12:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0E60816EA; Fri, 24 May 2019 19:03:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E60816EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558717459; bh=eXBney/PZzl+S4ry+pk3R1KpQCjr7+lpffpsZFIpcMQ=; h=From:Date:To:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=CWYHODXhg12Pg3YdEpMA2zXKa1fBlJyjoijLAutryJlI66on4sv+C6x3MJGmNqJ7I VDzEOo9/XL1JI0LnGcblqqS8veEG8QPUJXHIWY8OE2j/ikBg2Ztxr5UgSwezWiS25g UmAtVMaxt+TbgCPiZ7iKaeq65MRKqVwKMR0uujbk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 85637F8962F; Fri, 24 May 2019 19:03:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9C924F89630; Fri, 24 May 2019 19:03:25 +0200 (CEST) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C04E7F80C0F for ; Fri, 24 May 2019 19:03:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C04E7F80C0F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ap+RZbAy" Received: by mail-pf1-x442.google.com with SMTP id a23so5689344pff.4 for ; Fri, 24 May 2019 10:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=34qJ96AXyQCpF7NvNnEjvrHNLao/arBbmBUh05Ka3nM=; b=ap+RZbAyB3+sPLUmj/xydDyKCEKjkR0Cv2Qyus8DQ1U1BxXs7IsO8+VcSoFyrNsgNI qZK6I2yKvKXl7dK+J7zYpe+G2RhVW6hjfi4dXtptlkN9wUsVWSs8IshWTsrHyB4frK3F ZPbXLT9lDWq7pr/URJNfQYMZZHfEw85ctjpLUuGBJ/DZo3IcRSNA5Bru8kYUyY0C35WA EFj54pi8S5PPZNyuLUR3Cl7FwgjVzcdicFrbBKn9ZUrGbbqEOW3gsANRPHZ2OhJFvds3 B6i9WLWDBiZRXXqG+VO2bnlRnLNyKQ0sLEM5nlUIltr2ioYcLD9v9coF9dXOnDkHVNUw M2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=34qJ96AXyQCpF7NvNnEjvrHNLao/arBbmBUh05Ka3nM=; b=ZTYvhL9dNAKaATIAJDtTt7zEE0orwGEMaEVILej+Q+aHOF3jSv5OnO1NQGZP+5lZGq JakQWFoe/7zZ43M6Dey9vAs9kAPSTZTGvfvrw3pr862hRJPMmmIXt1xLWshyd0cKKTeW qJvgc+abeBktrFJdkZG/APDJ2/+W84jYgIHSNtY2fKWVbF0B1Bv8TaJxsgMBOcD1g9mJ FsXjcQ5W0dQHVA+h4s2e5b6WDs3a30FZPjtrU1Lmknx58YfO4Jck4qo4mvP5FKxBSEr2 hsRgLtlXQMBBvceY8yp3aLFKgXm7LSEQJJ0fNLdoimbMyN5WBg39wCiMam2mEJeyE3M5 xIFA== X-Gm-Message-State: APjAAAVHup1J4gUnx2llE5L5V5kKaX3+x2HNdTMJjCDL3JEAbeKjDj0e 7XbI+szONMDxwi8e7wJNknrfwVS9x1thqsfkB0H1QhAu X-Google-Smtp-Source: APXvYqxf7f4Z0E6iet+jPLpyXb+CU2tGX0WiZKKoTnAKaBtOTMApq+v9e/aH5IDdpkhzTGAjsk4sRZdCVzX9ej3Z1TE= X-Received: by 2002:a63:5c5b:: with SMTP id n27mr107904986pgm.52.1558717399947; Fri, 24 May 2019 10:03:19 -0700 (PDT) MIME-Version: 1.0 From: =?utf-8?b?VGFtw6FzIEtvdsOhY3M=?= Date: Fri, 24 May 2019 19:03:08 +0200 Message-ID: To: alsa-devel@alsa-project.org X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [alsa-devel] [PATCH] ASoC: Intel: Baytrail: add quirk for Aegex 10 (RU2) tablet X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This tablet has an incorrect acpi identifier, which is why it is trying to load the RT5640 driver instead of the RT5762 driver. The RT5640 driver, on the other hand, checks the hardware ID, so no drivers are loaded during boot. This fix resolves to load the RT5672 driver on this tablet during boot. It also provides the correct IO configuration, like the jack detect mode 3, for 1.8V pullup. I would like to thank Pierre-Louis Bossart for helping with this patch. Signed-off-by: Kovács Tamás diff --git a/ori/sound/soc/intel/common/soc-acpi-intel-byt-match.c b/new/sound/soc/intel/common/soc-acpi-intel-byt-match.c index fe812a9..e549950 100644 --- a/ori/sound/soc/intel/common/soc-acpi-intel-byt-match.c +++ b/new/sound/soc/intel/common/soc-acpi-intel-byt-match.c @@ -1,4 +1,4 @@ -/* +/* * soc-apci-intel-byt-match.c - tables and support for BYT ACPI enumeration. * * Copyright (c) 2017, Intel Corporation. @@ -22,6 +22,7 @@ static unsigned long byt_machine_id; #define BYT_THINKPAD_10 1 #define BYT_POV_P1006W 2 +#define BYT_AEGEX_10 3 static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id) { @@ -35,6 +36,12 @@ static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id) return 1; } +static int byt_aegex10_quirk_cb(const struct dmi_system_id *id) +{ + byt_machine_id = BYT_AEGEX_10; + return 1; +} + static const struct dmi_system_id byt_table[] = { { .callback = byt_thinkpad10_quirk_cb, @@ -75,6 +82,14 @@ static const struct dmi_system_id byt_table[] = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"), }, }, + { + /* Aegex 10 tablet (RU2) */ + .callback = byt_aegex10_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"), + DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"), + }, + }, { } }; @@ -96,6 +111,15 @@ static struct snd_soc_acpi_mach byt_pov_p1006w = { .sof_tplg_filename = "sof-byt-rt5651.tplg", }; +static struct snd_soc_acpi_mach byt_aegex_10 = { + .id = "10EC5640", + .drv_name = "cht-bsw-rt5672", + .fw_filename = "intel/fw_sst_0f28.bin", + .board = "cht-bsw", + .sof_fw_filename = "intel/sof-byt.ri", + .sof_tplg_filename = "intel/sof-byt-rt5670.tplg", +}; + static struct snd_soc_acpi_mach *byt_quirk(void *arg) { struct snd_soc_acpi_mach *mach = arg; @@ -107,6 +131,8 @@ static struct snd_soc_acpi_mach *byt_quirk(void *arg) return &byt_thinkpad_10; case BYT_POV_P1006W: return &byt_pov_p1006w; + case BYT_AEGEX_10: + return &byt_aegex_10; default: return mach; } diff --git a/ori/sound/soc/codecs/rt5670.c b/new/sound/soc/codecs/rt5670.c index 9a03710..37cce04 100644 --- a/ori/sound/soc/codecs/rt5670.c +++ b/new/sound/soc/codecs/rt5670.c @@ -1,4 +1,4 @@ -/* +/* * rt5670.c -- RT5670 ALSA SoC audio codec driver * * Copyright 2014 Realtek Semiconductor Corp. @@ -2882,6 +2882,18 @@ static const struct dmi_system_id dmi_platform_intel_quirks[] = { RT5670_DEV_GPIO | RT5670_JD_MODE3), }, + { + .callback = rt5670_quirk_cb, + .ident = "Aegex 10 tablet (RU2)", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"), + DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"), + }, + .driver_data = (unsigned long *)(RT5670_DMIC_EN | + RT5670_DMIC2_INR | + RT5670_DEV_GPIO | + RT5670_JD_MODE3), + }, {} };