From patchwork Mon May 29 22:14:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 100436 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1796057vqr; Mon, 29 May 2023 15:21:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ728K/fx6HsPlmwUj6GBpNe8yW4aQjBycxJBQgoQsvj77WUlNwHxrXqRXie7vEl07nx5Mmi X-Received: by 2002:a17:903:1251:b0:1ae:8892:7d27 with SMTP id u17-20020a170903125100b001ae88927d27mr456901plh.42.1685398861353; Mon, 29 May 2023 15:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685398861; cv=none; d=google.com; s=arc-20160816; b=vqupsBIltyRWFVJ3ci7FpwB9qoM4sdMWZ9FQopO8YyOA2f2nsfLzaNhcORkeaDT3oo O7Yedjzdhih0SRgOM786MXD6aI/yFD7Pz7oE7W7MSeQxYRzegGJ6PGkJuUlivXzUqEKu iMcP3eajllRPpKSpj7iRsw8h4uk/HwgN5QIIcM25Z0XSzq5wn+UyJn3bxPFegW/eekxO Yi3D4ah2UtF99RDRFDH27dwPvczeDxa6bZxxr2HCxCTZUdFJK+NHsu2T6D2pRLq4J4pc N2RZX+LaJFgRkPzL2+BlYphEuZPle1+G/7ziQmhJSQUVGFjyjNs7P6rl71puW7VyXZXz 4iTw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Pp31/QVDoRll+JmLjgkWEsc/xuNNRZOllSBb47tKMuc=; b=fCTG3CinaOF1cS0iW4GI5cL9JLHhFqdypJsFxfQHiRFMc4H/jbrea92IKYvwsR8Lql CmCWj35GSNk7HoX+KsZXzK2n/tKjcL8V19zGO87eHphwgwk7J3G5pXK0ZNmq9e5A8D7I fc7TZG8Qrkccl1j0mwpDIgAsROPopOgVuk1jWnkAh8LCfUGkuqwyFqbBafo32GQ+E2Uq T6bCkfyuBVN8b8iMxoSEehSUqivO/3bhfe09BHUpqEPYFppaF0+fCkEz4uPoDwblZhvc C2vh4GK07GORMo6SMDAFEo8FXHL6Nz3bUJBvJxcMBrZTvkrcht8kRINseKuF+6iLCcEU oiOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WKhKI2X0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a170903244800b001a4fc13dfa5si8269484pls.276.2023.05.29.15.20.47; Mon, 29 May 2023 15:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WKhKI2X0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbjE2WQX (ORCPT + 99 others); Mon, 29 May 2023 18:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbjE2WQS (ORCPT ); Mon, 29 May 2023 18:16:18 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E5B11B; Mon, 29 May 2023 15:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685398565; x=1716934565; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0gSXcrJw4rVVIbYtKUetrZyc67LpvOlFnbAG461PqkA=; b=WKhKI2X0NJfp0KmVzaCuY3wZzY/avxQcjX4jm2fGTuOh+g7D6+iL9cSa saIWd3iuDLY+XBJAHBgPBSL0NLYUXpu/jUNffS7DtjTWvFMPVW5Ugl/Rw NYHyfbZBU48dZWLFlk7RrodppDAcxHGJv8q06fH9fOZa46rl9NGkrQkGe Rw4n7OJVP4uNeTXJ3b0nxKUOql32q87w0JxwVFjx0I6GxmkrogegrODQM +t4vhd6sHWdtkfx9OYfpro3jb9PYuWXtHzx5mJAylbM7xXgWjVVdoK1bh RwW0PDOGcNGjoIAmyCUNvA/yIAgeh7NkEm3gAn2hiniUag3OM7fsNUq9a g==; X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="353615846" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="353615846" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 15:14:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="700382378" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="700382378" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 29 May 2023 15:14:45 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E63AC24F; Tue, 30 May 2023 01:14:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen Subject: [PATCH v2 1/2] gpiolib: Kill unused GPIOF_EXPORT and Co Date: Tue, 30 May 2023 01:14:45 +0300 Message-Id: <20230529221446.87785-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767268796662643312?= X-GMAIL-MSGID: =?utf-8?q?1767268796662643312?= There is no use of the GPIOF_EXPORT in the kernel. Kill it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- v2: added tag (Linus) Documentation/driver-api/gpio/legacy.rst | 3 --- Documentation/translations/zh_CN/driver-api/gpio/legacy.rst | 3 --- Documentation/translations/zh_TW/gpio.txt | 3 --- drivers/gpio/gpiolib-legacy.c | 6 ------ include/linux/gpio.h | 5 ----- 5 files changed, 20 deletions(-) diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst index 78372853c6d4..c5f98a78499f 100644 --- a/Documentation/driver-api/gpio/legacy.rst +++ b/Documentation/driver-api/gpio/legacy.rst @@ -322,9 +322,6 @@ where 'flags' is currently defined to specify the following properties: * GPIOF_OPEN_DRAIN - gpio pin is open drain type. * GPIOF_OPEN_SOURCE - gpio pin is open source type. - * GPIOF_EXPORT_DIR_FIXED - export gpio to sysfs, keep direction - * GPIOF_EXPORT_DIR_CHANGEABLE - also export, allow changing direction - since GPIOF_INIT_* are only valid when configured as output, so group valid combinations as: diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst index 84ce2322fdba..8720970393fb 100644 --- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst @@ -297,9 +297,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的 * GPIOF_OPEN_DRAIN - gpio引脚为开漏信号 * GPIOF_OPEN_SOURCE - gpio引脚为源极开路信号 - * GPIOF_EXPORT_DIR_FIXED - 将 gpio 导出到 sysfs,并保持方向 - * GPIOF_EXPORT_DIR_CHANGEABLE - 同样是导出, 但允许改变方向 - 因为 GPIOF_INIT_* 仅有在配置为输出的时候才存在,所以有效的组合为: * GPIOF_IN - 配置为输入 diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt index 62e560ffe628..e0b96d897fa7 100644 --- a/Documentation/translations/zh_TW/gpio.txt +++ b/Documentation/translations/zh_TW/gpio.txt @@ -303,9 +303,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映 * GPIOF_OPEN_DRAIN - gpio引腳爲開漏信號 * GPIOF_OPEN_SOURCE - gpio引腳爲源極開路信號 - * GPIOF_EXPORT_DIR_FIXED - 將 gpio 導出到 sysfs,並保持方向 - * GPIOF_EXPORT_DIR_CHANGEABLE - 同樣是導出, 但允許改變方向 - 因爲 GPIOF_INIT_* 僅有在配置爲輸出的時候才存在,所以有效的組合爲: * GPIOF_IN - 配置爲輸入 diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c index 028f7f504209..969f737012f6 100644 --- a/drivers/gpio/gpiolib-legacy.c +++ b/drivers/gpio/gpiolib-legacy.c @@ -50,12 +50,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) if (err) goto free_gpio; - if (flags & GPIOF_EXPORT) { - err = gpiod_export(desc, flags & GPIOF_EXPORT_CHANGEABLE); - if (err) - goto free_gpio; - } - return 0; free_gpio: diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 8528353e073b..86963a00b018 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -38,11 +38,6 @@ struct device; /* Gpio pin is open source */ #define GPIOF_OPEN_SOURCE (1 << 4) -#define GPIOF_EXPORT (1 << 5) -#define GPIOF_EXPORT_CHANGEABLE (1 << 6) -#define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT) -#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE) - /** * struct gpio - a structure describing a GPIO with configuration * @gpio: the GPIO number From patchwork Mon May 29 22:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 100440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1801828vqr; Mon, 29 May 2023 15:35:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wJ+EZKl1Uj9ERu2V/kpjirohhdWkIPyGCjbGr12NwJi8QO/ZQuziAiDqLAagqGjLrL9St X-Received: by 2002:a05:6a00:1990:b0:634:7ba3:d142 with SMTP id d16-20020a056a00199000b006347ba3d142mr119818pfl.10.1685399736619; Mon, 29 May 2023 15:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685399736; cv=none; d=google.com; s=arc-20160816; b=ow50yT8aiOtRfwm+x0ZB7Ka8RhpIDMQcW95TYbPIbOg1M1dz/H8Wh6A+iygY/PEYJz qrtvJQYzM/xwT+gqUHcjhUwrHZ63y6rpXeNAa2BlUpkFydb5RqnLJPh3gROi419CYiyW FVPKa/EOexIyIA932SCJtTHGU5pcHpObHLhWbFDDxGZadl6/Q0GKQr+RYpj2p1lFl/5A Qmckj0O44pv1FxMkeIR4uopMPD5j8A3Celrnk3WkTGrQshcgskzbRBxxQ8haN3vN1Qut RQiNYONFCjk4+C+aYODQVII2AB0oMqf8y4ZHQnLibwhA8eupTWZrIzZlJaZkCHCueWX3 Voqw== 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=JxQW7eQXWW/lzFs/reqhBT9vGLluWeNepYdCBSNB/gQ=; b=MTHq7f1t8XzrZ6MnMxjt2bnV9/NUSXXaF67lY0D45VErqXHMrjuaWnssqUQtftwa0B N+YPXX3fa7HKT2AYTLYVyMKfY0cs8HHTK7YSzUXjzgPA9DE7ELjZFO50IjVPCGJnYhLE nUcG7kjC2u9ggYhWk7TGx/DN03OlvG62rU655si/b950NQzP+1gzL0n3r9Ud5PW77i5E oTswWEJoM440I9dWU7JAzj2YVKSiBUEksdKrX6umr5IrRXqH1GbSEM4W02kGxF5MBHWt 5AA6Dp/ULGDF/DSM5FdnvMq3++wVYP3qKS5/htlBypOiTml1em71r5J7phMmFFv/3UB2 9Lzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DZZ+bcyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a056a00000d00b0064d28479818si602473pfk.96.2023.05.29.15.35.22; Mon, 29 May 2023 15:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DZZ+bcyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbjE2WQ3 (ORCPT + 99 others); Mon, 29 May 2023 18:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbjE2WQT (ORCPT ); Mon, 29 May 2023 18:16:19 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 371B411F; Mon, 29 May 2023 15:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685398566; x=1716934566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kxGmo102AnFebW7BplsrcPsTKI6SgAEjRaqKEH+ORTc=; b=DZZ+bcyN/B+DXSJcKxlf1eP6utPAHCBge4d8grbnVSY37u4ialPri5N7 x2i5oNGlKZAV19DejE3upPLhYzntTc+ZjjLAuljra6J21f5QlHCgUzOqZ Z30GX9uMhRnyMXqB7aFbh/o0Bywvrz+eIW2qa4tRsq0eikErcxVyR5A4v GbOHaCkCdk91Kl6+SGhThbQGUlEqlluY1nfdD3BBss/WAQBwS/8ZSF1Xu agQ0prDGdHiiVz0AcPJzFo6t8pfV0ZzoDR75IqeFwss9Xf53ot7W0JUTl ALET8Jq6tuJKkC7aubnJF27REwZ9h9LKLV5+qBgfxnfCl5mcQbt60oz3I g==; X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="353615855" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="353615855" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 15:14:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="700382383" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="700382383" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 29 May 2023 15:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 82245350; Tue, 30 May 2023 01:14:51 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen Subject: [PATCH v2 2/2] gpiolib: Kill unused GPIOF_OPEN_* Date: Tue, 30 May 2023 01:14:46 +0300 Message-Id: <20230529221446.87785-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230529221446.87785-1-andriy.shevchenko@linux.intel.com> References: <20230529221446.87785-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767269714416607749?= X-GMAIL-MSGID: =?utf-8?q?1767269714416607749?= There is no use of the GPIOF_OPEN_* in the kernel. Kill it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- v2: new change Documentation/driver-api/gpio/legacy.rst | 16 ---------------- .../zh_CN/driver-api/gpio/legacy.rst | 14 -------------- Documentation/translations/zh_TW/gpio.txt | 14 -------------- drivers/gpio/gpiolib-legacy.c | 6 ------ include/linux/gpio.h | 6 ------ 5 files changed, 56 deletions(-) diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst index c5f98a78499f..9eda54811faa 100644 --- a/Documentation/driver-api/gpio/legacy.rst +++ b/Documentation/driver-api/gpio/legacy.rst @@ -319,8 +319,6 @@ where 'flags' is currently defined to specify the following properties: * GPIOF_INIT_LOW - as output, set initial level to LOW * GPIOF_INIT_HIGH - as output, set initial level to HIGH - * GPIOF_OPEN_DRAIN - gpio pin is open drain type. - * GPIOF_OPEN_SOURCE - gpio pin is open source type. since GPIOF_INIT_* are only valid when configured as output, so group valid combinations as: @@ -329,20 +327,6 @@ combinations as: * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH -When setting the flag as GPIOF_OPEN_DRAIN then it will assume that pins is -open drain type. Such pins will not be driven to 1 in output mode. It is -require to connect pull-up on such pins. By enabling this flag, gpio lib will -make the direction to input when it is asked to set value of 1 in output mode -to make the pin HIGH. The pin is make to LOW by driving value 0 in output mode. - -When setting the flag as GPIOF_OPEN_SOURCE then it will assume that pins is -open source type. Such pins will not be driven to 0 in output mode. It is -require to connect pull-down on such pin. By enabling this flag, gpio lib will -make the direction to input when it is asked to set value of 0 in output mode -to make the pin LOW. The pin is make to HIGH by driving value 1 in output mode. - -In the future, these flags can be extended to support more properties. - Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is introduced to encapsulate all three fields as:: diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst index 8720970393fb..1bddecf73670 100644 --- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst @@ -294,8 +294,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的 * GPIOF_INIT_LOW - 在作为输出时,初始值为低电平 * GPIOF_INIT_HIGH - 在作为输出时,初始值为高电平 - * GPIOF_OPEN_DRAIN - gpio引脚为开漏信号 - * GPIOF_OPEN_SOURCE - gpio引脚为源极开路信号 因为 GPIOF_INIT_* 仅有在配置为输出的时候才存在,所以有效的组合为: @@ -303,18 +301,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的 * GPIOF_OUT_INIT_LOW - 配置为输出,并初始化为低电平 * GPIOF_OUT_INIT_HIGH - 配置为输出,并初始化为高电平 -当设置 flag 为 GPIOF_OPEN_DRAIN 时,则假设引脚是开漏信号。这样的引脚 -将不会在输出模式下置1。这样的引脚需要连接上拉电阻。通过使能这个标志,gpio库 -将会在被要求输出模式下置1时将引脚变为输入状态来使引脚置高。引脚在输出模式下 -通过置0使其输出低电平。 - -当设置 flag 为 GPIOF_OPEN_SOURCE 时,则假设引脚为源极开路信号。这样的引脚 -将不会在输出模式下置0。这样的引脚需要连接下拉电阻。通过使能这个标志,gpio库 -将会在被要求输出模式下置0时将引脚变为输入状态来使引脚置低。引脚在输出模式下 -通过置1使其输出高电平。 - -将来这些标志可能扩展到支持更多的属性。 - 更进一步,为了更简单地声明/释放多个 GPIO,'struct gpio'被引进来封装所有 这三个领域:: diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt index e0b96d897fa7..66bc7f2bbe53 100644 --- a/Documentation/translations/zh_TW/gpio.txt +++ b/Documentation/translations/zh_TW/gpio.txt @@ -300,8 +300,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映 * GPIOF_INIT_LOW - 在作爲輸出時,初始值爲低電平 * GPIOF_INIT_HIGH - 在作爲輸出時,初始值爲高電平 - * GPIOF_OPEN_DRAIN - gpio引腳爲開漏信號 - * GPIOF_OPEN_SOURCE - gpio引腳爲源極開路信號 因爲 GPIOF_INIT_* 僅有在配置爲輸出的時候才存在,所以有效的組合爲: @@ -309,18 +307,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映 * GPIOF_OUT_INIT_LOW - 配置爲輸出,並初始化爲低電平 * GPIOF_OUT_INIT_HIGH - 配置爲輸出,並初始化爲高電平 -當設置 flag 爲 GPIOF_OPEN_DRAIN 時,則假設引腳是開漏信號。這樣的引腳 -將不會在輸出模式下置1。這樣的引腳需要連接上拉電阻。通過使能這個標誌,gpio庫 -將會在被要求輸出模式下置1時將引腳變爲輸入狀態來使引腳置高。引腳在輸出模式下 -通過置0使其輸出低電平。 - -當設置 flag 爲 GPIOF_OPEN_SOURCE 時,則假設引腳爲源極開路信號。這樣的引腳 -將不會在輸出模式下置0。這樣的引腳需要連接下拉電阻。通過使能這個標誌,gpio庫 -將會在被要求輸出模式下置0時將引腳變爲輸入狀態來使引腳置低。引腳在輸出模式下 -通過置1使其輸出高電平。 - -將來這些標誌可能擴展到支持更多的屬性。 - 更進一步,爲了更簡單地聲明/釋放多個 GPIO,'struct gpio'被引進來封裝所有 這三個領域: diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c index 969f737012f6..87537657d040 100644 --- a/drivers/gpio/gpiolib-legacy.c +++ b/drivers/gpio/gpiolib-legacy.c @@ -32,12 +32,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) if (err) return err; - if (flags & GPIOF_OPEN_DRAIN) - set_bit(FLAG_OPEN_DRAIN, &desc->flags); - - if (flags & GPIOF_OPEN_SOURCE) - set_bit(FLAG_OPEN_SOURCE, &desc->flags); - if (flags & GPIOF_ACTIVE_LOW) set_bit(FLAG_ACTIVE_LOW, &desc->flags); diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 86963a00b018..88efac969754 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -32,12 +32,6 @@ struct device; /* Gpio pin is active-low */ #define GPIOF_ACTIVE_LOW (1 << 2) -/* Gpio pin is open drain */ -#define GPIOF_OPEN_DRAIN (1 << 3) - -/* Gpio pin is open source */ -#define GPIOF_OPEN_SOURCE (1 << 4) - /** * struct gpio - a structure describing a GPIO with configuration * @gpio: the GPIO number