All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: linus.walleij@linaro.org
Cc: robh+dt@kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, sandor.yu@nxp.com,
	Fabio Estevam <festevam@gmail.com>
Subject: [PATCH v3 2/2] gpio: 74x164: Introduce the 'registers-default' property
Date: Wed, 30 Dec 2020 18:49:18 -0300	[thread overview]
Message-ID: <20201230214918.17133-2-festevam@gmail.com> (raw)
In-Reply-To: <20201230214918.17133-1-festevam@gmail.com>

From: Sandor Yu <sandor.yu@nxp.com>

On the imx7d-sdb board, there is one output pin of the 74x164 that
controls all peripherals power supply (PERI_3V).

This pin should be at high voltage level when the 74x164 is probed,
otherwise the modules dependent on PERI_3V3 will not be powered.

Add a new optional property called 'registers-default' that allows
describing the default output value for each shift register.

Signed-off-by: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v2:
-Add Sandor's Signed-off-by tag.

 drivers/gpio/gpio-74x164.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index 05637d585152..a11637518774 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -141,6 +141,9 @@ static int gen_74x164_probe(struct spi_device *spi)
 	chip->registers = nregs;
 	chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers;
 
+	device_property_read_u8_array(&spi->dev, "registers-default",
+				      chip->buffer, chip->registers);
+
 	chip->gpio_chip.can_sleep = true;
 	chip->gpio_chip.parent = &spi->dev;
 	chip->gpio_chip.owner = THIS_MODULE;
-- 
2.17.1


  reply	other threads:[~2020-12-30 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 21:49 [PATCH v3 1/2] dt-bindings: gpio: 74x164: Introduce the 'registers-default' property Fabio Estevam
2020-12-30 21:49 ` Fabio Estevam [this message]
2021-01-05 15:40   ` [PATCH v3 2/2] " Linus Walleij
2021-01-05 15:34 ` [PATCH v3 1/2] dt-bindings: " Linus Walleij
2021-01-07 12:16   ` Fabio Estevam
2021-01-07 14:17     ` Linus Walleij
2021-01-07 14:33       ` Andrew Lunn
2021-01-07 14:25     ` Andrew Lunn
2021-01-07 14:38       ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201230214918.17133-2-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sandor.yu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.