#ifndef _DWC_OS_DEP_H_ #define _DWC_OS_DEP_H_ /** * @file * * This file contains OS dependent structures. * */ #if 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) # include #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) # include #else # include #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) # include #else # include #endif #endif #include #ifdef CONFIG_ARM64 #include #include #else #include #endif /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE typedef struct os_dependent { /** Base address returned from ioremap() */ void *base; /** Register offset for Diagnostic API */ uint32_t reg_offset; struct platform_device *platformdev; } os_dependent_t; #ifdef __cplusplus } #endif typedef struct platform_device dwc_bus_dev_t; /* Helper macro to retrieve drvdata from the device on the chosen bus */ #define DWC_OTG_BUSDRVDATA(_dev) platform_get_drvdata(_dev) /** * Helper macro returning the otg_device structure of a given struct device * * c.f. static dwc_otg_device_t *dwc_otg_drvdev(struct device *_dev) */ #define DWC_OTG_GETDRVDEV(_var, _dev) do { \ struct platform_device *platform_dev = \ container_of(_dev, struct platform_device, dev); \ _var = platform_get_drvdata(platform_dev); \ } while (0) /** * Helper macro returning the struct dev of the given struct os_dependent * * c.f. static struct device *dwc_otg_getdev(struct os_dependent *osdep) */ #define DWC_OTG_OS_GETDEV(_osdep) \ ((_osdep).platformdev == NULL? NULL: &(_osdep).platformdev->dev) #endif /* _DWC_OS_DEP_H_ */