From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 08A602561B8 for ; Tue, 25 Mar 2025 11:41:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902867; cv=none; b=TuMFe42h/kuRowDPGkPJPFDAHc8GqxUByZmBmV9Ra38naSruahSz5vTbyNJqKtYritEBcffpJgaKPXKifwpFZWANQtN1q054mdrrrEFYPyl5gRS7VwM0nY8QHL8+pgNpp57HsNYHO3j2dZOrs+cBGxgZGUdty/SLiAAsW7w3IKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902867; c=relaxed/simple; bh=nzVmJfufed+ekMZEjdRDlysNfkHvhI2RIGmGqRITGrI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dNIQYJhWMrL/BZrkr2FnnPiQVYf8Q03DItJ+kdPQ3shApGyOGOUjT9fNkadykSZhV6eCvYnhgvNTWdc+pyJicpx2VkUq9nmQcBcIQH/wDb5gPR9wWkz5XPdp3MVowQB1sIZkI5pa3LU6xwqKowNaN0QuWxLiZkpu9A57RN3lAkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ffWRSv8J; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ffWRSv8J" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4394036c0efso34322665e9.2 for ; Tue, 25 Mar 2025 04:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902864; x=1743507664; 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=fGhDhYESbCVLGZrKJ7EvUOhY/AIfq8zAGCvPtzsm0PA=; b=ffWRSv8J+GPpoy6DbNK+oKp1tY7WD4lq0zW2WzZjKmfy9AqtHmFqar8PY63iyhyqpY IJ3v31dtWrDJ8IGoUkGogdK1ezqGXD/4+8flP3qusj1Sdn4m4cQVmxmZHFm5Mg9VY49G Gw6+qTpu41rj4/dc3srTpCkgaV+SjikJw//DNigemL8yyZNXLVuo3u4/WVAgBYQmMial 7WyPLZuIZjknB3KQTQ4M2Yh/oH1cqUaZh2lObK/ug7O5ouDCvXxoSOumxIlloOyQ5gGM j8AhfR2J9xgSlJkekOtSVcglrViP+rnDcwH2ZX5+YfSoO/wpz0WAJUCav2irLGm4l4zb SPZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902864; x=1743507664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGhDhYESbCVLGZrKJ7EvUOhY/AIfq8zAGCvPtzsm0PA=; b=uGtzEyObCeCqXFRSsAZx/riCodZZamO7ISWLU7yV+9hHAuA0ssW9CvPX5tYDmxCm6B tNiw5fDwJ/tb9NuDpY2krF8oaE/bADB5t41KAi18TX2XDygPlRZSg4rWQlbGxl1OVTaH 8xPV6HUGuKsncW+eD4thavxqbR6oUR4rzzg/UTIHsf41JV0GVdC5qfm8L1M6wDi9VXza mUdTsolaZtCMxYffbcdfadjVcctl8WqUnOt5puDvtVYpgS7SMXCs8HB6+INBM/8J7bNT C46y2QcSubccpkc1NYzO98X9tp1Jgr7JGUTVyJP36E5x1qATH7rqt1YIod3yRmCNlHER MumA== X-Forwarded-Encrypted: i=1; AJvYcCVHMdC70DRKk1QjPS+5RiWqfVNKk3OJ/fzmxslkR+Hf5E7sZiH8P8d0O5g4XzzqFxCs0pPp4my7Qh/Crwk=@vger.kernel.org X-Gm-Message-State: AOJu0YzaLtAG89io+p3AEovnwCbQPgiKcKATS33SWYcImFdMz2c3g/VO apdx30xrCMrT0v/ldY0VMlpkQfpjp+EegcnhmHSiU+UISyc2ug3Rb2MQJk1M3MY= X-Gm-Gg: ASbGnctaaF9C0+M9k3+Pf5/VWYZGRYNo0bGLSvmpQxOuQshCkc/US2AEvY+KaDe/0MX MH94ZRpVc6iPLhHfM6V8cxsuZnac80qo4boXYH/l5GqBRh6IxWhU3S0pQq90Sz+nU8XCOhLoqZI UwbFtUWhE8n3OtJqvyFYxUN4+Orj4JIdTquPnckpmeX8iSSL4uiwTaI3yu0q4tkjmpV+LPIWBhk Mj6J0Vg8oNBONBltJZ3x9qr3zTKpA81rptMtFJ/F8gzs1L5qiUwr6yG2HdysMITg31QVAHq20ML mrgDNZkkG0xRJVuqVokXviH3NB6fW15oCDpbNbrssdCtdVu8uwk9gY3ZZOmrt1fVF3P2Eg== X-Google-Smtp-Source: AGHT+IHnXTKa7PclIfoxNwdAn+abeRK1ZHaSvsObkxA3nuEMe8tz977mZM57XF3mqVcCCaA/t91RfQ== X-Received: by 2002:a05:600c:5021:b0:43d:1c3:cb2e with SMTP id 5b1f17b1804b1-43d509f6788mr171568615e9.17.1742902864348; Tue, 25 Mar 2025 04:41:04 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:03 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla , Krzysztof Kozlowski Subject: [PATCH v5 1/6] dt-bindings: mux: add optional regulator binding to gpio mux Date: Tue, 25 Mar 2025 11:40:53 +0000 Message-Id: <20250325114058.12083-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla On some platforms to minimise pop and click during switching between CTIA and OMTP headset an additional HiFi Mux Switch is used. Most common case is that this switch is switched on by default, but on some platforms this needs a regulator enable. One such platform is Lenovo T14s. This patch adds required bindings in gpio-mux to add such optional regulato= r. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/mux/gpio-mux.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.yaml b/Document= ation/devicetree/bindings/mux/gpio-mux.yaml index b597c1f2c577..ef7e33ec85d4 100644 --- a/Documentation/devicetree/bindings/mux/gpio-mux.yaml +++ b/Documentation/devicetree/bindings/mux/gpio-mux.yaml @@ -25,6 +25,10 @@ properties: description: List of gpios used to control the multiplexer, least significant bit= first. =20 + mux-supply: + description: + Regulator to power on the multiplexer. + '#mux-control-cells': enum: [ 0, 1 ] =20 --=20 2.39.5 From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 7E3912566C0 for ; Tue, 25 Mar 2025 11:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902869; cv=none; b=RTuVtu68NlIfcsHtQ0nPjYG0vKwTrka2LxjNyBYtCoTCujI4tsaEmQGP1EkQS5C8hNutOJSfVstoH6a59XOMjTzA4QQuWVuxU0dlnkVQsm7Pqg/HIYAWlYDSakkz4cFif31d2R6CWrxERxJ5IpdMpy8z0//dA6U/v+xjaI/Efpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902869; c=relaxed/simple; bh=5X1aPO2z0jUPOmAmxxbRnG88+AZ4I5yT718/OM1HQtE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WEgYNc1octY0khcqU/d4DfFtUXRC2ng+Z9AH0mXVewq7rRSGfMG5i3RudXfJCcdlui5Z5rRrsot6ynzqMbC0Hao5bV8SJcPoOyIFdwT00ZtCgYlafqpSR3s5CCUuKF7Hy1LIppSSA+yWtvhLcS5maScV44OkiHzANEk0YQPn0p4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=usKXiX65; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="usKXiX65" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-39ac9aea656so424556f8f.3 for ; Tue, 25 Mar 2025 04:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902865; x=1743507665; 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=QPfdok1uXbCV3fbB68Oh0kuMKD9EmCqvBmSN9d5b64A=; b=usKXiX65vIWe7q2d7htqljwhlLNAbcNC8d+RPpW0XIPTuELCE68RrY/B7D0vW3fIU0 HR5a93xtJBjJRre9zzsTSbTA+JOPmc08bAVizY1fVVD8CEvo25qR7kTk3iDndWEm9trn NbF/Bquob1YR23U3anxQ4jKhoGuB+NIOhXraQWoRL70luThMNDKWJafMMvpOVtVsTtQx QMR0I5eChNE9dl2wSy19R8u9W9yeSaIWlyjCuzYUTGPYf5PUc9+VifBc0teGazFPUXzc DhlglhqJWE3+CSQs5fr8drisvfzv8oQf/m+6uAWHEDuZ0L/fvm+G1k+R+IOrIc1EgQL5 f+7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902865; x=1743507665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QPfdok1uXbCV3fbB68Oh0kuMKD9EmCqvBmSN9d5b64A=; b=F9zGlwK8Wkv+s1y9f8YkJgDkEoIISOowT/dF6iuFJQvahKD7W1UVDeN3vwI64i7FI1 55k90ngL0Nj+tgk0n7L14j9Lg0yGKiWUC8tNIJ05Ia75GJNl8UAJ70aVIKZY9DD2Pv9Y x3VxVbVL+1Lba0pfQ86uGtTId8Wg42KjHz1usfZA6zcuQBD++8/uUWSix98pyZ3I4L4f vMek0/u/KBCeQBHPfSRx2PgEGWnaP/srt+rz8HwnBE8rJaIkDMcdQjKcnZ81ZgS152Ik Gu3E8ThI05Y+TgVNK9hvG97oFbZcEz57SqgTa08/KtxK/HmKo9RBFZ7/2bieQkE6W0Y9 5wNg== X-Forwarded-Encrypted: i=1; AJvYcCWkPqc3X80sI4ZyW7j6Epu6e4y5RmmmQKWm8Oi6z52V7CnJrjg2451KU3OJrvQvDtPtY1rcK2xHkYcqT84=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9QA3xi0oPh0znC9RNyvYUbT16mWjVBQNx/Dg7RoKXRc7UFANB LH0Zr5jMhpSmSsWBE45e8Yfwnu9RxpeP0MuHFqPKhCHWQYZ3evlWcOoEQ00FTDs= X-Gm-Gg: ASbGncspnO/XWO9LIbDM0q0zPwJjV9Jk+jGhBWddc0VL6Ja69H500nkp/zN54GQ5HuF tGZ3b/wgKSuiq56j7Go7WhGFl6f/OSfxDC20YmExZJDihm+gMftxlrB8jpcyso7hBcGS1ErTB3O B8DnRWkO0J7YY4Swm0MOEmPkNJsdkFuOfvuwX4L7wJnRqjZ1RJHyPYceZNmcYEbSVfEiylVCtXD 9riW+R/et+roMgcPSSzkjmKk2gRnOv5h/y8LVP1FG2sxtqHjsbxCtaE2JAwA8RmjNpWz4b6yUYy e5ACHZpziBuNYzeHaa9j3H/4dXJOsIK30okALdAjOuekM21ZrnUopT/Gj4fNtfCWOYSGyA== X-Google-Smtp-Source: AGHT+IGX+E1xFo91m0AYrkO4kkEoY2JQnq0F/cboQi3QOCvL7ex9DY7qp1H7fIxNEBp+thnIa9ixkA== X-Received: by 2002:a5d:648e:0:b0:390:ee01:68fa with SMTP id ffacd0b85a97d-3997f91287emr14148949f8f.24.1742902865471; Tue, 25 Mar 2025 04:41:05 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:04 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla , Christopher Obbard Subject: [PATCH v5 2/6] mux: gpio: add optional regulator support Date: Tue, 25 Mar 2025 11:40:54 +0000 Message-Id: <20250325114058.12083-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla Some of the external muxes needs powering up using a regulator. This is the case with Lenovo T14s laptop which has a external audio mux to handle US/EURO headsets. Add support to the driver to handle this optional regulator. Signed-off-by: Srinivas Kandagatla Tested-by: Christopher Obbard --- drivers/mux/gpio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c index cc5f2c1861d4..d1607f287755 100644 --- a/drivers/mux/gpio.c +++ b/drivers/mux/gpio.c @@ -15,6 +15,7 @@ #include #include #include +#include =20 struct mux_gpio { struct gpio_descs *gpios; @@ -82,6 +83,10 @@ static int mux_gpio_probe(struct platform_device *pdev) mux_chip->mux->idle_state =3D idle_state; } =20 + ret =3D devm_regulator_get_enable_optional(dev, "mux"); + if (ret && ret !=3D -ENODEV) + return dev_err_probe(dev, ret, "Couldn't retrieve/enable gpio mux supply= \n"); + ret =3D devm_mux_chip_register(dev, mux_chip); if (ret < 0) return ret; --=20 2.39.5 From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 1D3FF256C64 for ; Tue, 25 Mar 2025 11:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902871; cv=none; b=WlOF8Aa/mmqK33TDDnKJDTgtpM54axvEIiCa3RPi8izeyDaMRFRXYNrjHz0UM0ok8npT2vPP8gmqCwwVgp7hNovKGePEghxyUpi8seyU3WLZcVWwNE/YE0FwbpZy4LoPHq1SZ0GLjvbpRMJFgjfu8WkpMbHnkxrFY7I750RWk1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902871; c=relaxed/simple; bh=hJEhHBHgmcwkLGn7ADU+TBJtnvqkH4aaspjSeICJrEo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JfME0H2XizjmbKMpRw+Lifd6htOu+QapH4559mowiOw2vo5IRPc+6Buv47oFJs8sMLLdx5IluYmvnsbedWaXvLs5kU8WtU3XDQbokHxyMy5v7y8l4EISncjnuF6f9lmdjE/XUOR7WTno0m3w98SlfsZ2/JfKtp3/DceoBJ5gBo8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=flRyaYqp; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="flRyaYqp" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3913d129c1aso3915867f8f.0 for ; Tue, 25 Mar 2025 04:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902867; x=1743507667; 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=QPKG26aBT6MGmMvi54w+dEW5MMoDzMUIu/y68UikHrA=; b=flRyaYqpIoHDWb/GhPNgMRLoc0AvD/ObTBvINIpHY09sagiCxJdWtkqYkMyUp8P5Xp ktvCxaAPQJzafUDmnsGdzElQoMZNtaHrR6v9KM1tw8K5PZlKlmwD0FdN1hqjltA1Usit NVP1p+Kl5wB3u+9Q/Kwh24rMloQIMbnOmv0RqeadXLU35wqL5uR6HwbFTFf9relFvVHB 6QZ1PsreiTD4hbOxyluudh+p8l0Rs1vpDDqOlHtIVIVBw0Qz/Tz94oBYM3+08d62fYCP vVLSJMnqks3lI5/RYa8Rb+7BZO88TGFpVp/TNDN0Q2ut74bWeCst17MMQppyUVl6zZAl 67vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902867; x=1743507667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QPKG26aBT6MGmMvi54w+dEW5MMoDzMUIu/y68UikHrA=; b=r82t0MefD5uNU69/oQy/P+d6P+f0OlogCijaqLPqNgTGDSMeu8vwT8SxUUJYeuYb1n inwoHkXsAjskvwir6YWpc+xfiQphXl436L0X/1Ms60iWxuMn9bx/7DWQKqQjFO40CJaf JjDIjcPObwR+UF7uEcR8G4PUncZpKFcDtOG2V0aRgDM2Si0WPERWEAIDoQgmK0rpGCvi 4jLDag5BTjY+14Os4T+Rk3Tw4CDWKAClE55HzlYXhLwv6fr0zoJiDKiS24WCQEoEYY8p sKrgrx4CD8ybQfJ5ntE3eBtp1p4eqo9yIJzMRWi39zQG0UmWS8grMVLvgw11vPXFoyr2 aebw== X-Forwarded-Encrypted: i=1; AJvYcCXW/UWK1J4z7sQSQ2JJWDbTrA0oto+p88Cg3lTCnOs4NZ90LcJ9DSnR8Zdx0U35XqYgXBkmMeGvAJgzhKA=@vger.kernel.org X-Gm-Message-State: AOJu0YzQPmCAZLPb/yJGzln6iB9fTuWYqBD4aYpMavQh8HRZinajIUU0 JYdjsySQce4xjn5f2Fi2fveo54gDcAgpdwCqlnuFs0JNIoIf3oyA4pOP0ter5PM= X-Gm-Gg: ASbGnct68mWGzVOXvVQOk+CtRT9Z6kh4eNyKdT1XXrXKRzpGXQLcjJIDe6eHHHeK72w 7Z5hPOtVPuAKIjxuJneR+ryb6jdE2HHe09s4vpISIpHt1Ocnj3aKdD4BWOuHmEiCb3L9MdZfT/P bDutC6umAAkJCGuQLDk7E+PVgvJP65h4vqGhIDO/l+ocGVBhd9IS9srivmDzvuDebREer6gR9SQ JBMUUv79gI7gTEYjLe8ryb8eyyys7CcUv9qcfR9azQGwb+fvMeGjpQ4mhnoTdNzRTgdDJMahTR+ ktYSbcThfhgL48mtjiDtNGpBeDJRMxZ0DpWr8KvRxW3rD4/1Z23MyMUAtbabQ9Mdvew97Q== X-Google-Smtp-Source: AGHT+IFqEVrx5mCJtplG7+w7CWWWndtmmBeTngl+nxKo8qHTXdRc7GMle1DFI7FxDeYhfsG7z+7Agw== X-Received: by 2002:adf:9dce:0:b0:39a:c9ae:9eea with SMTP id ffacd0b85a97d-39ac9aea552mr1090347f8f.10.1742902867202; Tue, 25 Mar 2025 04:41:07 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:06 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla Subject: [PATCH v5 3/6] ASoC: codecs: wcd-mbhc: cleanup swap_gnd_mic api Date: Tue, 25 Mar 2025 11:40:55 +0000 Message-Id: <20250325114058.12083-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla Remove confusing and unused argument in swap_gnd_mic api, the second argument active is not really used, and always set to true in the mbhc drivers. The callback itself is used to toggle the gnd_mic lines when a cross connection is detected by mbhc circuits, so there is no need of this argument. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- sound/soc/codecs/wcd-mbhc-v2.h | 2 +- sound/soc/codecs/wcd937x.c | 2 +- sound/soc/codecs/wcd938x.c | 2 +- sound/soc/codecs/wcd939x.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index d589a212b768..4b7c3d6080a1 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1260,7 +1260,7 @@ static void wcd_correct_swch_plug(struct work_struct = *work) if (pt_gnd_mic_swap_cnt =3D=3D mbhc->swap_thr) { /* US_EU gpio present, flip switch */ if (mbhc->cfg->swap_gnd_mic) { - if (mbhc->cfg->swap_gnd_mic(component, true)) + if (mbhc->cfg->swap_gnd_mic(component)) continue; } } diff --git a/sound/soc/codecs/wcd-mbhc-v2.h b/sound/soc/codecs/wcd-mbhc-v2.h index b977e8f87d7c..a5d52b9643f5 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.h +++ b/sound/soc/codecs/wcd-mbhc-v2.h @@ -194,7 +194,7 @@ struct wcd_mbhc_config { int num_btn; bool mono_stero_detection; bool typec_analog_mux; - bool (*swap_gnd_mic)(struct snd_soc_component *component, bool active); + bool (*swap_gnd_mic)(struct snd_soc_component *component); bool hs_ext_micbias; bool gnd_det_en; uint32_t linein_th; diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c index c9d5e67bf66e..b2fb8520c823 100644 --- a/sound/soc/codecs/wcd937x.c +++ b/sound/soc/codecs/wcd937x.c @@ -2646,7 +2646,7 @@ static void wcd937x_dt_parse_micbias_info(struct devi= ce *dev, struct wcd937x_pri dev_warn(dev, "Micbias3 DT property not found\n"); } =20 -static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component, bool= active) +static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component) { int value; struct wcd937x_priv *wcd937x; diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index f2a4f3262bdb..dfaa3de31164 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3235,7 +3235,7 @@ static void wcd938x_dt_parse_micbias_info(struct devi= ce *dev, struct wcd938x_pri dev_info(dev, "%s: Micbias4 DT property not found\n", __func__); } =20 -static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component, bool= active) +static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component) { int value; =20 diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c index 4a417a92514d..546aa88a398c 100644 --- a/sound/soc/codecs/wcd939x.c +++ b/sound/soc/codecs/wcd939x.c @@ -3215,7 +3215,7 @@ static void wcd939x_dt_parse_micbias_info(struct devi= ce *dev, struct wcd939x_pri } =20 #if IS_ENABLED(CONFIG_TYPEC) -static bool wcd939x_swap_gnd_mic(struct snd_soc_component *component, bool= active) +static bool wcd939x_swap_gnd_mic(struct snd_soc_component *component) { struct wcd939x_priv *wcd939x =3D snd_soc_component_get_drvdata(component); =20 --=20 2.39.5 From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 9116A256C8C for ; Tue, 25 Mar 2025 11:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902872; cv=none; b=TyPdZpoY/LJf1VeMVfgAYKOMPD4mOsVr2wgnJzijeUQC0KxMWDKZTlkB2CXHC31xQvIJwOprK5MGHwf+yyTYM90Z7IH6E0aCTE6zRyI7ZKUsysh6I0iBXfijbVTDMUWtIBZwO9+AWedUvQlFNMwOq9EQzQetlYqW41nJKZDWCAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902872; c=relaxed/simple; bh=SaEurHg9my0SgGDfooWj4uP1HnHehhMQjbSphU85xtU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TXc6i1TrWYLmRJLKhiOSO6VyQP6E20be0y72oumqH79Qh5qypbIaaCgj56auB/d4Mzvvyr62qmnobknPmo5Fg6H7aB961zps0LyqmgEMdwUc9JxupH34Mz+dzKaz6EkfRBSLAQLWrynCQmjvjACe9NHalNuab+Rtm5+PPn9DjTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sNiEq731; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sNiEq731" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43948f77f1aso36455745e9.0 for ; Tue, 25 Mar 2025 04:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902869; x=1743507669; 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=GZ6QvHirUebkLT0cLpo0Lkee0nQc81mUaPIyQl+HrrA=; b=sNiEq731KTmc1jjTcm9F7gE2NNji+grJtIKmNHJ32ZmXJLv/+37Ls9RS2WPCzmPXzz rxosFbjIq4Tt3l+HHYcXACz92l76Lc2zYqYZjs1GRYgqb5ubRUnjBkWJsdrAuCHZNN/t ItDoHUTRGt+azghgSgnlrabAk2ez4U1eg1CIprAAMlzJdaAo64IPldLV0YDotlUvWn/T /kCKnd7Zh2z+rBhmzwIaoy0bHQ4tPoKdTxeAqDM6OEDLLfaMfKQo78VgKrLiaegdWWO0 yM0sBQn0REvebg6R5befbv3mpjUyC+6aWX6AvrUObxQ3X1cR42tEFVfn4Szz1JEV4YKx Jrlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902869; x=1743507669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GZ6QvHirUebkLT0cLpo0Lkee0nQc81mUaPIyQl+HrrA=; b=PQ8FlcnP2MTo7YugToTUrL8QBbCOJyIj/mx4IvgWWv1BpMQntuBfPQnjYPpD16swyO fxfBkGeiLBiqhal80oFx0DjWvTmrUovF/qKHcCu0n3hkPXnAhi9KcXUyTcfPl5CGB87U qFevIJkRN7uU2jxc1jMIy/VTolMONKcF+X78y/UcRQzJXN3ehAmy/a/MxYiU5zg9nuy1 M7IYblGa6YoDleWGT7dk29HW5oSQLqjTe60O0eGp2auCLsJEZoFrWfpR91DJnPd075NY n9dJ29opZR1NeTfOnqpiYVJ6t0E6Rb9P/2ay7DxudINdVJprxQRhLedO8AXaaqnX0odu W6xw== X-Forwarded-Encrypted: i=1; AJvYcCWhNBygw/fAoNrmvnMDdhX6g0ZQwFeAGBDf2uVeZ748Gl5IuexTyaxbXhzVc3dj6zyJfQ6Z+NOzI8N0Meo=@vger.kernel.org X-Gm-Message-State: AOJu0YwnpoMopAS2UIuuMoz3jrKHX1bnMhaq/36uubAiXt/I3zaCYOh0 bgGUPorqd3SvzN1p2csVR1soXarRoaxyY2ehbI+79I+d7XMzLWeXFeLEEqQSIDU= X-Gm-Gg: ASbGnctRvwTOco3tCLhTC3GKecpuH9lAv0e84ZfFEGYHjju4bDeNjbagStlV4+hbctk QFJkap/AEpXLQdVWX84InpQ2SwEZPMSB4GcgopGf/lCbv/KRyQX2X7Mteo1I6GFMLln/7XaGJoL YjkFAZcLdTfNanII8vKHKr/Vzc3LJ6FqF855peK1Y92eXGjgj1IjW+kvCoHzOSsMr7OdVyaeJCH IRhwD/zhm2+vUGyqnK9YxpYGG/WGr/a+hPDm+136ogajUtFiNjHUq916Oo6/+3vTRGE+8ukjsi3 mPLflyF6Up40LwsXn3uRFtSfdB1XycbgTCs7agwo+PXXenL3KlGOSH3ImZ1/l5ue7bWVdg== X-Google-Smtp-Source: AGHT+IF1Bqa+5FDwi9MVrJZo7CYKuUtOKzFgzROxuovQWzOm+8iaGpshZQMW9c6GASBDXYEB8yBJ5A== X-Received: by 2002:a5d:5989:0:b0:390:fbcf:56be with SMTP id ffacd0b85a97d-3997f892973mr13392870f8f.0.1742902868882; Tue, 25 Mar 2025 04:41:08 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:07 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla , Krzysztof Kozlowski Subject: [PATCH v5 4/6] ASoC: dt-bindings: wcd93xx: add bindings for audio mux controlling hp Date: Tue, 25 Mar 2025 11:40:56 +0000 Message-Id: <20250325114058.12083-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla On some platforms to minimise pop and click during switching between CTIA and OMTP headset an additional HiFi mux is used. Most common case is that this switch is switched on by default, but on some platforms this needs a regulator enable. Move to using mux-controls so that both the gpio and regulators can be driven correctly, rather than adding regulator handing in the codec. This patch adds required bindings to add such mux controls. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/sound/qcom,wcd938x.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd938x.yaml b/Do= cumentation/devicetree/bindings/sound/qcom,wcd938x.yaml index 10531350c336..ab1c6285dbf8 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wcd938x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wcd938x.yaml @@ -23,9 +23,15 @@ properties: - qcom,wcd9380-codec - qcom,wcd9385-codec =20 + mux-controls: + description: A reference to the audio mux switch for + switching CTIA/OMTP Headset types + maxItems: 1 + us-euro-gpios: description: GPIO spec for swapping gnd and mic segments maxItems: 1 + deprecated: true =20 required: - compatible --=20 2.39.5 From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 A6B992571C6 for ; Tue, 25 Mar 2025 11:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902875; cv=none; b=Rzxc6fVnZfKFXAokAIKiWJWh4n90geAluYV2YG+vVxkM4ID2CT7vYSKtqi5Hxp8jJykEB/Y0uD7o/zN9RjiZco8Bbno1p+fmQXhbwIzGefV1+x/Y+AtF0u9/tcfgBovbTcSM2ClYew0+AO+N0t5yfiPr80DuQAJ8orupl7FW45I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902875; c=relaxed/simple; bh=A0WtHTs89u0NRiqeb7jtxP3PC6SiQD+qIJMNWTfSuvQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SAZLw29g52d2RWbZHrUkKUclnjoScpytoZ80Q2kH3URNTSepId7z9iNq8JuEHJMrgm2mp6NKv3y/Z+FSMKQbjd32gO1TkyMFchUN5MbKB1nbMP3AQyhAlryK2cAy3xXFbscfM+Y0qiatEyNibVuncxZg24l73nLfdVVI1/hHIOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wiJ7JQ22; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wiJ7JQ22" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3995ff6b066so3055873f8f.3 for ; Tue, 25 Mar 2025 04:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902870; x=1743507670; 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=ciCsmE+euFjZCUyipJS5apSViu1JxNfFN5bCQJg2zCQ=; b=wiJ7JQ22WojqGzrhJ8Pl+cTT8qIbgdtpPw1H5fgulafVZdOcoggMP508EQlSHIugSy u4FUL4udk5AUOI9r/sLg3gYySlqPBblpBL+7njJyH8DEdSzvpNtSsea3sqeOdIVQ4P9K Ry45Iv8R19LXzFe/A5PJYShS4xvTibjZt/Scr/svzlzqC3NRnvoMG27Pjzw5slBNTkBH tgRABLHmbq4zdLOVLuqlsim8cGrJ9kIKyLC4kl5W7hZgTRAjktbsLqMlEZcqBoS3OJDl ErZhxOiLn9DNv6fzw8/cgQJDlS4IVZLqKQ53AJ7oKZIG77CE8APAD6bYJDsvbtdSzuId R4HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902870; x=1743507670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ciCsmE+euFjZCUyipJS5apSViu1JxNfFN5bCQJg2zCQ=; b=Ks18lcATvfBVOJPQR0TG0caapXnVZigt+y6wHwRC1k6zSRqdK5IhyGRiWQxp67WHNK /7HpUuEwgC5xyUzsnwJYECsn1ty3VMPjUddWOD3TYeGf7xgEnfLIxBjgvP5Q+Hu/aVbl VwNSWZKbhThgDUewBnNevU4sEKv4MZBEpac3MwUfar6hybJ9P90qh/bexRPBUrn3avqc AqrS2hxQIX8jdpgXG2dYZc/0ev+/Cj+29FXC2lbNqiyGHUag4xeMH0ON8r8+S/B+EA0f MjFUyBEGuAMrMRcfziE4bLpQGxYqmZtKHjH4SErJwHzhJZ2AB6p+TuT4SRLC5MMUgjww D6Bg== X-Forwarded-Encrypted: i=1; AJvYcCWZgycC1shPGHThIQp+y9zzIhbtruLetdpcUVlf8MPn4oesdu1QUjeFCwZjNzYI3FKvM9zmPUAQL9i37rw=@vger.kernel.org X-Gm-Message-State: AOJu0YzeBx6m7+Iw66o9vIj/z9D+eW6z2GbTsDyZVVQqu9lmgc2U7OOW xEqcwDeII9YGO+sp04p2uVtcuVD5udeVGsQV0wzF4aTUo7V2Co7xANGKYjKpg7c= X-Gm-Gg: ASbGnctLdCv4ACZgYp3d2YZKm7bMOlou4Y0NhIWAhXDsI2kWWQPX3iYdis0J6ImPw/l F5waCIY0jX5vSntIrg6rjEE/fLv7DL+665mP7hGhDmuOscmMg9nZx29ewb56iLjHnLds6oxO+zK Z2U/Dx9+I39bm1K9Mbi7AcYlnro7MLmk+JMXOw2PF25MDkxjk3IXqqEVRWqre5tAUu+LU+PKDbI Acvzkd9q3L4F5D0MGt9gt+LSfPkyqpCwhq3J5h0eiBEkw+qMlejmq9+EEgI370GGtDKFLpujHoz rKcjUqrXrq7xXp/ItY62+vJjpHFO1qj/ooF/TT7ClFcWQPBl7U33XoFh9a/vvqAxje7PJA== X-Google-Smtp-Source: AGHT+IF0JTdKEiQNMaj66CfUpe4bYsSfOE4aj8Z5HReCu3uR/s99pqqLX+H/2CSyYdeTC/sC6+XkdA== X-Received: by 2002:a5d:5f96:0:b0:391:2fe3:24ec with SMTP id ffacd0b85a97d-3997f91072amr14239891f8f.14.1742902870048; Tue, 25 Mar 2025 04:41:10 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:09 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla , Christopher Obbard Subject: [PATCH v5 5/6] ASoC: codecs: wcd938x: add mux control support for hp audio mux Date: Tue, 25 Mar 2025 11:40:57 +0000 Message-Id: <20250325114058.12083-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla On some platforms to minimise pop and click during switching between CTIA and OMTP headset an additional HiFi mux is used. Most common case is that this switch is switched on by default, but on some platforms this needs a regulator enable. move to using mux control to enable both regulator and handle gpios, deprecate the usage of gpio. Signed-off-by: Srinivas Kandagatla Tested-by: Christopher Obbard --- sound/soc/codecs/Kconfig | 1 + sound/soc/codecs/wcd938x.c | 50 +++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index ee35f3aa5521..a2829d76e108 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -2226,6 +2226,7 @@ config SND_SOC_WCD938X tristate depends on SOUNDWIRE || !SOUNDWIRE select SND_SOC_WCD_CLASSH + select MULTIPLEXER =20 config SND_SOC_WCD938X_SDW tristate "WCD9380/WCD9385 Codec - SDW" diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index dfaa3de31164..209d0b64c8be 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -19,6 +19,7 @@ #include #include #include +#include #include =20 #include "wcd-clsh-v2.h" @@ -178,6 +179,8 @@ struct wcd938x_priv { int variant; int reset_gpio; struct gpio_desc *us_euro_gpio; + struct mux_control *us_euro_mux; + unsigned int mux_state; u32 micb1_mv; u32 micb2_mv; u32 micb3_mv; @@ -3237,15 +3240,22 @@ static void wcd938x_dt_parse_micbias_info(struct de= vice *dev, struct wcd938x_pri =20 static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component) { - int value; - - struct wcd938x_priv *wcd938x; - - wcd938x =3D snd_soc_component_get_drvdata(component); + struct wcd938x_priv *wcd938x =3D snd_soc_component_get_drvdata(component); + struct device *dev =3D component->dev; + int ret; =20 - value =3D gpiod_get_value(wcd938x->us_euro_gpio); + if (wcd938x->us_euro_mux) { + mux_control_deselect(wcd938x->us_euro_mux); + ret =3D mux_control_try_select(wcd938x->us_euro_mux, !wcd938x->mux_state= ); + if (ret) { + dev_err(dev, "Error (%d) Unable to select us/euro mux state\n", ret); + return false; + } + } else { + gpiod_set_value(wcd938x->us_euro_gpio, !wcd938x->mux_state); + } =20 - gpiod_set_value(wcd938x->us_euro_gpio, !value); + wcd938x->mux_state =3D !wcd938x->mux_state; =20 return true; } @@ -3261,11 +3271,24 @@ static int wcd938x_populate_dt_data(struct wcd938x_= priv *wcd938x, struct device return dev_err_probe(dev, wcd938x->reset_gpio, "Failed to get reset gpio\n"); =20 - wcd938x->us_euro_gpio =3D devm_gpiod_get_optional(dev, "us-euro", - GPIOD_OUT_LOW); - if (IS_ERR(wcd938x->us_euro_gpio)) - return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio), - "us-euro swap Control GPIO not found\n"); + wcd938x->us_euro_mux =3D devm_mux_control_get(dev, NULL); + if (IS_ERR(wcd938x->us_euro_mux)) { + if (PTR_ERR(wcd938x->us_euro_mux) =3D=3D -EPROBE_DEFER) + return -EPROBE_DEFER; + + /* mux is optional and now fallback to using gpio */ + wcd938x->us_euro_mux =3D NULL; + wcd938x->us_euro_gpio =3D devm_gpiod_get_optional(dev, "us-euro", GPIOD_= OUT_LOW); + if (IS_ERR(wcd938x->us_euro_gpio)) + return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio), + "us-euro swap Control GPIO not found\n"); + } else { + ret =3D mux_control_try_select(wcd938x->us_euro_mux, wcd938x->mux_state); + if (ret) { + dev_err(dev, "Error (%d) Unable to select us/euro mux state\n", ret); + return ret; + } + } =20 cfg->swap_gnd_mic =3D wcd938x_swap_gnd_mic; =20 @@ -3581,6 +3604,9 @@ static void wcd938x_remove(struct platform_device *pd= ev) pm_runtime_set_suspended(dev); pm_runtime_dont_use_autosuspend(dev); =20 + if (wcd938x->us_euro_mux) + mux_control_deselect(wcd938x->us_euro_mux); + regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); } --=20 2.39.5 From nobody Fri Dec 19 00:38:03 2025 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 9450A2571DF for ; Tue, 25 Mar 2025 11:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902875; cv=none; b=IgQ504b9srHmi80ZYBNJaMBrY2ShLMuK+9Y0qIDAbIdJWqzgVIrMNWbvnC5+2eeqfK6TcoAdGQTaAoM9yyLKGJlNHRDEVm3YGtZS0AX32k8pBBoZpz2/oF15f5jJ9lbzw3u9WDTRtoUvjA18V9YvqSPq+YCsHUs3RO5asFeHRYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742902875; c=relaxed/simple; bh=4hK5NwvGZj3PELV41E3//V4IRXz5oGNBj9IGYps+vOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OEYfhpQdQ5j3rnusDa1GNY6xrgc5Dts1ppxMeIzMUxDRTAM+3ADZh2TsCbYcuEoCkZB+WiFavYZNq3w4Vhg1K45u1eGTVap0B8oh6hOxgMqetEFJ+wnLMY8kcg6DUxrmbuKT8VSErm+8zR7i2sBV6E1az8ZvMnMpHEZrE0FPn6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O37S5wV+; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O37S5wV+" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-39133f709f5so2924449f8f.0 for ; Tue, 25 Mar 2025 04:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742902872; x=1743507672; 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=LHH3q92f3jVI2cl1PwT0LmA+qhtDvCooULm9gmNkwck=; b=O37S5wV+iqpX8LHQLqDuBub3v39fJGQ1jyfFmU5HgS1AsV6pBmA00c4M0oJU2vSSSy RhQnb2/5QHg18hkf+Ayg5tGQkQz7U6R8jui0UnBLcJWv4COW6MTfyrqDnbtJmk1IYWaP MsNDYDcbEClzxgGIVWAjY87akqe7w5eaZHTM63o+jNya7GNn5akIBv0Bb5tVpemnQYul 8ycHGqhi7H9cQ9s8d9V3MkC9NBl6n+7213xOjRfFdpRG45ZyXYEOqv4UAtlCGeoDOsUy cqJYWsGLq3QhZnBtCHjzW3O5e90rw/1X/ByTdSfPPwZOnf/ePaZ8wd2VbVqO6qTmyKBq KYjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742902872; x=1743507672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LHH3q92f3jVI2cl1PwT0LmA+qhtDvCooULm9gmNkwck=; b=hlb/QIIDutVwUzk6YWFKKtpccQaagtCd/r7U9hJZ89QqKaEftadyKi5jKSaczmDwj8 dDK45Hzpnh21Tn82ofRDSbF18sWQDYUFQmpBLFMD7ivZTJgvOG65BEyyBtgeegPprsZd r+CaYfGsODWsfgeH89Y++ej2TsUKaGjk9zky6a+adkS1xAJbcuuVx67v+92lZU1OPl4s E6dYYTh8ka2N/7AGTvfsqXmSmYE+f9bqlqbYUY3wMsBrDPYHjy2DytY3K1OAou3O+87E ow4fnw9rR1/mUh/AB58VeLitdlh9mia6WI1n5sFts3TCJaCnK79YxEglCoM+F563b+It Rnuw== X-Forwarded-Encrypted: i=1; AJvYcCUzwM6JJ+qqKX8s9GB2wJGQdgdnCME0UDauBs0KDzk8EnLT1UQTRRPu09vC95g4IiyMNan/hS8J/hjYPWw=@vger.kernel.org X-Gm-Message-State: AOJu0YxAFlm1KlbFdoJDLHm5jPUMhB5ksLGcmJybphdTM+x76V5WCaFY 7pXPjzTV5i+1nkWsyk+6ZM69Vp/b6gipEJkh79rwp7PL3CSokV1rzSlmz6t3Npo= X-Gm-Gg: ASbGncs2uFxmj2+sFFKoVvI6RPnD0fyidZTl5gh33Gmc/wrPyv8GFxcbMyArqRrLmvX eoCEkRSke3BaDyPgcO9Q9wUmQ5dwPt3OTKn8ZepzsHtWpFYj8hrd6hcMz/UC6bWxpE/ekOk6ZOM 1gkxDX131mBT6J6E+T/sTeWYTn1mYZoksf5vdtuPvOc1+Z0eZG5DiJVqlFj5bJby/tqLlA+eM1M 2QFUzjemmUrlJpbfWqbh7gQFKzl+P6cHJ3QxkKDRgMIWwGS1igsYN7Fsx9SYks4uC8jG1Q9yswV /iRAng4GzhMkSn0iLKT7xhdPXV1kAhB0vU/MtWiFtiD2VYIX/hMafRGxo1epOd1SU2BXdw== X-Google-Smtp-Source: AGHT+IEMuI1g0ZU02+lOgr8fYYCjQ7o8X4OMjftQEoVT08K9es8AYYCt3BGby4k10kE/8HnyILx4Lg== X-Received: by 2002:a5d:59a6:0:b0:390:f6aa:4e72 with SMTP id ffacd0b85a97d-3997f8fabdbmr14153166f8f.18.1742902871718; Tue, 25 Mar 2025 04:41:11 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9a6326sm13213330f8f.29.2025.03.25.04.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Mar 2025 04:41:10 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: peda@axentia.se, broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org Cc: ivprusov@salutedevices.com, luca.ceresoli@bootlin.com, zhoubinbin@loongson.cn, paulha@opensource.cirrus.com, lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org, konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com, dmitry.baryshkov@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, johan+linaro@kernel.org, Srinivas Kandagatla , Krzysztof Kozlowski , Christopher Obbard Subject: [PATCH v5 6/6] arm64: dts: qcom: x1e78100-t14s: Enable audio headset support Date: Tue, 25 Mar 2025 11:40:58 +0000 Message-Id: <20250325114058.12083-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> References: <20250325114058.12083-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla On Lenovo ThinkPad T14s, the headset is connected via a HiFi mux to support CTIA and OMTP headsets. This switch is used to minimise pop and click during headset type switching. Enable the mux controls required to power this switch along with wiring up gpio that control the headset switching. Without this, headset audio will be very noisy and might see headset detection errors. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Tested-by: Christopher Obbard --- .../qcom/x1e78100-lenovo-thinkpad-t14s.dtsi | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dtsi b/= arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dtsi index afea82616bc4..34d1d8927484 100644 --- a/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dtsi +++ b/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dtsi @@ -41,6 +41,7 @@ wcd938x: audio-codec { qcom,tx-device =3D <&wcd_tx>; =20 reset-gpios =3D <&tlmm 191 GPIO_ACTIVE_LOW>; + mux-controls =3D <&us_euro_mux_ctrl>; =20 vdd-buck-supply =3D <&vreg_l15b_1p8>; vdd-rxtx-supply =3D <&vreg_l15b_1p8>; @@ -149,6 +150,16 @@ pmic_glink_ss1_con_sbu_in: endpoint { }; }; =20 + /* two muxes together support CTIA and OMTP switching */ + us_euro_mux_ctrl: mux-controller { + compatible =3D "gpio-mux"; + pinctrl-0 =3D <&us_euro_hs_sel>; + pinctrl-names =3D "default"; + mux-supply =3D <&vreg_l16b_2p5>; + #mux-control-cells =3D <0>; + mux-gpios =3D <&tlmm 68 GPIO_ACTIVE_HIGH>; + }; + reserved-memory { linux,cma { compatible =3D "shared-dma-pool"; @@ -604,6 +615,13 @@ vreg_l15b_1p8: ldo15 { regulator-always-on; }; =20 + vreg_l16b_2p5: ldo16 { + regulator-name =3D "vreg_l16b_2p5"; + regulator-min-microvolt =3D <2504000>; + regulator-max-microvolt =3D <2504000>; + regulator-initial-mode =3D ; + }; + vreg_l17b_2p5: ldo17 { regulator-name =3D "vreg_l17b_2p5"; regulator-min-microvolt =3D <2504000>; @@ -1461,6 +1479,13 @@ rtmr1_default: rtmr1-reset-n-active-state { bias-disable; }; =20 + us_euro_hs_sel: us-euro-hs-sel-state { + pins =3D "gpio68"; + function =3D "gpio"; + bias-pull-down; + drive-strength =3D <2>; + }; + usb1_pwr_1p15_reg_en: usb1-pwr-1p15-reg-en-state { pins =3D "gpio188"; function =3D "gpio"; --=20 2.39.5