| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Nano River Technologies viperboard GPIO lib driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * (C) 2012 by Lemonage GmbH |
|---|
| 5 | 6 | * Author: Lars Poeschel <poeschel@lemonage.de> |
|---|
| 6 | 7 | * All rights reserved. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 10 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 11 | | - * option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | |
|---|
| 15 | 10 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 19 | 14 | #include <linux/types.h> |
|---|
| 20 | 15 | #include <linux/mutex.h> |
|---|
| 21 | 16 | #include <linux/platform_device.h> |
|---|
| 22 | | - |
|---|
| 23 | 17 | #include <linux/usb.h> |
|---|
| 24 | | -#include <linux/gpio.h> |
|---|
| 18 | +#include <linux/gpio/driver.h> |
|---|
| 25 | 19 | |
|---|
| 26 | 20 | #include <linux/mfd/viperboard.h> |
|---|
| 27 | 21 | |
|---|
| .. | .. |
|---|
| 85 | 79 | /* ----- begin of gipo a chip -------------------------------------------- */ |
|---|
| 86 | 80 | |
|---|
| 87 | 81 | static int vprbrd_gpioa_get(struct gpio_chip *chip, |
|---|
| 88 | | - unsigned offset) |
|---|
| 82 | + unsigned int offset) |
|---|
| 89 | 83 | { |
|---|
| 90 | 84 | int ret, answer, error = 0; |
|---|
| 91 | 85 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 135 | 129 | } |
|---|
| 136 | 130 | |
|---|
| 137 | 131 | static void vprbrd_gpioa_set(struct gpio_chip *chip, |
|---|
| 138 | | - unsigned offset, int value) |
|---|
| 132 | + unsigned int offset, int value) |
|---|
| 139 | 133 | { |
|---|
| 140 | 134 | int ret; |
|---|
| 141 | 135 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 176 | 170 | } |
|---|
| 177 | 171 | |
|---|
| 178 | 172 | static int vprbrd_gpioa_direction_input(struct gpio_chip *chip, |
|---|
| 179 | | - unsigned offset) |
|---|
| 173 | + unsigned int offset) |
|---|
| 180 | 174 | { |
|---|
| 181 | 175 | int ret; |
|---|
| 182 | 176 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 213 | 207 | } |
|---|
| 214 | 208 | |
|---|
| 215 | 209 | static int vprbrd_gpioa_direction_output(struct gpio_chip *chip, |
|---|
| 216 | | - unsigned offset, int value) |
|---|
| 210 | + unsigned int offset, int value) |
|---|
| 217 | 211 | { |
|---|
| 218 | 212 | int ret; |
|---|
| 219 | 213 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 257 | 251 | |
|---|
| 258 | 252 | /* ----- begin of gipo b chip -------------------------------------------- */ |
|---|
| 259 | 253 | |
|---|
| 260 | | -static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned offset, |
|---|
| 261 | | - unsigned dir) |
|---|
| 254 | +static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned int offset, |
|---|
| 255 | + unsigned int dir) |
|---|
| 262 | 256 | { |
|---|
| 263 | 257 | struct vprbrd_gpiob_msg *gbmsg = (struct vprbrd_gpiob_msg *)vb->buf; |
|---|
| 264 | 258 | int ret; |
|---|
| .. | .. |
|---|
| 279 | 273 | } |
|---|
| 280 | 274 | |
|---|
| 281 | 275 | static int vprbrd_gpiob_get(struct gpio_chip *chip, |
|---|
| 282 | | - unsigned offset) |
|---|
| 276 | + unsigned int offset) |
|---|
| 283 | 277 | { |
|---|
| 284 | 278 | int ret; |
|---|
| 285 | 279 | u16 val; |
|---|
| .. | .. |
|---|
| 311 | 305 | } |
|---|
| 312 | 306 | |
|---|
| 313 | 307 | static void vprbrd_gpiob_set(struct gpio_chip *chip, |
|---|
| 314 | | - unsigned offset, int value) |
|---|
| 308 | + unsigned int offset, int value) |
|---|
| 315 | 309 | { |
|---|
| 316 | 310 | int ret; |
|---|
| 317 | 311 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 344 | 338 | } |
|---|
| 345 | 339 | |
|---|
| 346 | 340 | static int vprbrd_gpiob_direction_input(struct gpio_chip *chip, |
|---|
| 347 | | - unsigned offset) |
|---|
| 341 | + unsigned int offset) |
|---|
| 348 | 342 | { |
|---|
| 349 | 343 | int ret; |
|---|
| 350 | 344 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|
| .. | .. |
|---|
| 365 | 359 | } |
|---|
| 366 | 360 | |
|---|
| 367 | 361 | static int vprbrd_gpiob_direction_output(struct gpio_chip *chip, |
|---|
| 368 | | - unsigned offset, int value) |
|---|
| 362 | + unsigned int offset, int value) |
|---|
| 369 | 363 | { |
|---|
| 370 | 364 | int ret; |
|---|
| 371 | 365 | struct vprbrd_gpio *gpio = gpiochip_get_data(chip); |
|---|