Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) ST-Ericsson SA 2011
0004  * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson.
0005  */
0006 #ifndef __SOC_BUS_H
0007 #define __SOC_BUS_H
0008 
0009 #include <linux/device.h>
0010 
0011 struct soc_device_attribute {
0012     const char *machine;
0013     const char *family;
0014     const char *revision;
0015     const char *serial_number;
0016     const char *soc_id;
0017     const void *data;
0018     const struct attribute_group *custom_attr_group;
0019 };
0020 
0021 /**
0022  * soc_device_register - register SoC as a device
0023  * @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
0024  */
0025 struct soc_device *soc_device_register(
0026     struct soc_device_attribute *soc_plat_dev_attr);
0027 
0028 /**
0029  * soc_device_unregister - unregister SoC device
0030  * @dev: SoC device to be unregistered
0031  */
0032 void soc_device_unregister(struct soc_device *soc_dev);
0033 
0034 /**
0035  * soc_device_to_device - helper function to fetch struct device
0036  * @soc: Previously registered SoC device container
0037  */
0038 struct device *soc_device_to_device(struct soc_device *soc);
0039 
0040 #ifdef CONFIG_SOC_BUS
0041 const struct soc_device_attribute *soc_device_match(
0042     const struct soc_device_attribute *matches);
0043 #else
0044 static inline const struct soc_device_attribute *soc_device_match(
0045     const struct soc_device_attribute *matches) { return NULL; }
0046 #endif
0047 
0048 #endif /* __SOC_BUS_H */