blob: 14a8210522bffddb9e7cd778ceb3de54517b2dc9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Mateusz Kulikowski15a58532016-03-31 23:12:31 +02002/*
Sumit Garg60900b42022-08-04 19:57:17 +05303 * Qualcomm generic pmic gpio driver
Mateusz Kulikowski15a58532016-03-31 23:12:31 +02004 *
5 * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Mateusz Kulikowski15a58532016-03-31 23:12:31 +02006 */
7
8#include <common.h>
9#include <dm.h>
Caleb Connollyc17a5c72024-02-26 17:26:15 +000010#include <dm/device-internal.h>
11#include <dm/lists.h>
12#include <dm/pinctrl.h>
Simon Glass0f2af882020-05-10 11:40:05 -060013#include <log.h>
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020014#include <power/pmic.h>
15#include <spmi/spmi.h>
16#include <asm/io.h>
Caleb Connollyc17a5c72024-02-26 17:26:15 +000017#include <stdlib.h>
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020018#include <asm/gpio.h>
19#include <linux/bitops.h>
20
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020021/* Register offset for each gpio */
22#define REG_OFFSET(x) ((x) * 0x100)
23
24/* Register maps */
25
Sumit Garg60900b42022-08-04 19:57:17 +053026/* Type and subtype are shared for all PMIC peripherals */
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020027#define REG_TYPE 0x4
28#define REG_SUBTYPE 0x5
29
Sumit Garg35642572022-08-04 19:57:18 +053030/* GPIO peripheral type and subtype out_values */
31#define REG_TYPE_VAL 0x10
32#define REG_SUBTYPE_GPIO_4CH 0x1
33#define REG_SUBTYPE_GPIOC_4CH 0x5
34#define REG_SUBTYPE_GPIO_8CH 0x9
35#define REG_SUBTYPE_GPIOC_8CH 0xd
36#define REG_SUBTYPE_GPIO_LV 0x10
37#define REG_SUBTYPE_GPIO_MV 0x11
38
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020039#define REG_STATUS 0x08
40#define REG_STATUS_VAL_MASK 0x1
41
42/* MODE_CTL */
Jorge Ramirez-Ortiz35561612018-01-10 11:33:51 +010043#define REG_CTL 0x40
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020044#define REG_CTL_MODE_MASK 0x70
45#define REG_CTL_MODE_INPUT 0x00
46#define REG_CTL_MODE_INOUT 0x20
47#define REG_CTL_MODE_OUTPUT 0x10
48#define REG_CTL_OUTPUT_MASK 0x0F
Sumit Garg35642572022-08-04 19:57:18 +053049#define REG_CTL_LV_MV_MODE_MASK 0x3
50#define REG_CTL_LV_MV_MODE_INPUT 0x0
51#define REG_CTL_LV_MV_MODE_INOUT 0x2
52#define REG_CTL_LV_MV_MODE_OUTPUT 0x1
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020053
54#define REG_DIG_VIN_CTL 0x41
55#define REG_DIG_VIN_VIN0 0
56
57#define REG_DIG_PULL_CTL 0x42
58#define REG_DIG_PULL_NO_PU 0x5
59
Sumit Garg35642572022-08-04 19:57:18 +053060#define REG_LV_MV_OUTPUT_CTL 0x44
61#define REG_LV_MV_OUTPUT_CTL_MASK 0x80
62#define REG_LV_MV_OUTPUT_CTL_SHIFT 7
63
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020064#define REG_DIG_OUT_CTL 0x45
65#define REG_DIG_OUT_CTL_CMOS (0x0 << 4)
66#define REG_DIG_OUT_CTL_DRIVE_L 0x1
67
68#define REG_EN_CTL 0x46
69#define REG_EN_CTL_ENABLE (1 << 7)
70
Caleb Connolly0b9e5002024-02-26 17:26:14 +000071/**
72 * pmic_gpio_match_data - platform specific configuration
73 *
74 * @PMIC_MATCH_READONLY: treat all GPIOs as readonly, don't attempt to configure them.
75 * This is a workaround for an unknown bug on some platforms where trying to write the
76 * GPIO configuration registers causes the board to hang.
77 */
78enum pmic_gpio_quirks {
79 QCOM_PMIC_QUIRK_READONLY = (1 << 0),
80};
81
Caleb Connollyc17a5c72024-02-26 17:26:15 +000082struct qcom_pmic_gpio_data {
Tom Rini44d15c22016-04-12 15:11:23 -040083 uint32_t pid; /* Peripheral ID on SPMI bus */
Sumit Garg35642572022-08-04 19:57:18 +053084 bool lv_mv_type; /* If subtype is GPIO_LV(0x10) or GPIO_MV(0x11) */
Caleb Connollyc17a5c72024-02-26 17:26:15 +000085 u32 pin_count;
86 struct udevice *pmic; /* Reference to pmic device for read/write */
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020087};
88
Caleb Connollyc17a5c72024-02-26 17:26:15 +000089/* dev can be the GPIO or pinctrl device */
90static int _qcom_gpio_set_direction(struct udevice *dev, u32 offset, bool input, int value)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020091{
Caleb Connollyc17a5c72024-02-26 17:26:15 +000092 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
93 u32 gpio_base = plat->pid + REG_OFFSET(offset);
94 u32 reg_ctl_val;
Caleb Connolly0b9e5002024-02-26 17:26:14 +000095 int ret = 0;
Mateusz Kulikowski15a58532016-03-31 23:12:31 +020096
Sumit Garg35642572022-08-04 19:57:18 +053097 /* Select the mode and output */
Caleb Connollyc17a5c72024-02-26 17:26:15 +000098 if (plat->lv_mv_type) {
Sumit Garg35642572022-08-04 19:57:18 +053099 if (input)
100 reg_ctl_val = REG_CTL_LV_MV_MODE_INPUT;
101 else
102 reg_ctl_val = REG_CTL_LV_MV_MODE_INOUT;
103 } else {
104 if (input)
105 reg_ctl_val = REG_CTL_MODE_INPUT;
106 else
107 reg_ctl_val = REG_CTL_MODE_INOUT | !!value;
108 }
109
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000110 ret = pmic_reg_write(plat->pmic, gpio_base + REG_CTL, reg_ctl_val);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200111 if (ret < 0)
112 return ret;
113
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000114 if (plat->lv_mv_type && !input) {
115 ret = pmic_reg_write(plat->pmic,
Sumit Garg35642572022-08-04 19:57:18 +0530116 gpio_base + REG_LV_MV_OUTPUT_CTL,
117 !!value << REG_LV_MV_OUTPUT_CTL_SHIFT);
118 if (ret < 0)
119 return ret;
120 }
121
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000122 return 0;
123}
124
125static int qcom_gpio_set_direction(struct udevice *dev, unsigned int offset,
126 bool input, int value)
127{
128 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
129 uint32_t gpio_base = plat->pid + REG_OFFSET(offset);
130 ulong quirks = dev_get_driver_data(dev);
131 int ret = 0;
132
133 /* Some PMICs don't like their GPIOs being configured */
134 if (quirks & QCOM_PMIC_QUIRK_READONLY)
135 return 0;
136
137 /* Disable the GPIO */
138 ret = pmic_clrsetbits(dev->parent, gpio_base + REG_EN_CTL,
139 REG_EN_CTL_ENABLE, 0);
140 if (ret < 0)
141 return ret;
142
143 _qcom_gpio_set_direction(dev, offset, input, value);
144
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200145 /* Set the right pull (no pull) */
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000146 ret = pmic_reg_write(plat->pmic, gpio_base + REG_DIG_PULL_CTL,
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200147 REG_DIG_PULL_NO_PU);
148 if (ret < 0)
149 return ret;
150
151 /* Configure output pin drivers if needed */
152 if (!input) {
153 /* Select the VIN - VIN0, pin is input so it doesn't matter */
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000154 ret = pmic_reg_write(plat->pmic, gpio_base + REG_DIG_VIN_CTL,
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200155 REG_DIG_VIN_VIN0);
156 if (ret < 0)
157 return ret;
158
159 /* Set the right dig out control */
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000160 ret = pmic_reg_write(plat->pmic, gpio_base + REG_DIG_OUT_CTL,
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200161 REG_DIG_OUT_CTL_CMOS |
162 REG_DIG_OUT_CTL_DRIVE_L);
163 if (ret < 0)
164 return ret;
165 }
166
167 /* Enable the GPIO */
168 return pmic_clrsetbits(dev->parent, gpio_base + REG_EN_CTL, 0,
169 REG_EN_CTL_ENABLE);
170}
171
Sumit Garg60900b42022-08-04 19:57:17 +0530172static int qcom_gpio_direction_input(struct udevice *dev, unsigned offset)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200173{
Sumit Garg60900b42022-08-04 19:57:17 +0530174 return qcom_gpio_set_direction(dev, offset, true, 0);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200175}
176
Sumit Garg60900b42022-08-04 19:57:17 +0530177static int qcom_gpio_direction_output(struct udevice *dev, unsigned offset,
178 int value)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200179{
Sumit Garg60900b42022-08-04 19:57:17 +0530180 return qcom_gpio_set_direction(dev, offset, false, value);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200181}
182
Sumit Garg60900b42022-08-04 19:57:17 +0530183static int qcom_gpio_get_function(struct udevice *dev, unsigned offset)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200184{
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000185 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
186 uint32_t gpio_base = plat->pid + REG_OFFSET(offset);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200187 int reg;
188
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000189 reg = pmic_reg_read(plat->pmic, gpio_base + REG_CTL);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200190 if (reg < 0)
191 return reg;
192
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000193 if (plat->lv_mv_type) {
Sumit Garg35642572022-08-04 19:57:18 +0530194 switch (reg & REG_CTL_LV_MV_MODE_MASK) {
195 case REG_CTL_LV_MV_MODE_INPUT:
196 return GPIOF_INPUT;
197 case REG_CTL_LV_MV_MODE_INOUT: /* Fallthrough */
198 case REG_CTL_LV_MV_MODE_OUTPUT:
199 return GPIOF_OUTPUT;
200 default:
201 return GPIOF_UNKNOWN;
202 }
203 } else {
204 switch (reg & REG_CTL_MODE_MASK) {
205 case REG_CTL_MODE_INPUT:
206 return GPIOF_INPUT;
207 case REG_CTL_MODE_INOUT: /* Fallthrough */
208 case REG_CTL_MODE_OUTPUT:
209 return GPIOF_OUTPUT;
210 default:
211 return GPIOF_UNKNOWN;
212 }
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200213 }
214}
215
Sumit Garg60900b42022-08-04 19:57:17 +0530216static int qcom_gpio_get_value(struct udevice *dev, unsigned offset)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200217{
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000218 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
219 uint32_t gpio_base = plat->pid + REG_OFFSET(offset);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200220 int reg;
221
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000222 reg = pmic_reg_read(plat->pmic, gpio_base + REG_STATUS);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200223 if (reg < 0)
224 return reg;
225
226 return !!(reg & REG_STATUS_VAL_MASK);
227}
228
Sumit Garg60900b42022-08-04 19:57:17 +0530229static int qcom_gpio_set_value(struct udevice *dev, unsigned offset,
230 int value)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200231{
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000232 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
233 uint32_t gpio_base = plat->pid + REG_OFFSET(offset);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200234
235 /* Set the output value of the gpio */
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000236 if (plat->lv_mv_type)
Sumit Garg35642572022-08-04 19:57:18 +0530237 return pmic_clrsetbits(dev->parent,
238 gpio_base + REG_LV_MV_OUTPUT_CTL,
239 REG_LV_MV_OUTPUT_CTL_MASK,
240 !!value << REG_LV_MV_OUTPUT_CTL_SHIFT);
241 else
242 return pmic_clrsetbits(dev->parent, gpio_base + REG_CTL,
243 REG_CTL_OUTPUT_MASK, !!value);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200244}
245
Caleb Connolly9bd70792024-02-26 17:26:13 +0000246static int qcom_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
247 struct ofnode_phandle_args *args)
248{
249 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
250
251 if (args->args_count < 1)
252 return -EINVAL;
253
254 /* GPIOs in DT are 1-based */
255 desc->offset = args->args[0] - 1;
256 if (desc->offset >= uc_priv->gpio_count)
257 return -EINVAL;
258
259 if (args->args_count < 2)
260 return 0;
261
262 desc->flags = gpio_flags_xlate(args->args[1]);
263
264 return 0;
265}
266
Sumit Garg60900b42022-08-04 19:57:17 +0530267static const struct dm_gpio_ops qcom_gpio_ops = {
268 .direction_input = qcom_gpio_direction_input,
269 .direction_output = qcom_gpio_direction_output,
270 .get_value = qcom_gpio_get_value,
271 .set_value = qcom_gpio_set_value,
272 .get_function = qcom_gpio_get_function,
Caleb Connolly9bd70792024-02-26 17:26:13 +0000273 .xlate = qcom_gpio_xlate,
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200274};
275
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000276static int qcom_gpio_bind(struct udevice *dev)
277{
Tom Rini5f908f32024-03-01 13:54:49 -0500278
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000279 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
280 ulong quirks = dev_get_driver_data(dev);
281 struct udevice *child;
282 struct driver *drv;
283 int ret;
284
285 drv = lists_driver_lookup_name("qcom_pmic_pinctrl");
286 if (!drv) {
287 log_warning("Cannot find driver '%s'\n", "qcom_pmic_pinctrl");
288 return -ENOENT;
289 }
290
291 /* Bind the GPIO driver as a child of the PMIC. */
292 ret = device_bind_with_driver_data(dev, drv,
293 dev->name,
294 quirks, dev_ofnode(dev), &child);
295 if (ret)
296 return log_msg_ret("bind", ret);
297
298 dev_set_plat(child, plat);
299
300 return 0;
301}
302
Sumit Garg60900b42022-08-04 19:57:17 +0530303static int qcom_gpio_probe(struct udevice *dev)
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200304{
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000305 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
306 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
307 struct ofnode_phandle_args args;
308 int val, ret;
Caleb Connollyadd04362023-12-05 13:46:46 +0000309 u64 pid;
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200310
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000311 plat->pmic = dev->parent;
312
Caleb Connollyadd04362023-12-05 13:46:46 +0000313 pid = dev_read_addr(dev);
314 if (pid == FDT_ADDR_T_NONE)
Simon Glass95139972019-09-25 08:55:59 -0600315 return log_msg_ret("bad address", -EINVAL);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200316
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000317 plat->pid = pid;
Caleb Connollyadd04362023-12-05 13:46:46 +0000318
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200319 /* Do a sanity check */
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000320 val = pmic_reg_read(plat->pmic, plat->pid + REG_TYPE);
321 if (val != REG_TYPE_VAL)
Simon Glass95139972019-09-25 08:55:59 -0600322 return log_msg_ret("bad type", -ENXIO);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200323
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000324 val = pmic_reg_read(plat->pmic, plat->pid + REG_SUBTYPE);
325 if (val != REG_SUBTYPE_GPIO_4CH && val != REG_SUBTYPE_GPIOC_4CH &&
326 val != REG_SUBTYPE_GPIO_LV && val != REG_SUBTYPE_GPIO_MV)
Simon Glass95139972019-09-25 08:55:59 -0600327 return log_msg_ret("bad subtype", -ENXIO);
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200328
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000329 plat->lv_mv_type = val == REG_SUBTYPE_GPIO_LV ||
330 val == REG_SUBTYPE_GPIO_MV;
Caleb Connolly9482a9e2023-12-05 13:46:50 +0000331
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000332 /*
333 * Parse basic GPIO count specified via the gpio-ranges property
334 * as specified in upstream devicetrees
335 */
Caleb Connolly9482a9e2023-12-05 13:46:50 +0000336 ret = ofnode_parse_phandle_with_args(dev_ofnode(dev), "gpio-ranges",
337 NULL, 3, 0, &args);
338 if (ret)
339 return log_msg_ret("gpio-ranges", ret);
340
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000341 plat->pin_count = args.args[2];
Caleb Connolly9482a9e2023-12-05 13:46:50 +0000342
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000343 uc_priv->gpio_count = plat->pin_count;
Caleb Connolly9482a9e2023-12-05 13:46:50 +0000344 uc_priv->bank_name = "pmic";
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200345
346 return 0;
347}
348
Sumit Garg60900b42022-08-04 19:57:17 +0530349static const struct udevice_id qcom_gpio_ids[] = {
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200350 { .compatible = "qcom,pm8916-gpio" },
Jorge Ramirez-Ortiz35561612018-01-10 11:33:51 +0100351 { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */
Caleb Connolly0b9e5002024-02-26 17:26:14 +0000352 { .compatible = "qcom,pm8998-gpio", .data = QCOM_PMIC_QUIRK_READONLY },
Sumit Garg35642572022-08-04 19:57:18 +0530353 { .compatible = "qcom,pms405-gpio" },
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200354 { }
355};
356
Sumit Garg60900b42022-08-04 19:57:17 +0530357U_BOOT_DRIVER(qcom_pmic_gpio) = {
358 .name = "qcom_pmic_gpio",
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200359 .id = UCLASS_GPIO,
Sumit Garg60900b42022-08-04 19:57:17 +0530360 .of_match = qcom_gpio_ids,
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000361 .bind = qcom_gpio_bind,
362 .probe = qcom_gpio_probe,
Sumit Garg60900b42022-08-04 19:57:17 +0530363 .ops = &qcom_gpio_ops,
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000364 .plat_auto = sizeof(struct qcom_pmic_gpio_data),
365 .flags = DM_FLAG_ALLOC_PDATA,
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200366};
367
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000368static const struct pinconf_param qcom_pmic_pinctrl_conf_params[] = {
369 { "output-high", PIN_CONFIG_OUTPUT_ENABLE, 1 },
370 { "output-low", PIN_CONFIG_OUTPUT, 0 },
Mateusz Kulikowski15a58532016-03-31 23:12:31 +0200371};
372
Caleb Connollyc17a5c72024-02-26 17:26:15 +0000373static int qcom_pmic_pinctrl_get_pins_count(struct udevice *dev)
374{
375 struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
376
377 return plat->pin_count;
378}
379
380static const char *qcom_pmic_pinctrl_get_pin_name(struct udevice *dev, unsigned int selector)
381{
382 static char name[8];
383
384 /* DT indexes from 1 */
385 snprintf(name, sizeof(name), "gpio%u", selector + 1);
386
387 return name;
388}
389
390static int qcom_pmic_pinctrl_pinconf_set(struct udevice *dev, unsigned int selector,
391 unsigned int param, unsigned int arg)
392{
393 /* We only support configuring the pin as an output, either low or high */
394 return _qcom_gpio_set_direction(dev, selector, false,
395 param == PIN_CONFIG_OUTPUT_ENABLE);
396}
397
398static const char *qcom_pmic_pinctrl_get_function_name(struct udevice *dev, unsigned int selector)
399{
400 if (!selector)
401 return "normal";
402 return NULL;
403}
404
405static int qcom_pmic_pinctrl_generic_get_functions_count(struct udevice *dev)
406{
407 return 1;
408}
409
410static int qcom_pmic_pinctrl_generic_pinmux_set_mux(struct udevice *dev, unsigned int selector,
411 unsigned int func_selector)
412{
413 return 0;
414}
415
416struct pinctrl_ops qcom_pmic_pinctrl_ops = {
417 .get_pins_count = qcom_pmic_pinctrl_get_pins_count,
418 .get_pin_name = qcom_pmic_pinctrl_get_pin_name,
419 .set_state = pinctrl_generic_set_state,
420 .pinconf_num_params = ARRAY_SIZE(qcom_pmic_pinctrl_conf_params),
421 .pinconf_params = qcom_pmic_pinctrl_conf_params,
422 .pinconf_set = qcom_pmic_pinctrl_pinconf_set,
423 .get_function_name = qcom_pmic_pinctrl_get_function_name,
424 .get_functions_count = qcom_pmic_pinctrl_generic_get_functions_count,
425 .pinmux_set = qcom_pmic_pinctrl_generic_pinmux_set_mux,
426};
427
428U_BOOT_DRIVER(qcom_pmic_pinctrl) = {
429 .name = "qcom_pmic_pinctrl",
430 .id = UCLASS_PINCTRL,
431 .ops = &qcom_pmic_pinctrl_ops,
432};