blob: 67975b3c45099f624ae93cba37c4578c11557340 [file] [log] [blame]
Michael Niewöhnerdbb667a2020-12-11 21:26:02 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef __DEVICE_GPIO_H__
4#define __DEVICE_GPIO_H__
5
6#include <types.h>
7
8struct gpio_operations {
9 int (*get)(uint32_t gpio);
10 void (*set)(uint32_t gpio, int value);
11 void (*input_pulldown)(uint32_t gpio);
12 void (*input_pullup)(uint32_t gpio);
13 void (*input)(uint32_t gpio);
14 void (*output)(uint32_t gpio, int value);
15};
16
17/* Helper for getting gpio operations from a device */
18const struct gpio_operations *dev_get_gpio_ops(struct device *dev);
19
20#endif /* __DEVICE_GPIO_H__ */