Message ID | 20230913115001.23183-2-brgl@bgdev.pl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp1097475vqx; Wed, 13 Sep 2023 06:47:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfPHRaoCozqtZaa3fDI1Il2Hwd0avdQBHoOjZbQ2SJfwTwwOEUVdqlbHEDWyAIVFphK0ss X-Received: by 2002:a05:6870:4726:b0:1ba:989b:ca65 with SMTP id b38-20020a056870472600b001ba989bca65mr2649039oaq.19.1694612838868; Wed, 13 Sep 2023 06:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694612838; cv=none; d=google.com; s=arc-20160816; b=hY7eN5J4iREoCa4XaaTxjHkTIZzGeSVL/42j3neQtwjMEcPRcDTmcc9TtKBYqyrJQR qVf9kufD8IWewls5ddQORh3/DTh+VYm1ZvOQ4LqvPErAyxjet9f36kBkmod/HQmHAjJd hyzXTfreKz52MFIEnmpH8w7jtzSat22xhVhAXW4zgWjj9BEtHPZFzoH6bDPs4kROpsyY aDy+wo4z9JSI87pkToal7mg46AuCSaYJozh9b1icW+FdvYxfrK+ecRnRosoPCajvX9NT deThjl/Ys3HkYGrm6E7iMRCOUkiiA+ooeBkrYkDjiKpka7BUKv8gdEFnr/BV+WQFAgPa 7N+A== 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=YzyriHXDyGfsqSRGhB6U9l6fcpz9mRdaLbPmEard1K0=; fh=0APTZUKOvF74sGqrjhjjJpAFLL5Kw9fbVHsTj8Q1YJA=; b=MRIH9A+a1q4bTmuy0nt8ggtzm+xr2jsaYIHrcMLWrSsWTAqU0hYSw3jqGn7q6RiRZo BkCrNXWtp8cia/IiOGZI2yjNZb/CabJP5ve1AYI7fHj5XC0VIWm7AfY/6LYWh7dDGCkY umqYgd8xp2AZMfjSDbSY14l87URyFgtInq54IduhrT8ZzWcxDWACm42PUFIiYNVyXy62 Tl3e8vqRkQfhtQBMSRPPy/NJg5tmA/7d3he5VU8GS4tVyuZ1p0LNk4fb5Pd4txanxHhV eUhacOaANtVELAHJHQ/lknSYeuMPfwP35SfpRB1isyYyQeEaW8aPXJFTDTn8Zr4BNNS1 8hIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=wlAimHdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bg26-20020a056a02011a00b0054fdfd26dffsi10424037pgb.337.2023.09.13.06.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=wlAimHdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 9C8008216E6B; Wed, 13 Sep 2023 04:50:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240543AbjIMLu0 (ORCPT <rfc822;pwkd43@gmail.com> + 36 others); Wed, 13 Sep 2023 07:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240528AbjIMLuY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Sep 2023 07:50:24 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7823719AF for <linux-kernel@vger.kernel.org>; Wed, 13 Sep 2023 04:50:20 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40037db2fe7so71829145e9.0 for <linux-kernel@vger.kernel.org>; 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=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=YzyriHXDyGfsqSRGhB6U9l6fcpz9mRdaLbPmEard1K0=; b=wlAimHdr0JCDmOb03eTk5kgHiJqcEUNDbeZJ17Ujyb8Bulg1333oDjT+W/JAqjYg5R nAT7fWijaClkmMZOXkVBGTtoluxqI6Z0z7OhNUjguWteV4O2JZCeVrhkz5YKjTyz7iZl d0tWbaipDjCQUMogpTM30YSWslaRmlF1S7Xlw7EzgcyXsmValJ9zR/vPu8lb4CAnddEh IFK5uFQXqT6ZlZ1wE8PeibMEnIb6wX2KFbNuVnMuEvTkV3454cGKU6kAoKfObFQzlqFx cONcCEmSZnvbMzK9tno4pPDzt/8IN91qnFHwixCtechAHiD8MGhlyS+jWXl8kzIv/y7Y A3uw== 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=Z9IVsXEkuF1gC8X/bU/kkGBbreRG3V2KpWI5aNnaj75z8Vs7R7z6CJYpnlPQtsExTL 31oH/OA++HmDInRWHbvZV2DCGxIYcLaotTzvjKjCuE1JewJnL+nImS4EfG0hhuaHZfua cEaeconH+DxBXv+DlnuavvYD745XWqZKXPXjF5eLMBgUWQXy5i8bJS3rufpUC5rRqfy7 xPlNDbG8nscQ7IHPPcqUssec60yorZoYSQB7fSyshze1K1wZchqW3Un5RPtYAya7IRO9 NvwBC/yg2Vy0B0SqI9KKRL3yO8WCwHDiQUp5tuqrCYIaodE0SvjZJOaz5EOqToJme+RZ 6mfQ== X-Gm-Message-State: AOJu0Yxyv7oJq2dsK7mknFQEdpSUSOUsKVW1DBkpE8TToSDqcTl3hz8O kuvu3Ix59ioIy7+YQ3izjVAmpw== 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 <brgl@bgdev.pl> To: Linus Walleij <linus.walleij@linaro.org>, Andy Shevchenko <andy@kernel.org>, Ulf Hansson <ulf.hansson@linaro.org>, Paul Cercueil <paul@crapouillou.net>, Harvey Hunt <harveyhuntnexus@gmail.com>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, Daniel Scally <djrscally@gmail.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>, Heiner Kallweit <hkallweit1@gmail.com> 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 <bartosz.golaszewski@linaro.org> 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 04:50:46 -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 morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776930352028329651 X-GMAIL-MSGID: 1776930352028329651 |
Series |
gpio: remove gpiod_toggle_active_low()
|
|
Commit Message
Bartosz Golaszewski
Sept. 13, 2023, 11:49 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> 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 <bartosz.golaszewski@linaro.org> --- drivers/gpio/gpiolib.c | 22 ++++++++++++++++++++++ include/linux/gpio/consumer.h | 14 ++++++++++++++ 2 files changed, 36 insertions(+)
Comments
Hi Bartosz, kernel test robot noticed the following build errors: [auto build test ERROR on brgl/gpio/for-next] [also build test ERROR on mtd/nand/next linus/master ulf-hansson-mmc-mirror/next v6.6-rc1 next-20230913] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpiolib-provide-gpiod_set_active_-low-high/20230913-195053 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230913115001.23183-2-brgl%40bgdev.pl patch subject: [PATCH 1/5] gpiolib: provide gpiod_set_active_[low/high]() config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20230913/202309132304.Uw3cYH9C-lkp@intel.com/config) compiler: s390-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/202309132304.Uw3cYH9C-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202309132304.Uw3cYH9C-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/nvmem-provider.h:15, from include/linux/rtc.h:18, from include/linux/efi.h:20, from block/partitions/efi.h:19, from block/partitions/msdos.c:32: >> include/linux/gpio/consumer.h:505:1: error: expected ';', ',' or ')' before '{' token 505 | { | ^ vim +505 include/linux/gpio/consumer.h 503 504 static inline void gpiod_set_active_low(struct gpio_desc *desc > 505 { 506 /* GPIO can never have been requested */ 507 WARN_ON(desc); 508 } 509
Hi Bartosz,
kernel test robot noticed the following build warnings:
[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on mtd/nand/next linus/master ulf-hansson-mmc-mirror/next v6.6-rc1 next-20230913]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpiolib-provide-gpiod_set_active_-low-high/20230913-195053
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230913115001.23183-2-brgl%40bgdev.pl
patch subject: [PATCH 1/5] gpiolib: provide gpiod_set_active_[low/high]()
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20230914/202309140219.EH2Y6r52-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230914/202309140219.EH2Y6r52-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309140219.EH2Y6r52-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/linux/nvmem-provider.h:15,
from include/linux/rtc.h:18,
from include/linux/mc146818rtc.h:15,
from drivers/block/floppy.c:183:
include/linux/gpio/consumer.h:505:1: error: expected ';', ',' or ')' before '{' token
505 | {
| ^
>> drivers/block/floppy.c:165:12: warning: 'print_unex' defined but not used [-Wunused-variable]
165 | static int print_unex = 1;
| ^~~~~~~~~~
vim +/print_unex +165 drivers/block/floppy.c
87f530d8f17336 Joe Perches 2010-03-10 163
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 /* do print messages for unexpected interrupts */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @165 static int print_unex = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 166 #include <linux/module.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 #include <linux/sched.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 #include <linux/fs.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 169 #include <linux/kernel.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 #include <linux/timer.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 171 #include <linux/workqueue.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 #include <linux/fdreg.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 173 #include <linux/fd.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 #include <linux/hdreg.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 175 #include <linux/errno.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 176 #include <linux/slab.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 #include <linux/mm.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 178 #include <linux/bio.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 179 #include <linux/string.h>
50297cbf07427b Marcelo Feitoza Parisi 2006-03-28 180 #include <linux/jiffies.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 181 #include <linux/fcntl.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 182 #include <linux/delay.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 @183 #include <linux/mc146818rtc.h> /* CMOS defines */
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 #include <linux/ioport.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 185 #include <linux/interrupt.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 186 #include <linux/init.h>
b81e0c2372e65e Christoph Hellwig 2021-09-20 187 #include <linux/major.h>
d052d1beff7069 Russell King 2005-10-29 188 #include <linux/platform_device.h>
83f9ef463bcb4b Scott James Remnant 2009-04-02 189 #include <linux/mod_devicetable.h>
b1c82b5c55851b Jes Sorensen 2006-03-23 190 #include <linux/mutex.h>
d49375434ec011 Joe Perches 2010-03-10 191 #include <linux/io.h>
d49375434ec011 Joe Perches 2010-03-10 192 #include <linux/uaccess.h>
0cc15d03bcccdf Andi Kleen 2012-07-02 193 #include <linux/async.h>
229b53c9bf4e11 Al Viro 2017-06-27 194 #include <linux/compat.h>
^1da177e4c3f41 Linus Torvalds 2005-04-16 195
Hi Bartosz,
kernel test robot noticed the following build warnings:
[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on mtd/nand/next linus/master ulf-hansson-mmc-mirror/next v6.6-rc1 next-20230913]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpiolib-provide-gpiod_set_active_-low-high/20230913-195053
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230913115001.23183-2-brgl%40bgdev.pl
patch subject: [PATCH 1/5] gpiolib: provide gpiod_set_active_[low/high]()
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20230914/202309140338.TPkz7l7g-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230914/202309140338.TPkz7l7g-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309140338.TPkz7l7g-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/smsc/smc91x.c:60:
include/linux/gpio/consumer.h:505:1: error: expected ';', ',' or ')' before '{' token
505 | {
| ^
>> drivers/net/ethernet/smsc/smc91x.c:47:19: warning: 'version' defined but not used [-Wunused-const-variable=]
47 | static const char version[] =
| ^~~~~~~
vim +/version +47 drivers/net/ethernet/smsc/smc91x.c
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 @47 static const char version[] =
6389aa458ed995 drivers/net/ethernet/smsc/smc91x.c Ben Boeckel 2013-11-01 48 "smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>";
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 49
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 50 /* Debugging level */
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 51 #ifndef SMC_DEBUG
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 52 #define SMC_DEBUG 0
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 53 #endif
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 54
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 55
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 56 #include <linux/module.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 57 #include <linux/kernel.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 58 #include <linux/sched.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 59 #include <linux/delay.h>
c0e906a953f03c drivers/net/ethernet/smsc/smc91x.c Andy Shevchenko 2023-03-16 @60 #include <linux/gpio/consumer.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 61 #include <linux/interrupt.h>
476c32c47a84fc drivers/net/smc91x.c David Howells 2010-10-07 62 #include <linux/irq.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 63 #include <linux/errno.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 64 #include <linux/ioport.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 65 #include <linux/crc32.h>
d052d1beff7069 drivers/net/smc91x.c Russell King 2005-10-29 66 #include <linux/platform_device.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 67 #include <linux/spinlock.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 68 #include <linux/ethtool.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 69 #include <linux/mii.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 70 #include <linux/workqueue.h>
682a1694115ec1 drivers/net/smc91x.c Thomas Chou 2011-01-25 71 #include <linux/of.h>
3f823c15d53dc7 drivers/net/ethernet/smsc/smc91x.c Tony Lindgren 2013-12-11 72 #include <linux/of_device.h>
^1da177e4c3f41 drivers/net/smc91x.c Linus Torvalds 2005-04-16 73
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 */