1 #ifndef __TINYX_DEVICE_H
2 #define __TINYX_DEVICE_H
4 #include <tinyx/list.h>
21 struct resource_mem mem
;
22 struct resource_irq irq
;
27 struct list_head queue
;
31 int (*probe
) (struct bus_type
*bus
);
32 int (*remove
) (struct bus_type
*bus
);
33 int (*match
) (struct bus_type
*bus
,
34 struct device
*dev
, struct device_driver
*drv
);
36 /* These write* and read* exists in order to avoid if's
37 * inside critial buses. */
38 void (*writeb
) (struct device
*dev
,
39 unsigned char val
, unsigned long addr
);
40 void (*writew
) (struct device
*dev
,
41 unsigned int val
, unsigned long addr
);
42 void (*writel
) (struct device
*dev
,
43 unsigned long val
, unsigned long addr
);
45 unsigned char (*readb
) (struct device
*dev
, unsigned long addr
);
46 unsigned int (*readw
) (struct device
*dev
, unsigned long addr
);
47 unsigned long (*readl
) (struct device
*dev
, unsigned long addr
);
49 void (*ioctl
) (struct device
*dev
, void *data
, int type
);
52 struct device_driver
{
53 struct list_head queue
;
56 int (*probe
) (struct device
*dev
);
57 int (*remove
) (struct device
*dev
);
61 struct list_head queue
;
64 struct device_driver
*drv
;
70 int register_bus_type(struct bus_type
*bus
);
71 int register_device_driver(struct device_driver
*drv
);
72 int register_device(struct device
*dev
, struct bus_type
*bus
);
74 #endif /* __TINYX_DEVICE_H */