Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * ads7828.c - driver for TI ADS7828 8-channel A/D converter and compatibles
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * (C) 2007 EADS Astrium
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * This driver is based on the lm75 and other lm_sensors/hwmon drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Written by Steve Hardy <shardy@redhat.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * ADS7830 support, by Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * For further information, see the Documentation/hwmon/ads7828.rst file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/err.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/hwmon.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/hwmon-sysfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/of_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/platform_data/ads7828.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/regmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/regulator/consumer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) /* The ADS7828 registers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #define ADS7828_CMD_SD_SE	0x80	/* Single ended inputs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define ADS7828_CMD_PD1		0x04	/* Internal vref OFF && A/D ON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define ADS7828_CMD_PD3		0x0C	/* Internal vref ON && A/D ON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define ADS7828_INT_VREF_MV	2500	/* Internal vref is 2.5V, 2500mV */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #define ADS7828_EXT_VREF_MV_MIN	50	/* External vref min value 0.05V */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define ADS7828_EXT_VREF_MV_MAX	5250	/* External vref max value 5.25V */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) /* List of supported devices */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) enum ads7828_chips { ads7828, ads7830 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) /* Client specific data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) struct ads7828_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	struct regmap *regmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	u8 cmd_byte;			/* Command byte without channel bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	unsigned int lsb_resol;		/* Resolution of the ADC sample LSB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) /* Command byte C2,C1,C0 - see datasheet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) static inline u8 ads7828_cmd_byte(u8 cmd, int ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	return cmd | (((ch >> 1) | (ch & 0x01) << 2) << 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /* sysfs callback function */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) static ssize_t ads7828_in_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 			       struct device_attribute *da, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	struct ads7828_data *data = dev_get_drvdata(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	u8 cmd = ads7828_cmd_byte(data->cmd_byte, attr->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	unsigned int regval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	err = regmap_read(data->regmap, cmd, &regval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	return sprintf(buf, "%d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		       DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) static SENSOR_DEVICE_ATTR_RO(in0_input, ads7828_in, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) static SENSOR_DEVICE_ATTR_RO(in1_input, ads7828_in, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) static SENSOR_DEVICE_ATTR_RO(in2_input, ads7828_in, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) static SENSOR_DEVICE_ATTR_RO(in3_input, ads7828_in, 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static SENSOR_DEVICE_ATTR_RO(in4_input, ads7828_in, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static SENSOR_DEVICE_ATTR_RO(in5_input, ads7828_in, 5);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static SENSOR_DEVICE_ATTR_RO(in6_input, ads7828_in, 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) static SENSOR_DEVICE_ATTR_RO(in7_input, ads7828_in, 7);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) static struct attribute *ads7828_attrs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	&sensor_dev_attr_in0_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	&sensor_dev_attr_in1_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	&sensor_dev_attr_in2_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	&sensor_dev_attr_in3_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	&sensor_dev_attr_in4_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	&sensor_dev_attr_in5_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	&sensor_dev_attr_in6_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	&sensor_dev_attr_in7_input.dev_attr.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) ATTRIBUTE_GROUPS(ads7828);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) static const struct regmap_config ads2828_regmap_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	.reg_bits = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	.val_bits = 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) static const struct regmap_config ads2830_regmap_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	.reg_bits = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	.val_bits = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) static const struct i2c_device_id ads7828_device_ids[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) static int ads7828_probe(struct i2c_client *client)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	struct device *dev = &client->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	struct ads7828_platform_data *pdata = dev_get_platdata(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	struct ads7828_data *data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	struct device *hwmon_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	unsigned int vref_mv = ADS7828_INT_VREF_MV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	unsigned int vref_uv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	bool diff_input = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	bool ext_vref = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	unsigned int regval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	enum ads7828_chips chip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	struct regulator *reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	data = devm_kzalloc(dev, sizeof(struct ads7828_data), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	if (!data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if (pdata) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		diff_input = pdata->diff_input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		ext_vref = pdata->ext_vref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		if (ext_vref && pdata->vref_mv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 			vref_mv = pdata->vref_mv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	} else if (dev->of_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		diff_input = of_property_read_bool(dev->of_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 						   "ti,differential-input");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		reg = devm_regulator_get_optional(dev, "vref");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		if (!IS_ERR(reg)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			vref_uv = regulator_get_voltage(reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			if (vref_mv < ADS7828_EXT_VREF_MV_MIN ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 			    vref_mv > ADS7828_EXT_VREF_MV_MAX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 				return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 			ext_vref = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	if (client->dev.of_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		chip = (enum ads7828_chips)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 			of_device_get_match_data(&client->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		chip = i2c_match_id(ads7828_device_ids, client)->driver_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	/* Bound Vref with min/max values */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			    ADS7828_EXT_VREF_MV_MAX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	/* ADS7828 uses 12-bit samples, while ADS7830 is 8-bit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	if (chip == ads7828) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		data->regmap = devm_regmap_init_i2c(client,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 						    &ads2828_regmap_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		data->regmap = devm_regmap_init_i2c(client,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 						    &ads2830_regmap_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	if (IS_ERR(data->regmap))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		return PTR_ERR(data->regmap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	data->cmd_byte = ext_vref ? ADS7828_CMD_PD1 : ADS7828_CMD_PD3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	if (!diff_input)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		data->cmd_byte |= ADS7828_CMD_SD_SE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	 * Datasheet specifies internal reference voltage is disabled by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	 * default. The internal reference voltage needs to be enabled and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	 * voltage needs to settle before getting valid ADC data. So perform a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	 * dummy read to enable the internal reference voltage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	if (!ext_vref)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		regmap_read(data->regmap, data->cmd_byte, &regval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 							   data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 							   ads7828_groups);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	return PTR_ERR_OR_ZERO(hwmon_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) static const struct i2c_device_id ads7828_device_ids[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	{ "ads7828", ads7828 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	{ "ads7830", ads7830 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) MODULE_DEVICE_TABLE(i2c, ads7828_device_ids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) static const struct of_device_id __maybe_unused ads7828_of_match[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		.compatible = "ti,ads7828",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		.data = (void *)ads7828
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		.compatible = "ti,ads7830",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		.data = (void *)ads7830
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) MODULE_DEVICE_TABLE(of, ads7828_of_match);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) static struct i2c_driver ads7828_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		.name = "ads7828",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		.of_match_table = of_match_ptr(ads7828_of_match),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	.id_table = ads7828_device_ids,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	.probe_new = ads7828_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) module_i2c_driver(ads7828_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) MODULE_AUTHOR("Steve Hardy <shardy@redhat.com>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) MODULE_DESCRIPTION("Driver for TI ADS7828 A/D converter and compatibles");