#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/platform_device.h>
#include <linux/platform_data/max197.h>
#define MAX199_LIMIT …
#define MAX197_LIMIT …
#define MAX197_NUM_CH …
#define MAX197_BIP …
#define MAX197_RNG …
#define MAX197_SCALE …
enum max197_chips { … };
struct max197_data { … };
static inline void max197_set_unipolarity(struct max197_data *data, int channel)
{ … }
static inline void max197_set_bipolarity(struct max197_data *data, int channel)
{ … }
static inline void max197_set_half_range(struct max197_data *data, int channel)
{ … }
static inline void max197_set_full_range(struct max197_data *data, int channel)
{ … }
static inline bool max197_is_bipolar(struct max197_data *data, int channel)
{ … }
static inline bool max197_is_full_range(struct max197_data *data, int channel)
{ … }
static ssize_t max197_show_range(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t max197_store_range(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t max197_show_input(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
#define MAX197_SENSOR_DEVICE_ATTR_CH(chan) …
#define MAX197_SENSOR_DEV_ATTR_IN(chan) …
static DEVICE_ATTR_RO(name);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
MAX197_SENSOR_DEVICE_ATTR_CH(…);
static const struct attribute_group max197_sysfs_group = …;
static int max197_probe(struct platform_device *pdev)
{ … }
static void max197_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id max197_device_ids[] = …;
MODULE_DEVICE_TABLE(platform, max197_device_ids);
static struct platform_driver max197_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;