From patchwork Wed Dec 14 09:53:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 634905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7354FC4332F for ; Wed, 14 Dec 2022 09:54:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237896AbiLNJyX (ORCPT ); Wed, 14 Dec 2022 04:54:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238054AbiLNJyA (ORCPT ); Wed, 14 Dec 2022 04:54:00 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA7421E30; Wed, 14 Dec 2022 01:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011632; x=1702547632; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jSMLFNgpl5itBCtqAbPyBTBI01DUvC31suIJbP6CgHc=; b=O0QOUHJb7Ksd8AyUauV5cpnTp5U7l3hviL3mU3WUrwFUFTRYCLyMsKhU Wg1zBa3n8AadMOhAzy+Hu6PcTonZaae6jlN8mLOu2TdyxkTKXaAUbbFYT hDLyB4FnP51MfKUpvgoJP8zzP7tYC3LoTK3tsndOoSFcgkX4JFZ7GLPCH 9tCmpb/u3xvrLfKEaI47gBRV9l6eDl2R6BoVzh6vIKPvoPD6y4ss4Feah 9zifDVzkKKH/yABYVjUmXIbieRin22N9OLcfCMnUObBDq1H8oGssxJGI0 KO8onK3M83ZvbaxQiw2/APVaTMxrQaR96DzWb3nfYlNmEcBXsmuG5vA3G g==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943175" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 14 Dec 2022 10:53:48 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 14 Dec 2022 10:53:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011628; x=1702547628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jSMLFNgpl5itBCtqAbPyBTBI01DUvC31suIJbP6CgHc=; b=dcZYhwA3uBPFpLldGv6hzb64iagtMAJEzDy2E0R33jrJF6RdGGUQgSW+ m70LMcbIK+jE/TvIphh1ZzJmK4tTKmluaInJUM2solC8K/BS9pdGO6oCU VkrKFBBUTlumfd/WhrYKDaWW+GEyt2zqrQO1a8csbqizseTii67nDKwWI bpOVUB3k/95A5TBnFeQeKofuu36iOoNHsaFS2aa6v4eaeclqaRNKqEfNd SNqKUsANAQbfJtMkt94jkOZM6ojqfFbUYNDrrDQ4mJEOB0DmLy7INMpJc cRbGPCn+MLS42NMttSdnSIQXYu9upp6HLV7GDdPIFSlusjbTAFAQ+F8Ei A==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943174" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id D8B3F280072; Wed, 14 Dec 2022 10:53:47 +0100 (CET) From: Alexander Stein To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski Cc: Alexander Stein , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Marek Vasut , Laurent Pinchart Subject: [RFC PATCH v2 1/3] dt-bindings: gpio: Add gpio-delay binding document Date: Wed, 14 Dec 2022 10:53:40 +0100 Message-Id: <20221214095342.937303-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> References: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This adds bindings for a GPIO enable/disable delay driver. Signed-off-by: Alexander Stein --- .../devicetree/bindings/gpio/gpio-delay.yaml | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-delay.yaml diff --git a/Documentation/devicetree/bindings/gpio/gpio-delay.yaml b/Documentation/devicetree/bindings/gpio/gpio-delay.yaml new file mode 100644 index 000000000000..20871356e9b5 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-delay.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-delay.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO delay controller + +maintainers: + - Alexander Stein + +description: | + This binding describes an electrical setup where setting an GPIO output + is delayed by some external setup, e.g. RC curcuit. + + +----------+ +-----------+ + | | VCC_B | | + | | | | | + | | VCC_A _ | | + | GPIO | | | R | Consumer | + |controller| ___ |_| | | + | | | | | | | + | [IOx|-------| |--+-----|-----+ | + | | |___| | | input | + | | | | | + +----------+ --- C +-----------+ + --- + | + - + GND + + If the input on the consumer is controlled by an open-drain signal + attached to an RC curcuit the ramp-up delay is not under control + of the GPIO controller. + +properties: + compatible: + const: gpio-delay + + "#gpio-cells": + description: | + Specifies the pin, ramp-up and ramp-down delays. The + delays are specified in microseconds. + const: 3 + + input-gpios: + description: Array of GPIOs which output signal change is delayed + + gpio-controller: true + + gpio-line-names: true + +required: + - compatible + - "#gpio-cells" + - gpio-controller + - input-gpios + +additionalProperties: false + +examples: + - | + #include + + enable_delay: enable-delay { + compatible = "gpio-delay"; + #gpio-cells = <3>; + gpio-controller; + input-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, + <&gpio3 1 GPIO_ACTIVE_HIGH>; + }; + + consumer { + enable-gpios = <&enable_delay 0 130000 30000>; + }; From patchwork Wed Dec 14 09:53:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 634904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F37F5C4332F for ; Wed, 14 Dec 2022 09:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237993AbiLNJy1 (ORCPT ); Wed, 14 Dec 2022 04:54:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238055AbiLNJyA (ORCPT ); Wed, 14 Dec 2022 04:54:00 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED18011B; Wed, 14 Dec 2022 01:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011633; x=1702547633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gn2uz/l27FEWIkvWQjkXj9Cd5gqzlT+kGDtvIUOrdYs=; b=WGwNCu1YYTaz/8JYOjuV8VeGTeCAWLxtGSBQcfSRnsvZpsf4GSIadA7T Tfb16+LMyUudYOf8fSriOebuL+dnLnV/+5eGGQ0vZzkTq+sG5SejH8ACn vuhQkmt8vx4OYWGvE6FfR9pV+rU1SjpgoQ6h17d53lVayfCFFz6rZqdwQ LJoHdkAoa+N4poKeICpKRBVZv5ouN9xwRdfOfa0/cbI23vqeieW/DIS/D Q5tVYAa/CCsL8lS70npHa55nRZZfWZ4+WfTvyIVFlGH81/m+MfjC1JoW2 M2A8If6tFseQ8NrIgT4auJZannANps4JnupsB3++yV05Cu0dLaIO6cwml g==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943177" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 14 Dec 2022 10:53:48 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 14 Dec 2022 10:53:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011628; x=1702547628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gn2uz/l27FEWIkvWQjkXj9Cd5gqzlT+kGDtvIUOrdYs=; b=YpZmmZZ4jvK3ceXLNnq4lCdvB6Q3mlRna8csrZB8gBgj0gLuhz2ukRQh XdgkDmjnghSWU54gTvMnH6cMsQ1obHH6xmo94/PbE83cHvm6ZHbN3HRvv WZuPixaU9FwRXLa4B3vMNQgFIU5emp6PbBXjaCMaxDTxuhWYJX/6DkSgG JsgEXKIYBHe+SHPVUmSt9SBa9sBFvxpPizJmSQwX8XuBg/561WWhc3kT0 /zJ+jkywMeq1aQGtI4a9to1frZJ6FGk+uW26mDU0LIhZGlYLXh/4C/pVt RCqB/Lxm/QzD37+g0qba1np3KhKsB3LzPWUYiUsK5L63y43xqJhTjsDbK w==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943176" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 0FCBB280071; Wed, 14 Dec 2022 10:53:48 +0100 (CET) From: Alexander Stein To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski Cc: Alexander Stein , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Marek Vasut , Laurent Pinchart Subject: [RFC PATCH v2 2/3] gpio: Add gpio delay driver Date: Wed, 14 Dec 2022 10:53:41 +0100 Message-Id: <20221214095342.937303-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> References: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This driver implements a GPIO enable/disable delay. It supports a list of GPIO outputs, which ramp-up/ramp-down delay can be specified at consumer location. The main purpose is to address external, passive delays upon line voltage changes. Signed-off-by: Alexander Stein --- drivers/gpio/Kconfig | 8 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-delay.c | 164 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 drivers/gpio/gpio-delay.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index ec7cfd4f52b1..8f1dcbe3fd00 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1684,6 +1684,14 @@ config GPIO_AGGREGATOR industrial control context, to be operated from userspace using the GPIO chardev interface. +config GPIO_DELAY + tristate "GPIO delay" + help + Say yes here to enable the GPIO delay, which provides a way to + configure platform specific delays for GPIO ramp-up or ramp-down + delays. This can serve the following purposes: + - Open-drain output using an RC filter + config GPIO_LATCH tristate "GPIO latch driver" help diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 010587025fc8..56b6cbe35248 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -52,6 +52,7 @@ obj-$(CONFIG_GPIO_DA9052) += gpio-da9052.o obj-$(CONFIG_GPIO_DA9055) += gpio-da9055.o obj-$(CONFIG_GPIO_DAVINCI) += gpio-davinci.o obj-$(CONFIG_GPIO_DLN2) += gpio-dln2.o +obj-$(CONFIG_GPIO_DELAY) += gpio-delay.o obj-$(CONFIG_GPIO_DWAPB) += gpio-dwapb.o obj-$(CONFIG_GPIO_EIC_SPRD) += gpio-eic-sprd.o obj-$(CONFIG_GPIO_EM) += gpio-em.o diff --git a/drivers/gpio/gpio-delay.c b/drivers/gpio/gpio-delay.c new file mode 100644 index 000000000000..a91d2ea9a8bc --- /dev/null +++ b/drivers/gpio/gpio-delay.c @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2022 TQ-Systems GmbH + * Author: Alexander Stein + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "gpiolib.h" + +struct gpio_delay_timing { + unsigned long ramp_up_delay_us; + unsigned long ramp_down_delay_us; +}; + +struct gpio_delay_priv { + struct gpio_chip gc; + struct gpio_descs *input_gpio; + struct gpio_delay_timing *delay_timings; +}; + +static int gpio_delay_get_direction(struct gpio_chip *gc, unsigned int offset) +{ + return GPIO_LINE_DIRECTION_OUT; +} + +static void gpio_delay_set(struct gpio_chip *gc, unsigned int offset, int val) +{ + struct gpio_delay_priv *priv = gpiochip_get_data(gc); + struct gpio_desc *gpio_desc = priv->input_gpio->desc[offset]; + const struct gpio_delay_timing *delay_timings; + bool ramp_up; + + gpiod_set_value(gpio_desc, val); + + delay_timings = &priv->delay_timings[offset]; + ramp_up = (!gpiod_is_active_low(gpio_desc) && val) || + (gpiod_is_active_low(gpio_desc) && !val); + + if (ramp_up && delay_timings->ramp_up_delay_us) + udelay(delay_timings->ramp_up_delay_us); + if (!ramp_up && delay_timings->ramp_down_delay_us) + udelay(delay_timings->ramp_down_delay_us); +} + +static void gpio_delay_set_can_sleep(struct gpio_chip *gc, unsigned int offset, int val) +{ + struct gpio_delay_priv *priv = gpiochip_get_data(gc); + struct gpio_desc *gpio_desc = priv->input_gpio->desc[offset]; + const struct gpio_delay_timing *delay_timings; + bool ramp_up; + + gpiod_set_value_cansleep(gpio_desc, val); + + delay_timings = &priv->delay_timings[offset]; + ramp_up = (!gpiod_is_active_low(gpio_desc) && val) || + (gpiod_is_active_low(gpio_desc) && !val); + + if (ramp_up && delay_timings->ramp_up_delay_us) + fsleep(delay_timings->ramp_up_delay_us); + if (!ramp_up && delay_timings->ramp_down_delay_us) + fsleep(delay_timings->ramp_down_delay_us); +} + +static int gpio_delay_of_xlate(struct gpio_chip *gc, + const struct of_phandle_args *gpiospec, + u32 *flags) +{ + struct gpio_delay_priv *priv = gpiochip_get_data(gc); + struct gpio_delay_timing *timings; + u32 line; + + if (gpiospec->args_count != gc->of_gpio_n_cells) + return -EINVAL; + + line = gpiospec->args[0]; + if (line >= gc->ngpio) + return -EINVAL; + + timings = &priv->delay_timings[line]; + timings->ramp_up_delay_us = gpiospec->args[1]; + timings->ramp_down_delay_us = gpiospec->args[2]; + + return line; +} + +static bool gpio_delay_can_sleep(const struct gpio_delay_priv *priv) +{ + int i; + + for (i = 0; i < priv->input_gpio->ndescs; i++) + if (gpiod_cansleep(priv->input_gpio->desc[i])) + return true; + + return false; +} + +static int gpio_delay_probe(struct platform_device *pdev) +{ + struct gpio_delay_priv *priv; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->input_gpio = devm_gpiod_get_array(&pdev->dev, "input", GPIOD_OUT_LOW); + if (IS_ERR(priv->input_gpio)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->input_gpio), + "Failed to get input-gpios"); + + priv->delay_timings = devm_kcalloc(&pdev->dev, + priv->input_gpio->ndescs, + sizeof(*priv->delay_timings), + GFP_KERNEL); + if (!priv->delay_timings) + return -ENOMEM; + + if (gpio_delay_can_sleep(priv)) { + priv->gc.can_sleep = true; + priv->gc.set = gpio_delay_set_can_sleep; + } else { + priv->gc.can_sleep = false; + priv->gc.set = gpio_delay_set; + } + + priv->gc.get_direction = gpio_delay_get_direction; + priv->gc.of_xlate = gpio_delay_of_xlate; + priv->gc.of_gpio_n_cells = 3; + priv->gc.ngpio = priv->input_gpio->ndescs; + priv->gc.owner = THIS_MODULE; + priv->gc.base = -1; + priv->gc.parent = &pdev->dev; + + platform_set_drvdata(pdev, priv); + + return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv); +} + +static const struct of_device_id gpio_delay_ids[] = { + { + .compatible = "gpio-delay", + }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, gpio_delay_ids); + +static struct platform_driver gpio_delay_driver = { + .driver = { + .name = "gpio-delay", + .of_match_table = gpio_delay_ids, + }, + .probe = gpio_delay_probe, +}; +module_platform_driver(gpio_delay_driver); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Alexander Stein "); +MODULE_DESCRIPTION("GPIO delay driver"); From patchwork Wed Dec 14 09:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 634016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD7DEC46467 for ; Wed, 14 Dec 2022 09:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237966AbiLNJyY (ORCPT ); Wed, 14 Dec 2022 04:54:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238056AbiLNJyA (ORCPT ); Wed, 14 Dec 2022 04:54:00 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C16C021C; Wed, 14 Dec 2022 01:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011634; x=1702547634; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LzqGGxmF1t3qGuJLCa6X1QP62ut/E2OTUEGN+pkAN+I=; b=Z7PornlXpW7/J2W4xxlcLomCOdtd+HHnHEqaNRLbY4MqiUb7q3Uk0iKM 2a7Wa4UTAg+QkjNNC3ib3JNI1fgUdV1h4UyDRKnwSK90swbFHR/ZX6Kby UvoGsVr5i5/L6ZZ7fTCQFA4srt8Ot6lWhkQ+xKFWXKLkNv2nyAKISp0mf 0rm09RYsowdjESM2/bsJrMjBFLF7UYQsiuSpJqqZJd3gr0OdgCiMO51AK qOYTGMdZSszBh/YeZnmHIijwl47dIOvWE38pBl2B22uDQzHVn4J7bpRCQ 1uF4tLtSOVAKhsqB4xV3tll+3I+1o7CroH4k4DuCA68+b/cuhesxHu7ol w==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943179" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 14 Dec 2022 10:53:48 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 14 Dec 2022 10:53:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1671011628; x=1702547628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LzqGGxmF1t3qGuJLCa6X1QP62ut/E2OTUEGN+pkAN+I=; b=dlA0EUnXY7/pe8a6VpYC68WVr4InRSwN2qHkBOOL5gWii78uIIkY/S7t zi7cZ/ATnCcuwjQTcICzNsptpES85t+XQeJ/q+irWs/XBTd7aTsIk7zyf B/y3cwdRTW69UQnO7SDXgQEQ5DTn9XmiIhwjve8EePPuZPsIZervJ0HoP Hzk8cYnt0aqPnENxcwAwgBxfRdJM2/4LP8rvKgibe5vym8vmR9t+rmtrN dDDH5Qp9QvDhc43BOczHF6Lq37ol3+2YoeIlq3wbHQnkAexg1Q8xJAHSt Z5jcV0Wq7K6VcPg2Ln3J+imds5F2pNUmvreJZTxvsSwXPPsWF7uW4/eg5 Q==; X-IronPort-AV: E=Sophos;i="5.96,244,1665439200"; d="scan'208";a="27943178" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 14 Dec 2022 10:53:48 +0100 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 3CD34280072; Wed, 14 Dec 2022 10:53:48 +0100 (CET) From: Alexander Stein To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski Cc: Alexander Stein , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Marek Vasut , Laurent Pinchart Subject: [RFC PATCH v2 3/3] [DNI] arm64: dts: mba8mx: Use gpio-delay for LVDS bridge Date: Wed, 14 Dec 2022 10:53:42 +0100 Message-Id: <20221214095342.937303-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> References: <20221214095342.937303-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add a gpio-delay for LVDS_BRIDGE_EN_1V8 which ramp-up time is defined by the external RC filter. Signed-off-by: Alexander Stein --- arch/arm64/boot/dts/freescale/mba8mx.dtsi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/mba8mx.dtsi b/arch/arm64/boot/dts/freescale/mba8mx.dtsi index b0662dfa6194..a1ceadfa5b3d 100644 --- a/arch/arm64/boot/dts/freescale/mba8mx.dtsi +++ b/arch/arm64/boot/dts/freescale/mba8mx.dtsi @@ -75,6 +75,14 @@ led2: led2 { }; }; + gpio_delays: gpio-delays { + compatible = "gpio-delay"; + #gpio-cells = <3>; + gpio-controller; + input-gpios = <&expander0 6 GPIO_ACTIVE_HIGH>; + gpio-line-names = "LVDS_BRIDGE_EN_1V8"; + }; + panel0: panel_lvds0 { /* * Display is not fixed, so compatible has to be added from @@ -191,6 +199,10 @@ expander0: gpio@23 { interrupts = <9 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <2>; + gpio-line-names = "", "", "", "", + "", "", "LVDS_BRIDGE_EN_3V3", "", + "", "", "", "", + "", "", "", ""; sd-mux-oe-hog { gpio-hog; @@ -272,7 +284,7 @@ &i2c3 { dsi_lvds_bridge: bridge@2d { compatible = "ti,sn65dsi83"; reg = <0x2d>; - enable-gpios = <&expander0 6 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpio_delays 0 130000 0>; vcc-supply = <®_sn65dsi83_1v8>; status = "disabled";