2019-05-20 07:19:02 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-01-27 04:09:02 +00:00
|
|
|
/*
|
|
|
|
* Hardware monitoring driver for PMBus devices
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010, 2011 Ericsson AB.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PMBUS_H_
|
|
|
|
#define _PMBUS_H_
|
|
|
|
|
2019-12-12 17:14:34 +00:00
|
|
|
#include <linux/bits.h>
|
|
|
|
|
2011-01-27 04:09:02 +00:00
|
|
|
/* flags */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PMBUS_SKIP_STATUS_CHECK
|
|
|
|
*
|
|
|
|
* During register detection, skip checking the status register for
|
|
|
|
* communication or command errors.
|
|
|
|
*
|
|
|
|
* Some PMBus chips respond with valid data when trying to read an unsupported
|
|
|
|
* register. For such chips, checking the status register is mandatory when
|
|
|
|
* trying to determine if a chip register exists or not.
|
|
|
|
* Other PMBus chips don't support the STATUS_CML register, or report
|
|
|
|
* communication errors for no explicable reason. For such chips, checking
|
|
|
|
* the status register must be disabled.
|
|
|
|
*/
|
2019-12-12 17:14:34 +00:00
|
|
|
#define PMBUS_SKIP_STATUS_CHECK BIT(0)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PMBUS_WRITE_PROTECTED
|
|
|
|
* Set if the chip is write protected and write protection is not determined
|
|
|
|
* by the standard WRITE_PROTECT command.
|
|
|
|
*/
|
|
|
|
#define PMBUS_WRITE_PROTECTED BIT(1)
|
2011-01-27 04:09:02 +00:00
|
|
|
|
2020-12-22 15:26:39 +00:00
|
|
|
/*
|
|
|
|
* PMBUS_NO_CAPABILITY
|
|
|
|
*
|
|
|
|
* Some PMBus chips don't respond with valid data when reading the CAPABILITY
|
|
|
|
* register. For such chips, this flag should be set so that the PMBus core
|
|
|
|
* driver doesn't use CAPABILITY to determine it's behavior.
|
|
|
|
*/
|
|
|
|
#define PMBUS_NO_CAPABILITY BIT(2)
|
|
|
|
|
2011-01-27 04:09:02 +00:00
|
|
|
struct pmbus_platform_data {
|
|
|
|
u32 flags; /* Device specific flags */
|
2014-10-15 18:55:09 +00:00
|
|
|
|
|
|
|
/* regulator support */
|
|
|
|
int num_regulators;
|
|
|
|
struct regulator_init_data *reg_init_data;
|
2011-01-27 04:09:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _PMBUS_H_ */
|