Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3180288rdb; Wed, 13 Sep 2023 04:51:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6NGd8akUaOpyO/9lnNbSNOtxMA7ZuJ40upEcJmh1URKAditwHitMXgCe/ENydVJjRKGVi X-Received: by 2002:a05:6a20:549d:b0:153:c9fa:4ed2 with SMTP id i29-20020a056a20549d00b00153c9fa4ed2mr2330358pzk.11.1694605907423; Wed, 13 Sep 2023 04:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694605907; cv=none; d=google.com; s=arc-20160816; b=HPkg8w2b6IhT2nsR16FFQuA+6JmExrrlBXm6g7JcnUvGfGMiEJbJGZecU81eDBzjFW NoVijnSWLPegV/fqDNvumtNWdX8ZSSB//7i+sc2L6KyPmze3cMD36jL45A4M5+mWJeAd MY9wCTOKa5E1K7CbPqZD9BmHWXGolLqyhuMfzEaVIJkmgG5MKvf/YEj10LMzQB+1AO8u zMhV+QEi1S2tqjWyB4n+sQ1wADSu4MFUeE8cFrJA6sxze7NhYu6WS834m45K/oFMk2ow WIgcARz2dxjG8FgZI24a6QnzM+W7QFlQq96jdWIKwADCqR9iKslHnc35d6vrL9izPE7M 89Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9VygHWUUTxJcwgk20gKLWHe+YEMHPQx8FheNmwIckcQ=; fh=0APTZUKOvF74sGqrjhjjJpAFLL5Kw9fbVHsTj8Q1YJA=; b=Wq0wtlfNNoMzj8t7/DcL8sMcK51k6qUsYhu9k6XqdGeA/AxuHR45hKqHpHhi9edLWh WV+ryeKxJ1+vZmgPDhn34qL2ruhraVHwFvVr+rsDcvNqTcu2+rfeakRcIuSh1cLARDoA Luy8ih/S9T83urJh5gRFNrcSt+7mYVweCeMd9KmwQ4AcbSP/sT9JuS2buUMRAJsmJbV4 ZPlNaeh6bLr/6yBveJK+IxQAkgghN7XZrOpfNUIF0+aXH6LcFAmn/5rdLmTLlXcuUxlt IQVD1tVPOZpQgioFGD52iJ10IHnQcq0PfnjvaElOyZ/mjNLEe66MhybUTM7lW3Z4Z+K5 eYEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=it6XWD63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i12-20020a170902c94c00b001b9d335180dsi10433288pla.618.2023.09.13.04.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=it6XWD63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 604948120476; Wed, 13 Sep 2023 04:50:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240605AbjIMLuc (ORCPT + 99 others); Wed, 13 Sep 2023 07:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240548AbjIMLu1 (ORCPT ); Wed, 13 Sep 2023 07:50:27 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A82651990 for ; Wed, 13 Sep 2023 04:50:22 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31dcf18f9e2so6728747f8f.0 for ; Wed, 13 Sep 2023 04:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694605821; x=1695210621; 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=9VygHWUUTxJcwgk20gKLWHe+YEMHPQx8FheNmwIckcQ=; b=it6XWD63NWzmlXIvizvgT6JCD9RWAoAEwGWTLHbrTB9cBevk2KasDN3Hvq/cBcMTci /GZ9Jwaj3xM6j67vzx0Iu70UkpbvB/MQox/v6wEkDAdFf3qXsl/3mZZZtqkS8bp8KuEy QUuoJeTzvYc38TIzguvRl1iCzvgBaQ8W41EclIJ/ZVpEn8pEHkEpd23pjO4K3N3wBM9H DDEOdS9C0jYoGRySHc9yWUKHEIFBjQOkH2f2nmNDbYsVShyXfoHVYa2xVDd4aSE/QwIg D7l1gyjKSb6urjJ+WXeDWMiGHlarDCCQMYTori2ay49npCywVbUYkzZA42ZXGjOj/3X9 Vcfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694605821; x=1695210621; 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=9VygHWUUTxJcwgk20gKLWHe+YEMHPQx8FheNmwIckcQ=; b=rigoOD7s31kdjxMMj4+FYEYDhipM2FyB7DXDibwkEvauJ6PNcUbBbGKo9Hj/vkmuBU IU1rMjAzr1MzWN7TudodPphgeDSh2eG70kSIi/HXUrGg0pw5U8dTmyamnEf90DUXEWeE 8VAZtoW8jh0nQrzkZqNILXJ8q4ClVI99FOa55H+hIahzqs36e2XGkNEo+awM+1XPsTX6 cC2Oq8gpbMtEJVwe6Z7Y/uD+gTm2ilD4fGJ8h0ERhL3eYca4/WFHXKPoSSgaBk7SzYIV 3vcXwoa+ImhlIvzQJ+/Kun4Aa/hCgT9vCvwrYuB04wwn+FGUGjyysjf99iV/kXay4Rev nu2g== X-Gm-Message-State: AOJu0YwiKvkiADx0MeELb6L6Oa5ep7Kn9LwxjmyOfuBHeFM0SBJ2a8zL Yvyx279/kCE/5dYVYp7J5XzuzQ== X-Received: by 2002:a5d:5957:0:b0:314:12c:4322 with SMTP id e23-20020a5d5957000000b00314012c4322mr1948005wri.4.1694605821222; Wed, 13 Sep 2023 04:50:21 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:3b50:bca5:a754:7463]) by smtp.gmail.com with ESMTPSA id j14-20020adfd20e000000b0031fc4c31d77sm1932689wrh.88.2023.09.13.04.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:50:20 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Ulf Hansson , Paul Cercueil , Harvey Hunt , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Daniel Scally , Hans de Goede , Mark Gross , Heiner Kallweit Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mtd@lists.infradead.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/5] mmc: slot-gpio: use gpiod_set_active_[low|high]() Date: Wed, 13 Sep 2023 13:49:59 +0200 Message-Id: <20230913115001.23183-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230913115001.23183-1-brgl@bgdev.pl> References: <20230913115001.23183-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 04:50:37 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email From: Bartosz Golaszewski We have new, less cumbersome and clearer interfaces for controlling GPIO polarity. Use them in the MMC code. Signed-off-by: Bartosz Golaszewski --- drivers/mmc/core/slot-gpio.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index 2a2d949a9344..a6fea6559a5e 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -204,12 +204,11 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, } /* override forces default (active-low) polarity ... */ - if (override_active_level && !gpiod_is_active_low(desc)) - gpiod_toggle_active_low(desc); - + if (override_active_level) + gpiod_set_active_low(desc); /* ... or active-high */ - if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) - gpiod_toggle_active_low(desc); + else if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) + gpiod_set_active_high(desc); ctx->cd_gpio = desc; @@ -256,7 +255,7 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, } if (host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH) - gpiod_toggle_active_low(desc); + gpiod_set_active_high(desc); ctx->ro_gpio = desc; -- 2.39.2