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