#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
struct power_supply_hwmon { … };
static const char *const ps_temp_label[] = …;
static int power_supply_hwmon_in_to_property(u32 attr)
{ … }
static int power_supply_hwmon_curr_to_property(u32 attr)
{ … }
static int power_supply_hwmon_power_to_property(u32 attr)
{ … }
static int power_supply_hwmon_temp_to_property(u32 attr, int channel)
{ … }
static int
power_supply_hwmon_to_property(enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static bool power_supply_hwmon_is_a_label(enum hwmon_sensor_types type,
u32 attr)
{ … }
struct hwmon_type_attr_list { … };
static const u32 ps_temp_attrs[] = …;
static const struct hwmon_type_attr_list ps_type_attrs[hwmon_max] = …;
static bool power_supply_hwmon_has_input(
const struct power_supply_hwmon *psyhw,
enum hwmon_sensor_types type, int channel)
{ … }
static bool power_supply_hwmon_is_writable(enum hwmon_sensor_types type,
u32 attr)
{ … }
static umode_t power_supply_hwmon_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int power_supply_hwmon_read_string(struct device *dev,
enum hwmon_sensor_types type,
u32 attr, int channel,
const char **str)
{ … }
static int
power_supply_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int
power_supply_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static const struct hwmon_ops power_supply_hwmon_ops = …;
static const struct hwmon_channel_info * const power_supply_hwmon_info[] = …;
static const struct hwmon_chip_info power_supply_hwmon_chip_info = …;
int power_supply_add_hwmon_sysfs(struct power_supply *psy)
{ … }
void power_supply_remove_hwmon_sysfs(struct power_supply *psy)
{ … }