@@ -62,3 +62,26 @@ Description:
output level low is enabled.
- "0" - Output-disable request from gpt when same time
output level low is disabled.
+
+What: /sys/devices/platform/<rzg2l-poeg's name>/gpt_req_deadtime_err
+Date: November 2022
+KernelVersion: 6.3
+Contact: Biju Das <biju.das.jz@bp.renesas.com>
+Description:
+ This file can be read and write.
+ The file used to configure the output disable request from
+ gpt when dead time error occurred.
+
+ Write the following string to control the output disable:
+
+ - "1" - Enables output-disable request from gpt when dead time
+ error occurs.
+ - "0" - Disables output-disable request from gpt when dead time
+ error occurs.
+
+ Read the file, then it shows the following strings:
+
+ - "1" - Output-disable request from gpt when dead time
+ error occurs is enabled.
+ - "0" - Output-disable request from gpt when dead time
+ error occurs is disabled.
@@ -155,14 +155,51 @@ static ssize_t gpt_req_both_low_show(struct device *dev,
return sysfs_emit(buf, "%u\n", test_bit(RZG2L_GPT_OABLF, chip->gpt_irq));
}
+static ssize_t gpt_req_deadtime_err_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_DTEF, chip->gpt_irq);
+ else
+ clear_bit(RZG2L_GPT_DTEF, chip->gpt_irq);
+
+ rzg2l_gpt_poeg_disable_req_deadtime_error(chip->gpt_dev, chip->index,
+ test_bit(RZG2L_GPT_DTEF, chip->gpt_irq));
+
+ return count;
+}
+
+static ssize_t gpt_req_deadtime_err_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_DTEF, 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 DEVICE_ATTR_RW(gpt_req_deadtime_err);
static struct attribute *poeg_attrs[] = {
&dev_attr_output_disable.attr,
&dev_attr_gpt_req_both_high.attr,
&dev_attr_gpt_req_both_low.attr,
+ &dev_attr_gpt_req_deadtime_err.attr,
NULL,
};
This patch adds support for output-disable requests from GPT, when dead time error occurs. Added sysfs to enable/disable for configuring GPT output disable request for dead time error. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- .../ABI/testing/sysfs-platform-rzg2l-poeg | 23 ++++++++++++ drivers/pinctrl/renesas/poeg/rzg2l-poeg.c | 37 +++++++++++++++++++ 2 files changed, 60 insertions(+)