#include <linux/delay.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/completion.h>
#include <linux/mfd/da9055/core.h>
#include <linux/mfd/da9055/reg.h>
#define DA9055_ADCIN_DIV …
#define DA9055_VSYS_DIV …
#define DA9055_ADC_VSYS …
#define DA9055_ADC_ADCIN1 …
#define DA9055_ADC_ADCIN2 …
#define DA9055_ADC_ADCIN3 …
#define DA9055_ADC_TJUNC …
struct da9055_hwmon { … };
static const char * const input_names[] = …;
static const u8 chan_mux[DA9055_ADC_TJUNC + 1] = …;
static int da9055_adc_manual_read(struct da9055_hwmon *hwmon,
unsigned char channel)
{ … }
static irqreturn_t da9055_auxadc_irq(int irq, void *irq_data)
{ … }
static inline int volt_reg_to_mv(int value, int channel)
{ … }
static int da9055_enable_auto_mode(struct da9055 *da9055, int channel)
{ … }
static int da9055_disable_auto_mode(struct da9055 *da9055, int channel)
{ … }
static ssize_t da9055_auto_ch_show(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t da9055_tjunc_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t label_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(in0_input, da9055_auto_ch, DA9055_ADC_VSYS);
static SENSOR_DEVICE_ATTR_RO(in0_label, label, DA9055_ADC_VSYS);
static SENSOR_DEVICE_ATTR_RO(in1_input, da9055_auto_ch, DA9055_ADC_ADCIN1);
static SENSOR_DEVICE_ATTR_RO(in1_label, label, DA9055_ADC_ADCIN1);
static SENSOR_DEVICE_ATTR_RO(in2_input, da9055_auto_ch, DA9055_ADC_ADCIN2);
static SENSOR_DEVICE_ATTR_RO(in2_label, label, DA9055_ADC_ADCIN2);
static SENSOR_DEVICE_ATTR_RO(in3_input, da9055_auto_ch, DA9055_ADC_ADCIN3);
static SENSOR_DEVICE_ATTR_RO(in3_label, label, DA9055_ADC_ADCIN3);
static SENSOR_DEVICE_ATTR_RO(temp1_input, da9055_tjunc, DA9055_ADC_TJUNC);
static SENSOR_DEVICE_ATTR_RO(temp1_label, label, DA9055_ADC_TJUNC);
static struct attribute *da9055_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int da9055_hwmon_probe(struct platform_device *pdev)
{ … }
static struct platform_driver da9055_hwmon_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;