From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D73701F418F for ; Wed, 11 Feb 2026 00:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770769401; cv=none; b=PbpYy76nTtNCaLVzQwrSmSjZv2oK7nVtP9M6zBRK2n0V3qsX6F4D+tiLKDXtq9/PzPvc77cnCcUoVi22IAVSwK5LUFj/zSBmUkmaBaFa1we6kO+8c7nm06RdDWGNP/FWPWVC5NnjVVSx8CSOKsYT/5JKCkyy7JB0jWyQSggjr74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770769401; c=relaxed/simple; bh=pBYowSFXs4W63BB+daEZB7CWXgti/ugLPsgjljCktxE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tC3GF6NUkhr6xA1RlqWEdrpGPgN/TJHv4HyJu44b1QDwFAM3k6ppsTfyHMj3MgGAdeidfhf+cthjs9iLabtenXcxXUVMlGuqXPSAoXT9tFsvKm7Xh0ogprIFX3tmjAb66R7NoL8WwcN+oxtATjJHsZ+sViGBwgEdwFWVHE249WY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d40NJih/; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d40NJih/" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b885a18f620so950474566b.3 for ; Tue, 10 Feb 2026 16:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770769398; x=1771374198; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x6JmkL+CRn+Pw5NCzGZqdOEyJTF9xPfYvca4al1/s8s=; b=d40NJih/XjPMP0J6hTJlbq6ncDOxTBXvUTkwBagSfYh7+OOnlv7vcvTRS7uRbTXX9t EdqyRDdehFB8ix61Eo6dEp4PjcGehLVmNh+yOSTmS0fK61QkayBJjMxN1lRFyVWq+Q8S ItPOtV9+bgLNGCvNnoOAEEPspnRrWeBJF58D8q3YM+tcERYWRdGqR/Rrxe24q8FXzzV7 QsuSJVX9lQqXkK2BKcSHv7P7vUPuODqGo1ldvIySvS0PNmFHV/Hd5ijY2CvJFuFE4QVi oJ/oTwPgaN4sqD4Q20iF4xU4SmfDdJ2hHIMBHIR9YXkagEVqfjWOu40tzpumeD8SSkhF pXQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770769398; x=1771374198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=x6JmkL+CRn+Pw5NCzGZqdOEyJTF9xPfYvca4al1/s8s=; b=X5b4Sw21h9V11E00zPiQw/C3A4C4oIkMgmWfGc6e2pXwKv6ZzvGcmug54NAaJcRL4J Wh/BWlRKd25JQITsR72D2U/sdIz2M8Y5p6utRhNgf8IHT+QhhtLT5NeTYjbrLXO5iZQF 0oL9rZ9LnaBRRSJi9UGE1/truUxhGNonROjseXnqU0KByWBvzYHvRbHFXj//sgMd9L49 4U7Vc8xv7ws4LtqavMnrfIikgX7T6XX97+egVHf54qSlLldn/Ehbp38Ipp8pTaQE8wBU gO0UQotA8kmGj9YeZoRRbIny1O/O7DDMqUmEpiMiAQMrIOhT6FcQSqzXvHUtCN/0rBHB HQ6A== X-Forwarded-Encrypted: i=1; AJvYcCV0eN8AiOsvv1ARF5D056mfiFY74/RFtWOkEQKgyOa0Pd4b4GZKmKXCxHKeBTMC7E9YnPgq/3g8Vt76yOo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/MFh4lP0gGCHqZUSwDGOwa0qMq/2+bOlBWyL81Os7TyBUe0mQ wLgQ8qXVt7Ko76xhsg2YRCHwEgNDJ3AIQWc2G5sz0X717r2cw6d7MdCNDgQWXA== X-Gm-Gg: AZuq6aI4glP2GPPQLXZVG2J4r7XmSNLJ17EMvhsdLjsS2vO34Krq0K4VgO0yHugaU2K QMbEbwDSJv9XtYMScllDYLOxRLgdS/rQ6A6ilqDiS78HczUtTQFfs/N3inS8Aeeiuazw5lHTr33 6/UUfWLD1YGrWI6lTq8y+wwcqotNmYiaTdbSsjUf+tEBLhFeWEYMY6dwQDiDEVf7SNNKOX6cr7P eYS++5O6OCGSaMVjfnPu5XRFgSuy3UCCncXv2kAsnPMrHzAhxz6ZNxZ7gLob2c7t5CCQpaR7euk Mhh/NKrXdmtUGLwwm9iDz6VNANZMfLn44E06G2r7G68Cly1VogG4KsHqn3ZufS2ytXQOTzcPuaP PbRFxMFacMGww2XqC/wc2SRbnA8gjD2NUnqGRdAGWR+H8Yvp38iBrppfN5t4LSjc70/nKC3nLfk Ng9bQ3Qg3zk2Ub5w== X-Received: by 2002:a17:907:9612:b0:b79:fe73:3b18 with SMTP id a640c23a62f3a-b8f7159cfdamr5053866b.22.1770769398162; Tue, 10 Feb 2026 16:23:18 -0800 (PST) Received: from jekhomev ([46.251.53.180]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8f6ec1db0bsm9992866b.46.2026.02.10.16.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 16:23:17 -0800 (PST) From: Yauhen Kharuzhy To: Oder Chiou , Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Hans de Goede , Yauhen Kharuzhy Subject: [PATCH 5/7] ASoC: rt5677: Set up ACPI GPIO pins mapping table Date: Wed, 11 Feb 2026 02:18:37 +0200 Message-ID: <20260211002255.4090440-6-jekhor@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211002255.4090440-1-jekhor@gmail.com> References: <20260211002255.4090440-1-jekhor@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To get GPIO configuration from ACPI, define an ACPI GPIO mapping table, linking GPIO names with CRS entries. The only known device that has an ACPI entry for the RT5677 codec is the Lenovo Yoga Book YB1-X91, and it uses this entry to describe the entire sound system configuration: codec connections and jack detection chip connections. This ACPI definition looks YogaBook-specific, but codec GPIOs may be recognized as generic, so add this lookup table for all devices. Details about the YogaBook RT5677 ACPI entry are provided below. CRS resources: I2C devices: 0: rt5677 codec 1: ts3a227e jack detection IC GPIOs: 0: rt5677 codec reset 1: rt5677 codec pow-ldo2 2: speaker enable INTs: 0: rt5677 codec 1: ts3a227e jack detection IC SPI device: 0: rt5677 codec SPI connection ACPI decompiled dump fragment: Device (RTEK) { Name (_ADR, Zero) // _ADR: Address Name (_HID, "10EC5677") // _HID: Hardware ID Name (_CID, "10EC5677") // _CID: Compatible ID Name (_DDN, "Realtek IIS Audio Codec") // _DDN: DOS Device Name Name (_SUB, "17AA7005") // _SUB: Subsystem ID Name (_UID, One) // _UID: Unique ID Name (_PR0, Package (0x01) // _PR0: Power Resources for D0 { CLK3 }) Name (CHAN, Package (0x02) { One, 0x0124F800 }) Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (SBUF, ResourceTemplate () { I2cSerialBusV2 (0x002C, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x003B, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\_SB.GPO3", 0x00, ResourceConsumer, , ) { // Pin list 0x0019 } GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\_SB.GPO3", 0x00, ResourceConsumer, , ) { // Pin list 0x0012 } GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\_SB.GPO3", 0x00, ResourceConsumer, , ) { // Pin list 0x0030 } GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.GPO0", 0x00, ResourceConsumer, , ) { // Pin list 0x005B } GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.GPO0", 0x00, ResourceConsumer, , ) { // Pin list 0x004D } SpiSerialBusV2 (0x0001, PolarityLow, FourWireMode, 0x08, ControllerInitiated, 0x003D0900, ClockPolarityHigh, ClockPhaseSecond, "\\_SB.PCI0.SPI1", 0x00, ResourceConsumer, , Exclusive, ) }) Return (SBUF) /* \_SB_.PCI0.I2C1.RTEK._CRS.SBUF */ } } Signed-off-by: Yauhen Kharuzhy --- sound/soc/codecs/rt5677.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 845385c1fb88..f56ac267f53b 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -5536,6 +5536,15 @@ static int rt5677_init_irq(struct i2c_client *i2c) return ret; } +static const struct acpi_gpio_params rt5677_acpi_reset_gpios = {0, 0, true}; +static const struct acpi_gpio_params rt5677_acpi_ldo2_gpios = {1, 0, false}; + +static const struct acpi_gpio_mapping rt5677_acpi_gpios[] = { + { "realtek,reset-gpios", &rt5677_acpi_reset_gpios, 1 }, + { "realtek,pow-ldo2-gpios", &rt5677_acpi_ldo2_gpios, 1 }, + {}, +}; + static int rt5677_i2c_probe(struct i2c_client *i2c) { struct rt5677_priv *rt5677; @@ -5556,6 +5565,9 @@ static int rt5677_i2c_probe(struct i2c_client *i2c) if (rt5677->type == 0) return -EINVAL; + if (devm_acpi_dev_add_driver_gpios(rt5677->dev, rt5677_acpi_gpios)) + dev_warn(rt5677->dev, "Unable to add GPIO mapping table\n"); + rt5677_read_device_properties(rt5677, &i2c->dev); /* pow-ldo2 and reset are optional. The codec pins may be statically -- 2.51.0