@@ -420,6 +420,7 @@ extern const struct regulator_ops pmbus_regulator_ops;
/* Function declarations */
+const struct pmbus_driver_info *pmbus_get_info(struct i2c_client *client);
void pmbus_clear_cache(struct i2c_client *client);
int pmbus_set_page(struct i2c_client *client, u8 page);
int pmbus_read_word_data(struct i2c_client *client, u8 page, u8 reg);
@@ -140,6 +140,12 @@ static const int pmbus_fan_command_registers[] = {
PMBUS_FAN_COMMAND_4,
};
+const struct pmbus_driver_info *pmbus_get_info(struct i2c_client *client)
+{
+ return ((struct pmbus_data *)i2c_get_clientdata(client))->info;
+}
+EXPORT_SYMBOL_GPL(pmbus_get_info);
+
void pmbus_clear_cache(struct i2c_client *client)
{
struct pmbus_data *data = i2c_get_clientdata(client);
This allows the caller to hoist themselves out to a containing structure in e.g. the read/write callbacks without exposing struct pmbus_data. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> --- New since v1. drivers/hwmon/pmbus/pmbus.h | 1 + drivers/hwmon/pmbus/pmbus_core.c | 6 ++++++ 2 files changed, 7 insertions(+)