Lines Matching +full:mux +full:- +full:reg +full:- +full:masks
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ads7871 - driver for TI ADS7871 A/D converter
22 #define REG_GAIN_MUX 4 /*Gain/Mux Register*/
34 /*Instruction Bit masks*/
40 /*bit masks for Rev/Oscillator Control Register*/
44 #define MUX_G_BV 4 /*allows for reg = (gain << MUX_G_BV) | ...*/
47 /*bit masks for Rev/Oscillator Control Register*/
59 #include <linux/hwmon-sysfs.h>
69 static int ads7871_read_reg8(struct spi_device *spi, int reg) in ads7871_read_reg8() argument
72 reg = reg | INST_READ_BM; in ads7871_read_reg8()
73 ret = spi_w8r8(spi, reg); in ads7871_read_reg8()
77 static int ads7871_read_reg16(struct spi_device *spi, int reg) in ads7871_read_reg16() argument
80 reg = reg | INST_READ_BM | INST_16BIT_BM; in ads7871_read_reg16()
81 ret = spi_w8r16(spi, reg); in ads7871_read_reg16()
85 static int ads7871_write_reg8(struct spi_device *spi, int reg, u8 val) in ads7871_write_reg8() argument
87 u8 tmp[2] = {reg, val}; in ads7871_write_reg8()
95 struct spi_device *spi = pdata->spi; in voltage_show()
100 channel = attr->index; in voltage_show()
129 return -1; in voltage_show()
158 struct device *dev = &spi->dev; in ads7871_probe()
165 spi->mode = (SPI_MODE_0); in ads7871_probe()
166 spi->bits_per_word = 8; in ads7871_probe()
182 return -ENODEV; in ads7871_probe()
186 return -ENOMEM; in ads7871_probe()
188 pdata->spi = spi; in ads7871_probe()
190 hwmon_dev = devm_hwmon_device_register_with_groups(dev, spi->modalias, in ads7871_probe()