#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/unaligned.h>
#define PAC1934_MAX_RFSH_LIMIT_MS …
#define PAC1934_MIN_POLLING_TIME_MS …
#define PAC1934_MIN_UPDATE_WAIT_TIME_US …
#define PAC1934_VOLTAGE_MILLIVOLTS_MAX …
#define PAC1934_VOLTAGE_U_RES …
#define PAC1934_VOLTAGE_S_RES …
#define PAC_193X_MAX_POWER_ACC …
#define PAC_193X_MIN_POWER_ACC …
#define PAC1934_MAX_NUM_CHANNELS …
#define PAC1934_MEAS_REG_LEN …
#define PAC1934_CTRL_REG_LEN …
#define PAC1934_DEFAULT_CHIP_SAMP_SPEED_HZ …
#define PAC1934_REFRESH_REG_ADDR …
#define PAC1934_CTRL_REG_ADDR …
#define PAC1934_ACC_COUNT_REG_ADDR …
#define PAC1934_VPOWER_ACC_1_ADDR …
#define PAC1934_VPOWER_ACC_2_ADDR …
#define PAC1934_VPOWER_ACC_3_ADDR …
#define PAC1934_VPOWER_ACC_4_ADDR …
#define PAC1934_VBUS_1_ADDR …
#define PAC1934_VBUS_2_ADDR …
#define PAC1934_VBUS_3_ADDR …
#define PAC1934_VBUS_4_ADDR …
#define PAC1934_VSENSE_1_ADDR …
#define PAC1934_VSENSE_2_ADDR …
#define PAC1934_VSENSE_3_ADDR …
#define PAC1934_VSENSE_4_ADDR …
#define PAC1934_VBUS_AVG_1_ADDR …
#define PAC1934_VBUS_AVG_2_ADDR …
#define PAC1934_VBUS_AVG_3_ADDR …
#define PAC1934_VBUS_AVG_4_ADDR …
#define PAC1934_VSENSE_AVG_1_ADDR …
#define PAC1934_VSENSE_AVG_2_ADDR …
#define PAC1934_VSENSE_AVG_3_ADDR …
#define PAC1934_VSENSE_AVG_4_ADDR …
#define PAC1934_VPOWER_1_ADDR …
#define PAC1934_VPOWER_2_ADDR …
#define PAC1934_VPOWER_3_ADDR …
#define PAC1934_VPOWER_4_ADDR …
#define PAC1934_REFRESH_V_REG_ADDR …
#define PAC1934_CTRL_STAT_REGS_ADDR …
#define PAC1934_PID_REG_ADDR …
#define PAC1934_MID_REG_ADDR …
#define PAC1934_RID_REG_ADDR …
#define PAC1934_ID_REG_LEN …
#define PAC1934_PID_IDX …
#define PAC1934_MID_IDX …
#define PAC1934_RID_IDX …
#define PAC1934_ACPI_GET_NAMES_AND_MOHMS_VALS …
#define PAC1934_ACPI_GET_UOHMS_VALS …
#define PAC1934_ACPI_GET_BIPOLAR_SETTINGS …
#define PAC1934_ACPI_GET_SAMP …
#define PAC1934_SAMPLE_RATE_SHIFT …
#define PAC1934_VBUS_SENSE_REG_LEN …
#define PAC1934_ACC_REG_LEN …
#define PAC1934_VPOWER_REG_LEN …
#define PAC1934_VPOWER_ACC_REG_LEN …
#define PAC1934_MAX_REGISTER_LENGTH …
#define PAC1934_CUSTOM_ATTR_FOR_CHANNEL …
#define PAC1934_CHANNEL_DIS_REG_OFF …
#define PAC1934_NEG_PWR_REG_OFF …
#define PAC1934_SLOW_REG_OFF …
#define PAC1934_CTRL_ACT_REG_OFF …
#define PAC1934_CHANNEL_DIS_ACT_REG_OFF …
#define PAC1934_NEG_PWR_ACT_REG_OFF …
#define PAC1934_CTRL_LAT_REG_OFF …
#define PAC1934_CHANNEL_DIS_LAT_REG_OFF …
#define PAC1934_NEG_PWR_LAT_REG_OFF …
#define PAC1934_PID_REG_OFF …
#define PAC1934_MID_REG_OFF …
#define PAC1934_REV_REG_OFF …
#define PAC1934_CTRL_STATUS_INFO_LEN …
#define PAC1934_MID …
#define PAC1931_PID …
#define PAC1932_PID …
#define PAC1933_PID …
#define PAC1934_PID …
#define PAC1934_SCALE_CONSTANT …
#define PAC1934_MAX_VPOWER_RSHIFTED_BY_28B …
#define PAC1934_MAX_VSENSE_RSHIFTED_BY_16B …
#define PAC1934_DEV_ATTR(name) …
#define PAC1934_CRTL_SAMPLE_RATE_MASK …
#define PAC1934_CHAN_SLEEP_MASK …
#define PAC1934_CHAN_SLEEP_SET …
#define PAC1934_CHAN_SINGLE_MASK …
#define PAC1934_CHAN_SINGLE_SHOT_SET …
#define PAC1934_CHAN_ALERT_MASK …
#define PAC1934_CHAN_ALERT_EN …
#define PAC1934_CHAN_ALERT_CC_MASK …
#define PAC1934_CHAN_ALERT_CC_EN …
#define PAC1934_CHAN_OVF_ALERT_MASK …
#define PAC1934_CHAN_OVF_ALERT_EN …
#define PAC1934_CHAN_OVF_MASK …
#define PAC1934_CHAN_DIS_CH1_OFF_MASK …
#define PAC1934_CHAN_DIS_CH2_OFF_MASK …
#define PAC1934_CHAN_DIS_CH3_OFF_MASK …
#define PAC1934_CHAN_DIS_CH4_OFF_MASK …
#define PAC1934_SMBUS_TIMEOUT_MASK …
#define PAC1934_SMBUS_BYTECOUNT_MASK …
#define PAC1934_SMBUS_NO_SKIP_MASK …
#define PAC1934_NEG_PWR_CH1_BIDI_MASK …
#define PAC1934_NEG_PWR_CH2_BIDI_MASK …
#define PAC1934_NEG_PWR_CH3_BIDI_MASK …
#define PAC1934_NEG_PWR_CH4_BIDI_MASK …
#define PAC1934_NEG_PWR_CH1_BIDV_MASK …
#define PAC1934_NEG_PWR_CH2_BIDV_MASK …
#define PAC1934_NEG_PWR_CH3_BIDV_MASK …
#define PAC1934_NEG_PWR_CH4_BIDV_MASK …
#define PAC1934_DSM_UUID …
enum pac1934_ids { … };
enum pac1934_samps { … };
enum pac1934_ch_idx { … };
struct pac1934_features { … };
static const unsigned int samp_rate_map_tbl[] = …;
static const struct pac1934_features pac1934_chip_config[] = …;
struct reg_data { … };
struct pac1934_chip_info { … };
#define TO_PAC1934_CHIP_INFO(d) …
#define PAC1934_VPOWER_ACC_CHANNEL(_index, _si, _address) …
#define PAC1934_VBUS_CHANNEL(_index, _si, _address) …
#define PAC1934_VBUS_AVG_CHANNEL(_index, _si, _address) …
#define PAC1934_VSENSE_CHANNEL(_index, _si, _address) …
#define PAC1934_VSENSE_AVG_CHANNEL(_index, _si, _address) …
#define PAC1934_VPOWER_CHANNEL(_index, _si, _address) …
static const struct iio_chan_spec pac1934_single_channel[] = …;
static int pac1934_i2c_read(struct i2c_client *client, u8 reg_addr,
void *databuf, u8 len)
{ … }
static int pac1934_get_samp_rate_idx(struct pac1934_chip_info *info,
u32 new_samp_rate)
{ … }
static ssize_t pac1934_shunt_value_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pac1934_shunt_value_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static int pac1934_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel,
const int **vals, int *type, int *length, long mask)
{ … }
static int pac1934_send_refresh(struct pac1934_chip_info *info,
u8 refresh_cmd, u32 wait_time)
{ … }
static int pac1934_reg_snapshot(struct pac1934_chip_info *info,
bool do_refresh, u8 refresh_cmd, u32 wait_time)
{ … }
static int pac1934_retrieve_data(struct pac1934_chip_info *info,
u32 wait_time)
{ … }
static int pac1934_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{ … }
static int pac1934_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int pac1934_read_label(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, char *label)
{ … }
static void pac1934_work_periodic_rfsh(struct work_struct *work)
{ … }
static int pac1934_read_revision(struct pac1934_chip_info *info, u8 *buf)
{ … }
static int pac1934_chip_identify(struct pac1934_chip_info *info)
{ … }
static int pac1934_acpi_parse_channel_config(struct i2c_client *client,
struct pac1934_chip_info *info)
{ … }
static int pac1934_fw_parse_channel_config(struct i2c_client *client,
struct pac1934_chip_info *info)
{ … }
static void pac1934_cancel_delayed_work(void *dwork)
{ … }
static int pac1934_chip_configure(struct pac1934_chip_info *info)
{ … }
static int pac1934_prep_iio_channels(struct pac1934_chip_info *info, struct iio_dev *indio_dev)
{ … }
static IIO_DEVICE_ATTR(in_shunt_resistor1, 0644,
pac1934_shunt_value_show, pac1934_shunt_value_store, 0);
static IIO_DEVICE_ATTR(in_shunt_resistor2, 0644,
pac1934_shunt_value_show, pac1934_shunt_value_store, 1);
static IIO_DEVICE_ATTR(in_shunt_resistor3, 0644,
pac1934_shunt_value_show, pac1934_shunt_value_store, 2);
static IIO_DEVICE_ATTR(in_shunt_resistor4, 0644,
pac1934_shunt_value_show, pac1934_shunt_value_store, 3);
static int pac1934_prep_custom_attributes(struct pac1934_chip_info *info,
struct iio_dev *indio_dev)
{ … }
static void pac1934_mutex_destroy(void *data)
{ … }
static const struct iio_info pac1934_info = …;
static int pac1934_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id pac1934_id[] = …;
MODULE_DEVICE_TABLE(i2c, pac1934_id);
static const struct of_device_id pac1934_of_match[] = …;
MODULE_DEVICE_TABLE(of, pac1934_of_match);
static const struct acpi_device_id pac1934_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, pac1934_acpi_match);
static struct i2c_driver pac1934_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;