Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 2 | /* |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 3 | * Copyright (c) 2013 - 2018 Xilinx, Michal Simek |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 6 | #include <errno.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 7 | #include <log.h> |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 8 | #include <malloc.h> |
| 9 | #include <linux/list.h> |
| 10 | #include <asm/io.h> |
| 11 | #include <asm/gpio.h> |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 12 | #include <dm.h> |
Michal Simek | e2f91e5 | 2018-07-23 13:40:01 +0200 | [diff] [blame] | 13 | #include <dt-bindings/gpio/gpio.h> |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 14 | |
Michal Simek | e2f91e5 | 2018-07-23 13:40:01 +0200 | [diff] [blame] | 15 | #define XILINX_GPIO_MAX_BANK 2 |
Michal Simek | 23ccda0 | 2013-04-24 10:01:20 +0200 | [diff] [blame] | 16 | |
| 17 | /* Gpio simple map */ |
| 18 | struct gpio_regs { |
| 19 | u32 gpiodata; |
| 20 | u32 gpiodir; |
| 21 | }; |
| 22 | |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 23 | struct xilinx_gpio_plat { |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 24 | struct gpio_regs *regs; |
| 25 | int bank_max[XILINX_GPIO_MAX_BANK]; |
| 26 | int bank_input[XILINX_GPIO_MAX_BANK]; |
| 27 | int bank_output[XILINX_GPIO_MAX_BANK]; |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 28 | u32 dout_default[XILINX_GPIO_MAX_BANK]; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 29 | }; |
| 30 | |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 31 | struct xilinx_gpio_privdata { |
| 32 | u32 output_val[XILINX_GPIO_MAX_BANK]; |
| 33 | }; |
| 34 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 35 | static int xilinx_gpio_get_bank_pin(unsigned offset, u32 *bank_num, |
| 36 | u32 *bank_pin_num, struct udevice *dev) |
| 37 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 38 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 39 | u32 bank, max_pins; |
| 40 | /* the first gpio is 0 not 1 */ |
| 41 | u32 pin_num = offset; |
| 42 | |
| 43 | for (bank = 0; bank < XILINX_GPIO_MAX_BANK; bank++) { |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 44 | max_pins = plat->bank_max[bank]; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 45 | if (pin_num < max_pins) { |
| 46 | debug("%s: found at bank 0x%x pin 0x%x\n", __func__, |
| 47 | bank, pin_num); |
| 48 | *bank_num = bank; |
| 49 | *bank_pin_num = pin_num; |
| 50 | return 0; |
| 51 | } |
| 52 | pin_num -= max_pins; |
| 53 | } |
| 54 | |
| 55 | return -EINVAL; |
| 56 | } |
| 57 | |
| 58 | static int xilinx_gpio_set_value(struct udevice *dev, unsigned offset, |
| 59 | int value) |
| 60 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 61 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 62 | struct xilinx_gpio_privdata *priv = dev_get_priv(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 63 | int val, ret; |
| 64 | u32 bank, pin; |
| 65 | |
| 66 | ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev); |
| 67 | if (ret) |
| 68 | return ret; |
| 69 | |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 70 | val = priv->output_val[bank]; |
Michal Simek | ee39afb | 2018-07-30 14:29:27 +0200 | [diff] [blame] | 71 | |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 72 | debug("%s: regs: %lx, value: %x, gpio: %x, bank %x, pin %x, out %x\n", |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 73 | __func__, (ulong)plat->regs, value, offset, bank, pin, val); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 74 | |
Michal Simek | ee39afb | 2018-07-30 14:29:27 +0200 | [diff] [blame] | 75 | if (value) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 76 | val = val | (1 << pin); |
Michal Simek | ee39afb | 2018-07-30 14:29:27 +0200 | [diff] [blame] | 77 | else |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 78 | val = val & ~(1 << pin); |
Michal Simek | ee39afb | 2018-07-30 14:29:27 +0200 | [diff] [blame] | 79 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 80 | writel(val, &plat->regs->gpiodata + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 81 | |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 82 | priv->output_val[bank] = val; |
| 83 | |
Michal Simek | 7fa52c2 | 2018-08-06 07:42:40 +0200 | [diff] [blame] | 84 | return 0; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset) |
| 88 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 89 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 90 | struct xilinx_gpio_privdata *priv = dev_get_priv(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 91 | int val, ret; |
| 92 | u32 bank, pin; |
| 93 | |
| 94 | ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev); |
| 95 | if (ret) |
| 96 | return ret; |
| 97 | |
| 98 | debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__, |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 99 | (ulong)plat->regs, offset, bank, pin); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 100 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 101 | if (plat->bank_output[bank]) { |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 102 | debug("%s: Read saved output value\n", __func__); |
| 103 | val = priv->output_val[bank]; |
| 104 | } else { |
| 105 | debug("%s: Read input value from reg\n", __func__); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 106 | val = readl(&plat->regs->gpiodata + bank * 2); |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 107 | } |
| 108 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 109 | val = !!(val & (1 << pin)); |
| 110 | |
| 111 | return val; |
| 112 | }; |
| 113 | |
| 114 | static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset) |
| 115 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 116 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 117 | int val, ret; |
| 118 | u32 bank, pin; |
| 119 | |
Michal Simek | 9260d99 | 2018-07-23 12:08:49 +0200 | [diff] [blame] | 120 | ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev); |
| 121 | if (ret) |
| 122 | return ret; |
| 123 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 124 | /* Check if all pins are inputs */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 125 | if (plat->bank_input[bank]) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 126 | return GPIOF_INPUT; |
| 127 | |
| 128 | /* Check if all pins are outputs */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 129 | if (plat->bank_output[bank]) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 130 | return GPIOF_OUTPUT; |
| 131 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 132 | /* FIXME test on dual */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 133 | val = readl(&plat->regs->gpiodir + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 134 | val = !(val & (1 << pin)); |
| 135 | |
| 136 | /* input is 1 in reg but GPIOF_INPUT is 0 */ |
| 137 | /* output is 0 in reg but GPIOF_OUTPUT is 1 */ |
| 138 | |
| 139 | return val; |
| 140 | } |
| 141 | |
| 142 | static int xilinx_gpio_direction_output(struct udevice *dev, unsigned offset, |
| 143 | int value) |
| 144 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 145 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 146 | int val, ret; |
| 147 | u32 bank, pin; |
| 148 | |
| 149 | ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev); |
| 150 | if (ret) |
| 151 | return ret; |
| 152 | |
| 153 | /* can't change it if all is input by default */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 154 | if (plat->bank_input[bank]) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 155 | return -EINVAL; |
| 156 | |
Michal Simek | c2116f3 | 2018-07-30 10:02:53 +0200 | [diff] [blame] | 157 | xilinx_gpio_set_value(dev, offset, value); |
| 158 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 159 | if (!plat->bank_output[bank]) { |
| 160 | val = readl(&plat->regs->gpiodir + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 161 | val = val & ~(1 << pin); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 162 | writel(val, &plat->regs->gpiodir + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 163 | } |
| 164 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 165 | return 0; |
| 166 | } |
| 167 | |
| 168 | static int xilinx_gpio_direction_input(struct udevice *dev, unsigned offset) |
| 169 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 170 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 171 | int val, ret; |
| 172 | u32 bank, pin; |
| 173 | |
| 174 | ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev); |
| 175 | if (ret) |
| 176 | return ret; |
| 177 | |
| 178 | /* Already input */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 179 | if (plat->bank_input[bank]) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 180 | return 0; |
| 181 | |
| 182 | /* can't change it if all is output by default */ |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 183 | if (plat->bank_output[bank]) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 184 | return -EINVAL; |
| 185 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 186 | val = readl(&plat->regs->gpiodir + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 187 | val = val | (1 << pin); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 188 | writel(val, &plat->regs->gpiodir + bank * 2); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 189 | |
| 190 | return 0; |
| 191 | } |
| 192 | |
| 193 | static int xilinx_gpio_xlate(struct udevice *dev, struct gpio_desc *desc, |
| 194 | struct ofnode_phandle_args *args) |
| 195 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 196 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 197 | |
| 198 | desc->offset = args->args[0]; |
| 199 | |
| 200 | debug("%s: argc: %x, [0]: %x, [1]: %x, [2]: %x\n", __func__, |
| 201 | args->args_count, args->args[0], args->args[1], args->args[2]); |
| 202 | |
| 203 | /* |
| 204 | * The second cell is channel offset: |
| 205 | * 0 is first channel, 8 is second channel |
| 206 | * |
| 207 | * U-Boot driver just combine channels together that's why simply |
| 208 | * add amount of pins in second channel if present. |
| 209 | */ |
| 210 | if (args->args[1]) { |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 211 | if (!plat->bank_max[1]) { |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 212 | printf("%s: %s has no second channel\n", |
| 213 | __func__, dev->name); |
| 214 | return -EINVAL; |
| 215 | } |
| 216 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 217 | desc->offset += plat->bank_max[0]; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | /* The third cell is optional */ |
| 221 | if (args->args_count > 2) |
| 222 | desc->flags = (args->args[2] & |
| 223 | GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0); |
| 224 | |
| 225 | debug("%s: offset %x, flags %lx\n", |
| 226 | __func__, desc->offset, desc->flags); |
| 227 | return 0; |
| 228 | } |
| 229 | |
| 230 | static const struct dm_gpio_ops xilinx_gpio_ops = { |
| 231 | .direction_input = xilinx_gpio_direction_input, |
| 232 | .direction_output = xilinx_gpio_direction_output, |
| 233 | .get_value = xilinx_gpio_get_value, |
| 234 | .set_value = xilinx_gpio_set_value, |
| 235 | .get_function = xilinx_gpio_get_function, |
| 236 | .xlate = xilinx_gpio_xlate, |
| 237 | }; |
| 238 | |
| 239 | static int xilinx_gpio_probe(struct udevice *dev) |
| 240 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 241 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 242 | struct xilinx_gpio_privdata *priv = dev_get_priv(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 243 | struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); |
Michal Simek | 305f1c5 | 2018-08-02 12:58:54 +0200 | [diff] [blame] | 244 | const void *label_ptr; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 245 | |
Michal Simek | 305f1c5 | 2018-08-02 12:58:54 +0200 | [diff] [blame] | 246 | label_ptr = dev_read_prop(dev, "label", NULL); |
| 247 | if (label_ptr) { |
| 248 | uc_priv->bank_name = strdup(label_ptr); |
| 249 | if (!uc_priv->bank_name) |
| 250 | return -ENOMEM; |
| 251 | } else { |
| 252 | uc_priv->bank_name = dev->name; |
| 253 | } |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 254 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 255 | uc_priv->gpio_count = plat->bank_max[0] + plat->bank_max[1]; |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 256 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 257 | priv->output_val[0] = plat->dout_default[0]; |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 258 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 259 | if (plat->bank_max[1]) |
| 260 | priv->output_val[1] = plat->dout_default[1]; |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 261 | |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 262 | return 0; |
| 263 | } |
| 264 | |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 265 | static int xilinx_gpio_of_to_plat(struct udevice *dev) |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 266 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 267 | struct xilinx_gpio_plat *plat = dev_get_plat(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 268 | int is_dual; |
| 269 | |
Johan Jonker | 8d5d8e0 | 2023-03-13 01:32:04 +0100 | [diff] [blame] | 270 | plat->regs = dev_read_addr_ptr(dev); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 271 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 272 | plat->bank_max[0] = dev_read_u32_default(dev, "xlnx,gpio-width", 0); |
| 273 | plat->bank_input[0] = dev_read_u32_default(dev, "xlnx,all-inputs", 0); |
| 274 | plat->bank_output[0] = dev_read_u32_default(dev, "xlnx,all-outputs", 0); |
| 275 | plat->dout_default[0] = dev_read_u32_default(dev, "xlnx,dout-default", |
| 276 | 0); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 277 | |
| 278 | is_dual = dev_read_u32_default(dev, "xlnx,is-dual", 0); |
| 279 | if (is_dual) { |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 280 | plat->bank_max[1] = dev_read_u32_default(dev, |
| 281 | "xlnx,gpio2-width", 0); |
| 282 | plat->bank_input[1] = dev_read_u32_default(dev, |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 283 | "xlnx,all-inputs-2", 0); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 284 | plat->bank_output[1] = dev_read_u32_default(dev, |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 285 | "xlnx,all-outputs-2", 0); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 286 | plat->dout_default[1] = dev_read_u32_default(dev, |
Michal Simek | 810e4bc | 2018-07-23 12:40:36 +0200 | [diff] [blame] | 287 | "xlnx,dout-default-2", 0); |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | return 0; |
| 291 | } |
| 292 | |
| 293 | static const struct udevice_id xilinx_gpio_ids[] = { |
| 294 | { .compatible = "xlnx,xps-gpio-1.00.a",}, |
| 295 | { } |
| 296 | }; |
| 297 | |
| 298 | U_BOOT_DRIVER(xilinx_gpio) = { |
| 299 | .name = "xlnx_gpio", |
| 300 | .id = UCLASS_GPIO, |
| 301 | .ops = &xilinx_gpio_ops, |
| 302 | .of_match = xilinx_gpio_ids, |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 303 | .of_to_plat = xilinx_gpio_of_to_plat, |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 304 | .probe = xilinx_gpio_probe, |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 305 | .plat_auto = sizeof(struct xilinx_gpio_plat), |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 306 | .priv_auto = sizeof(struct xilinx_gpio_privdata), |
Michal Simek | 6887797 | 2018-07-12 16:05:46 +0200 | [diff] [blame] | 307 | }; |