Home
last modified time | relevance | path

Searched +full:adc +full:- +full:chan (Results 1 – 25 of 138) sorted by relevance

123456

/linux/drivers/iio/adc/
H A Dad7944.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Analog Devices AD7944/85/86 PulSAR ADC family driver.
26 #include <linux/iio/buffer-dmaengine.h>
40 /* datasheet calls this "4-wire mode" */
42 /* datasheet calls this "3-wire mode" (not related to SPI_3WIRE!) */
48 /* maps adi,spi-mode property value to enum */
67 /* Chip-specific timing specifications. */
73 /* Indicates TURBO is hard-wired to be always enabled. */
118 * AD7944_DEFINE_CHIP_INFO - Define a chip info structure for a specific chip
170 * - There is no soft timestamp since everything is done in hardware.
[all …]
H A Daxp20x_adc.c1 // SPDX-License-Identifier: GPL-2.0-only
2 /* ADC driver for AXP20X and AXP22X PMICs
5 * Quentin Schulz <quentin.schulz@free-electrons.com>
159 IIO_MAP("vbus_v", "axp20x-usb-power-supply", "vbus_v"),
160 IIO_MAP("vbus_i", "axp20x-usb-power-supply", "vbus_i"),
161 IIO_MAP("acin_v", "axp20x-ac-power-supply", "acin_v"),
162 IIO_MAP("acin_i", "axp20x-ac-power-supply", "acin_i"),
163 IIO_MAP("batt_v", "axp20x-battery-power-supply", "batt_v"),
164 IIO_MAP("batt_chrg_i", "axp20x-battery-power-supply", "batt_chrg_i"),
165 IIO_MAP("batt_dischrg_i", "axp20x-battery-power-supply", "batt_dischrg_i"),
[all …]
H A Dcc10001_adc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2014-2015 Imagination Technologies Ltd.
47 * As per device specification, wait six clock cycles after power-up to
69 writel(val, adc_dev->reg_base + reg); in cc10001_adc_write_reg()
75 return readl(adc_dev->reg_base + reg); in cc10001_adc_read_reg()
81 ndelay(adc_dev->start_delay_ns); in cc10001_adc_power_up()
146 indio_dev = pf->indio_dev; in cc10001_adc_trigger_h()
148 data = adc_dev->buf; in cc10001_adc_trigger_h()
150 mutex_lock(&adc_dev->lock); in cc10001_adc_trigger_h()
152 if (!adc_dev->shared) in cc10001_adc_trigger_h()
[all …]
H A Dindustrialio-adc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Helpers for parsing common ADC information from a firmware node.
15 #include <linux/iio/adc-helpers.h>
19 * devm_iio_adc_device_alloc_chaninfo_se - allocate and fill iio_chan_spec for ADC
21 * Scan the device node for single-ended ADC channel information. Channel ID is
26 * @dev: Pointer to the ADC device.
35 * failure. Specifically, -ENOENT if no channel nodes were found.
42 struct iio_chan_spec *chan_array, *chan; in devm_iio_adc_device_alloc_chaninfo_se() local
50 return -ENOENT; in devm_iio_adc_device_alloc_chaninfo_se()
55 return -ENOMEM; in devm_iio_adc_device_alloc_chaninfo_se()
[all …]
H A Dingenic-adc.c1 // SPDX-License-Identifier: GPL-2.0
3 * ADC driver for the Ingenic JZ47xx SoCs
4 * Copyright (c) 2019 Artur Rojek <contact@artur-rojek.eu>
6 * based on drivers/mfd/jz4740-adc.c
9 #include <dt-bindings/iio/adc/ingenic,adc.h>
102 int (*init_clk_div)(struct device *dev, struct ingenic_adc *adc);
116 struct ingenic_adc *adc = iio_priv(iio_dev); in ingenic_adc_set_adcmd() local
118 mutex_lock(&adc->lock); in ingenic_adc_set_adcmd()
121 readl(adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
128 adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
[all …]
H A Dmt6370-adc.c1 // SPDX-License-Identifier: GPL-2.0-only
20 #include <dt-bindings/iio/adc/mediatek,mt6370_adc.h>
60 * This mutex lock is for preventing the different ADC channels
67 static int mt6370_adc_read_channel(struct mt6370_adc_data *priv, int chan, in mt6370_adc_read_channel() argument
74 mutex_lock(&priv->adc_lock); in mt6370_adc_read_channel()
78 ret = regmap_write(priv->regmap, MT6370_REG_CHG_ADC, reg_val); in mt6370_adc_read_channel()
84 ret = regmap_read_poll_timeout(priv->regmap, in mt6370_adc_read_channel()
90 dev_err(priv->dev, "Failed to read ADC register (%d)\n", ret); in mt6370_adc_read_channel()
94 ret = regmap_raw_read(priv->regmap, MT6370_REG_ADC_DATA_H, in mt6370_adc_read_channel()
103 mutex_unlock(&priv->adc_lock); in mt6370_adc_read_channel()
[all …]
H A Dat91_adc.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for the ADC present in the Atmel AT91 evaluation boards.
38 #define AT91_ADC_TSAMOD (3 << 0) /* ADC mode */
39 #define AT91_ADC_TSAMOD_ADC_ONLY_MODE (0 << 0) /* ADC Mode */
103 #define AT91_ADC_ACR_PENDETSENS (0x3 << 0) /* pull-up resistor */
137 (st->registers->channel_base + (ch * 4))
139 (readl_relaxed(st->reg_base + reg))
141 (writel_relaxed(val, st->reg_base + reg))
161 * struct at91_adc_trigger - description of triggers
163 * @value: value to set in the ADC's trigger setup register
[all …]
H A Dintel_mrfld_adc.c1 // SPDX-License-Identifier: GPL-2.0
3 * ADC driver for Basin Cove PMIC
65 struct mrfld_adc *adc = iio_priv(indio_dev); in mrfld_adc_thread_isr() local
67 complete(&adc->completion); in mrfld_adc_thread_isr()
72 struct iio_chan_spec const *chan, in mrfld_adc_single_conv() argument
75 struct mrfld_adc *adc = iio_priv(indio_dev); in mrfld_adc_single_conv() local
76 struct regmap *regmap = adc->regmap; in mrfld_adc_single_conv()
82 reinit_completion(&adc->completion); in mrfld_adc_single_conv()
93 req = mrfld_adc_requests[chan->channel]; in mrfld_adc_single_conv()
98 time_left = wait_for_completion_interruptible_timeout(&adc->completion, in mrfld_adc_single_conv()
[all …]
H A Dmt6359-auxadc.c1 // SPDX-License-Identifier: GPL-2.0-only
25 #include <dt-bindings/iio/adc/mediatek,mt6357-auxadc.h>
26 #include <dt-bindings/iio/adc/mediatek,mt6358-auxadc.h>
27 #include <dt-bindings/iio/adc/mediatek,mt6359-auxadc.h>
28 #include <dt-bindings/iio/adc/mediatek,mt6363-auxadc.h>
103 * struct mt6359_auxadc - Main driver structure
119 * struct mtk_pmic_auxadc_chan - PMIC AUXADC channel data
143 * struct mtk_pmic_auxadc_info - PMIC specific chip info
145 * @channels: IIO specification of ADC channels
146 * @num_channels: Number of ADC channels
[all …]
H A Dmax77541-adc.c1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * ADI MAX77541 ADC Driver with IIO interface
30 struct iio_chan_spec const *chan, in max77541_adc_offset() argument
33 switch (chan->channel) { in max77541_adc_offset()
38 return -EINVAL; in max77541_adc_offset()
43 struct iio_chan_spec const *chan, in max77541_adc_scale() argument
50 switch (chan->channel) { in max77541_adc_scale()
74 return -EINVAL; in max77541_adc_scale()
82 return -EINVAL; in max77541_adc_scale()
87 struct iio_chan_spec const *chan, in max77541_adc_raw() argument
[all …]
H A Dmt6360-adc.c1 // SPDX-License-Identifier: GPL-2.0
61 /* Due to only one set of ADC control, this lock is used to prevent the race condition */
74 mutex_lock(&mad->adc_lock); in mt6360_adc_read_channel()
76 /* Select the preferred ADC channel */ in mt6360_adc_read_channel()
77 ret = regmap_update_bits(mad->regmap, MT6360_REG_PMUADCRPT1, MT6360_PREFERCH_MASK, in mt6360_adc_read_channel()
83 ret = regmap_raw_write(mad->regmap, MT6360_REG_PMUADCCFG, &adc_enable, sizeof(adc_enable)); in mt6360_adc_read_channel()
87 predict_end_t = ktime_add_ms(mad->last_off_timestamps[channel], 2 * ADC_WAIT_TIME_MS); in mt6360_adc_read_channel()
95 ret = -ERESTARTSYS; in mt6360_adc_read_channel()
101 ret = regmap_raw_read(mad->regmap, MT6360_REG_PMUADCRPT1, rpt, sizeof(rpt)); in mt6360_adc_read_channel()
106 * There are two functions, ZCV and TypeC OTP, running ADC VBAT and TS in in mt6360_adc_read_channel()
[all …]
H A Dmen_z188_adc.c1 // SPDX-License-Identifier: GPL-2.0-only
48 struct iio_chan_spec const *chan, in z188_iio_read_raw() argument
53 struct z188_adc *adc = iio_priv(iio_dev); in z188_iio_read_raw() local
59 tmp = readw(adc->base + chan->channel * 4); in z188_iio_read_raw()
62 dev_info(&iio_dev->dev, in z188_iio_read_raw()
63 "Oversampling error on ADC channel %d\n", in z188_iio_read_raw()
64 chan->channel); in z188_iio_read_raw()
65 return -EIO; in z188_iio_read_raw()
71 ret = -EINVAL; in z188_iio_read_raw()
103 struct z188_adc *adc; in men_z188_probe() local
[all …]
H A Dnau7802.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for the Nuvoton NAU7802 ADC
64 #define NAU7802_CHANNEL(chan) { \ argument
67 .channel = (chan), \
68 .scan_index = (chan), \
88 for (i = 0; i < ARRAY_SIZE(st->scale_avail); i++) in nau7802_show_scales()
89 len += scnprintf(buf + len, PAGE_SIZE - len, "0.%09d ", in nau7802_show_scales()
90 st->scale_avail[i]); in nau7802_show_scales()
92 buf[len-1] = '\n'; in nau7802_show_scales()
116 mutex_lock(&st->lock); in nau7802_set_gain()
[all …]
H A Dfsl-imx25-gcq.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014-2015 Pengutronix, Markus Pargmann <mpa@pengutronix.de>
6 * connected to the imx25 ADC.
9 #include <dt-bindings/iio/adc/fsl-imx25-gcq.h>
13 #include <linux/mfd/imx25-tsadc.h>
23 static const char * const driver_name = "mx25-gcq";
55 #define MX25_CQG_CHAN(chan, id) {\ argument
58 .channel = chan,\
87 regmap_read(priv->regs, MX25_ADCQ_SR, &stats); in mx25_gcq_irq()
90 regmap_set_bits(priv->regs, MX25_ADCQ_MR, in mx25_gcq_irq()
[all …]
H A Dti-adc0832.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * ADC0831/ADC0832/ADC0834/ADC0838 8-bit ADC driver
7 * Datasheet: https://www.ti.com/lit/ds/symlink/adc0832-n.pdf
33 * Max size needed: 16x 1 byte ADC data + 8 bytes timestamp
43 #define ADC0832_VOLTAGE_CHANNEL(chan) \ argument
47 .channel = chan, \
50 .scan_index = chan, \
120 static int adc0831_adc_conversion(struct adc0832 *adc) in adc0831_adc_conversion() argument
122 struct spi_device *spi = adc->spi; in adc0831_adc_conversion()
125 ret = spi_read(spi, &adc->rx_buf, 2); in adc0831_adc_conversion()
[all …]
H A Dsun20i-gpadc-iio.c1 // SPDX-License-Identifier: GPL-2.0
3 * GPADC driver for sunxi platforms (D1, T113-S3 and R329)
18 #include <linux/iio/adc-helpers.h>
21 #define SUN20I_GPADC_DRIVER_NAME "sun20i-gpadc"
64 struct iio_chan_spec const *chan, int *val) in sun20i_gpadc_adc_read() argument
69 mutex_lock(&info->lock); in sun20i_gpadc_adc_read()
71 reinit_completion(&info->completion); in sun20i_gpadc_adc_read()
73 if (info->last_channel != chan->channel) { in sun20i_gpadc_adc_read()
74 info->last_channel = chan->channel; in sun20i_gpadc_adc_read()
77 writel(SUN20I_GPADC_CS_EN_ADC_CH(chan->channel), in sun20i_gpadc_adc_read()
[all …]
H A Dqcom-spmi-iadc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
94 * struct iadc_chip - IADC Current ADC device structure.
97 * @base: base offset for the ADC peripheral.
102 * @lock: ADC lock for access to the peripheral.
103 * @complete: ADC notification after end of conversion interrupt is received.
122 ret = regmap_read(iadc->regmap, iadc->base + offset, &val); in iadc_read()
132 return regmap_write(iadc->regmap, iadc->base + offset, data); in iadc_write()
164 u8 mode, sta1, chan, dig, en, req; in iadc_status_show() local
175 ret = iadc_read(iadc, IADC_CH_SEL_CTL, &chan); in iadc_status_show()
[all …]
H A Dlpc18xx_adc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * IIO ADC driver for NXP LPC18xx ADC
8 * - Hardware triggers
9 * - Burst mode
10 * - Interrupts
11 * - DMA
26 /* LPC18XX ADC registers and bits */
69 static int lpc18xx_adc_read_chan(struct lpc18xx_adc *adc, unsigned int ch) in lpc18xx_adc_read_chan() argument
74 reg = adc->cr_reg | BIT(ch) | LPC18XX_ADC_CR_START_NOW; in lpc18xx_adc_read_chan()
75 writel(reg, adc->base + LPC18XX_ADC_CR); in lpc18xx_adc_read_chan()
[all …]
/linux/Documentation/devicetree/bindings/iio/adc/
H A Dti,am3359-adc.yaml1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
3 ---
4 $id: http://devicetree.org/schemas/iio/adc/ti,am3359-adc.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: TI AM3359 ADC
10 - Miquel Raynal <miquel.raynal@bootlin.com>
15 - enum:
16 - ti,am3359-adc
17 - ti,am4372-adc
18 - items:
[all …]
/linux/drivers/comedi/drivers/
H A Ds626.c1 // SPDX-License-Identifier: GPL-2.0+
6 * COMEDI - Linux Control and Measurement Device Interface
10 * Copyright (C) 2002-2004 Sensoray Co., Inc.
68 * struct s626_private - Working data for s626 driver.
69 * @ai_cmd_running: non-zero if ai_cmd is running.
74 * @adc_items: number of items in ADC poll list.
75 * @rps_buf: DMA buffer used to hold ADC (RPS1) program.
76 * @ana_buf: DMA buffer used to receive ADC data and hold DAC data.
98 #define S626_INDXMASK(C) (1 << (((C) > 2) ? ((C) * 2 - 1) : ((C) * 2 + 4)))
110 writel(val, dev->mmio + reg); in s626_mc_enable()
[all …]
/linux/drivers/iio/light/
H A Dsi1133.c1 // SPDX-License-Identifier: GPL-2.0+
3 * si1133.c - Support for Silabs SI1133 combined ambient
6 * Copyright 2018 Maxime Roussin-Belanger <maxime.roussinbelanger@gmail.com>
225 {-2671, 234}
230 {-1022, 36363},
232 { -367, 57909},
233 {-1774, 38240},
234 { -608, 46775},
235 {-1503, 51831},
236 {-1886, 58928}
[all …]
H A Dtsl2563.c1 // SPDX-License-Identifier: GPL-2.0-only
125 struct i2c_client *client = chip->client; in tsl2563_set_power()
139 struct i2c_client *client = chip->client; in tsl2563_get_power()
153 ret = i2c_smbus_write_byte_data(chip->client, in tsl2563_configure()
155 chip->gainlevel->gaintime); in tsl2563_configure()
158 ret = i2c_smbus_write_word_data(chip->client, in tsl2563_configure()
160 chip->high_thres); in tsl2563_configure()
163 ret = i2c_smbus_write_word_data(chip->client, in tsl2563_configure()
165 chip->low_thres); in tsl2563_configure()
195 return ret ? 0 : -ENODEV; in tsl2563_detect()
[all …]
/linux/drivers/iio/addac/
H A Dstx104.c1 // SPDX-License-Identifier: GPL-2.0-only
23 #define STX104_OUT_CHAN(chan) { \ argument
25 .channel = chan, \
30 #define STX104_IN_CHAN(chan, diff) { \ argument
32 .channel = chan, \
33 .channel2 = chan, \
64 /* ADC Channel */
70 /* ADC Status */
75 /* ADC Control */
79 /* ADC Configuration */
[all …]
/linux/drivers/iio/temperature/
H A Dltc2983.c1 // SPDX-License-Identifier: GPL-2.0
3 * Analog Devices LTC2983 Multi-Sensor Digital Temperature Measurement System
59 #define LTC2983_CHAN_START_ADDR(chan) \ argument
60 (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)
61 #define LTC2983_CHAN_RES_ADDR(chan) \ argument
62 (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG)
247 u32 chan; member
312 * instance a resolution of 2^-10 means we have 10 fractional bits.
326 s64 __res = -(s32)val; in __convert_to_raw_sign()
330 return (u32)-__res; in __convert_to_raw_sign()
[all …]
/linux/drivers/macintosh/
H A Dwindfarm_ad7417_sensor.c1 // SPDX-License-Identifier: GPL-2.0-only
38 struct wf_ad7417_priv *pv = sr->priv; in wf_ad7417_temp_get()
44 mutex_lock(&pv->lock); in wf_ad7417_temp_get()
48 rc = i2c_master_send(pv->i2c, buf, 1); in wf_ad7417_temp_get()
51 rc = i2c_master_recv(pv->i2c, buf, 2); in wf_ad7417_temp_get()
55 /* Read a a 16-bit signed value */ in wf_ad7417_temp_get()
58 /* Convert 8.8-bit to 16.16 fixed point */ in wf_ad7417_temp_get()
61 mutex_unlock(&pv->lock); in wf_ad7417_temp_get()
65 mutex_unlock(&pv->lock); in wf_ad7417_temp_get()
66 return -1; in wf_ad7417_temp_get()
[all …]

123456