#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/platform_data/ina2xx.h>
#define INA238_CONFIG …
#define INA238_ADC_CONFIG …
#define INA238_SHUNT_CALIBRATION …
#define INA238_SHUNT_VOLTAGE …
#define INA238_BUS_VOLTAGE …
#define INA238_DIE_TEMP …
#define INA238_CURRENT …
#define INA238_POWER …
#define INA238_DIAG_ALERT …
#define INA238_SHUNT_OVER_VOLTAGE …
#define INA238_SHUNT_UNDER_VOLTAGE …
#define INA238_BUS_OVER_VOLTAGE …
#define INA238_BUS_UNDER_VOLTAGE …
#define INA238_TEMP_LIMIT …
#define INA238_POWER_LIMIT …
#define INA238_DEVICE_ID …
#define INA238_CONFIG_ADCRANGE …
#define INA238_DIAG_ALERT_TMPOL …
#define INA238_DIAG_ALERT_SHNTOL …
#define INA238_DIAG_ALERT_SHNTUL …
#define INA238_DIAG_ALERT_BUSOL …
#define INA238_DIAG_ALERT_BUSUL …
#define INA238_DIAG_ALERT_POL …
#define INA238_REGISTERS …
#define INA238_RSHUNT_DEFAULT …
#define INA238_CONFIG_DEFAULT …
#define INA238_ADC_CONFIG_DEFAULT …
#define INA238_DIAG_ALERT_DEFAULT …
#define INA238_CALIBRATION_VALUE …
#define INA238_FIXED_SHUNT …
#define INA238_SHUNT_VOLTAGE_LSB …
#define INA238_BUS_VOLTAGE_LSB …
#define INA238_DIE_TEMP_LSB …
static const struct regmap_config ina238_regmap_config = …;
struct ina238_data { … };
static int ina238_read_reg24(const struct i2c_client *client, u8 reg, u32 *val)
{ … }
static int ina238_read_in(struct device *dev, u32 attr, int channel,
long *val)
{ … }
static int ina238_write_in(struct device *dev, u32 attr, int channel,
long val)
{ … }
static int ina238_read_current(struct device *dev, u32 attr, long *val)
{ … }
static int ina238_read_power(struct device *dev, u32 attr, long *val)
{ … }
static int ina238_write_power(struct device *dev, u32 attr, long val)
{ … }
static int ina238_read_temp(struct device *dev, u32 attr, long *val)
{ … }
static int ina238_write_temp(struct device *dev, u32 attr, long val)
{ … }
static int ina238_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int ina238_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t ina238_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
#define INA238_HWMON_IN_CONFIG …
static const struct hwmon_channel_info * const ina238_info[] = …;
static const struct hwmon_ops ina238_hwmon_ops = …;
static const struct hwmon_chip_info ina238_chip_info = …;
static int ina238_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ina238_id[] = …;
MODULE_DEVICE_TABLE(i2c, ina238_id);
static const struct of_device_id __maybe_unused ina238_of_match[] = …;
MODULE_DEVICE_TABLE(of, ina238_of_match);
static struct i2c_driver ina238_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;