diff options
author | Dzmitry Sankouski <dsankouski@gmail.com> | 2023-01-22 18:21:21 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-02-10 20:50:00 +0300 |
commit | 42a0c908dd1efea93914b82c8d26a7106fd23a13 (patch) | |
tree | eeff80e1cece4c0dc4576e0b400b7d028e62a52c /drivers | |
parent | baf0677b74c5f382458bc928b1f0f05fdba508c4 (diff) | |
download | u-boot-42a0c908dd1efea93914b82c8d26a7106fd23a13.tar.xz |
gpio: qcom: add direction functions for pwrkey
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/qcom_pmic_gpio.c | 16 |
1 files changed, 16 insertions, 0 deletions
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) |