android_kernel_xiaomi_sm8350/include/linux/sys_soc.h
Murali Nalajala 1caeb408f5 UPSTREAM: base: soc: Handle custom soc information sysfs entries
Soc framework exposed sysfs entries are not sufficient for some
of the h/w platforms. Currently there is no interface where soc
drivers can expose further information about their SoCs via soc
framework. This change address this limitation where clients can
pass their custom entries as attribute group and soc framework
would expose them as sysfs properties.

Bug: 141190076
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/1570480662-25252-1-git-send-email-mnalajal@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry-picked from c31e73121f4c1ec45a3e523ac6ce3ce6dafdcec1)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia1c8d697e29052b4503da7c4b30c2c97d3b697f7
2019-10-17 13:15:53 -07:00

49 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) ST-Ericsson SA 2011
* Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson.
*/
#ifndef __SOC_BUS_H
#define __SOC_BUS_H
#include <linux/device.h>
struct soc_device_attribute {
const char *machine;
const char *family;
const char *revision;
const char *serial_number;
const char *soc_id;
const void *data;
const struct attribute_group *custom_attr_group;
};
/**
* soc_device_register - register SoC as a device
* @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
*/
struct soc_device *soc_device_register(
struct soc_device_attribute *soc_plat_dev_attr);
/**
* soc_device_unregister - unregister SoC device
* @dev: SoC device to be unregistered
*/
void soc_device_unregister(struct soc_device *soc_dev);
/**
* soc_device_to_device - helper function to fetch struct device
* @soc: Previously registered SoC device container
*/
struct device *soc_device_to_device(struct soc_device *soc);
#ifdef CONFIG_SOC_BUS
const struct soc_device_attribute *soc_device_match(
const struct soc_device_attribute *matches);
#else
static inline const struct soc_device_attribute *soc_device_match(
const struct soc_device_attribute *matches) { return NULL; }
#endif
#endif /* __SOC_BUS_H */