Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 2 | /* |
Patrice Chotard | 3bc599c | 2017-10-23 09:53:58 +0200 | [diff] [blame] | 3 | * Copyright (C) 2017, STMicroelectronics - All Rights Reserved |
| 4 | * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics. |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 5 | */ |
| 6 | |
Patrick Delaunay | 6dd89d9 | 2020-11-06 19:01:33 +0100 | [diff] [blame] | 7 | #define LOG_CATEGORY UCLASS_GPIO |
| 8 | |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 9 | #include <common.h> |
| 10 | #include <clk.h> |
| 11 | #include <dm.h> |
| 12 | #include <fdtdec.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 13 | #include <log.h> |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 14 | #include <asm/arch/stm32.h> |
| 15 | #include <asm/gpio.h> |
| 16 | #include <asm/io.h> |
Simon Glass | 336d461 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 17 | #include <dm/device_compat.h> |
Simon Glass | cd93d62 | 2020-05-10 11:40:13 -0600 | [diff] [blame] | 18 | #include <linux/bitops.h> |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 19 | #include <linux/errno.h> |
| 20 | #include <linux/io.h> |
| 21 | |
Patrick Delaunay | 56a368f | 2021-10-22 20:12:34 +0200 | [diff] [blame] | 22 | #include "stm32_gpio_priv.h" |
| 23 | |
Patrick Delaunay | 6af78d0 | 2020-10-02 14:08:54 +0200 | [diff] [blame] | 24 | #define STM32_GPIOS_PER_BANK 16 |
| 25 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 26 | #define MODE_BITS(gpio_pin) ((gpio_pin) * 2) |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 27 | #define MODE_BITS_MASK 3 |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 28 | #define BSRR_BIT(gpio_pin, value) BIT((gpio_pin) + (value ? 0 : 16)) |
| 29 | |
| 30 | #define PUPD_BITS(gpio_pin) ((gpio_pin) * 2) |
| 31 | #define PUPD_MASK 3 |
| 32 | |
| 33 | #define OTYPE_BITS(gpio_pin) (gpio_pin) |
| 34 | #define OTYPE_MSK 1 |
| 35 | |
| 36 | static void stm32_gpio_set_moder(struct stm32_gpio_regs *regs, |
| 37 | int idx, |
| 38 | int mode) |
| 39 | { |
| 40 | int bits_index; |
| 41 | int mask; |
| 42 | |
| 43 | bits_index = MODE_BITS(idx); |
| 44 | mask = MODE_BITS_MASK << bits_index; |
| 45 | |
| 46 | clrsetbits_le32(®s->moder, mask, mode << bits_index); |
| 47 | } |
| 48 | |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 49 | static int stm32_gpio_get_moder(struct stm32_gpio_regs *regs, int idx) |
| 50 | { |
| 51 | return (readl(®s->moder) >> MODE_BITS(idx)) & MODE_BITS_MASK; |
| 52 | } |
| 53 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 54 | static void stm32_gpio_set_otype(struct stm32_gpio_regs *regs, |
| 55 | int idx, |
| 56 | enum stm32_gpio_otype otype) |
| 57 | { |
| 58 | int bits; |
| 59 | |
| 60 | bits = OTYPE_BITS(idx); |
| 61 | clrsetbits_le32(®s->otyper, OTYPE_MSK << bits, otype << bits); |
| 62 | } |
| 63 | |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 64 | static enum stm32_gpio_otype stm32_gpio_get_otype(struct stm32_gpio_regs *regs, |
| 65 | int idx) |
| 66 | { |
| 67 | return (readl(®s->otyper) >> OTYPE_BITS(idx)) & OTYPE_MSK; |
| 68 | } |
| 69 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 70 | static void stm32_gpio_set_pupd(struct stm32_gpio_regs *regs, |
| 71 | int idx, |
| 72 | enum stm32_gpio_pupd pupd) |
| 73 | { |
| 74 | int bits; |
| 75 | |
| 76 | bits = PUPD_BITS(idx); |
| 77 | clrsetbits_le32(®s->pupdr, PUPD_MASK << bits, pupd << bits); |
| 78 | } |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 79 | |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 80 | static enum stm32_gpio_pupd stm32_gpio_get_pupd(struct stm32_gpio_regs *regs, |
| 81 | int idx) |
| 82 | { |
| 83 | return (readl(®s->pupdr) >> PUPD_BITS(idx)) & PUPD_MASK; |
| 84 | } |
| 85 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 86 | /* |
| 87 | * convert gpio offset to gpio index taking into account gpio holes |
| 88 | * into gpio bank |
| 89 | */ |
| 90 | int stm32_offset_to_index(struct udevice *dev, unsigned int offset) |
| 91 | { |
| 92 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
Patrick Delaunay | 99e14b2 | 2019-06-21 15:26:46 +0200 | [diff] [blame] | 93 | unsigned int idx = 0; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 94 | int i; |
| 95 | |
| 96 | for (i = 0; i < STM32_GPIOS_PER_BANK; i++) { |
| 97 | if (priv->gpio_range & BIT(i)) { |
| 98 | if (idx == offset) |
| 99 | return idx; |
| 100 | idx++; |
| 101 | } |
| 102 | } |
| 103 | /* shouldn't happen */ |
| 104 | return -EINVAL; |
| 105 | } |
| 106 | |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 107 | static int stm32_gpio_direction_input(struct udevice *dev, unsigned offset) |
| 108 | { |
| 109 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 110 | struct stm32_gpio_regs *regs = priv->regs; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 111 | int idx; |
| 112 | |
| 113 | idx = stm32_offset_to_index(dev, offset); |
| 114 | if (idx < 0) |
| 115 | return idx; |
| 116 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 117 | stm32_gpio_set_moder(regs, idx, STM32_GPIO_MODE_IN); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 118 | |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | static int stm32_gpio_direction_output(struct udevice *dev, unsigned offset, |
| 123 | int value) |
| 124 | { |
| 125 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 126 | struct stm32_gpio_regs *regs = priv->regs; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 127 | int idx; |
| 128 | |
| 129 | idx = stm32_offset_to_index(dev, offset); |
| 130 | if (idx < 0) |
| 131 | return idx; |
| 132 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 133 | stm32_gpio_set_moder(regs, idx, STM32_GPIO_MODE_OUT); |
Patrice Chotard | 798cd70 | 2018-08-09 11:57:57 +0200 | [diff] [blame] | 134 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 135 | writel(BSRR_BIT(idx, value), ®s->bsrr); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 136 | |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | static int stm32_gpio_get_value(struct udevice *dev, unsigned offset) |
| 141 | { |
| 142 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 143 | struct stm32_gpio_regs *regs = priv->regs; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 144 | int idx; |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 145 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 146 | idx = stm32_offset_to_index(dev, offset); |
| 147 | if (idx < 0) |
| 148 | return idx; |
| 149 | |
| 150 | return readl(®s->idr) & BIT(idx) ? 1 : 0; |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | static int stm32_gpio_set_value(struct udevice *dev, unsigned offset, int value) |
| 154 | { |
| 155 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 156 | struct stm32_gpio_regs *regs = priv->regs; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 157 | int idx; |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 158 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 159 | idx = stm32_offset_to_index(dev, offset); |
| 160 | if (idx < 0) |
| 161 | return idx; |
| 162 | |
| 163 | writel(BSRR_BIT(idx, value), ®s->bsrr); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 164 | |
| 165 | return 0; |
| 166 | } |
| 167 | |
Patrice Chotard | cad7324 | 2018-10-24 14:10:21 +0200 | [diff] [blame] | 168 | static int stm32_gpio_get_function(struct udevice *dev, unsigned int offset) |
| 169 | { |
| 170 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 171 | struct stm32_gpio_regs *regs = priv->regs; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 172 | int bits_index; |
| 173 | int mask; |
| 174 | int idx; |
Patrice Chotard | cad7324 | 2018-10-24 14:10:21 +0200 | [diff] [blame] | 175 | u32 mode; |
| 176 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 177 | idx = stm32_offset_to_index(dev, offset); |
| 178 | if (idx < 0) |
| 179 | return idx; |
| 180 | |
| 181 | bits_index = MODE_BITS(idx); |
| 182 | mask = MODE_BITS_MASK << bits_index; |
| 183 | |
Patrice Chotard | cad7324 | 2018-10-24 14:10:21 +0200 | [diff] [blame] | 184 | mode = (readl(®s->moder) & mask) >> bits_index; |
| 185 | if (mode == STM32_GPIO_MODE_OUT) |
| 186 | return GPIOF_OUTPUT; |
| 187 | if (mode == STM32_GPIO_MODE_IN) |
| 188 | return GPIOF_INPUT; |
| 189 | if (mode == STM32_GPIO_MODE_AN) |
| 190 | return GPIOF_UNUSED; |
| 191 | |
| 192 | return GPIOF_FUNC; |
| 193 | } |
| 194 | |
Simon Glass | 13979fc | 2021-02-04 21:21:55 -0700 | [diff] [blame] | 195 | static int stm32_gpio_set_flags(struct udevice *dev, unsigned int offset, |
| 196 | ulong flags) |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 197 | { |
| 198 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 199 | struct stm32_gpio_regs *regs = priv->regs; |
| 200 | int idx; |
| 201 | |
| 202 | idx = stm32_offset_to_index(dev, offset); |
| 203 | if (idx < 0) |
| 204 | return idx; |
| 205 | |
| 206 | if (flags & GPIOD_IS_OUT) { |
Simon Glass | 7e0a96d | 2021-02-04 21:22:03 -0700 | [diff] [blame] | 207 | bool value = flags & GPIOD_IS_OUT_ACTIVE; |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 208 | |
| 209 | if (flags & GPIOD_OPEN_DRAIN) |
| 210 | stm32_gpio_set_otype(regs, idx, STM32_GPIO_OTYPE_OD); |
| 211 | else |
| 212 | stm32_gpio_set_otype(regs, idx, STM32_GPIO_OTYPE_PP); |
Simon Glass | 7e0a96d | 2021-02-04 21:22:03 -0700 | [diff] [blame] | 213 | |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 214 | stm32_gpio_set_moder(regs, idx, STM32_GPIO_MODE_OUT); |
| 215 | writel(BSRR_BIT(idx, value), ®s->bsrr); |
| 216 | |
| 217 | } else if (flags & GPIOD_IS_IN) { |
| 218 | stm32_gpio_set_moder(regs, idx, STM32_GPIO_MODE_IN); |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 219 | } |
Patrick Delaunay | 2c6df94 | 2020-10-28 10:49:08 +0100 | [diff] [blame] | 220 | if (flags & GPIOD_PULL_UP) |
| 221 | stm32_gpio_set_pupd(regs, idx, STM32_GPIO_PUPD_UP); |
| 222 | else if (flags & GPIOD_PULL_DOWN) |
| 223 | stm32_gpio_set_pupd(regs, idx, STM32_GPIO_PUPD_DOWN); |
Patrick Delaunay | f13ff88 | 2020-06-04 14:30:25 +0200 | [diff] [blame] | 224 | |
| 225 | return 0; |
| 226 | } |
| 227 | |
Simon Glass | 9648789 | 2021-02-04 21:21:56 -0700 | [diff] [blame] | 228 | static int stm32_gpio_get_flags(struct udevice *dev, unsigned int offset, |
| 229 | ulong *flagsp) |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 230 | { |
| 231 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
| 232 | struct stm32_gpio_regs *regs = priv->regs; |
| 233 | int idx; |
| 234 | ulong dir_flags = 0; |
| 235 | |
| 236 | idx = stm32_offset_to_index(dev, offset); |
| 237 | if (idx < 0) |
| 238 | return idx; |
| 239 | |
| 240 | switch (stm32_gpio_get_moder(regs, idx)) { |
| 241 | case STM32_GPIO_MODE_OUT: |
| 242 | dir_flags |= GPIOD_IS_OUT; |
| 243 | if (stm32_gpio_get_otype(regs, idx) == STM32_GPIO_OTYPE_OD) |
| 244 | dir_flags |= GPIOD_OPEN_DRAIN; |
| 245 | if (readl(®s->idr) & BIT(idx)) |
| 246 | dir_flags |= GPIOD_IS_OUT_ACTIVE; |
| 247 | break; |
| 248 | case STM32_GPIO_MODE_IN: |
| 249 | dir_flags |= GPIOD_IS_IN; |
Patrick Delaunay | 2c6df94 | 2020-10-28 10:49:08 +0100 | [diff] [blame] | 250 | break; |
| 251 | default: |
| 252 | break; |
| 253 | } |
| 254 | switch (stm32_gpio_get_pupd(regs, idx)) { |
| 255 | case STM32_GPIO_PUPD_UP: |
| 256 | dir_flags |= GPIOD_PULL_UP; |
| 257 | break; |
| 258 | case STM32_GPIO_PUPD_DOWN: |
| 259 | dir_flags |= GPIOD_PULL_DOWN; |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 260 | break; |
| 261 | default: |
| 262 | break; |
| 263 | } |
Simon Glass | 9648789 | 2021-02-04 21:21:56 -0700 | [diff] [blame] | 264 | *flagsp = dir_flags; |
Patrick Delaunay | 43efbb6 | 2020-06-04 14:30:26 +0200 | [diff] [blame] | 265 | |
| 266 | return 0; |
| 267 | } |
| 268 | |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 269 | static const struct dm_gpio_ops gpio_stm32_ops = { |
| 270 | .direction_input = stm32_gpio_direction_input, |
| 271 | .direction_output = stm32_gpio_direction_output, |
| 272 | .get_value = stm32_gpio_get_value, |
| 273 | .set_value = stm32_gpio_set_value, |
Patrice Chotard | cad7324 | 2018-10-24 14:10:21 +0200 | [diff] [blame] | 274 | .get_function = stm32_gpio_get_function, |
Simon Glass | 13979fc | 2021-02-04 21:21:55 -0700 | [diff] [blame] | 275 | .set_flags = stm32_gpio_set_flags, |
Simon Glass | 9648789 | 2021-02-04 21:21:56 -0700 | [diff] [blame] | 276 | .get_flags = stm32_gpio_get_flags, |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 277 | }; |
| 278 | |
| 279 | static int gpio_stm32_probe(struct udevice *dev) |
| 280 | { |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 281 | struct stm32_gpio_priv *priv = dev_get_priv(dev); |
Patrick Delaunay | 15c8cbf | 2020-09-09 18:28:33 +0200 | [diff] [blame] | 282 | struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); |
| 283 | struct ofnode_phandle_args args; |
| 284 | const char *name; |
Patrice Chotard | 8b6d45a | 2018-12-03 10:52:53 +0100 | [diff] [blame] | 285 | struct clk clk; |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 286 | fdt_addr_t addr; |
Patrick Delaunay | 15c8cbf | 2020-09-09 18:28:33 +0200 | [diff] [blame] | 287 | int ret, i; |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 288 | |
Patrick Delaunay | d876eaf | 2018-03-12 10:46:07 +0100 | [diff] [blame] | 289 | addr = dev_read_addr(dev); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 290 | if (addr == FDT_ADDR_T_NONE) |
| 291 | return -EINVAL; |
| 292 | |
| 293 | priv->regs = (struct stm32_gpio_regs *)addr; |
Patrice Chotard | 4fb2246 | 2019-01-04 10:55:06 +0100 | [diff] [blame] | 294 | |
Patrick Delaunay | d876eaf | 2018-03-12 10:46:07 +0100 | [diff] [blame] | 295 | name = dev_read_string(dev, "st,bank-name"); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 296 | if (!name) |
| 297 | return -EINVAL; |
| 298 | uc_priv->bank_name = name; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 299 | |
| 300 | i = 0; |
| 301 | ret = dev_read_phandle_with_args(dev, "gpio-ranges", |
| 302 | NULL, 3, i, &args); |
| 303 | |
Patrick Delaunay | cb08e84 | 2020-09-09 18:28:34 +0200 | [diff] [blame] | 304 | if (!ret && args.args_count < 3) |
| 305 | return -EINVAL; |
| 306 | |
Patrice Chotard | 39a8f0b | 2019-01-04 10:55:05 +0100 | [diff] [blame] | 307 | if (ret == -ENOENT) { |
| 308 | uc_priv->gpio_count = STM32_GPIOS_PER_BANK; |
| 309 | priv->gpio_range = GENMASK(STM32_GPIOS_PER_BANK - 1, 0); |
| 310 | } |
| 311 | |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 312 | while (ret != -ENOENT) { |
| 313 | priv->gpio_range |= GENMASK(args.args[2] + args.args[0] - 1, |
| 314 | args.args[0]); |
| 315 | |
| 316 | uc_priv->gpio_count += args.args[2]; |
| 317 | |
| 318 | ret = dev_read_phandle_with_args(dev, "gpio-ranges", NULL, 3, |
| 319 | ++i, &args); |
Patrick Delaunay | cb08e84 | 2020-09-09 18:28:34 +0200 | [diff] [blame] | 320 | if (!ret && args.args_count < 3) |
| 321 | return -EINVAL; |
Patrice Chotard | dbf928d | 2018-12-03 10:52:51 +0100 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | dev_dbg(dev, "addr = 0x%p bank_name = %s gpio_count = %d gpio_range = 0x%x\n", |
| 325 | (u32 *)priv->regs, uc_priv->bank_name, uc_priv->gpio_count, |
| 326 | priv->gpio_range); |
Patrick Delaunay | f17412e | 2020-04-22 14:29:17 +0200 | [diff] [blame] | 327 | |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 328 | ret = clk_get_by_index(dev, 0, &clk); |
| 329 | if (ret < 0) |
| 330 | return ret; |
| 331 | |
| 332 | ret = clk_enable(&clk); |
| 333 | |
| 334 | if (ret) { |
| 335 | dev_err(dev, "failed to enable clock\n"); |
| 336 | return ret; |
| 337 | } |
Patrick Delaunay | 6dd89d9 | 2020-11-06 19:01:33 +0100 | [diff] [blame] | 338 | dev_dbg(dev, "clock enabled\n"); |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 339 | |
| 340 | return 0; |
| 341 | } |
| 342 | |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 343 | U_BOOT_DRIVER(gpio_stm32) = { |
| 344 | .name = "gpio_stm32", |
| 345 | .id = UCLASS_GPIO, |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 346 | .probe = gpio_stm32_probe, |
| 347 | .ops = &gpio_stm32_ops, |
Bin Meng | 695c499 | 2018-10-24 06:36:30 -0700 | [diff] [blame] | 348 | .flags = DM_UC_FLAG_SEQ_ALIAS, |
Simon Glass | 41575d8 | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 349 | .priv_auto = sizeof(struct stm32_gpio_priv), |
Vikas Manocha | 7741710 | 2017-04-10 15:02:57 -0700 | [diff] [blame] | 350 | }; |