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)  * adcxx.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * The adcxx4s is an AD converter family from National Semiconductor (NS).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright (c) 2008 Marc Pignat <marc.pignat@hevs.ch>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * interface. This driver supports the whole family of devices with name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * ADC<bb><c>S<sss>, where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * * bb is the resolution in number of bits (8, 10, 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * * c is the number of channels (1, 2, 4, 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  *   and 101 for 1 MSPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * Complete datasheets are available at National's website here:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * http://www.national.com/ds/DC/ADC<bb><c>S<sss>.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * Handling of 8, 10 and 12 bits converters are the same, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * unavailable bits are 0 :)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <linux/err.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include <linux/sysfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <linux/hwmon.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <linux/hwmon-sysfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <linux/mod_devicetable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <linux/spi/spi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define DRVNAME		"adcxx"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) struct adcxx {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	struct device *hwmon_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	struct mutex lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	u32 channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	u32 reference; /* in millivolts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) /* sysfs hook function */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) static ssize_t adcxx_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 			  struct device_attribute *devattr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	struct spi_device *spi = to_spi_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	struct adcxx *adc = spi_get_drvdata(spi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	u8 tx_buf[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	u8 rx_buf[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	int status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	u32 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	if (mutex_lock_interruptible(&adc->lock))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		return -ERESTARTSYS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	if (adc->channels == 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		status = spi_read(spi, rx_buf, sizeof(rx_buf));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		tx_buf[0] = attr->index << 3; /* other bits are don't care */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		status = spi_write_then_read(spi, tx_buf, sizeof(tx_buf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 						rx_buf, sizeof(rx_buf));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	if (status < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		dev_warn(dev, "SPI synch. transfer failed with status %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 				status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	value = (rx_buf[0] << 8) + rx_buf[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	dev_dbg(dev, "raw value = 0x%x\n", value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	value = value * adc->reference >> 12;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	status = sprintf(buf, "%d\n", value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	return status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) static ssize_t adcxx_min_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			      struct device_attribute *devattr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	/* The minimum reference is 0 for this chip family */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	return sprintf(buf, "0\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) static ssize_t adcxx_max_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 			      struct device_attribute *devattr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	struct spi_device *spi = to_spi_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	struct adcxx *adc = spi_get_drvdata(spi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	u32 reference;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	if (mutex_lock_interruptible(&adc->lock))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		return -ERESTARTSYS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	reference = adc->reference;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	return sprintf(buf, "%d\n", reference);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static ssize_t adcxx_max_store(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			       struct device_attribute *devattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 			       const char *buf, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	struct spi_device *spi = to_spi_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	struct adcxx *adc = spi_get_drvdata(spi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	unsigned long value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	if (kstrtoul(buf, 10, &value))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	if (mutex_lock_interruptible(&adc->lock))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		return -ERESTARTSYS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	adc->reference = value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) static ssize_t adcxx_name_show(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 			       struct device_attribute *devattr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	return sprintf(buf, "%s\n", to_spi_device(dev)->modalias);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) static struct sensor_device_attribute ad_input[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	SENSOR_ATTR_RO(name, adcxx_name, 0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	SENSOR_ATTR_RO(in_min, adcxx_min, 0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	SENSOR_ATTR_RW(in_max, adcxx_max, 0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	SENSOR_ATTR_RO(in0_input, adcxx, 0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	SENSOR_ATTR_RO(in1_input, adcxx, 1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	SENSOR_ATTR_RO(in2_input, adcxx, 2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	SENSOR_ATTR_RO(in3_input, adcxx, 3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	SENSOR_ATTR_RO(in4_input, adcxx, 4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	SENSOR_ATTR_RO(in5_input, adcxx, 5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	SENSOR_ATTR_RO(in6_input, adcxx, 6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	SENSOR_ATTR_RO(in7_input, adcxx, 7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) /*----------------------------------------------------------------------*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) static int adcxx_probe(struct spi_device *spi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	int channels = spi_get_device_id(spi)->driver_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	struct adcxx *adc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	int status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	adc = devm_kzalloc(&spi->dev, sizeof(*adc), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	if (!adc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	/* set a default value for the reference */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	adc->reference = 3300;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	adc->channels = channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	mutex_init(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	mutex_lock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	spi_set_drvdata(spi, adc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	for (i = 0; i < 3 + adc->channels; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		status = device_create_file(&spi->dev, &ad_input[i].dev_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		if (status) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			dev_err(&spi->dev, "device_create_file failed.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 			goto out_err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	adc->hwmon_dev = hwmon_device_register(&spi->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if (IS_ERR(adc->hwmon_dev)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		dev_err(&spi->dev, "hwmon_device_register failed.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		status = PTR_ERR(adc->hwmon_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		goto out_err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) out_err:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	for (i--; i >= 0; i--)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		device_remove_file(&spi->dev, &ad_input[i].dev_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	return status;
^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) static int adcxx_remove(struct spi_device *spi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	struct adcxx *adc = spi_get_drvdata(spi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	mutex_lock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	hwmon_device_unregister(adc->hwmon_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	for (i = 0; i < 3 + adc->channels; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		device_remove_file(&spi->dev, &ad_input[i].dev_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	mutex_unlock(&adc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) static const struct spi_device_id adcxx_ids[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	{ "adcxx1s", 1 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	{ "adcxx2s", 2 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	{ "adcxx4s", 4 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	{ "adcxx8s", 8 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) MODULE_DEVICE_TABLE(spi, adcxx_ids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static struct spi_driver adcxx_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		.name	= "adcxx",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	.id_table = adcxx_ids,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	.probe	= adcxx_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	.remove	= adcxx_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) module_spi_driver(adcxx_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) MODULE_AUTHOR("Marc Pignat");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) MODULE_DESCRIPTION("National Semiconductor adcxx8sxxx Linux driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) MODULE_LICENSE("GPL");