From patchwork Wed Sep 13 11:49:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1833492 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=j0Odtll7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=diykgQNH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RlzLH5Gzcz1ypG for ; Wed, 13 Sep 2023 21:51:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k3tC6ozwkwkLasmd5i54u9e2+zQszeVilQMa5mtp9DI=; b=j0Odtll7+LLtIe af7ZqpHNMxB+ZYTjyk3D6NK16pxf+0ZuwLr+ZHn53khR8a2rUlEmlakEBSc5FCD/D4RjNcfm7Keus AKGwGOkclgoOeXU45q97TuVaCQdg5l6sc0iwv1SlduKkJ8qUEgGqvE0qKPzYjhPti2FNtVlXHVaPh zgv9/NcUC1YFlYTEtI52mdq4qRWjdZNqU7xWcyjpGHsUsO7RwNBX+Z96NiDhum1J9B8/LCItByqgO It1+OFRaeAoqzaD64UmU1ImZI7MKv0T91z6GTu3Bl86IkI0mD4YXhNqHOT/i0ZQKzUPF9xaadVA84 wv4GgBAoLgvO1m/7rv5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO0-005mVt-22; Wed, 13 Sep 2023 11:50:24 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgONx-005mT2-03 for linux-mtd@lists.infradead.org; Wed, 13 Sep 2023 11:50:22 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31f8a05aa24so4516821f8f.1 for ; Wed, 13 Sep 2023 04:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694605819; x=1695210619; darn=lists.infradead.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=YzyriHXDyGfsqSRGhB6U9l6fcpz9mRdaLbPmEard1K0=; b=diykgQNHslJlYxO1/+kmE+xqjB+SOm+RBHSgI+7Tj2KIJO7Zc4U7ThKnyN7kUlj//l DHKIDL9gyFwv83WGbOEjfeRL2moV24vk74C3imua/EgIYHkx7/dn7nciD0s0YOPB8ZYk WVu6vwfNNjN5fTeHQY+/S7+PDpzZd/NP0C8+v1+gUfkXZAS96b1DR2mq6jjfn3L082y4 fQwRQQtgDDkQr4AKDn9BDhzgiUbZssPnF4ZrKMc93QCWiJPRmx7BTTKNcXeukG9QrSqJ KxbAVcuA5g0TS9+Xurc8bn5FUy5S8IXdA++Dyh41n9ni3REcpCIxddUghX1K0N6+q9m9 ztHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694605819; x=1695210619; 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=YzyriHXDyGfsqSRGhB6U9l6fcpz9mRdaLbPmEard1K0=; b=xRIpMFdIZbT0N2NzqNgnvzdzKIQV9/WtLSPSjKP2zI4dJV5DkUB1GmsyihrX6XFUss D5WLCzmBXBtlno4lQvncQjkt6BKi/Ks03/4s0IroAU8fyFLEMJxuMDd/csyX5HoVK3dZ NCTericRDcTgVmJSRIa9ooQm8z1mH38XRn5s4LWlhzNj5tc1CnXvq8hRq8KgLspBDRl4 PqqsJ7gt+Sj1KtTu7j4H87F65cnpKg5P5uiEajoSVjMGcGrXTp9aFy5cS61ys1JwFl8R TRIa6dcseDTqaMvBnnTIWJqdWb6+9/n6Gg6ziuKEPJ4TVXu/OENCfrZfaV35ovMlxsiW upPQ== X-Gm-Message-State: AOJu0YyRtOcgJ4l5Hf6KuebVS0JimwonK+L95nJWe3A5uittljiwes4I TiQ5uoc3V+uiL2XrLfIHhXnC9Q== X-Google-Smtp-Source: AGHT+IHc3Nnqh7FxXn5j82zlMwGGyFk0UEacPknUOdO1EfjviMuMeXi35mpFtRpdkqCvV2719fQtUA== X-Received: by 2002:a5d:620a:0:b0:313:f61c:42ab with SMTP id y10-20020a5d620a000000b00313f61c42abmr1731997wru.56.1694605818963; Wed, 13 Sep 2023 04:50:18 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:50:18 -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 1/5] gpiolib: provide gpiod_set_active_[low/high]() Date: Wed, 13 Sep 2023 13:49:57 +0200 Message-Id: <20230913115001.23183-2-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_045021_205871_A94A7F2A X-CRM114-Status: GOOD ( 12.79 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Bartosz Golaszewski Out current interface for changing line polarity is quite cumbersome to use as it only "toggles" the current state instead of deterministically setting it. Because of that all but one user in the kern [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42b listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bartosz Golaszewski Out current interface for changing line polarity is quite cumbersome to use as it only "toggles" the current state instead of deterministically setting it. Because of that all but one user in the kernel first need check the current state anyway. Let's provide two new functions that allow users to set this value explicitly with the aim of removing the existing function. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpiolib.c | 22 ++++++++++++++++++++++ include/linux/gpio/consumer.h | 14 ++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index edffa0d2acaa..131965814a7c 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2725,6 +2725,28 @@ void gpiod_toggle_active_low(struct gpio_desc *desc) } EXPORT_SYMBOL_GPL(gpiod_toggle_active_low); +/** + * gpiod_set_active_low() - set the GPIO as active-low + * @desc: the GPIO descriptor to set the active-low setting for + */ +void gpiod_set_active_low(struct gpio_desc *desc) +{ + VALIDATE_DESC_VOID(desc); + set_bit(FLAG_ACTIVE_LOW, &desc->flags); +} +EXPORT_SYMBOL_GPL(gpiod_set_active_low); + +/** + * gpiod_set_active_high() - set the GPIO as active-high + * @desc: the GPIO descriptor to set the active-low setting for + */ +void gpiod_set_active_high(struct gpio_desc *desc) +{ + VALIDATE_DESC_VOID(desc); + clear_bit(FLAG_ACTIVE_LOW, &desc->flags); +} +EXPORT_SYMBOL_GPL(gpiod_set_active_high); + static int gpio_chip_get_value(struct gpio_chip *gc, const struct gpio_desc *desc) { return gc->get ? gc->get(gc, gpio_chip_hwgpio(desc)) : -EIO; diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 6cc345440a5b..ddbf0d8e4a75 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -160,6 +160,8 @@ int gpiod_set_raw_array_value_cansleep(unsigned int array_size, int gpiod_set_config(struct gpio_desc *desc, unsigned long config); int gpiod_set_debounce(struct gpio_desc *desc, unsigned int debounce); void gpiod_toggle_active_low(struct gpio_desc *desc); +void gpiod_set_active_low(struct gpio_desc *desc); +void gpiod_set_active_high(struct gpio_desc *desc); int gpiod_is_active_low(const struct gpio_desc *desc); int gpiod_cansleep(const struct gpio_desc *desc); @@ -499,6 +501,18 @@ static inline void gpiod_toggle_active_low(struct gpio_desc *desc) WARN_ON(desc); } +static inline void gpiod_set_active_low(struct gpio_desc *desc +{ + /* GPIO can never have been requested */ + WARN_ON(desc); +} + +static inline void gpiod_set_active_high(struct gpio_desc *desc) +{ + /* GPIO can never have been requested */ + WARN_ON(desc); +} + static inline int gpiod_is_active_low(const struct gpio_desc *desc) { /* GPIO can never have been requested */ From patchwork Wed Sep 13 11:49:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1833493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=A3xTs8N+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=JgrKBtTu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RlzLH5VWMz26jQ for ; Wed, 13 Sep 2023 21:51:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P72YnbHG277V28NmKzgEKK0LlAUPoVLvCPTcL5fKXi0=; b=A3xTs8N+TfgEuj VetKGe1/xXNwJdLxkL9ig87HYoMeYftGr2vQUWOMGQ/PxP2PTcaSyjAZytu4McTRNjF86WYx/gONg p78lJqoXYI5r52DYSJ3mo5SliW4Dj5gpD8Q34nXoXtYRswUZ1AhQ5z9D+0XN1ld4tMjfMvmYTAUB5 krj/E1xtElBLFSLMNfj06BhkFK5BsSG5HBJvb3va2w1ishfvId2oEiC+Cn510PXqiKlO0Kg2HyYn+ IeeJxzHldDl3tl33MMbMJcA32ZMJhJ98UiBLchzGLMC+oJrW4ZXodDVMCwwq3HTYUzcCyGkZKSyos ghbmtZ+UUiGg5oOzpPnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO2-005mWx-1a; Wed, 13 Sep 2023 11:50:26 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgONy-005mTD-0S for linux-mtd@lists.infradead.org; Wed, 13 Sep 2023 11:50:23 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-401d2e11dacso5430845e9.0 for ; Wed, 13 Sep 2023 04:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694605820; x=1695210620; darn=lists.infradead.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=ZfIOoxhDAqFwndjqT4NZlTiK/Oyr/4kFj6yAfQvO5X0=; b=JgrKBtTuqUSmEwBGpw6sFEn3zm9ldo/H3BxMvd0X100l7LlYeYgjKl9vRZ0OkBg7fM 7a3SJvRUe1HCz8m1Gi7bid9afH1wRUKRqSmidObGxNljCMsvf402/eebk2333XTxZa7Y qlag+Ykzak43G801B9gI8h89vYRsh7POx+p9f3TALTnRFWgNYQj7vxQhmx1yuHr3tvsg 4Lyo9ShSv9PeJpZ2B1Dvpv5xshUmbwwhQo0QtDJy6yAUpOBeZle5o+c6WVtGcTKiIUTT KKY3FSnb2jnxKBR7IOrpbXv42xfPhKDB20UlOE1zZd9pKVd1Xad3gH6PwsJdS+UNp9/d Eztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694605820; x=1695210620; 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=ZfIOoxhDAqFwndjqT4NZlTiK/Oyr/4kFj6yAfQvO5X0=; b=wDpJE6Dn8CDoxquUHmBV1QXCKFr1C/hHAF/NlKrCdYZCH3TBuAWbLiPeyHR7sChE95 1r3SLNVCo1Y/SHaD9LFz8zi4W29Zxc/MjgrHZ0JpQavC2LQLvfpQ+IYUp/lsxchDCEer TEsudPd6jHqekxbd8Oob/0WSPS+ILlXf+ls4/Jdt0PxBUlUf7TUbnG4F3vSqd2wv5hbT dhWvlMiC70h8WgRQoM/PoB2yON5chl/oCE5lQgsxjH0VQVNyWKI9gB8OoCADQfm93kg/ Ld51NPw6qmfVvAvYsmFaa5TLBhvLethZJ8NgVWIfzYOnOhuII94Vx2PImtSUL+K0bLv1 2wZA== X-Gm-Message-State: AOJu0Yy2QYtVN01MH70dwW88tYFl1DOLc1QmRqit6aOHpJF7Pj0YKw6O eX01FeZjJwbNQYE3nmDTi3wWQQ== X-Google-Smtp-Source: AGHT+IG+tXi5eOBKUfSbBaQCtatc0omt4sm58mllw94JLePpeq53xP2hYKGlGG+xCKfpc+HJfdMuUQ== X-Received: by 2002:a5d:5b18:0:b0:31f:cc46:3db9 with SMTP id bx24-20020a5d5b18000000b0031fcc463db9mr1114110wrb.26.1694605820092; Wed, 13 Sep 2023 04:50:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:50:19 -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 2/5] mtd: rawnand: ingenic: use gpiod_set_active_high() Date: Wed, 13 Sep 2023 13:49:58 +0200 Message-Id: <20230913115001.23183-3-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_045022_214763_279FCD3A X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Bartosz Golaszewski Use the new, less cumbersome interface for setting the GPIO as active-high that doesn't require first checking the current state. Signed-off-by: Bartosz Golaszewski --- drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:332 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bartosz Golaszewski Use the new, less cumbersome interface for setting the GPIO as active-high that doesn't require first checking the current state. Signed-off-by: Bartosz Golaszewski Acked-by: Paul Cercueil Acked-by: Miquel Raynal --- drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c index 6748226b8bd1..c055133c45fe 100644 --- a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c +++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c @@ -388,9 +388,8 @@ static int ingenic_nand_init_chip(struct platform_device *pdev, * here for older DTs so we can re-use the generic nand_gpio_waitrdy() * helper, and be consistent with what other drivers do. */ - if (of_machine_is_compatible("qi,lb60") && - gpiod_is_active_low(nand->busy_gpio)) - gpiod_toggle_active_low(nand->busy_gpio); + if (of_machine_is_compatible("qi,lb60")) + gpiod_set_active_high(nand->busy_gpio); nand->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); From patchwork Wed Sep 13 11:49:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1833494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=mknhr96G; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=loxJOOd2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RlzLH51gwz1yp9 for ; Wed, 13 Sep 2023 21:51:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hS54qmF4Z4ixfx48pOLBe27LftP2f4YrcXN+UGAHnPE=; b=mknhr96Glcklaa hTk3VlZv0zwzQ8JCDPVjBxJSnGSYXr91M36Js3F80EtkAXlAVjuxXRbWi66esM8Rr6gC69DutLf5m Dp6/MiWA4kdK5rn1TK0aMn81Sdt8JSNzhZAsf8SLVpt72PspSo5S3kccwdNGl8CNp7P4n2lgcpkTE 5Q49Q1llMBs2hl80W0eRxIVyVijeFABH+xFZmIS9b6EyBZtMAd9vpTiReMfdjuB6t/0OBuUWAMWQ4 21Li5Fu/e6biC5yEXqSTHHvmhQcSguXrR9mdDLd7bh3icbbLpJWJAT3AUG4IvUE7Z0BCLDHVgT55g 0khJcLmt3JkmGCEujZRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO3-005mXG-1d; Wed, 13 Sep 2023 11:50:27 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgONz-005mTd-10 for linux-mtd@lists.infradead.org; Wed, 13 Sep 2023 11:50:24 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31f7638be6eso5938926f8f.3 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=lists.infradead.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=loxJOOd2HYI/sVJmERlqRt9qRDiCUu0pbW8N1eBnb66RUl0iwgLeDUPowBD2DYWAhI cxPwsLZ90aR9arnsFlA6eRVC/b+V4J50hnbmuHD1I/6jA2C68vmUiWGYatDEbGIYtSr4 QtFJZ5f1/Mrj5F6wzg+YLLR7rQAwdEjEhnAFdo17aCcKc90Jzw59DYzYtM2+TlKuOB76 D/NmB/AinlwJ/+X0ce2ewCVajVAzA8V0C5m6TsqK/KXFE4xd2Co/xsgpJOK84I6u9dGa hD2CCj09Z5jjZ68gtVFGv+VPRxLBZ0WlMMbvCDZHtgapSE1CLc2YlfSgL0L1ppVN4eZq vpWw== 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=NUB7D5af3+l3mffuacwA/mvOTmrmJeL2tcIjGPaKsOCEYy2lrzpjHIF0g3ZF6/MmzZ emw7LpVMrnfV35s+FdXAEcZtfMEZRelWZHeC/1mUli/fNzWh+f6/djS4/mj4hUnDLinx qquQKJEdZsVphBt0VqjvCd5jt4LXNLgOwPqS0XQSJ2hHcZlzYnWqPdTVOiyApBqWBNWB f5HYq5KqV6sEEfNfOBhhzrzB5ue99bx52s9gpIQC4nhyUO4G8M6HreqbX/OYEAj90vqX KW9WRcCQDAexjRVild3X6ILdKf6PcduKKnxmEG58syqcd0r0YA3wFOuuQtiHBmI1JCGH IUSg== X-Gm-Message-State: AOJu0YybdGrpJPsOrdTxX4+SLuwxZx3cK9B4/HCO/svLebwFCNPXcY0R R+dRfa9O5buUHLcMN0DNj51phw== X-Google-Smtp-Source: AGHT+IE8/xUMx2CxEG3cqDJgSjbSA2NWMS00vPEgINZ0yvChOcoxgNUbEbPflHzcyEJln62XxJ5Bpg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_045023_397952_07584551 X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:434 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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; From patchwork Wed Sep 13 11:50:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1833490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zK+q4PAD; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=txXe7C2o; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RlzLH4zXrz1yhg for ; Wed, 13 Sep 2023 21:51:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bKiDIycOrKfl559tBxpHQ6xaCvzzw5ims5QNM4cK1rU=; b=zK+q4PADoqy3BP rZRGrAgrWHFjpXVRPPyThNKu7vYiduM//MOI2WpgHiEbtDNUhXaAbzjAvvx+u9DMbeTEO5boyz6Hj VxCLnFp+/buZSms4IEW9YR5n/Xq90HmdzFSlH5qDhROHSORPkTKSsj8DwHX65TCFabExS+nOvXux5 GJ9E1ZgrqCCsaN94X3twhyPWp2EcEinFl65XXWquwLPDIsZsipZ/+j9giV92Wkyj6BdbECdmvds9Y idFzWBakVcKeEmQa0UBbmNXvR7y6vMmtMGahL2x4qoyYMo4mks+c63Wh5/dcOExKxXRf4WOMK8qOb qyPcmLoyPLvz/DA2m0LQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO4-005mXW-12; Wed, 13 Sep 2023 11:50:28 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO0-005mUN-1E for linux-mtd@lists.infradead.org; Wed, 13 Sep 2023 11:50:25 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31c8321c48fso540401f8f.1 for ; Wed, 13 Sep 2023 04:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694605822; x=1695210622; darn=lists.infradead.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=jSDvgG/AlTocCbtsh72PpLY+FqxqCYIc4jmjYno6s+Q=; b=txXe7C2o7Hetsi8O/2Lgm9+O8EQm/DUNT2eyyeHofZNSqE4AfhN/k34ogZ6yS75+nz 9/gVVZWBuFCW2hemzpD7sUazwgbFVYrIMxJxlLQ3HKCSeG6R6rOZYfpmvLKc0U2s8Drq /N77NSyGXVN9UI0eUeGXn7oeM257S8+W9sDLDhY5x3mPZ0AMBBlB1mtKOH7ESbN92UZi 1XeLZV15E4czUwrgX7v0KWuHLoc1UcOhmVJH/M16Yi7TEn0u56dIrNoa6tpffp2zCTAK vPOVc0oRBiGd7sj2DH/5adCdZFIFJBQzE9Uw7llMYb+1zwQWJq4aw6dx38jFVGE8UdAz Jd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694605822; x=1695210622; 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=jSDvgG/AlTocCbtsh72PpLY+FqxqCYIc4jmjYno6s+Q=; b=d+s8gU3RkcPuguzx1ohYbRlo9XwpxWQ5LQ0dQkw6cfyoZ9uC5bEcwAgOZy+mXLNqe+ KKNqCTuO9ot1d4f7h2rGN8iaLNlJFRb6qMwGpR3HvHkGWM5jMDsM+lmtRcgfp4ukvCqI +T3RNYYyK+S6XeyzyBJJaOymPVg0IBuphGHlysCBjFqhlSjjvyeAtUzz8uvmhq3NcXQR l29KCVkmhq+/JSLlYHh2gyMXMFVTT+Ih1lOkZ5QwDcLlSdgX+s51F+nrCUgyhU+Ksg5c 1bNwqzypEKq3Tt1P5nMbkBacvJymT26yvYn8aPlvuamHac2eSKptekheKA7qBBgwCoh1 o9pQ== X-Gm-Message-State: AOJu0YwyJMpfn/jHsVTxoEAW8lV1G13RIbROgs7iZlENc8XbVrrBPoU7 LGAziz3PLlGlL2eTlX00CJu8sg== X-Google-Smtp-Source: AGHT+IESxmTjjKwZ3Mmhzu2vYwbPTXYIyEeB82mrbgAnbchaF/ankGu50kRqPiQDLeOH4+3ZF+l1XA== X-Received: by 2002:adf:e885:0:b0:31f:9bd6:e8c3 with SMTP id d5-20020adfe885000000b0031f9bd6e8c3mr1744751wrm.22.1694605822422; Wed, 13 Sep 2023 04:50:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:50:21 -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 4/5] platform/x86: int3472/discrete: use gpiod_set_active_low() Date: Wed, 13 Sep 2023 13:50:00 +0200 Message-Id: <20230913115001.23183-5-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_045024_443517_E5DB1CE2 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Bartosz Golaszewski Use the new polarity setter instead of the more cumbersome toggle function. Signed-off-by: Bartosz Golaszewski --- drivers/platform/x86/intel/int3472/clk_and_regulator.c | 2 +- drivers/platform/x86/intel/int3472/led.c | 2 +- 2 files changed, 2 [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bartosz Golaszewski Use the new polarity setter instead of the more cumbersome toggle function. Signed-off-by: Bartosz Golaszewski Acked-by: Hans de Goede --- drivers/platform/x86/intel/int3472/clk_and_regulator.c | 2 +- drivers/platform/x86/intel/int3472/led.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/clk_and_regulator.c b/drivers/platform/x86/intel/int3472/clk_and_regulator.c index ef4b3141efcd..31e520838b95 100644 --- a/drivers/platform/x86/intel/int3472/clk_and_regulator.c +++ b/drivers/platform/x86/intel/int3472/clk_and_regulator.c @@ -183,7 +183,7 @@ int skl_int3472_register_gpio_clock(struct int3472_discrete_device *int3472, } if (polarity == GPIO_ACTIVE_LOW) - gpiod_toggle_active_low(int3472->clock.ena_gpio); + gpiod_set_active_low(int3472->clock.ena_gpio); /* Ensure the pin is in output mode and non-active state */ gpiod_direction_output(int3472->clock.ena_gpio, 0); diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x86/intel/int3472/led.c index bca1ce7d0d0c..46c9c569df5e 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -32,7 +32,7 @@ int skl_int3472_register_pled(struct int3472_discrete_device *int3472, "getting privacy LED GPIO\n"); if (polarity == GPIO_ACTIVE_LOW) - gpiod_toggle_active_low(int3472->pled.gpio); + gpiod_set_active_low(int3472->pled.gpio); /* Ensure the pin is in output mode and non-active state */ gpiod_direction_output(int3472->pled.gpio, 0); From patchwork Wed Sep 13 11:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1833495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=AtP/OO9i; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=zFuIUh2E; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RlzLL2kZfz26jR for ; Wed, 13 Sep 2023 21:51:06 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9wY9chJBZlF7g4xGrwId7QNHnlLp0zKzMM8sWo1lJ9Y=; b=AtP/OO9iABuJ8w pLDG7563ylx5aM87S/n2YulA/vLXT6ZKRunznwHbolBhsr1iT+YDtB8wcrS+8hZQIoBD2Bmjs+TPf UxMw7PK2ULPuYVb9zQ4wiUmh3vgdfKxkRvM/q3n0CcrH0wdQcXWX4hcl/z9/sGh2QUWj4lpLBHf9I Y66X3Y18cCqFzC91LRgo3lmSUvZF2T9h1Sx3Qa69oxcBFhrtEaEWEvBp1V98rmCVBV4YEORJJvC2k SW4ZaTVgO1Xam/EZry87eadf1M/O3ufFgBF97WcSbiJASGXtXb2XXLGzjJhG0g0J6iEIgOXT49KeC sdkmQlOPVt3zJb7nvJ/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO6-005mYN-0m; Wed, 13 Sep 2023 11:50:30 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgOO1-005mV1-18 for linux-mtd@lists.infradead.org; Wed, 13 Sep 2023 11:50:26 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31dca134c83so6775562f8f.3 for ; Wed, 13 Sep 2023 04:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694605823; x=1695210623; darn=lists.infradead.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=Qakrc9HB1O5Iu/mhnl/aqGs6dWn+CSwn3hlAKhsYM7Q=; b=zFuIUh2EEeYJMLnZsJv3+aR2Vm7jNO3aFQsgI4pwxZvze/4zlBiL56n3AKBpf/6ipY WYxd32keoM9A17jMYIX+fAL7kOKCCbXBuVmIprwqKG0yugmEs5mzWPHT+fTE9hhYcjdG 8eFnf3FwfKsRO9q8uPJueXpx7tCPfaLvo+ozhQijsPiX4kSbD4CNICrApoOlC1RQTH8L jnQ519AF3rS1wNtYRlTLcYd8BgZdDQkGqKIPtIPo/C2MZDs0Ya5/7ZcX6mCfDin9osWD Cj/WUtiZvH5EyttUGBIavmvfjerez9pwQZxhLQ3JWXmpY37DtsMZmzNxVuZ8T4Jfriy/ 9DwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694605823; x=1695210623; 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=Qakrc9HB1O5Iu/mhnl/aqGs6dWn+CSwn3hlAKhsYM7Q=; b=e5lgU7xBifxxTKz5qrk28s79SIjQBps1CpWg2tV/avYJkZbib+rPG8DzWa3yaMwd/p pbGyenDODx6e0hS4LlcP01WEur9afjNq2/DL3MYCLU2c22eyiaJX+UQ4hFGvr1MWJz1C wFSQHvZKj3Qav7JaP5FFxOBOy3MLABgkhP3KF4J4yBy/ZRUS2/MMvlxWdr0dfmyFMjAA YU5UM/SpwgkfmDf0TGE5dPVsXFZ2FpgPRwArpjN+qo8M6Mmba5OCFv2t3eir3WdUj/6N K6SKzAqAHSGb6p0jwFlCIxG39yDe1H623xvtatbO/R1iQFKdgTZe0HxvyLf4uyadd4mO siEg== X-Gm-Message-State: AOJu0YypBrtAh+gttNEkPSddGErK/un16RPoA8iXRx3MET6d1oQwOxSH NTYmjA2xrGKXiaEeKfqB9U3/GQ== X-Google-Smtp-Source: AGHT+IHSaGvQEu7p/aPUxTrIpzTkMdMiNylYl6uXXTnV4TP4nHCU3quUTmCv138dyfMb7wv/N8jbvw== X-Received: by 2002:a5d:56ca:0:b0:311:1dba:ca65 with SMTP id m10-20020a5d56ca000000b003111dbaca65mr1878093wrw.51.1694605823533; Wed, 13 Sep 2023 04:50:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:50:23 -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 5/5] gpiolib: remove gpiod_toggle_active_low() Date: Wed, 13 Sep 2023 13:50:01 +0200 Message-Id: <20230913115001.23183-6-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_045025_401067_9EAF4ED7 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Bartosz Golaszewski With all users now having switched to gpiod_set_active_[low|high](), we can now remove gpiod_toggle_active_low(). Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpiolib.c | 11 include/linux/gpio/consumer.h | 7 ------- 2 files changed, 18 deletions(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:433 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bartosz Golaszewski With all users now having switched to gpiod_set_active_[low|high](), we can now remove gpiod_toggle_active_low(). Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpiolib.c | 11 ----------- include/linux/gpio/consumer.h | 7 ------- 2 files changed, 18 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 131965814a7c..14b84bad93ea 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2714,17 +2714,6 @@ int gpiod_is_active_low(const struct gpio_desc *desc) } EXPORT_SYMBOL_GPL(gpiod_is_active_low); -/** - * gpiod_toggle_active_low - toggle whether a GPIO is active-low or not - * @desc: the gpio descriptor to change - */ -void gpiod_toggle_active_low(struct gpio_desc *desc) -{ - VALIDATE_DESC_VOID(desc); - change_bit(FLAG_ACTIVE_LOW, &desc->flags); -} -EXPORT_SYMBOL_GPL(gpiod_toggle_active_low); - /** * gpiod_set_active_low() - set the GPIO as active-low * @desc: the GPIO descriptor to set the active-low setting for diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index ddbf0d8e4a75..395e1a67c4c8 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -159,7 +159,6 @@ int gpiod_set_raw_array_value_cansleep(unsigned int array_size, int gpiod_set_config(struct gpio_desc *desc, unsigned long config); int gpiod_set_debounce(struct gpio_desc *desc, unsigned int debounce); -void gpiod_toggle_active_low(struct gpio_desc *desc); void gpiod_set_active_low(struct gpio_desc *desc); void gpiod_set_active_high(struct gpio_desc *desc); @@ -495,12 +494,6 @@ static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned int deboun return -ENOSYS; } -static inline void gpiod_toggle_active_low(struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(desc); -} - static inline void gpiod_set_active_low(struct gpio_desc *desc { /* GPIO can never have been requested */