xref: /linux-6.15/include/linux/sys_soc.h (revision c31e7312)
1af873fceSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
274d1d82cSLee Jones /*
374d1d82cSLee Jones  * Copyright (C) ST-Ericsson SA 2011
474d1d82cSLee Jones  * Author: Lee Jones <[email protected]> for ST-Ericsson.
574d1d82cSLee Jones  */
674d1d82cSLee Jones #ifndef __SOC_BUS_H
774d1d82cSLee Jones #define __SOC_BUS_H
874d1d82cSLee Jones 
974d1d82cSLee Jones #include <linux/device.h>
1074d1d82cSLee Jones 
1174d1d82cSLee Jones struct soc_device_attribute {
1274d1d82cSLee Jones 	const char *machine;
1374d1d82cSLee Jones 	const char *family;
1474d1d82cSLee Jones 	const char *revision;
159aebf4deSBjorn Andersson 	const char *serial_number;
1674d1d82cSLee Jones 	const char *soc_id;
17c97db7ccSArnd Bergmann 	const void *data;
18*c31e7312SMurali Nalajala 	const struct attribute_group *custom_attr_group;
1974d1d82cSLee Jones };
2074d1d82cSLee Jones 
2174d1d82cSLee Jones /**
2274d1d82cSLee Jones  * soc_device_register - register SoC as a device
2374d1d82cSLee Jones  * @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
2474d1d82cSLee Jones  */
2574d1d82cSLee Jones struct soc_device *soc_device_register(
2674d1d82cSLee Jones 	struct soc_device_attribute *soc_plat_dev_attr);
2774d1d82cSLee Jones 
2874d1d82cSLee Jones /**
2974d1d82cSLee Jones  * soc_device_unregister - unregister SoC device
3074d1d82cSLee Jones  * @dev: SoC device to be unregistered
3174d1d82cSLee Jones  */
3274d1d82cSLee Jones void soc_device_unregister(struct soc_device *soc_dev);
3374d1d82cSLee Jones 
3474d1d82cSLee Jones /**
3574d1d82cSLee Jones  * soc_device_to_device - helper function to fetch struct device
3674d1d82cSLee Jones  * @soc: Previously registered SoC device container
3774d1d82cSLee Jones  */
3874d1d82cSLee Jones struct device *soc_device_to_device(struct soc_device *soc);
3974d1d82cSLee Jones 
40da65a158SGeert Uytterhoeven #ifdef CONFIG_SOC_BUS
41c97db7ccSArnd Bergmann const struct soc_device_attribute *soc_device_match(
42c97db7ccSArnd Bergmann 	const struct soc_device_attribute *matches);
43da65a158SGeert Uytterhoeven #else
soc_device_match(const struct soc_device_attribute * matches)44da65a158SGeert Uytterhoeven static inline const struct soc_device_attribute *soc_device_match(
45da65a158SGeert Uytterhoeven 	const struct soc_device_attribute *matches) { return NULL; }
46da65a158SGeert Uytterhoeven #endif
47da65a158SGeert Uytterhoeven 
4874d1d82cSLee Jones #endif /* __SOC_BUS_H */
49