File: gio_device.h

package info (click to toggle)
linux 4.19.235-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 968,876 kB
  • sloc: ansic: 16,807,772; asm: 272,130; makefile: 38,425; sh: 33,854; perl: 27,702; python: 21,148; cpp: 5,068; yacc: 4,650; lex: 2,584; awk: 1,386; ruby: 25; sed: 5
file content (55 lines) | stat: -rw-r--r-- 1,531 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/device.h>
#include <linux/mod_devicetable.h>

struct gio_device_id {
	__u8 id;
};

struct gio_device {
	struct device	dev;
	struct resource resource;
	unsigned int	irq;
	unsigned int	slotno;

	const char	*name;
	struct gio_device_id id;
	unsigned	id32:1;
	unsigned	gio64:1;
};
#define to_gio_device(d) container_of(d, struct gio_device, dev)

struct gio_driver {
	const char    *name;
	struct module *owner;
	const struct gio_device_id *id_table;

	int  (*probe)(struct gio_device *, const struct gio_device_id *);
	void (*remove)(struct gio_device *);
	void (*shutdown)(struct gio_device *);

	struct device_driver driver;
};
#define to_gio_driver(drv) container_of(drv, struct gio_driver, driver)

extern const struct gio_device_id *gio_match_device(const struct gio_device_id *,
						    const struct gio_device *);
extern struct gio_device *gio_dev_get(struct gio_device *);
extern void gio_dev_put(struct gio_device *);

extern int gio_device_register(struct gio_device *);
extern void gio_device_unregister(struct gio_device *);
extern void gio_release_dev(struct device *);

static inline void gio_device_free(struct gio_device *dev)
{
	gio_release_dev(&dev->dev);
}

extern int gio_register_driver(struct gio_driver *);
extern void gio_unregister_driver(struct gio_driver *);

#define gio_get_drvdata(_dev)	     dev_get_drvdata(&(_dev)->dev)
#define gio_set_drvdata(_dev, data)  dev_set_drvdata(&(_dev)->dev, (data))

extern void gio_set_master(struct gio_device *);