Home
last modified time | relevance | path

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

1234567

/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/iio/adc/
H A Dstm32-dfsdm-adc.c1 // SPDX-License-Identifier: GPL-2.0
3 * This file is the ADC part of the STM32 DFSDM driver
5 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
10 #include <linux/dma-mapping.h>
11 #include <linux/iio/adc/stm32-dfsdm-adc.h>
14 #include <linux/iio/hw-consumer.h>
16 #include <linux/iio/timer/stm32-lptim-trigger.h>
17 #include <linux/iio/timer/stm32-timer-trigger.h>
29 #include "stm32-dfsdm.h"
44 /* Limit filter output resolution to 31 bits. (i.e. sample range is +/-2^30) */
[all …]
H A Dstmpe-adc.c1 // SPDX-License-Identifier: GPL-2.0
3 * STMicroelectronics STMPE811 IIO ADC Driver
5 * 4 channel, 10/12-bit ADC
7 * Copyright (C) 2013-2018 Toradex AG <stefan.agner@toradex.com>
62 struct iio_chan_spec const *chan, int *val) in stmpe_read_voltage() argument
66 mutex_lock(&info->lock); in stmpe_read_voltage()
68 reinit_completion(&info->completion); in stmpe_read_voltage()
70 info->channel = (u8)chan->channel; in stmpe_read_voltage()
72 if (info->channel > STMPE_ADC_LAST_NR) { in stmpe_read_voltage()
73 mutex_unlock(&info->lock); in stmpe_read_voltage()
[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 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 Dviperboard_adc.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Nano River Technologies viperboard IIO ADC driver
27 u8 chan; member
50 struct iio_chan_spec const *chan, in vprbrd_iio_read_raw() argument
56 struct vprbrd_adc *adc = iio_priv(iio_dev); in vprbrd_iio_read_raw() local
57 struct vprbrd *vb = adc->vb; in vprbrd_iio_read_raw()
58 struct vprbrd_adc_msg *admsg = (struct vprbrd_adc_msg *)vb->buf; in vprbrd_iio_read_raw()
62 mutex_lock(&vb->lock); in vprbrd_iio_read_raw()
64 admsg->cmd = VPRBRD_ADC_CMD_GET; in vprbrd_iio_read_raw()
65 admsg->chan = chan->channel; in vprbrd_iio_read_raw()
[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 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 Dadi-axi-adc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Analog Devices Generic AXI ADC IP core
6 * Copyright 2012-2020 Analog Devices Inc.
23 #include <linux/fpga/adi-axi-common.h>
26 #include <linux/iio/buffer-dmaengine.h>
35 /* ADC controls */
48 /* ADC Channel controls */
96 guard(mutex)(&st->lock); in axi_adc_enable()
97 ret = regmap_set_bits(st->regmap, ADI_AXI_REG_RSTN, in axi_adc_enable()
107 ret = regmap_read_poll_timeout(st->regmap, ADI_AXI_ADC_REG_DRP_STATUS, in axi_adc_enable()
[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 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 Dad9467.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Analog Devices AD9467 SPI ADC driver
5 * Copyright 2012-2020 Analog Devices Inc.
32 * ADI High-Speed ADC common spi interface registers
33 * See Application-Note AN-877:
34 * https://www.analog.com/media/en/technical-documentation/application-notes/AN-877.pdf
85 * Analog Devices AD9265 16-Bit, 125/105/80 MSPS ADC
93 * Analog Devices AD9434 12-Bit, 370/500 MSPS ADC
101 * Analog Devices AD9467 16-Bit, 200/250 MSPS ADC
109 * Analog Devices AD9643 14-Bit, 170/210/250 MSPS ADC
[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-adc161s626.c1 // SPDX-License-Identifier: GPL-2.0+
3 * ti-adc161s626.c - Texas Instruments ADC161S626 1-channel differential ADC
5 * ADC Devices Supported:
6 * adc141s626 - 14-bit ADC
7 * adc161s626 - 16-bit ADC
9 * Copyright (C) 2016-2018
25 #define TI_ADC_DRV_NAME "ti-adc161s626"
78 struct iio_chan_spec const *chan, int *val) in ti_adc_read_measurement() argument
82 switch (data->read_size) { in ti_adc_read_measurement()
86 ret = spi_read(data->spi, (void *) &buf, 2); in ti_adc_read_measurement()
[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 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/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/extcon/
H A Dextcon-adc-jack.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/extcon/extcon-adc-jack.c
5 * Analog Jack extcon driver with ADC-based detection capability.
13 * Modified for calling to IIO to get adc by <anish.singh@samsung.com>
24 #include <linux/extcon/extcon-adc-jack.h>
25 #include <linux/extcon-provider.h>
28 * struct adc_jack_data - internal data for adc_jack device driver
32 * @adc_conditions: list of adc value conditions.
38 * @chan: iio channel being queried.
53 struct iio_channel *chan; member
[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 …]
/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/power/supply/
H A Dgeneric-adc-battery.c1 // SPDX-License-Identifier: GPL-2.0
21 #include <linux/devm-helpers.h>
62 schedule_delayed_work(&adc_bat->bat_work, msecs_to_jiffies(0)); in gab_ext_power_changed()
71 * should correspond one-to-one with enum chan_type.
82 if (!adc_bat->charge_finished) in gab_charge_finished()
84 return gpiod_get_value(adc_bat->charge_finished); in gab_charge_finished()
92 ret = iio_read_channel_processed(adc_bat->channel[channel], result); in gab_read_channel()
94 dev_err(&adc_bat->psy->dev, "read channel error: %d\n", ret); in gab_read_channel()
108 val->intval = adc_bat->status; in gab_get_property()
111 return gab_read_channel(adc_bat, GAB_VOLTAGE, &val->intval); in gab_get_property()
[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 …]

1234567