blob: 1ea5bae708a154c739d40c64c716128513adb84f [file] [log] [blame]
Thomas Gleixner74ba9202019-05-20 09:19:02 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Guenter Roeck442aba72011-01-26 20:09:02 -08002/*
3 * Hardware monitoring driver for PMBus devices
4 *
5 * Copyright (c) 2010, 2011 Ericsson AB.
Guenter Roeck442aba72011-01-26 20:09:02 -08006 */
7
8#ifndef _PMBUS_H_
9#define _PMBUS_H_
10
Guenter Roeck9e347722019-12-12 09:14:34 -080011#include <linux/bits.h>
12
Guenter Roeck442aba72011-01-26 20:09:02 -080013/* flags */
14
15/*
16 * PMBUS_SKIP_STATUS_CHECK
17 *
18 * During register detection, skip checking the status register for
19 * communication or command errors.
20 *
21 * Some PMBus chips respond with valid data when trying to read an unsupported
22 * register. For such chips, checking the status register is mandatory when
23 * trying to determine if a chip register exists or not.
24 * Other PMBus chips don't support the STATUS_CML register, or report
25 * communication errors for no explicable reason. For such chips, checking
26 * the status register must be disabled.
27 */
Guenter Roeck9e347722019-12-12 09:14:34 -080028#define PMBUS_SKIP_STATUS_CHECK BIT(0)
29
30/*
31 * PMBUS_WRITE_PROTECTED
32 * Set if the chip is write protected and write protection is not determined
33 * by the standard WRITE_PROTECT command.
34 */
35#define PMBUS_WRITE_PROTECTED BIT(1)
Guenter Roeck442aba72011-01-26 20:09:02 -080036
37struct pmbus_platform_data {
38 u32 flags; /* Device specific flags */
Alan Tullddbb4db2014-10-15 13:55:09 -050039
40 /* regulator support */
41 int num_regulators;
42 struct regulator_init_data *reg_init_data;
Guenter Roeck442aba72011-01-26 20:09:02 -080043};
44
45#endif /* _PMBUS_H_ */