From patchwork Wed Jun 28 19:23:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 106573 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp279620qge; Wed, 28 Jun 2017 12:25:48 -0700 (PDT) X-Received: by 10.28.58.147 with SMTP id h141mr9143863wma.112.1498677948202; Wed, 28 Jun 2017 12:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498677948; cv=none; d=google.com; s=arc-20160816; b=tU5z9c0ojkwP4HVIwZfPV6tQ7h72/LY69dQB8osmcnWAsBsRpXUfMThT3zAm4MCFOE LyhWwI1Nv1nq+eHj5eJCJYiMzh27yXCIq2jjg9KgBzctYpku91NTQ4B6qSMZ2cvUIpoc Wu6i1iX/r+nq1tb8C99vGVPs80Og7Cw8HEKeUas6fX62daYMZDb/O9k4jiOwfSbNR4f1 RjfTOeE1OZoS+chIF24HVRNwpXnK4mxrhq2UuwhG3uB/hqdh8s6GjIwaew5M7lBPAlLy MZ4L3yQWn0UdvYV2aj4rt/PUpYKCWz3fZKynpNOV+hwJqNdLBRC6T6zufT2JkU5Y+tLh 7iuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=BefohuhtAFGdLGMmnEsnQlDDRxpc1DLt1Y8fwPrnKlE=; b=qw0kBSPgXLN8HIkS5If+6rONStoPiE6WrlsEQsDUzwuNw74AwrmQLtCFfNu0O62i7X inKWWzZK+XUifYVON0Vd1qYEuzo/cp4g1EDD5S+ryo23+Vbx7ppXWbjwG1v3n7VOr/wx Gt9Yvdz4VbaX1Oyy1A/pqwbaukA8cjR3UBrhp7x8NeoqhOC96KNNFLfaLA6XO/t/r3/0 ePBtIuLM25VbRCP/TL3nICW6vCiul2lu4y8zgGxzdH3lxAP48fSdGJhLv60ujSWDj1xs 4od+kIm5xqlbgC/n7WJL3XXPhkgYZPFRXE9VtFiMPdaC2gz4i55zyubcnUh0zVNyVG0V oqiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h66si6370154wmd.160.2017.06.28.12.25.47; Wed, 28 Jun 2017 12:25:48 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 02CAA267256; Wed, 28 Jun 2017 21:24:30 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 94BAC26724A; Wed, 28 Jun 2017 21:24:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, PRX_BODY_30, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 7E51E2671EB for ; Wed, 28 Jun 2017 21:24:10 +0200 (CEST) Received: from [176.12.107.140] (helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dQIZI-0001Vo-C4; Wed, 28 Jun 2017 19:24:06 +0000 Received: from broonie by finisterre with local (Exim 4.89) (envelope-from ) id 1dQIZD-0004Mn-SN; Wed, 28 Jun 2017 20:23:59 +0100 From: Mark Brown To: Takashi Iwai In-Reply-To: <20170628124939.11696-5-tiwai@suse.de> Message-Id: Date: Wed, 28 Jun 2017 20:23:59 +0100 X-SA-Exim-Connect-IP: 176.12.107.140 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: Oder Chiou , Hans de Goede , alsa-devel@alsa-project.org, Mark Brown , Bard Liao Subject: [alsa-devel] Applied "ASoC: rt5645: Add jack detection workaround for GPD Win" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rt5645: Add jack detection workaround for GPD Win has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From ea2b5a6e3a386b89d7f9148ff8be6c78d13542a0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 28 Jun 2017 14:49:39 +0200 Subject: [PATCH] ASoC: rt5645: Add jack detection workaround for GPD Win GPD Win requires jd_mode=3 and the inverted flag for making the jack detection working. Unfortunately, the BIOS doesn't give a nice way to match with DMI strings, and the only working way so far is to match with the board vendor/name/version/date to some known patterns. Hopefully other vendors won't do such a stupid setup, too... Thanks to Hans de Goede for the DMI matching suggestion. Suggested-by: Hans de Goede Tested-by: Hans de Goede Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 162044d82632..308c22f5909a 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3599,6 +3599,33 @@ static struct dmi_system_id dmi_platform_intel_broadwell[] = { { } }; +static struct rt5645_platform_data gpd_win_platform_data = { + .jd_mode = 3, + .inv_jd1_1 = true, +}; + +static const struct dmi_system_id dmi_platform_gpd_win[] = { + { + /* + * Match for the GPDwin which unfortunately uses somewhat + * generic dmi strings, which is why we test for 4 strings. + * Comparing against 23 other byt/cht boards, board_vendor + * and board_name are unique to the GPDwin, where as only one + * other board has the same board_serial and 3 others have + * the same default product_name. Also the GPDwin is the + * only device to have both board_ and product_name not set. + */ + .ident = "GPD Win", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "Default string"), + DMI_MATCH(DMI_BOARD_SERIAL, "Default string"), + DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), + }, + }, + {} +}; + static bool rt5645_check_dp(struct device *dev) { if (device_property_present(dev, "realtek,in2-differential") || @@ -3649,6 +3676,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, rt5645_parse_dt(rt5645, &i2c->dev); else if (dmi_check_system(dmi_platform_intel_braswell)) rt5645->pdata = general_platform_data; + else if (dmi_check_system(dmi_platform_gpd_win)) + rt5645->pdata = gpd_win_platform_data; rt5645->gpiod_hp_det = devm_gpiod_get_optional(&i2c->dev, "hp-detect", GPIOD_IN);