forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/pinctrl/qcom/pinctrl-msm.h
....@@ -1,14 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (c) 2013, Sony Mobile Communications AB.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 and
6
- * only version 2 as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135 #ifndef __PINCTRL_MSM_H__
146 #define __PINCTRL_MSM_H__
....@@ -46,6 +38,7 @@
4638 * @mux_bit: Offset in @ctl_reg for the pinmux function selection.
4739 * @pull_bit: Offset in @ctl_reg for the bias configuration.
4840 * @drv_bit: Offset in @ctl_reg for the drive strength configuration.
41
+ * @od_bit: Offset in @ctl_reg for controlling open drain.
4942 * @oe_bit: Offset in @ctl_reg for controlling output enable.
5043 * @in_bit: Offset in @io_reg for the input bit value.
5144 * @out_bit: Offset in @io_reg for the output bit value.
....@@ -76,11 +69,14 @@
7669 u32 intr_status_reg;
7770 u32 intr_target_reg;
7871
72
+ unsigned int tile:2;
73
+
7974 unsigned mux_bit:5;
8075
8176 unsigned pull_bit:5;
8277 unsigned drv_bit:5;
8378
79
+ unsigned od_bit:5;
8480 unsigned oe_bit:5;
8581 unsigned in_bit:5;
8682 unsigned out_bit:5;
....@@ -98,6 +94,16 @@
9894 };
9995
10096 /**
97
+ * struct msm_gpio_wakeirq_map - Map of GPIOs and their wakeup pins
98
+ * @gpio: The GPIOs that are wakeup capable
99
+ * @wakeirq: The interrupt at the always-on interrupt controller
100
+ */
101
+struct msm_gpio_wakeirq_map {
102
+ unsigned int gpio;
103
+ unsigned int wakeirq;
104
+};
105
+
106
+/**
101107 * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration
102108 * @pins: An array describing all pins the pin controller affects.
103109 * @npins: The number of entries in @pins.
....@@ -107,6 +113,12 @@
107113 * @ngroups: The numbmer of entries in @groups.
108114 * @ngpio: The number of pingroups the driver should expose as GPIOs.
109115 * @pull_no_keeper: The SoC does not support keeper bias.
116
+ * @wakeirq_map: The map of wakeup capable GPIOs and the pin at PDC/MPM
117
+ * @nwakeirq_map: The number of entries in @wakeirq_map
118
+ * @wakeirq_dual_edge_errata: If true then GPIOs using the wakeirq_map need
119
+ * to be aware that their parent can't handle dual
120
+ * edge interrupts.
121
+ * @gpio_func: Which function number is GPIO (usually 0).
110122 */
111123 struct msm_pinctrl_soc_data {
112124 const struct pinctrl_pin_desc *pins;
....@@ -117,8 +129,17 @@
117129 unsigned ngroups;
118130 unsigned ngpios;
119131 bool pull_no_keeper;
132
+ const char *const *tiles;
133
+ unsigned int ntiles;
134
+ const int *reserved_gpios;
135
+ const struct msm_gpio_wakeirq_map *wakeirq_map;
136
+ unsigned int nwakeirq_map;
137
+ bool wakeirq_dual_edge_errata;
138
+ unsigned int gpio_func;
120139 };
121140
141
+extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
142
+
122143 int msm_pinctrl_probe(struct platform_device *pdev,
123144 const struct msm_pinctrl_soc_data *soc_data);
124145 int msm_pinctrl_remove(struct platform_device *pdev);