summaryrefslogtreecommitdiff
path: root/drivers/peci/internal.h
diff options
context:
space:
mode:
authorIwona Winiarska <iwona.winiarska@intel.com>2022-02-08 18:36:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-09 10:04:44 +0300
commit52857e6828e260b16ac569578705f83cf2a71ac1 (patch)
treee468e1dbeef61906b3457d1d1d13af7690cdab6e /drivers/peci/internal.h
parenta85e4c52086cd8da6399447a92bf0250d8e634c2 (diff)
downloadlinux-52857e6828e260b16ac569578705f83cf2a71ac1.tar.xz
peci: Add device detection
Since PECI devices are discoverable, we can dynamically detect devices that are actually available in the system. This change complements the earlier implementation by rescanning PECI bus to detect available devices. For this purpose, it also introduces the minimal API for PECI requests. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20220208153639.255278-7-iwona.winiarska@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/peci/internal.h')
-rw-r--r--drivers/peci/internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 918dea745a86..57d11a902c5d 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -8,6 +8,20 @@
#include <linux/types.h>
struct peci_controller;
+struct peci_device;
+struct peci_request;
+
+/* PECI CPU address range 0x30-0x37 */
+#define PECI_BASE_ADDR 0x30
+#define PECI_DEVICE_NUM_MAX 8
+
+struct peci_request *peci_request_alloc(struct peci_device *device, u8 tx_len, u8 rx_len);
+void peci_request_free(struct peci_request *req);
+
+extern struct device_type peci_device_type;
+
+int peci_device_create(struct peci_controller *controller, u8 addr);
+void peci_device_destroy(struct peci_device *device);
extern struct bus_type peci_bus_type;