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,
Sandor Yu <Sandor.yu@nxp.com>, Fabio Estevam <festevam@gmail.com>
Subject: [PATCH 2/2] gpio: 74x164: Introduce the 'registers-default' property
Date: Wed, 30 Dec 2020 12:41:07 -0300 [thread overview]
Message-ID: <20201230154107.4151-2-festevam@gmail.com> (raw)
In-Reply-To: <20201230154107.4151-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>
---
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..4be51ee4d44c 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;
+ of_property_read_u8_array(spi->dev.of_node, "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
prev parent reply other threads:[~2020-12-30 15:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 15:41 [PATCH 1/2] dt-bindings: gpio: 74x164: Introduce the 'registers-default' property Fabio Estevam
2020-12-30 15:41 ` Fabio Estevam [this message]
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=20201230154107.4151-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.