sys_soc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) ST-Ericsson SA 2011
  4. * Author: Lee Jones <[email protected]> for ST-Ericsson.
  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 *serial_number;
  14. const char *soc_id;
  15. const void *data;
  16. const struct attribute_group *custom_attr_group;
  17. };
  18. /**
  19. * soc_device_register - register SoC as a device
  20. * @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
  21. */
  22. struct soc_device *soc_device_register(
  23. struct soc_device_attribute *soc_plat_dev_attr);
  24. /**
  25. * soc_device_unregister - unregister SoC device
  26. * @dev: SoC device to be unregistered
  27. */
  28. void soc_device_unregister(struct soc_device *soc_dev);
  29. /**
  30. * soc_device_to_device - helper function to fetch struct device
  31. * @soc: Previously registered SoC device container
  32. */
  33. struct device *soc_device_to_device(struct soc_device *soc);
  34. #ifdef CONFIG_SOC_BUS
  35. const struct soc_device_attribute *soc_device_match(
  36. const struct soc_device_attribute *matches);
  37. #else
  38. static inline const struct soc_device_attribute *soc_device_match(
  39. const struct soc_device_attribute *matches) { return NULL; }
  40. #endif
  41. #endif /* __SOC_BUS_H */