From: Dzmitry Sankouski <dsankouski@gmail.com>
To: u-boot@lists.denx.de
Cc: Dzmitry Sankouski <dsankouski@gmail.com>,
Sumit Garg <sumit.garg@linaro.org>
Subject: [PATCH v3 1/5] gpio: qcom: add direction functions for pwrkey
Date: Sun, 22 Jan 2023 18:21:21 +0300 [thread overview]
Message-ID: <20230122152125.858085-2-dsankouski@gmail.com> (raw)
In-Reply-To: <20230122152125.858085-1-dsankouski@gmail.com>
GPIO button driver requires direction functions to probe
button gpio. Those functions are blank, since pwrkey is not
really gpio, and don't support direction settings.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
---
Changes for v2:
- none
Changes for v3:
- KDPWR and RESIN not gpio: fix comment and commit message
drivers/gpio/qcom_pmic_gpio.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpio/qcom_pmic_gpio.c b/drivers/gpio/qcom_pmic_gpio.c
index 3be1be8692..65feb453eb 100644
--- a/drivers/gpio/qcom_pmic_gpio.c
+++ b/drivers/gpio/qcom_pmic_gpio.c
@@ -303,9 +303,25 @@ static int qcom_pwrkey_get_value(struct udevice *dev, unsigned offset)
}
}
+/*
+ * Since pmic buttons modelled as GPIO, we need empty direction functions
+ * to trick u-boot button driver
+ */
+static int qcom_pwrkey_direction_input(struct udevice *dev, unsigned int offset)
+{
+ return 0;
+}
+
+static int qcom_pwrkey_direction_output(struct udevice *dev, unsigned int offset, int value)
+{
+ return -EOPNOTSUPP;
+}
+
static const struct dm_gpio_ops qcom_pwrkey_ops = {
.get_value = qcom_pwrkey_get_value,
.get_function = qcom_pwrkey_get_function,
+ .direction_input = qcom_pwrkey_direction_input,
+ .direction_output = qcom_pwrkey_direction_output,
};
static int qcom_pwrkey_probe(struct udevice *dev)
--
2.30.2
next prev parent reply other threads:[~2023-01-22 15:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-22 15:21 [PATCH v3 0/5] dm: input: driver for buttons with linux, code declaration Dzmitry Sankouski
2023-01-22 15:21 ` Dzmitry Sankouski [this message]
2023-02-10 18:43 ` [PATCH v3 1/5] gpio: qcom: add direction functions for pwrkey Tom Rini
2023-01-22 15:21 ` [PATCH v3 2/5] dts: add missing linux,code in gpio-keys Dzmitry Sankouski
2023-02-10 18:43 ` Tom Rini
2023-01-22 15:21 ` [PATCH v3 3/5] test: create dedicated fdt node for ofnode_for_each_prop test Dzmitry Sankouski
2023-01-23 18:42 ` Simon Glass
2023-02-10 18:43 ` Tom Rini
2023-01-22 15:21 ` [PATCH v3 4/5] dm: button: add support for linux_code in button-gpio.c driver Dzmitry Sankouski
2023-01-23 18:42 ` Simon Glass
2023-02-10 18:43 ` Tom Rini
2023-01-22 15:21 ` [PATCH v3 5/5] dm: input: add button_kbd driver Dzmitry Sankouski
2023-01-23 18:42 ` Simon Glass
2023-02-10 18:43 ` Tom Rini
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=20230122152125.858085-2-dsankouski@gmail.com \
--to=dsankouski@gmail.com \
--cc=sumit.garg@linaro.org \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox