From patchwork Thu Jan 3 16:40:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1020392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Vtw93ZP0z9s55 for ; Fri, 4 Jan 2019 03:41:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730440AbfACQlM (ORCPT ); Thu, 3 Jan 2019 11:41:12 -0500 Received: from mail.bootlin.com ([62.4.15.54]:59878 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbfACQlL (ORCPT ); Thu, 3 Jan 2019 11:41:11 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BE4E0207AD; Thu, 3 Jan 2019 17:41:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (mat33-2-88-189-187-82.fbx.proxad.net [88.189.187.82]) by mail.bootlin.com (Postfix) with ESMTPSA id 723F5206DC; Thu, 3 Jan 2019 17:41:09 +0100 (CET) From: Thomas Petazzoni To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Mark Rutland Cc: Frank Rowand , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Marek Vasut , Thomas Petazzoni Subject: [PATCH 0/4] Proposal to support pull-up/pull-down GPIO configuration Date: Thu, 3 Jan 2019 17:40:58 +0100 Message-Id: <20190103164102.31437-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hello, As we started discussing in [1], it would be useful to have a way to configure pull-up/pull-down resistors for simple GPIO controllers that don't have any pinmuxing capability, and therefore no interaction with the pinctrl subsystem. This set of patches implements what I understood of Linus option (2), i.e extend the ->set_config() callback, and provide additional flags that can be used in the Device Tree: GPIO_PULL_UP and GPIO_PULL_DOWN. Let me know what you think about this proposal. Thanks for your feedback. Thomas [1] https://marc.info/?l=linux-gpio&m=154491873506701&w=2 Thomas Petazzoni (4): dt-bindings: gpio: document the new pull-up/pull-down flags gpio: rename gpio_set_drive_single_ended() to gpio_set_config() gpio: add core support for pull-up/pull-down configuration gpio: pca953x: add ->set_config implementation .../devicetree/bindings/gpio/gpio.txt | 4 ++ drivers/gpio/gpio-pca953x.c | 59 ++++++++++++++++++- drivers/gpio/gpiolib-of.c | 5 ++ drivers/gpio/gpiolib.c | 40 ++++++++----- drivers/gpio/gpiolib.h | 2 + include/dt-bindings/gpio/gpio.h | 6 ++ include/linux/gpio/machine.h | 2 + include/linux/of_gpio.h | 2 + 8 files changed, 104 insertions(+), 16 deletions(-)