linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: "Biju Das" <biju.das.jz@bp.renesas.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	linux-pwm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-gpio@vger.kernel.org,
	"Prabhakar Mahadev Lad" <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [DO NOT APPLY PATCH v7 09/10] pinctrl: renesas: rzg2l-poeg: output-disable request by external pin
Date: Tue, 28 Mar 2023 11:10:10 +0100	[thread overview]
Message-ID: <20230328101011.185594-10-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20230328101011.185594-1-biju.das.jz@bp.renesas.com>

Add support for output-disable request by external pin.

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

diff --git a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
index 7576f756af3c..5d93a0be33f3 100644
--- a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
+++ b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
@@ -15,13 +15,16 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/pwm/rzg2l-gpt.h>
+#include <linux/pinctrl/rzg2l-poeg.h>
 #include <linux/poll.h>
 #include <linux/reset.h>
 #include <linux/wait.h>
 
 #define POEGG_IOCE	BIT(5)
+#define POEGG_PIDE	BIT(4)
 #define POEGG_SSF	BIT(3)
 #define POEGG_IOCF	BIT(1)
+#define POEGG_PIDF	BIT(0)
 
 #define RZG2L_POEG_MAX_INDEX		3
 
@@ -113,6 +116,9 @@ static irqreturn_t rzg2l_poeg_irq(int irq, void *ptr)
 	if (val & POEGG_IOCF)
 		val &= ~POEGG_IOCF;
 
+	if (val & POEGG_PIDF)
+		val &= ~POEGG_PIDF;
+
 	rzg2l_poeg_write(chip, val);
 
 	return IRQ_HANDLED;
@@ -378,6 +384,9 @@ static int rzg2l_poeg_probe(struct platform_device *pdev)
 			assign_bit(RZG2L_GPT_OABLF, chip->gpt_irq, true);
 			assign_bit(RZG2L_GPT_DTEF, chip->gpt_irq, true);
 			break;
+		case POEG_EXT_PIN_CTRL:
+			rzg2l_poeg_write(chip, POEGG_PIDE);
+			break;
 		default:
 			ret = -EINVAL;
 			goto err_pm;
diff --git a/include/linux/pinctrl/rzg2l-poeg.h b/include/linux/pinctrl/rzg2l-poeg.h
index 5441de7f3751..359849fea6a0 100644
--- a/include/linux/pinctrl/rzg2l-poeg.h
+++ b/include/linux/pinctrl/rzg2l-poeg.h
@@ -7,11 +7,13 @@
 #define RZG2L_GPT_DTEF	0
 #define RZG2L_GPT_OABHF	1
 #define RZG2L_GPT_OABLF	2
+#define RZG2L_POEG_EXT_PIN_CTRL	3
 
 #define RZG2L_POEG_USR_CTRL_ENABLE_CMD	0
 #define RZG2L_POEG_USR_CTRL_DISABLE_CMD	1
 #define RZG2L_POEG_GPT_CFG_IRQ_CMD		2
 #define RZG2L_POEG_GPT_FAULT_CLR_CMD		3
+#define RZG2L_POEG_EXT_PIN_CTRL_FAULT_CLR_CMD	4
 
 struct poeg_event {
 	__u32 gpt_disable_irq_status;
-- 
2.25.1


  parent reply	other threads:[~2023-03-28 10:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 10:10 [PATCH v7 00/10] Add RZ/G2L POEG support Biju Das
2023-03-28 10:10 ` [PATCH v7 01/10] dt-bindings: pinctrl: rzg2l-poeg: Document renesas,poeg-config property Biju Das
2023-03-31  9:48   ` Linus Walleij
2023-03-31 12:11     ` Geert Uytterhoeven
2023-04-03 20:39   ` Rob Herring
2023-03-28 10:10 ` [PATCH v7 02/10] drivers: pinctrl: renesas: Add RZ/G2L POEG driver support Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 03/10] pwm: rzg2l-gpt: Add support for output disable request from gpt Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 04/10] pinctrl: renesas: rzg2l-poeg: Add support for GPT Output-Disable Request Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 05/10] pwm: rzg2l-gpt: Add support for output disable when both output low Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 06/10] pinctrl: renesas: rzg2l-poeg: output-disable request from GPT when both outputs are low Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 07/10] pwm: rzg2l-gpt: Add support for output disable on dead time error Biju Das
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 08/10] pinctrl: renesas: rzg2l-poeg: output-disable request from GPT " Biju Das
2023-03-28 10:10 ` Biju Das [this message]
2023-03-28 10:10 ` [DO NOT APPLY PATCH v7 10/10] tools/poeg: Add test app for poeg Biju Das

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=20230328101011.185594-10-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.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;
as well as URLs for NNTP newsgroup(s).