xref: /openbmc/linux/include/linux/mfd/rsmu.h (revision 67d6c76f)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Core interface for Renesas Synchronization Management Unit (SMU) devices.
4  *
5  * Copyright (C) 2021 Integrated Device Technology, Inc., a Renesas Company.
6  */
7 
8 #ifndef __LINUX_MFD_RSMU_H
9 #define __LINUX_MFD_RSMU_H
10 
11 #define RSMU_MAX_WRITE_COUNT	(255)
12 #define RSMU_MAX_READ_COUNT	(255)
13 
14 /* The supported devices are ClockMatrix, Sabre and SnowLotus */
15 enum rsmu_type {
16 	RSMU_CM		= 0x34000,
17 	RSMU_SABRE	= 0x33810,
18 	RSMU_SL		= 0x19850,
19 };
20 
21 /**
22  *
23  * struct rsmu_ddata - device data structure for sub devices.
24  *
25  * @dev:    i2c/spi device.
26  * @regmap: i2c/spi bus access.
27  * @lock:   mutex used by sub devices to make sure a series of
28  *          bus access requests are not interrupted.
29  * @type:   RSMU device type.
30  * @page:   i2c/spi bus driver internal use only.
31  */
32 struct rsmu_ddata {
33 	struct device *dev;
34 	struct regmap *regmap;
35 	struct mutex lock;
36 	enum rsmu_type type;
37 	u32 page;
38 };
39 #endif /*  __LINUX_MFD_RSMU_H */
40