sys_soc.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2011
  3. * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson.
  4. * License terms: GNU General Public License (GPL), version 2
  5. */
  6. #ifndef __SOC_BUS_H
  7. #define __SOC_BUS_H
  8. #include <linux/device.h>
  9. struct soc_device_attribute {
  10. const char *machine;
  11. const char *family;
  12. const char *revision;
  13. const char *soc_id;
  14. const void *data;
  15. };
  16. /**
  17. * soc_device_register - register SoC as a device
  18. * @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
  19. */
  20. struct soc_device *soc_device_register(
  21. struct soc_device_attribute *soc_plat_dev_attr);
  22. /**
  23. * soc_device_unregister - unregister SoC device
  24. * @dev: SoC device to be unregistered
  25. */
  26. void soc_device_unregister(struct soc_device *soc_dev);
  27. /**
  28. * soc_device_to_device - helper function to fetch struct device
  29. * @soc: Previously registered SoC device container
  30. */
  31. struct device *soc_device_to_device(struct soc_device *soc);
  32. #ifdef CONFIG_SOC_BUS
  33. const struct soc_device_attribute *soc_device_match(
  34. const struct soc_device_attribute *matches);
  35. #else
  36. static inline const struct soc_device_attribute *soc_device_match(
  37. const struct soc_device_attribute *matches) { return NULL; }
  38. #endif
  39. #endif /* __SOC_BUS_H */