From patchwork Mon Jan 2 11:41:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 638445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9D4DFC46467 for ; Mon, 2 Jan 2023 11:43:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 04DAC9488; Mon, 2 Jan 2023 12:42:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 04DAC9488 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672659803; bh=mm2aTrjRt2wES2CUu7FGYcD61/ziCPpEBL+95eHkdtQ=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=rTA2dN0UMcFe6t/Jca+H7xDWnHZsvy4AL8rgdjIZPpFu1TiTakBAit9j21FGuRoEF POmssZ/fKY3udgDnODP6NPdANwjB3Nc5OhedY4th+V+3/DcoCDvthWnA9Ophv5/Y8f /tlvToR6hDg+fKuv7AsojuXPgVUAiq1ra2hmlAwA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2D512F8023A; Mon, 2 Jan 2023 12:42:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 832FEF801EB; Mon, 2 Jan 2023 12:42:04 +0100 (CET) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 976CEF801EB for ; Mon, 2 Jan 2023 12:42:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 976CEF801EB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=GK4P+qO5 Received: by mail-lf1-x12b.google.com with SMTP id bq39so33459672lfb.0 for ; Mon, 02 Jan 2023 03:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=d3ISjc0HqFZLXSFtXhlmeBjb8PLOBicDWq3ocAujh1c=; b=GK4P+qO5a7tUHbIu3KBEzJQf+LXCryVD3sQnn0/7NhmYDIr3J7AYo+OB/fW8fZRrBg aA7rscY8x7m82EAsVDetQNaiAXOuNr+95LtYickbCC2H/l1964yv+w+s32rhWGfywqcJ 0vtSPyK9cxBxBJd972wcNTeNZZ11+frK8GIHZ4HgeDMWkyQwLJieUypa9+gXiOLZC2wZ Rj4Pdeh8UUaYaF5msURa97gdfPBDbM0VVBi1r1FEydq+7V7Rqrd78iPbDyF+uzDP1mfu dvqc7v539aBZBsQxIkEuFKfT+F0WYZdn4VHA7b94NHfrpAuebipeb+h+RwMjqOP6v4Yz VJeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=d3ISjc0HqFZLXSFtXhlmeBjb8PLOBicDWq3ocAujh1c=; b=MnHmKx3FFT9RcNeQivoABq3VNwYcdLXX/jfLA7mlAlFcYm6aqkvd1hbAfbYrgxCgO9 2AMxGeeyrMb+xw5oNWyg4UonKWvWywSctZFBkSAavHHMAGU2+oqO7ny8fomtSL2MdEub axM/akflbL5THIuKM0yY7l83M21/ITPojLIw8+TvxxP0/kHLv+Nt/rW1tEoipS/MnoKc xM6xeJ6aKOfWPGtfCTamXGLwvvq2WLAaP39k5WGvV/N/sOTFIMiV7ptfpD7pHcS3D0K5 Bp5B+yTvB8ZpheQAwjXd7cwMLGOSl+nnYzxWa8GlszhNMuI31FDZEhDOVE5KwvbLhR2O BhrA== X-Gm-Message-State: AFqh2kp+OJwkhirnQpJ9hH0ci/619B++yfpZ4B64uC4Dp3Oh2fa8kdPt Fn/HOJKEUQWiZtRD4I6XOnBnWQ== X-Google-Smtp-Source: AMrXdXs9h8TiI5V7XQ5q+QwTxLi/FoTFF6VfTsBp3p4U0gG5FenWvfu1LJLWKzWit66ydiavrRVL5A== X-Received: by 2002:a05:6512:4005:b0:4b5:9183:5ad0 with SMTP id br5-20020a056512400500b004b591835ad0mr14368017lfb.63.1672659719657; Mon, 02 Jan 2023 03:41:59 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b0048a8c907fe9sm4356397lfi.167.2023.01.02.03.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 03:41:59 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe Date: Mon, 2 Jan 2023 12:41:47 +0100 Message-Id: <20230102114152.297305-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> References: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Krzysztof Kozlowski Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Code can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa881x.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index cd7be55f6a89..6df9c48f42bf 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1119,10 +1119,9 @@ static int wsa881x_probe(struct sdw_slave *pdev, wsa881x->sd_n = devm_gpiod_get_optional(dev, "powerdown", GPIOD_FLAGS_BIT_NONEXCLUSIVE); - if (IS_ERR(wsa881x->sd_n)) { - dev_err(&pdev->dev, "Shutdown Control GPIO not found\n"); - return PTR_ERR(wsa881x->sd_n); - } + if (IS_ERR(wsa881x->sd_n)) + return dev_err_probe(dev, PTR_ERR(wsa881x->sd_n), + "Shutdown Control GPIO not found\n"); dev_set_drvdata(dev, wsa881x); wsa881x->slave = pdev; @@ -1138,10 +1137,8 @@ static int wsa881x_probe(struct sdw_slave *pdev, gpiod_direction_output(wsa881x->sd_n, 1); wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config); - if (IS_ERR(wsa881x->regmap)) { - dev_err(&pdev->dev, "regmap_init failed\n"); - return PTR_ERR(wsa881x->regmap); - } + if (IS_ERR(wsa881x->regmap)) + return dev_err_probe(dev, PTR_ERR(wsa881x->regmap), "regmap_init failed\n"); pm_runtime_set_autosuspend_delay(dev, 3000); pm_runtime_use_autosuspend(dev); From patchwork Mon Jan 2 11:41:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 638444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9C88FC54E76 for ; Mon, 2 Jan 2023 11:43:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 56C1194C7; Mon, 2 Jan 2023 12:42:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56C1194C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672659825; bh=ovM7YGeiF5YWFcZAg4hKsxvkaLbu5YZnYUtb7A8PPcY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=MIbPW2qbF1gMnu3LM/FUp6amZkDpGC4fG5xeU65qVZhkO738cQ455Lrclw+F7vm3W 9RR24b1DK91RvECzDE/TS9KsqfDx3C4cW/lcXh5BkWoKxX9Wb1aB/lw9kdFT4GjY1l uU5NL7UDWT0JCNe7h3o3E5x+jusoy4NDjbK3bWAM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32167F80544; Mon, 2 Jan 2023 12:42:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC766F8053A; Mon, 2 Jan 2023 12:42:06 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3DADBF8023A for ; Mon, 2 Jan 2023 12:42:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3DADBF8023A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=HasjY8J8 Received: by mail-lf1-x12a.google.com with SMTP id 1so41237502lfz.4 for ; Mon, 02 Jan 2023 03:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=yMNnSXj/QiOhqHsI5QRJCgQgDJelef4FSyVTSnv9aFE=; b=HasjY8J87SavHdaA7R8pq2SIcm1kxvmhAxkPBIP9ffbBrJqjq1tpRAeRfF5WdMCKGA 4FMQ7jY0j26hnr9NMhpYHH4gfWmLsey/y5sp19xoS5ru3/P7GQu2NTv7VIQbos+76TZC 1rZ2Kv1caFFXXhuAKCM/DAJ+mjONC+Qa9nZqHoNXoyjJQzy160WBDmmwJPvoJ4W9wzIE QmopCkZwnK5nS8EELiWsGe7wYOZD59GYSdKH0d+LbAWkdWb33uJPwY8jAxtxvQmXsR2n LxnY489R2f+mUii7e55hjHxsdb85JE4MLHWjLZwIpC/GPjoPZ9hMgpEIyoRsFi5o6HUq 9nAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yMNnSXj/QiOhqHsI5QRJCgQgDJelef4FSyVTSnv9aFE=; b=o0UmQzXKyeLYUyCffLycKG7TfFvdhtiJ4FTWVwcsbjMu7Gh6ZsCwzUZiRitppQA5+f zSsJhLJCM4TfqvLvoYvqOjS1c11qx8AS1Br41acAFxEy3ArjIbuPpq1BML8l9u/wcU33 t57duVCkYKjI/I5vv7YK/jlJbYGZh5oimPQd4a2nyTHjpo0ZxWUHxv2Z4AlBiE9EvYzl CdtE70V7HwxVAc8ueB79pG00dq2TWKzeeWDPv0f1+Gvo7bdD2IicT8UfLqvQ8xfLHG5t g893PpNVMppRDhudpAqjTtuwhtT4tah17Zeg9xRya3XVPxj8Bz4MkibulSZGrzm7MJDh z4yA== X-Gm-Message-State: AFqh2krL0zlj7NyAjoWrVL1aWTiTYWqz2APVKDGu2Ucdcw1GxT0KKLa1 LMTd2NKqoALxXkku/c73hDDfFQ== X-Google-Smtp-Source: AMrXdXt60VEsqEb6zfQW8P+NRa9yhyF9KUBMbhGc5D9YDyuOq2KnGpl7VUrL6NynXEuHQy+QRk48ww== X-Received: by 2002:ac2:43cf:0:b0:4b5:aa85:3874 with SMTP id u15-20020ac243cf000000b004b5aa853874mr12567219lfl.68.1672659720767; Mon, 02 Jan 2023 03:42:00 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b0048a8c907fe9sm4356397lfi.167.2023.01.02.03.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 03:42:00 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity Date: Mon, 2 Jan 2023 12:41:48 +0100 Message-Id: <20230102114152.297305-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> References: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Krzysztof Kozlowski Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The shutdown GPIO is active low (SD_N), but this depends on actual board layout. Linux drivers should only care about logical state, where high (1) means shutdown and low (0) means do not shutdown. Invert the GPIO to match logical value while preserving backwards DTB compatibility. It is not possible to detect whether ACTIVE_HIGH flag in DTB is because it is an old DTB (using incorrect flag) or it is a new DTB with a correct hardware pin polarity description. Therefore the solution prioritizes backwards compatibility while relying on relevant DTS being upstreamed. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa881x.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 6df9c48f42bf..7a5d31483cfc 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -679,6 +679,11 @@ struct wsa881x_priv { struct sdw_stream_runtime *sruntime; struct sdw_port_config port_config[WSA881X_MAX_SWR_PORTS]; struct gpio_desc *sd_n; + /* + * Logical state for SD_N GPIO: high for shutdown, low for enable. + * For backwards compatibility. + */ + unsigned int sd_n_val; int version; int active_ports; bool port_prepared[WSA881X_MAX_SWR_PORTS]; @@ -1123,6 +1128,26 @@ static int wsa881x_probe(struct sdw_slave *pdev, return dev_err_probe(dev, PTR_ERR(wsa881x->sd_n), "Shutdown Control GPIO not found\n"); + /* + * Backwards compatibility work-around. + * + * The SD_N GPIO is active low, however upstream DTS used always active + * high. Changing the flag in driver and DTS will break backwards + * compatibility, so add a simple value inversion to work with both old + * and new DTS. + * + * This won't work properly with DTS using the flags properly in cases: + * 1. Old DTS with proper ACTIVE_LOW, however such case was broken + * before as the driver required the active high. + * 2. New DTS with proper ACTIVE_HIGH (intended), which is rare case + * (not existing upstream) but possible. This is the price of + * backwards compatibility, therefore this hack should be removed at + * some point. + */ + wsa881x->sd_n_val = gpiod_is_active_low(wsa881x->sd_n); + if (!wsa881x->sd_n_val) + dev_warn(dev, "Using ACTIVE_HIGH for shutdown GPIO. Your DTB might be outdated or you use unsupported configuration for the GPIO."); + dev_set_drvdata(dev, wsa881x); wsa881x->slave = pdev; wsa881x->dev = dev; @@ -1134,7 +1159,7 @@ static int wsa881x_probe(struct sdw_slave *pdev, pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0); pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop; pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY; - gpiod_direction_output(wsa881x->sd_n, 1); + gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val); wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config); if (IS_ERR(wsa881x->regmap)) @@ -1157,7 +1182,7 @@ static int __maybe_unused wsa881x_runtime_suspend(struct device *dev) struct regmap *regmap = dev_get_regmap(dev, NULL); struct wsa881x_priv *wsa881x = dev_get_drvdata(dev); - gpiod_direction_output(wsa881x->sd_n, 0); + gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val); regcache_cache_only(regmap, true); regcache_mark_dirty(regmap); @@ -1172,13 +1197,13 @@ static int __maybe_unused wsa881x_runtime_resume(struct device *dev) struct wsa881x_priv *wsa881x = dev_get_drvdata(dev); unsigned long time; - gpiod_direction_output(wsa881x->sd_n, 1); + gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val); time = wait_for_completion_timeout(&slave->initialization_complete, msecs_to_jiffies(WSA881X_PROBE_TIMEOUT)); if (!time) { dev_err(dev, "Initialization not complete, timed out\n"); - gpiod_direction_output(wsa881x->sd_n, 0); + gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val); return -ETIMEDOUT; } From patchwork Mon Jan 2 11:41:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 638443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9DC8C3DA7A for ; Mon, 2 Jan 2023 11:44:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5B774948C; Mon, 2 Jan 2023 12:43:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5B774948C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672659862; bh=8Zhx6l+qF/fWOqGhxfTMp+MsBvcZpLVs/f2y2lBwBbA=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Qfkqfl9C0L251un3JBSCD1k97xeefJZeIi4NpPximWRevb4Jve+lzBBAYtnrbgm8m 0lkZgVkS+H1eBU2EvdLKJXjZSKYIVI6xhIexDM3+bzPph621fDYW3y10+Zi86avwak YfmOkb+Y5KAP3j1xvp0JpR89ol26y9zip0ukYHxw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E73E2F80553; Mon, 2 Jan 2023 12:42:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 162ADF80551; Mon, 2 Jan 2023 12:42:09 +0100 (CET) Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 09972F8032D for ; Mon, 2 Jan 2023 12:42:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09972F8032D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zqwcpag5 Received: by mail-lf1-x12e.google.com with SMTP id g13so41223153lfv.7 for ; Mon, 02 Jan 2023 03:42:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=s0DGttLpYO77MEtgPKeJIho/3p0G8MvI4IyRdGCB7vI=; b=zqwcpag510R0I1O97o6VuVZ7eDegAgifXOQ6W3qLAzENOo8o5qW4rN02gCLAL6dCsu 2up8OZSLUB52nq77A6YT/Cn8+3bwlzh65dK0BuXJ/yf9BbkmocISqvy3/YFOz5PN0ms3 LNBJAao0LkVySQAdAqQTKxYPoz8Bti1VKoKKN691D6hEVgX5JHjhncSMwWmYt41eueFp Bkr+iuNDg1KfXAjvSJem4BQmHAiTMKQEMofOWgGFfvukDZKK2efqVXZcDzHPq1C+bjIC 9ou629mojNGDu9SLn1cOVK3U5kv/bx2gUXOSMvBHnPfs6F385ErLc81fHO7dR8ezmH+3 16ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=s0DGttLpYO77MEtgPKeJIho/3p0G8MvI4IyRdGCB7vI=; b=28g3kyvNK/h+OWbPDdVgjUJr7/9v0HDG4vrh02oSvJ2JlkB9BBpxS3tRR+qWbnla+C yQ73aSVKa7yxHG/uHD1ySB7eb+OON2bizLbhNHz75GCcvp1fEQQ+AbcLI66ZEMtnDTq/ 52X8mzSSVZjRlQefBpTmlrKb0U6B1GWanDajHyZ0A5QB2EFA8AyfnHG7BBGBsKrQq+xr RZ1aveY3xpDNK1PY3VZEJf21M6yZnog8AVnpTO7uXP7zsduLzUKhzj2RPpV+uXj+gFMf DHvfBvs1FIRzxx+sXaqmhKqvToS3VcXB4uBy4G0Rvc+g6bt9bKkKrqUnrKv73eyCn2c3 3tgg== X-Gm-Message-State: AFqh2kpUk2MzSWeo65omn+Vo1GhdMl3xPDyE1zn4sIPe3kH/VLD5gEfb yyl3+MhaveAeKv3/Di1C81oY9A== X-Google-Smtp-Source: AMrXdXvQ4GlhI7AwL8ZBSeQBpJlW54TbgMV0HW6QzbLTFQGu4if90hQWSqplHqqN7UVJYKnBOJGYzQ== X-Received: by 2002:a05:6512:3f19:b0:4cb:780:813a with SMTP id y25-20020a0565123f1900b004cb0780813amr8558425lfa.13.1672659724660; Mon, 02 Jan 2023 03:42:04 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b0048a8c907fe9sm4356397lfi.167.2023.01.02.03.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 03:42:04 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 7/8] arm64: dts: qcom: sm8250-mtp: Use proper WSA881x shutdown GPIO polarity Date: Mon, 2 Jan 2023 12:41:51 +0100 Message-Id: <20230102114152.297305-7-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> References: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Krzysztof Kozlowski Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed DTS always comes with active high. Since Linux drivers were updated to handle proper flag, correct the DTS. The change is not backwards compatible with older Linux kernel. Signed-off-by: Krzysztof Kozlowski --- arch/arm64/boot/dts/qcom/sm8250-mtp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8250-mtp.dts b/arch/arm64/boot/dts/qcom/sm8250-mtp.dts index 3ed8c84e25b8..f3669c1a311e 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sm8250-mtp.dts @@ -760,7 +760,7 @@ &swr0 { left_spkr: speaker@0,3 { compatible = "sdw10217211000"; reg = <0 3>; - powerdown-gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>; + powerdown-gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; sound-name-prefix = "SpkrLeft"; #sound-dai-cells = <0>; @@ -769,7 +769,7 @@ left_spkr: speaker@0,3 { right_spkr: speaker@0,4 { compatible = "sdw10217211000"; reg = <0 4>; - powerdown-gpios = <&tlmm 127 GPIO_ACTIVE_HIGH>; + powerdown-gpios = <&tlmm 127 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; sound-name-prefix = "SpkrRight"; #sound-dai-cells = <0>; From patchwork Mon Jan 2 11:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 638442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A2C59C3DA7A for ; Mon, 2 Jan 2023 11:44:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D8BD594CE; Mon, 2 Jan 2023 12:44:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D8BD594CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672659895; bh=gr5jlaG4gSwl0XZpix1LBFuRuYV40JFp9nWq/SzIAAE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=G+k1Y7TaON6AO9HBtR9uUsZDHplwZ1ebleSykGLIgN3tD15Ei00Zp2ElDgXUtqVNV VQBMsp2VrFTue7LYddxLSdyrkLjV4PcKphIdOKBKqEWyzjz28SCBG1o02lSjC8AXkc Cj6ZGx2otijkjYZctC+VnEkf20xEavE5O4a1UUIg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D1CF2F80580; Mon, 2 Jan 2023 12:42:14 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22588F80571; Mon, 2 Jan 2023 12:42:11 +0100 (CET) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3BDC9F80543 for ; Mon, 2 Jan 2023 12:42:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3BDC9F80543 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=KPenZeSb Received: by mail-lf1-x134.google.com with SMTP id bf43so41252330lfb.6 for ; Mon, 02 Jan 2023 03:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=qhbiyazKqrVG6CgQo0Lo7FTo8Pu36wyTx9eEnoPfuPs=; b=KPenZeSbjXIiU2I1mwvFnabRBJSzvy4GXBXa8vjN1r0VIuumtfAXVFLeumSTbBxbFD qCghJbdlfn+GmQ3dym2GQW7cIVES2d/hQp6ItUTb8Ib2i/Oi4WvLcbd3dIePeuA37MNg xxn8dFloOYzWkWHGCQ7dNNmrV+Q1noZsHqwrvwK583jCFzVSz9i775OMzFIjmVk0Hto4 8qzd9AIYtReGsWFxqfoP2MDYnbdHkqdhIzUE5Bbl33F5pHvh6KRUn3gtCAyvfChJM3Cz +DtCECE6eZINTvzzrEEd+dTDTTrGcuNwIt8dIBYve1T7Dem4fFREPLPQcq7VS1IF5htf nQxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qhbiyazKqrVG6CgQo0Lo7FTo8Pu36wyTx9eEnoPfuPs=; b=LQ0oUpUbdztX68zkCrHcsj5TOXvx74t55+E5Z+9/B6XPui7njCGzsAldx+arfsmZ6o OAWTQzI0ZhOzl0Dp80OnizDEEgt9oXXmR3ShUh7C7HQoVY3+6YVQOxar8xWCop94NOga UHz3M7KYgvfGLM9gpT5VMU7mw7k7+hH21qamPXpvgs5hEc/UekeZVbI2JYKzV0WvW05x pDjRT3svHzO56w/0fLSW8dZFz7VP3BjxFnm2mI/A7Cn2mI3uAa0BkpLnR5cB7DmGDsTr hdTRqaaSrGhfocSDI5wHyraGw0H2Epdpp9DsJxn3cirQN1OK73vTpb0W6qbWfFmBkd9v jQrQ== X-Gm-Message-State: AFqh2kp0XK41eaLbAjdNTK0qrIzueikIj8oy5EsEdsSUgTHUmtXPUAAv Tf9hvvOUAtC5XWTEf7yJuOEJQw== X-Google-Smtp-Source: AMrXdXthvx+Tv+Pa7lEwdml7FHR3ul82K2m0m6TNS12fV3YlrUqv4uDKYlm0E/geyZfaWdwgBVRUJw== X-Received: by 2002:ac2:599d:0:b0:4b5:b8a9:b42c with SMTP id w29-20020ac2599d000000b004b5b8a9b42cmr10424407lfn.17.1672659725890; Mon, 02 Jan 2023 03:42:05 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b0048a8c907fe9sm4356397lfi.167.2023.01.02.03.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 03:42:05 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 8/8] arm64: dts: qcom: qrb5165-rb5: Use proper WSA881x shutdown GPIO polarity Date: Mon, 2 Jan 2023 12:41:52 +0100 Message-Id: <20230102114152.297305-8-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> References: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Krzysztof Kozlowski Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed DTS always comes with active high. Since Linux drivers were updated to handle proper flag, correct the DTS. The change is not backwards compatible with older Linux kernel. Signed-off-by: Krzysztof Kozlowski --- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts index 8c64cb060e21..5c510d59c054 100644 --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts @@ -1010,7 +1010,7 @@ &swr0 { left_spkr: speaker@0,3 { compatible = "sdw10217211000"; reg = <0 3>; - powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_HIGH>; + powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; sound-name-prefix = "SpkrLeft"; #sound-dai-cells = <0>; @@ -1019,7 +1019,7 @@ left_spkr: speaker@0,3 { right_spkr: speaker@0,4 { compatible = "sdw10217211000"; reg = <0 4>; - powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_HIGH>; + powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; sound-name-prefix = "SpkrRight"; #sound-dai-cells = <0>;