[DO NOT APPLY PATCH v8 13/15] pinctrl: renesas: rzg2l-poeg: output-disable request from GPT when both outputs are low

Biju
2025-11-21T16:08:56Z

This patch adds support for output-disable requests from GPT, when both
outputs are low.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/pinctrl/renesas/poeg/rzg2l-poeg.c | 10 ++++++++++
include/linux/pinctrl/rzg2l-poeg.h | 1 +
2 files changed, 11 insertions(+)

diff --git a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
index 3dd8bc3465b1..f66f69c5b1f7 100644
--- a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
+++ b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
@@ -89,6 +89,9 @@ static void rzg2l_poeg_config_irq(struct rzg2l_poeg_chip *chip)
{
if (test_bit(RZG2L_GPT_OABHF, chip->gpt_irq))
rzg2l_gpt_poeg_disable_req_both_high(chip->gpt_dev, chip->index, true);
+
+ if (test_bit(RZG2L_GPT_OABLF, chip->gpt_irq))
+ rzg2l_gpt_poeg_disable_req_both_low(chip->gpt_dev, chip->index, true);
}

static irqreturn_t rzg2l_poeg_irq(int irq, void *ptr)
@@ -347,9 +350,16 @@ static int rzg2l_poeg_probe(struct platform_device *pdev)
case POEG_GPT_BOTH_HIGH:
assign_bit(RZG2L_GPT_OABHF, chip->gpt_irq, true);
break;
+ case POEG_GPT_BOTH_LOW:
+ assign_bit(RZG2L_GPT_OABLF, chip->gpt_irq, true);
+ break;
case POEG_EXT_PIN_CTRL:
rzg2l_poeg_write(chip, POEGG_PIDE);
break;
+ case POEG_GPT_BOTH_HIGH_LOW:
+ assign_bit(RZG2L_GPT_OABHF, chip->gpt_irq, true);
+ assign_bit(RZG2L_GPT_OABLF, chip->gpt_irq, true);
+ break;
default:
ret = -EINVAL;
goto err_pm;
diff --git a/include/linux/pinctrl/rzg2l-poeg.h b/include/linux/pinctrl/rzg2l-poeg.h
index 311405b0137e..ed3e08f10834 100644
--- a/include/linux/pinctrl/rzg2l-poeg.h
+++ b/include/linux/pinctrl/rzg2l-poeg.h
@@ -10,6 +10,7 @@
#define RZG2L_POEG_GPT_FAULT_CLR_CMD 3

#define RZG2L_GPT_OABHF 1
+#define RZG2L_GPT_OABLF 2

struct poeg_event {
__u32 gpt_disable_irq_status;
--
2.43.0