Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp565633imj; Thu, 7 Feb 2019 08:29:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IbSwXbQvJ1+OQJkjz70LRs/C9tq/lBwyIFlvTZEq2wdkWq86o3D+NM4aXDEZ2s1p2mIeC6q X-Received: by 2002:a63:c56:: with SMTP id 22mr490166pgm.44.1549556977309; Thu, 07 Feb 2019 08:29:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549556977; cv=none; d=google.com; s=arc-20160816; b=W68reJzo1aFYI/PNoIAeagdJQmWjUfR+hger4aTAP9TioGSNZTH1LcJ+FAfzyLWpli GCcJ96Ds5UbfpUFqBESKHKaMGWgPnx7CeAwD43sZWy70iX5jqM1t8V4JdnXsXY22a4WT LW5TctqYEYfH9Uu/Wtex/VLvA62VyBGZecQgkWPKuJ27+D3ibMzivwN9/AzBKWvFNXjr LdNnp13fqQo0l41GHXOp0BjNrAM0ttusg3l02/IIeE07IBeU4UfTS3rStDQJABMJNSJv PDsElLHU9zZmFc+KkH7QGA0PePOfx2DmvITrDxtnqLu8YNYFqPTfeSuqhd6O43FZS/Uh f6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1SHrc3YskU2ONS1dIsJ5YBFDgmDVGRoUswVv8+hRkFA=; b=TUSmvjieomjI/Ipssjt5hkxjm22nHoPYfVfcXKTBke44yEtlo+Xwb5An9RHpnF5hyn peoDbNbab8O03q/Nh2pRakms38mLZECtokR4rjgnM6ORsfTfbejAhbMYCHL029CBDV75 zanzOUdxkMcGC6zOkb0T8c8vwUYSWj1oRAoyN3rmC9M2aKoUwFeVL21EHH9jqM0+pbG8 1GmPxrv76A8hbCXwCb9e3aYgOdnCaf7VjQPgP87xm7muajbzNnf9jbSX40BX8rm/di6B PJykXDAlIhTjTbCR64a1AucIbU4noZbv8ABL7Cu6+6IAA06qyD2lZADqarffXWjetrn8 YRvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si1114031pgl.114.2019.02.07.08.29.20; Thu, 07 Feb 2019 08:29:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726742AbfBGQ3K (ORCPT + 99 others); Thu, 7 Feb 2019 11:29:10 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:51873 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbfBGQ3K (ORCPT ); Thu, 7 Feb 2019 11:29:10 -0500 Received: from localhost (aaubervilliers-681-1-80-177.w90-88.abo.wanadoo.fr [90.88.22.177]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 6DDDE100010; Thu, 7 Feb 2019 16:29:06 +0000 (UTC) From: Thomas Petazzoni To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Mark Rutland , Frank Rowand Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jan=20Kundr=C3=A1t?= , Thomas Petazzoni Subject: [PATCH v2 0/5] gpio: add support for pull-up/pull-down configuration Date: Thu, 7 Feb 2019 17:28:54 +0100 Message-Id: <20190207162859.26252-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 is a second iteration of the patches (the v1 was posted at https://patchwork.ozlabs.org/cover/1020392/). Changes since v1: - Add a comment in the binding that explicitly states that the new bit 4 and 5 should only be used for HW with a simple on/off pull-up/pull-down configuration. More complex HW should use a pin control binding. Suggested by Linus Walleij. - Change gpiod_set_debounce() and gpiod_set_transitory() to use the new gpio_set_config() helper. This is done in a new, separate patch. Suggested by Linus Walleij. - Add error checking in gpiod_configure_flags() to make sure pull-up and pull-down are not both enabled on the same GPIO. Suggested by Jan Kundrát. Jan suggested to put this in the code converting from DT properties to internal flags, but it actually makes more sense to do it in gpiod_configure_flags(), independently from DT parsing. - Add a check in gpio-pca953x driver that pull-up/pull-down is indeed supported by the underlying HW in the pca953x_gpio_set_pull_up_down() function. Noticed by Linus Walleij. - Move the changes in include/dt-bindings/gpio/gpio.h to the dt-bindings patch, as suggested by Rob Herring. Rob: due to the changes in the dt-bindings patch, I have not kept your Acked-by. Thomas [1] https://marc.info/?l=linux-gpio&m=154491873506701&w=2 Thomas Petazzoni (5): dt-bindings: gpio: document the new pull-up/pull-down flags gpio: rename gpio_set_drive_single_ended() to gpio_set_config() gpio: use new gpio_set_config() helper in more places gpio: add core support for pull-up/pull-down configuration gpio: pca953x: add ->set_config implementation .../devicetree/bindings/gpio/gpio.txt | 12 ++++ drivers/gpio/gpio-pca953x.c | 66 ++++++++++++++++++- drivers/gpio/gpiolib-of.c | 5 ++ drivers/gpio/gpiolib.c | 50 +++++++++----- 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, 127 insertions(+), 18 deletions(-) -- 2.20.1