36#ifndef _LOS_DRIVER_BASE_H
37#define _LOS_DRIVER_BASE_H
130#define LOS_ERRNO_DRIVER_INPUT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x10)
140#define LOS_ERRNO_DRIVER_MUX_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x11)
150#define LOS_ERRNO_DRIVER_DRIVER_MATCH_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x20)
160#define LOS_ERRNO_DRIVER_DRIVER_PROBE_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x21)
170#define LOS_ERRNO_DRIVER_DRIVER_REGISTERED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x22)
180#define LOS_ERRNO_DRIVER_DRIVER_NOTFOUND LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x23)
190#define LOS_ERRNO_DRIVER_DEVICE_BOUNDED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x30)
200#define LOS_ERRNO_DRIVER_DEVICE_INITIALFAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x31)
210#define LOS_ERRNO_DRIVER_DEVICE_REGISTERED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x32)
220#define LOS_ERRNO_DRIVER_DEVICE_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x33)
439#define LOS_FOREACH_DEVICE_LIST_HOOK(device, list, hook) \
440 LOS_DL_LIST_FOR_EACH_ENTRY_HOOK(device, list, struct LosDevice, driverNode, hook)
462#define LOS_FOREACH_DEVICE_HOOK(device, hook) \
463 LOS_DL_LIST_FOR_EACH_ENTRY_HOOK(device, &g_deviceList, struct LosDevice, deviceItem, hook)
485#define LOS_FOREACH_DEVICE_BY_DRIVER(device, driver) \
486 LOS_FOREACH_DEVICE_LIST_HOOK(device, &(driver)->deviceList, NULL)
507#define LOS_FOREACH_DEVICE(device) \
508 LOS_FOREACH_DEVICE_HOOK(device, NULL)
UINTPTR LOS_DeviceRegBaseGet(const struct LosDevice *dev, UINT32 index)
get register base address form a device.
UINTPTR LOS_DeviceRegSizeGet(const struct LosDevice *dev, UINT32 index)
get register size form a device.
UINT32 LOS_DriverUnregister(struct LosDriver *drv)
unregister a driver from the system.
UINTPTR LOS_DeviceIrqNumGet(const struct LosDevice *dev)
get interrupt number form a device.
VOID LOS_PmResume(VOID)
resume all devices in suspendedList.
void LOS_DeviceUnregister(struct LosDevice *dev)
unregister a device from the system.
UINT32 LOS_DriverRegister(struct LosDriver *drv)
register a new driver to the system.
UINT32 LOS_DeviceRegister(struct LosDevice *dev)
register a new device to the system.
VOID * LOS_DeviceDataGet(const struct LosDevice *dev)
get data form a device.
INT32 LOS_PmSuspend(VOID)
suspend all devices in preparedList.
signed int INT32
Definition los_typedef.h:55
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
size_t BOOL
Definition los_typedef.h:83
Definition los_driverbase.h:59
UINT32 numRegs
Definition los_driverbase.h:61
struct LosDeviceRegs * regs
Definition los_driverbase.h:62
UINTPTR irqNum
Definition los_driverbase.h:60
Definition los_driverbase.h:49
UINTPTR size
Definition los_driverbase.h:51
UINTPTR base
Definition los_driverbase.h:50
Definition los_driverbase.h:70
UINT32 mutex
Definition los_driverbase.h:76
const CHAR * name
Definition los_driverbase.h:71
BOOL isRegistered
Definition los_driverbase.h:77
LOS_DL_LIST deviceItem
Definition los_driverbase.h:74
LOS_DL_LIST pmNode
Definition los_driverbase.h:75
VOID * data
Definition los_driverbase.h:80
INT32 id
Definition los_driverbase.h:72
struct LosDriver * driver
Definition los_driverbase.h:78
struct LosDeviceConfig cfg
Definition los_driverbase.h:79
LOS_DL_LIST driverNode
Definition los_driverbase.h:73
Definition los_driverbase.h:100
VOID(* shutdown)(struct LosDevice *device)
Definition los_driverbase.h:103
INT32(* remove)(struct LosDevice *device)
Definition los_driverbase.h:102
INT32(* probe)(struct LosDevice *device)
Definition los_driverbase.h:101
Definition los_driverbase.h:111
BOOL isRegistered
Definition los_driverbase.h:116
LOS_DL_LIST deviceList
Definition los_driverbase.h:113
UINT32 mutex
Definition los_driverbase.h:115
LOS_DL_LIST driverItem
Definition los_driverbase.h:114
struct LosPowerMgrOps pmOps
Definition los_driverbase.h:118
struct LosDriverOps ops
Definition los_driverbase.h:117
const CHAR * name
Definition los_driverbase.h:112
Definition los_driverbase.h:88
INT32(* complete)(struct LosDevice *device)
Definition los_driverbase.h:92
INT32(* resume)(struct LosDevice *device)
Definition los_driverbase.h:90
INT32(* prepare)(struct LosDevice *device)
Definition los_driverbase.h:91
INT32(* suspend)(struct LosDevice *device)
Definition los_driverbase.h:89