summaryrefslogtreecommitdiff
path: root/src/include/device/gpio.h
blob: 67975b3c45099f624ae93cba37c4578c11557340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __DEVICE_GPIO_H__
#define __DEVICE_GPIO_H__

#include <types.h>

struct gpio_operations {
	int  (*get)(uint32_t gpio);
	void (*set)(uint32_t gpio, int value);
	void (*input_pulldown)(uint32_t gpio);
	void (*input_pullup)(uint32_t gpio);
	void (*input)(uint32_t gpio);
	void (*output)(uint32_t gpio, int value);
};

/* Helper for getting gpio operations from a device */
const struct gpio_operations *dev_get_gpio_ops(struct device *dev);

#endif	/* __DEVICE_GPIO_H__ */