0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
0021 #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
0022
0023 #include <linux/kernel.h>
0024 #include <linux/platform_device.h>
0025
0026 #include "omap_hwmod.h"
0027
0028 extern struct dev_pm_domain omap_device_pm_domain;
0029 extern struct dev_pm_domain omap_device_fail_pm_domain;
0030
0031
0032 #define OMAP_DEVICE_STATE_UNKNOWN 0
0033 #define OMAP_DEVICE_STATE_ENABLED 1
0034 #define OMAP_DEVICE_STATE_IDLE 2
0035 #define OMAP_DEVICE_STATE_SHUTDOWN 3
0036
0037
0038 #define OMAP_DEVICE_SUSPENDED BIT(0)
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 struct omap_device {
0056 struct platform_device *pdev;
0057 struct omap_hwmod **hwmods;
0058 unsigned long _driver_status;
0059 u8 hwmods_cnt;
0060 u8 _state;
0061 u8 flags;
0062 };
0063
0064
0065
0066 int omap_device_enable(struct platform_device *pdev);
0067 int omap_device_idle(struct platform_device *pdev);
0068
0069
0070
0071 struct omap_device *omap_device_alloc(struct platform_device *pdev,
0072 struct omap_hwmod **ohs, int oh_cnt);
0073 void omap_device_delete(struct omap_device *od);
0074
0075 struct device *omap_device_get_by_hwmod_name(const char *oh_name);
0076
0077
0078 int omap_device_get_context_loss_count(struct platform_device *pdev);
0079
0080
0081
0082 int omap_device_assert_hardreset(struct platform_device *pdev,
0083 const char *name);
0084 int omap_device_deassert_hardreset(struct platform_device *pdev,
0085 const char *name);
0086
0087
0088 static inline struct omap_device *to_omap_device(struct platform_device *pdev)
0089 {
0090 return pdev ? pdev->archdata.od : NULL;
0091 }
0092 #endif