diff mbox series

[v6,02/13] pinctrl: Add poutdisops variable to struct pinctrl_desc

Message ID 20230306090014.128732-3-biju.das.jz@bp.renesas.com
State New
Headers show
Series Add pinctrl sysfs and RZ/G2L POEG support | expand

Commit Message

Biju Das March 6, 2023, 9 a.m. UTC
Add pin output disable operations vtable to struct pinctrl_desc.
This is needed for configuring IPs that support pin output disable
function.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v6:
 * New patch
Ref:
 https://lore.kernel.org/linux-renesas-soc/OS0PR01MB5922F5494D3C0862E15F3F8486B39@OS0PR01MB5922.jpnprd01.prod.outlook.com/T/#t
---
 include/linux/pinctrl/output-disable.h | 42 ++++++++++++++++++++++++++
 include/linux/pinctrl/pinctrl.h        |  4 +++
 2 files changed, 46 insertions(+)
 create mode 100644 include/linux/pinctrl/output-disable.h
diff mbox series

Patch

diff --git a/include/linux/pinctrl/output-disable.h b/include/linux/pinctrl/output-disable.h
new file mode 100644
index 000000000000..7f63dcc93e44
--- /dev/null
+++ b/include/linux/pinctrl/output-disable.h
@@ -0,0 +1,42 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Interface the output disable portions of the pinctrl subsystem
+ *
+ * Copyright (C) 2023 Renesas Electronics Corporation
+ * This interface is used in the core to keep track of output_disable pins.
+ *
+ * Author: Biju Das <biju.das.jz@bp.renesas.com>
+ */
+#ifndef __LINUX_PINCTRL_OUTPUT_DISABLE_H
+#define __LINUX_PINCTRL_OUTPUT_DISABLE_H
+
+#include <linux/types.h>
+#include <linux/pinctrl/consumer.h>
+
+struct pinctrl_dev;
+struct seq_file;
+
+enum pin_output_disable_conf {
+	PINCTRL_OUTPUT_DISABLE_BY_USER,
+	PINCTRL_OUTPUT_DISABLE_BY_SOC_ON_PIN_OUTPUT_HIGH,
+	PINCTRL_OUTPUT_DISABLE_BY_SOC_ON_PIN_OUTPUT_LOW,
+	PINCTRL_OUTPUT_DISABLE_BY_SOC_ON_DEAD_TIME_ERROR,
+	PINCTRL_OUTPUT_DISABLE_BY_LEVEL_DETECTION,
+};
+
+/**
+ * struct pin_config_set - pin output disable config operations, to be
+ * implemented by pin configuration capable drivers.
+ * @pin_output_disable_config_set: for pin controllers that want to use the
+ *	generic interface, this flag tells the framework that it's generic.
+ */
+struct pin_output_disable_ops {
+	int (*pin_output_disable_config_set)(struct pinctrl_dev *pctldev,
+					     struct device *dev,
+					     const char *fname,
+					     const char *gname,
+					     enum pin_output_disable_conf conf,
+					     unsigned int conf_val);
+};
+
+#endif /* __LINUX_PINCTRL_OUTPUT_DISABLE_H */
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 4d252ea00ed1..3b5beee49039 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -25,6 +25,7 @@  struct pinconf_ops;
 struct pinctrl_dev;
 struct pinctrl_map;
 struct pinmux_ops;
+struct pin_output_disable_ops;
 
 /**
  * struct pingroup - provides information on pingroup
@@ -135,6 +136,8 @@  struct pinctrl_ops {
  * @pmxops: pinmux operations vtable, if you support pinmuxing in your driver
  * @confops: pin config operations vtable, if you support pin configuration in
  *	your driver
+ * @poutdisops: pin output disable operations vtable, if you support pin output
+ *	disable in your driver
  * @owner: module providing the pin controller, used for refcounting
  * @num_custom_params: Number of driver-specific custom parameters to be parsed
  *	from the hardware description
@@ -154,6 +157,7 @@  struct pinctrl_desc {
 	const struct pinctrl_ops *pctlops;
 	const struct pinmux_ops *pmxops;
 	const struct pinconf_ops *confops;
+	const struct pin_output_disable_ops *poutdisops;
 	struct module *owner;
 #ifdef CONFIG_GENERIC_PINCONF
 	unsigned int num_custom_params;