[DO NOT APPLY PATCH v5 6/9] pinctrl: renesas: rzg2l-poeg: output-disable request from GPT when both outputs are low.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Added sysfs to enable/disable for configuring GPT output disable request
when both outputs are low.

Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
---
 .../ABI/testing/sysfs-platform-rzg2l-poeg     | 23 ++++++++++++
 drivers/pinctrl/renesas/poeg/rzg2l-poeg.c     | 36 +++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-platform-rzg2l-poeg b/Documentation/ABI/testing/sysfs-platform-rzg2l-poeg
index 598fca265aad..45a7f44dccdd 100644
--- a/Documentation/ABI/testing/sysfs-platform-rzg2l-poeg
+++ b/Documentation/ABI/testing/sysfs-platform-rzg2l-poeg
@@ -39,3 +39,26 @@ Description:
 		        output level high is enabled.
 		- "0" - Output-disable request from gpt when same time
 		        output level high is disabled.
+
+What:		/sys/devices/platform/<rzg2l-poeg's name>/gpt_req_both_low
+Date:		November 2022
+KernelVersion:	6.3
+Contact:	Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
+Description:
+		This file can be read and write.
+		The file used to configure the output disable request from
+		gpt when same time output level low.
+
+		Write the following string to control the output disable:
+
+		- "1" - Enables output-disable request from gpt when same time
+		        output level low.
+		- "0" - Disables output-disable request from gpt when same time
+		        output level low.
+
+		Read the file, then it shows the following strings:
+
+		- "1" - Output-disable request from gpt when same time
+		        output level low is enabled.
+		- "0" - Output-disable request from gpt when same time
+		        output level low is disabled.
diff --git a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
index 2a66dc869fd3..58a2cc9519e5 100644
--- a/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
+++ b/drivers/pinctrl/renesas/poeg/rzg2l-poeg.c
@@ -121,12 +121,48 @@ static ssize_t gpt_req_both_high_show(struct device *dev,
 	return sysfs_emit(buf, "%u\n", test_bit(RZG2L_GPT_OABHF, chip->gpt_irq));
 }
 
+static ssize_t gpt_req_both_low_store(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t count)
+{
+	struct rzg2l_poeg_chip *chip;
+	unsigned int val;
+	int ret;
+
+	chip = dev_get_drvdata(dev);
+	ret = kstrtouint(buf, 0, &val);
+	if (ret)
+		return ret;
+
+	if (val)
+		set_bit(RZG2L_GPT_OABLF, chip->gpt_irq);
+	else
+		clear_bit(RZG2L_GPT_OABLF, chip->gpt_irq);
+
+	rzg2l_gpt_poeg_disable_req_both_low(chip->gpt_dev, chip->index,
+					    test_bit(RZG2L_GPT_OABLF, chip->gpt_irq));
+
+	return count;
+}
+
+static ssize_t gpt_req_both_low_show(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	struct rzg2l_poeg_chip *chip;
+
+	chip = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%u\n", test_bit(RZG2L_GPT_OABLF, chip->gpt_irq));
+}
+
 static DEVICE_ATTR_RW(output_disable);
 static DEVICE_ATTR_RW(gpt_req_both_high);
+static DEVICE_ATTR_RW(gpt_req_both_low);
 
 static struct attribute *poeg_attrs[] = {
 	&dev_attr_output_disable.attr,
 	&dev_attr_gpt_req_both_high.attr,
+	&dev_attr_gpt_req_both_low.attr,
 	NULL,
 };
 
-- 
2.25.1




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux