#include <linux/delay.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/math64.h>
#include <linux/mfd/lochnagar.h>
#include <linux/mfd/lochnagar2_regs.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#define LN2_MAX_NSAMPLE …
#define LN2_SAMPLE_US …
#define LN2_CURR_UNITS …
#define LN2_VOLT_UNITS …
#define LN2_TEMP_UNITS …
#define LN2_PWR_UNITS …
static const char * const lochnagar_chan_names[] = …;
struct lochnagar_hwmon { … };
enum lochnagar_measure_mode { … };
static long float_to_long(u32 data, u32 precision)
{ … }
static int do_measurement(struct regmap *regmap, int chan,
enum lochnagar_measure_mode mode, int nsamples)
{ … }
static int request_data(struct regmap *regmap, int chan, u32 *data)
{ … }
static int read_sensor(struct device *dev, int chan,
enum lochnagar_measure_mode mode, int nsamples,
unsigned int precision, long *val)
{ … }
static int read_power(struct device *dev, int chan, long *val)
{ … }
static umode_t lochnagar_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int chan)
{ … }
static int lochnagar_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int chan, long *val)
{ … }
static int lochnagar_read_string(struct device *dev,
enum hwmon_sensor_types type, u32 attr,
int chan, const char **str)
{ … }
static int lochnagar_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int chan, long val)
{ … }
static const struct hwmon_ops lochnagar_ops = …;
static const struct hwmon_channel_info * const lochnagar_info[] = …;
static const struct hwmon_chip_info lochnagar_chip_info = …;
static const struct of_device_id lochnagar_of_match[] = …;
MODULE_DEVICE_TABLE(of, lochnagar_of_match);
static int lochnagar_hwmon_probe(struct platform_device *pdev)
{ … }
static struct platform_driver lochnagar_hwmon_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;