From patchwork Mon Jan 11 05:41:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 12009811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11461C433E0 for ; Mon, 11 Jan 2021 05:45:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D4772251F for ; Mon, 11 Jan 2021 05:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D4772251F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=endlessos.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 C30DC16C8; Mon, 11 Jan 2021 06:44:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C30DC16C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1610343916; bh=ZGeg1DKO9DrevWyKHE1un4rJxcXH+LYmxbXeo+38bGs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UIF2YDGnJaHQM5WPPA7JS0taPvlVGqpBj5PdpQvyAMrrVJFmS1RXdUtuzWi/uMBLc YfyfNUghT9SqzJnSI9LuEgTTouIzYFzrB8kcRmr0w/QQai4RaKxxvLhGap5fJyY+mk HB90HHBJPW8MUI6ETzvS6bqEQufnF/7ySnD6WXo8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 82E43F80290; Mon, 11 Jan 2021 06:43:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3695DF8026B; Mon, 11 Jan 2021 06:43:28 +0100 (CET) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (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 D624EF8016C for ; Mon, 11 Jan 2021 06:43:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D624EF8016C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=endlessos.org header.i=@endlessos.org header.b="L3RdQOOF" Received: by mail-pj1-x102d.google.com with SMTP id n3so7728015pjm.1 for ; Sun, 10 Jan 2021 21:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessos.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yOQr05X+xX/KVtl6ApOJMHz2x0Vp5f60Ndun7HKg7HU=; b=L3RdQOOFDqLy+Q2epvPbmWxfDdRAZEIDt/5MrRzq9uZlTDyDlHAd/IW6PqM9BDa9m0 xu/HGX3lw5FxV89PaNXMd/ZQ+nehmfgl79++uj65aKFA5fBxgYK12sSCmEiG/iOgKC7M J4Ku96aXby/ig0iLiiS9cy+EJag+V+MU0fQNF8bGa8rTz7qMbN26oIFPr5wXAwsPHFS8 l4dKkTzUop0Sju7/iw26KVWg+xd938tz+rsVRdmYXO3sC83CU4jaGMLod4FULsQXp1ek EejB3oLBcAvY3q2mS18mLymZytyieNro4puOVVsYdKAIzkopXApEBd7RXONI3sJ+DsxK PIBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yOQr05X+xX/KVtl6ApOJMHz2x0Vp5f60Ndun7HKg7HU=; b=eYSKjsCsF4A1v4+GFrDZUqnoXH3NRZCWiMSYdDOt0l317u0MHfQZNOgXq/eysXtIkO RYuliZ4stw2eBrUj0oKwKNc1Py7ZwPjqVS+Kyh+g2FNoMWn6oBe/gBreo27txtGA1Id9 2hGpHpL2vCSV0Q5Uv7TP6xxWiHzUChHx0Ci3kTUk2O9uAN/fTTQjrcOZn8CFsIn5pV8G a/6b5Lc8rGWW/iYTbivPgMRWTmzE1sQTkaCWfbvzkk85y0EkTvw/Yr9DGkCUuqjg/V7z uM7vSjssQr/yE6bUwCRTsAgfpkn6QXEKPl/HExgfU1xLLD256QOM4ci7ZTNbWQWoMVqu LC3g== X-Gm-Message-State: AOAM532/MZEBk7LvxH8rP9apF2LCeG8cYJWir+LkfyiriDJVkQMXzNlX 7gKuuMwuhq4ZImTnFtf3GCP7Pg== X-Google-Smtp-Source: ABdhPJw2ONFbNDwJMu27VEV4P16I/0rFc3iebLBY5JaKpGsgPjcU3McVOX/JWuuKs9nxla1GZwIrrA== X-Received: by 2002:a17:90a:6d62:: with SMTP id z89mr16567631pjj.71.1610343799816; Sun, 10 Jan 2021 21:43:19 -0800 (PST) Received: from localhost.localdomain (61-231-198-38.dynamic-ip.hinet.net. [61.231.198.38]) by smtp.googlemail.com with ESMTPSA id x15sm16726267pfn.118.2021.01.10.21.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 21:43:19 -0800 (PST) From: Chris Chiu To: oder_chiou@realtek.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Subject: [PATCH v3 2/4] ASoC: rt5645: Add ACPI-defined GPIO for ECS EF20 series Date: Mon, 11 Jan 2021 13:41:39 +0800 Message-Id: <20210111054141.4668-3-chiu@endlessos.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210111054141.4668-1-chiu@endlessos.org> References: <20210111054141.4668-1-chiu@endlessos.org> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Chris Chiu , linux-kernel@vger.kernel.org, linux@endlessos.org 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" Add the hp-detect gpio for ECS EF20 series laptops based on the _CRS defined in DSDT table. Method (_CRS, 0, NotSerialized) { Name (SBUF, ResourceTemplate () { I2cSerialBusV2 (0x001A, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C2", 0x00, ResourceConsumer, , Exclusive, ) GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 0x0000, "\\_SB.GPO3", 0x00, ResourceConsumer, , ) { // Pin list 0x004F } GpioIo (Shared, PullDefault, 0x0000, 0x0000, IoRestrictionInputOnly, "\\_SB.GPO3", 0x00, ResourceConsumer, , ) { // Pin list 0x004F } }) Return (SBUF) /* \_SB_.PCI0.I2C2.RTK2._CRS.SBUF */ } Signed-off-by: Chris Chiu --- v2 -> v3: - restore the terminator {} of the dmi_platform_data[] v1 -> v2: - Invoke callback() of the DMI quirk if it exists. sound/soc/codecs/rt5645.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index af8f95644f11..770801de42a6 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3653,6 +3653,19 @@ static const struct rt5645_platform_data kahlee_platform_data = { .jd_mode = 3, }; +static const struct acpi_gpio_params ef20_hp_detect = { 1, 0, false }; + +static const struct acpi_gpio_mapping cht_rt5645_ef20_gpios[] = { + { "hp-detect-gpios", &ef20_hp_detect, 1 }, + { }, +}; + +static int cht_rt5645_ef20_quirk_cb(const struct dmi_system_id *id) +{ + cht_rt5645_gpios = cht_rt5645_ef20_gpios; + return 1; +} + static const struct dmi_system_id dmi_platform_data[] = { { .ident = "Chrome Buddy", @@ -3782,6 +3795,20 @@ static const struct dmi_system_id dmi_platform_data[] = { }, .driver_data = (void *)&intel_braswell_platform_data, }, + { + .ident = "EF20", + .callback = cht_rt5645_ef20_quirk_cb, + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "EF20"), + }, + }, + { + .ident = "EF20EA", + .callback = cht_rt5645_ef20_quirk_cb, + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"), + }, + }, { } };