Home
last modified time | relevance | path

Searched full:adc (Results 1 – 25 of 2140) sorted by relevance

12345678910>>...86

/kernel/linux/linux-5.10/drivers/iio/adc/
Dpalmas_gpadc.c3 * palmas-adc.c -- TI PALMAS GPADC.
139 static int palmas_disable_auto_conversion(struct palmas_gpadc *adc) in palmas_disable_auto_conversion() argument
143 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
148 dev_err(adc->dev, "GPADC_CTRL1 update failed: %d\n", ret); in palmas_disable_auto_conversion()
152 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
158 dev_err(adc->dev, "AUTO_CTRL update failed: %d\n", ret); in palmas_disable_auto_conversion()
164 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
168 dev_err(adc->dev, "GPADC_CTRL1 update failed: %d\n", ret); in palmas_disable_auto_conversion()
175 struct palmas_gpadc *adc = data; in palmas_gpadc_irq() local
177 complete(&adc->conv_completion); in palmas_gpadc_irq()
[all …]
Dstm32-adc.c3 * This file is part of STM32 ADC driver
29 #include "stm32-adc-core.h"
34 /* BOOST bit must be set on STM32H7 when ADC clock is above 20MHz */
81 * struct stm32_adc_trig_info - ADC trigger info
91 * struct stm32_adc_calib - optional adc calibration data
105 * struct stm32_adc_regs - stm32 ADC misc registers & bitfield desc
158 * @smp_cycles: programmable sampling time (ADC clock cycles)
175 * struct stm32_adc - private data of each ADC IIO instance
176 * @common: reference to ADC block common data
177 * @offset: ADC instance register offset in ADC block
[all …]
Dmcp3911.c57 static int mcp3911_read(struct mcp3911 *adc, u8 reg, u32 *val, u8 len) in mcp3911_read() argument
61 reg = MCP3911_REG_READ(reg, adc->dev_addr); in mcp3911_read()
62 ret = spi_write_then_read(adc->spi, &reg, 1, val, len); in mcp3911_read()
68 dev_dbg(&adc->spi->dev, "reading 0x%x from register 0x%x\n", *val, in mcp3911_read()
73 static int mcp3911_write(struct mcp3911 *adc, u8 reg, u32 val, u8 len) in mcp3911_write() argument
75 dev_dbg(&adc->spi->dev, "writing 0x%x to register 0x%x\n", val, reg); in mcp3911_write()
79 val |= MCP3911_REG_WRITE(reg, adc->dev_addr); in mcp3911_write()
81 return spi_write(adc->spi, &val, len + 1); in mcp3911_write()
84 static int mcp3911_update(struct mcp3911 *adc, u8 reg, u32 mask, in mcp3911_update() argument
90 ret = mcp3911_read(adc, reg, &tmp, len); in mcp3911_update()
[all …]
Dti-adc12138.c3 * ADC12130/ADC12132/ADC12138 12-bit plus sign ADC driver
51 * Maximum size needed: 16x 2 bytes ADC data + 8 bytes timestamp.
127 static int adc12138_mode_programming(struct adc12138 *adc, u8 mode, in adc12138_mode_programming() argument
131 .tx_buf = adc->tx_buf, in adc12138_mode_programming()
132 .rx_buf = adc->rx_buf, in adc12138_mode_programming()
138 if (adc->id != adc12138) in adc12138_mode_programming()
141 adc->tx_buf[0] = mode; in adc12138_mode_programming()
143 ret = spi_sync_transfer(adc->spi, &xfer, 1); in adc12138_mode_programming()
147 memcpy(rx_buf, adc->rx_buf, len); in adc12138_mode_programming()
152 static int adc12138_read_status(struct adc12138 *adc) in adc12138_read_status() argument
[all …]
Dingenic-adc.c3 * ADC driver for the Ingenic JZ47xx SoCs
6 * based on drivers/mfd/jz4740-adc.c
9 #include <dt-bindings/iio/adc/ingenic,adc.h>
98 int (*init_clk_div)(struct device *dev, struct ingenic_adc *adc);
112 struct ingenic_adc *adc = iio_priv(iio_dev); in ingenic_adc_set_adcmd() local
114 mutex_lock(&adc->lock); in ingenic_adc_set_adcmd()
117 readl(adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
124 adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
130 adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
138 adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd()
[all …]
Dstm32-dfsdm-adc.c3 * This file is the ADC part of the STM32 DFSDM driver
11 #include <linux/iio/adc/stm32-dfsdm-adc.h>
77 /* ADC specific */
315 struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); in stm32_dfsdm_compute_all_osrs() local
316 struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id]; in stm32_dfsdm_compute_all_osrs()
336 struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); in stm32_dfsdm_start_channel() local
337 struct regmap *regmap = adc->dfsdm->regmap; in stm32_dfsdm_start_channel()
342 for_each_set_bit(bit, &adc->smask, sizeof(adc->smask) * BITS_PER_BYTE) { in stm32_dfsdm_start_channel()
356 struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); in stm32_dfsdm_stop_channel() local
357 struct regmap *regmap = adc->dfsdm->regmap; in stm32_dfsdm_stop_channel()
[all …]
DKconfig3 # ADC drivers
25 tristate "Analog Devices AD7091R5 ADC Driver"
29 Say yes here to build support for Analog Devices AD7091R-5 ADC.
37 SPI analog to digital converters (ADC).
43 tristate "Analog Devices AD7190 AD7192 AD7193 AD7195 ADC driver"
48 AD7192, AD7193 or AD7195 SPI analog to digital converters (ADC).
55 tristate "Analog Devices AD7265/AD7266 ADC driver"
68 tristate "Analog Devices AD7291 ADC driver"
72 8 Channel ADC with temperature sensor.
78 tristate "Analog Devices AD7292 ADC driver"
[all …]
Dlpc18xx_adc.c3 * IIO ADC driver for NXP LPC18xx ADC
27 /* LPC18XX ADC registers and bits */
70 static int lpc18xx_adc_read_chan(struct lpc18xx_adc *adc, unsigned int ch) in lpc18xx_adc_read_chan() argument
75 reg = adc->cr_reg | BIT(ch) | LPC18XX_ADC_CR_START_NOW; in lpc18xx_adc_read_chan()
76 writel(reg, adc->base + LPC18XX_ADC_CR); in lpc18xx_adc_read_chan()
78 ret = readl_poll_timeout(adc->base + LPC18XX_ADC_GDR, reg, in lpc18xx_adc_read_chan()
81 dev_warn(adc->dev, "adc read timed out\n"); in lpc18xx_adc_read_chan()
92 struct lpc18xx_adc *adc = iio_priv(indio_dev); in lpc18xx_adc_read_raw() local
96 mutex_lock(&adc->lock); in lpc18xx_adc_read_raw()
97 *val = lpc18xx_adc_read_chan(adc, chan->channel); in lpc18xx_adc_read_raw()
[all …]
Dmax1241.c3 * MAX1241 low-power, 12-bit serial ADC
42 static int max1241_read(struct max1241 *adc) in max1241_read() argument
58 .rx_buf = &adc->data, in max1241_read()
63 return spi_sync_transfer(adc->spi, xfers, ARRAY_SIZE(xfers)); in max1241_read()
71 struct max1241 *adc = iio_priv(indio_dev); in max1241_read_raw() local
75 mutex_lock(&adc->lock); in max1241_read_raw()
77 if (adc->shutdown) { in max1241_read_raw()
78 gpiod_set_value(adc->shutdown, 0); in max1241_read_raw()
80 ret = max1241_read(adc); in max1241_read_raw()
81 gpiod_set_value(adc->shutdown, 1); in max1241_read_raw()
[all …]
/kernel/linux/linux-4.19/drivers/iio/adc/
Dstm32-adc.c3 * This file is part of STM32 ADC driver
28 #include "stm32-adc-core.h"
33 /* BOOST bit must be set on STM32H7 when ADC clock is above 20MHz */
79 * struct stm32_adc_trig_info - ADC trigger info
89 * struct stm32_adc_calib - optional adc calibration data
101 * stm32_adc_regs - stm32 ADC misc registers & bitfield desc
150 * @smp_cycles: programmable sampling time (ADC clock cycles)
167 * struct stm32_adc - private data of each ADC IIO instance
168 * @common: reference to ADC block common data
169 * @offset: ADC instance register offset in ADC block
[all …]
Dpalmas_gpadc.c2 * palmas-adc.c -- TI PALMAS GPADC.
143 static int palmas_disable_auto_conversion(struct palmas_gpadc *adc) in palmas_disable_auto_conversion() argument
147 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
152 dev_err(adc->dev, "GPADC_CTRL1 update failed: %d\n", ret); in palmas_disable_auto_conversion()
156 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
162 dev_err(adc->dev, "AUTO_CTRL update failed: %d\n", ret); in palmas_disable_auto_conversion()
168 ret = palmas_update_bits(adc->palmas, PALMAS_GPADC_BASE, in palmas_disable_auto_conversion()
172 dev_err(adc->dev, "GPADC_CTRL1 update failed: %d\n", ret); in palmas_disable_auto_conversion()
179 struct palmas_gpadc *adc = data; in palmas_gpadc_irq() local
181 complete(&adc->conv_completion); in palmas_gpadc_irq()
[all …]
Dstm32-dfsdm-adc.c3 * This file is the ADC part of the STM32 DFSDM driver
11 #include <linux/iio/adc/stm32-dfsdm-adc.h>
58 /* ADC specific */
310 "st,adc-channels", chan_idx, in stm32_dfsdm_channel_parse_of()
314 " Error parsing 'st,adc-channels' for idx %d\n", in stm32_dfsdm_channel_parse_of()
326 "st,adc-channel-names", chan_idx, in stm32_dfsdm_channel_parse_of()
330 " Error parsing 'st,adc-channel-names' for idx %d\n", in stm32_dfsdm_channel_parse_of()
339 "st,adc-channel-types", chan_idx, in stm32_dfsdm_channel_parse_of()
351 "st,adc-channel-clk-src", chan_idx, in stm32_dfsdm_channel_parse_of()
363 "st,adc-alt-channel", chan_idx, in stm32_dfsdm_channel_parse_of()
[all …]
Dti-adc12138.c2 * ADC12130/ADC12132/ADC12138 12-bit plus sign ADC driver
54 * Maximum size needed: 16x 2 bytes ADC data + 8 bytes timestamp.
130 static int adc12138_mode_programming(struct adc12138 *adc, u8 mode, in adc12138_mode_programming() argument
134 .tx_buf = adc->tx_buf, in adc12138_mode_programming()
135 .rx_buf = adc->rx_buf, in adc12138_mode_programming()
141 if (adc->id != adc12138) in adc12138_mode_programming()
144 adc->tx_buf[0] = mode; in adc12138_mode_programming()
146 ret = spi_sync_transfer(adc->spi, &xfer, 1); in adc12138_mode_programming()
150 memcpy(rx_buf, adc->rx_buf, len); in adc12138_mode_programming()
155 static int adc12138_read_status(struct adc12138 *adc) in adc12138_read_status() argument
[all …]
DKconfig2 # ADC drivers
14 tristate "Analog Devices AD7265/AD7266 ADC driver"
27 tristate "Analog Devices AD7291 ADC driver"
31 8 Channel ADC with temperature sensor.
37 tristate "Analog Devices AD7298 ADC driver"
43 8 Channel ADC with temperature sensor.
56 AD7495, AD7910, AD7920, AD7920 SPI analog to digital converters (ADC).
62 tristate "Analog Devices AD7766/AD7767 ADC driver"
74 tristate "Analog Devices AD7791 ADC driver"
79 AD7790 and AD7791 SPI analog to digital converters (ADC).
[all …]
Dlpc18xx_adc.c2 * IIO ADC driver for NXP LPC18xx ADC
30 /* LPC18XX ADC registers and bits */
73 static int lpc18xx_adc_read_chan(struct lpc18xx_adc *adc, unsigned int ch) in lpc18xx_adc_read_chan() argument
78 reg = adc->cr_reg | BIT(ch) | LPC18XX_ADC_CR_START_NOW; in lpc18xx_adc_read_chan()
79 writel(reg, adc->base + LPC18XX_ADC_CR); in lpc18xx_adc_read_chan()
81 ret = readl_poll_timeout(adc->base + LPC18XX_ADC_GDR, reg, in lpc18xx_adc_read_chan()
84 dev_warn(adc->dev, "adc read timed out\n"); in lpc18xx_adc_read_chan()
95 struct lpc18xx_adc *adc = iio_priv(indio_dev); in lpc18xx_adc_read_raw() local
99 mutex_lock(&adc->lock); in lpc18xx_adc_read_raw()
100 *val = lpc18xx_adc_read_chan(adc, chan->channel); in lpc18xx_adc_read_raw()
[all …]
/kernel/linux/linux-5.10/arch/arm/mach-s3c/
Dadc.c7 // Samsung ADC device core
22 #include "regs-adc.h"
23 #include <linux/soc/samsung/s3c-adc.h>
25 /* This driver is designed to control the usage of the ADC block between
83 static inline void s3c_adc_convert(struct adc_device *adc) in s3c_adc_convert() argument
85 unsigned con = readl(adc->regs + S3C2410_ADCCON); in s3c_adc_convert()
88 writel(con, adc->regs + S3C2410_ADCCON); in s3c_adc_convert()
91 static inline void s3c_adc_select(struct adc_device *adc, in s3c_adc_select() argument
94 unsigned con = readl(adc->regs + S3C2410_ADCCON); in s3c_adc_select()
95 enum s3c_cpu_type cpu = platform_get_device_id(adc->pdev)->driver_data; in s3c_adc_select()
[all …]
/kernel/linux/linux-4.19/arch/arm/plat-samsung/
Dadc.c7 // Samsung ADC device core
22 #include <plat/regs-adc.h>
23 #include <plat/adc.h>
25 /* This driver is designed to control the usage of the ADC block between
83 static inline void s3c_adc_convert(struct adc_device *adc) in s3c_adc_convert() argument
85 unsigned con = readl(adc->regs + S3C2410_ADCCON); in s3c_adc_convert()
88 writel(con, adc->regs + S3C2410_ADCCON); in s3c_adc_convert()
91 static inline void s3c_adc_select(struct adc_device *adc, in s3c_adc_select() argument
94 unsigned con = readl(adc->regs + S3C2410_ADCCON); in s3c_adc_select()
95 enum s3c_cpu_type cpu = platform_get_device_id(adc->pdev)->driver_data; in s3c_adc_select()
[all …]
/kernel/linux/linux-4.19/Documentation/devicetree/bindings/iio/adc/
Dsamsung,exynos-adc.txt3 The devicetree bindings are for the new ADC driver written for
7 1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
9 2. Add ADC driver under iio/adc framework
13 - compatible: Must be "samsung,exynos-adc-v1"
15 Must be "samsung,exynos-adc-v2" for
17 Must be "samsung,exynos3250-adc" for
18 controllers compatible with ADC of Exynos3250.
19 Must be "samsung,exynos4212-adc" for
20 controllers compatible with ADC of Exynos4212 and Exynos4412.
21 Must be "samsung,exynos7-adc" for
[all …]
Dst,stm32-adc.txt1 STMicroelectronics STM32 ADC device driver
3 STM32 ADC is a successive approximation analog-to-digital converter.
5 in single, continuous, scan or discontinuous mode. Result of the ADC is
12 Each STM32 ADC block can have up to 3 ADC instances.
21 Contents of a stm32 adc root node:
25 "st,stm32f4-adc-core"
26 "st,stm32h7-adc-core"
27 "st,stm32mp1-adc-core"
28 - reg: Offset and length of the ADC block register set.
29 - interrupts: One or more interrupts for ADC block. Some parts like stm32f4
[all …]
Dat91_adc.txt1 * AT91's Analog to Digital Converter (ADC)
4 - compatible: Should be "atmel,<chip>-adc"
6 - reg: Should contain ADC registers location and length
7 - interrupts: Should contain the IRQ line for the ADC
11 - atmel,adc-channels-used: Bitmask of the channels muxed and enabled for this
13 - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
15 - atmel,adc-vref: Reference voltage in millivolts for the conversions
16 - atmel,adc-res: List of resolutions in bits supported by the ADC. List size
18 - atmel,adc-res-names: Contains one identifier string for each resolution
19 in atmel,adc-res property. "lowres" and "highres"
[all …]
/kernel/linux/linux-4.19/drivers/mfd/
Djz4740-adc.c3 * JZ4740 SoC ADC driver
14 * This driver synchronizes access to the JZ4740 ADC core between the
31 #include <linux/jz4740-adc.h>
83 /* Refcounting for the ADC clock is done in here instead of in the clock
86 static inline void jz4740_adc_clk_enable(struct jz4740_adc *adc) in jz4740_adc_clk_enable() argument
88 if (atomic_inc_return(&adc->clk_ref) == 1) in jz4740_adc_clk_enable()
89 clk_prepare_enable(adc->clk); in jz4740_adc_clk_enable()
92 static inline void jz4740_adc_clk_disable(struct jz4740_adc *adc) in jz4740_adc_clk_disable() argument
94 if (atomic_dec_return(&adc->clk_ref) == 0) in jz4740_adc_clk_disable()
95 clk_disable_unprepare(adc->clk); in jz4740_adc_clk_disable()
[all …]
Dpcf50633-adc.c1 /* NXP PCF50633 ADC Driver
15 * NOTE: This driver does not yet support subtractive ADC mode, which means
27 #include <linux/mfd/pcf50633/adc.h>
66 /* start ADC conversion on selected channel */ in adc_setup()
73 struct pcf50633_adc *adc = __to_adc(pcf); in trigger_next_adc_job_if_any() local
76 head = adc->queue_head; in trigger_next_adc_job_if_any()
78 if (!adc->queue[head]) in trigger_next_adc_job_if_any()
81 adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg); in trigger_next_adc_job_if_any()
87 struct pcf50633_adc *adc = __to_adc(pcf); in adc_enqueue_request() local
90 mutex_lock(&adc->queue_mutex); in adc_enqueue_request()
[all …]
/kernel/linux/linux-5.10/drivers/mfd/
Dpcf50633-adc.c2 /* NXP PCF50633 ADC Driver
11 * NOTE: This driver does not yet support subtractive ADC mode, which means
23 #include <linux/mfd/pcf50633/adc.h>
62 /* start ADC conversion on selected channel */ in adc_setup()
69 struct pcf50633_adc *adc = __to_adc(pcf); in trigger_next_adc_job_if_any() local
72 head = adc->queue_head; in trigger_next_adc_job_if_any()
74 if (!adc->queue[head]) in trigger_next_adc_job_if_any()
77 adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg); in trigger_next_adc_job_if_any()
83 struct pcf50633_adc *adc = __to_adc(pcf); in adc_enqueue_request() local
86 mutex_lock(&adc->queue_mutex); in adc_enqueue_request()
[all …]
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/iio/adc/
Dst,stm32-adc.yaml4 $id: "http://devicetree.org/schemas/iio/adc/st,stm32-adc.yaml#"
7 title: STMicroelectronics STM32 ADC bindings
10 STM32 ADC is a successive approximation analog-to-digital converter.
12 in single, continuous, scan or discontinuous mode. Result of the ADC is
19 Each STM32 ADC block can have up to 3 ADC instances.
27 - st,stm32f4-adc-core
28 - st,stm32h7-adc-core
29 - st,stm32mp1-adc-core
36 One or more interrupts for ADC block, depending on part used:
37 - stm32f4 and stm32h7 share a common ADC interrupt line.
[all …]
Dat91_adc.txt1 * AT91's Analog to Digital Converter (ADC)
4 - compatible: Should be "atmel,<chip>-adc"
6 - reg: Should contain ADC registers location and length
7 - interrupts: Should contain the IRQ line for the ADC
11 - atmel,adc-channels-used: Bitmask of the channels muxed and enabled for this
13 - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
15 - atmel,adc-vref: Reference voltage in millivolts for the conversions
16 - atmel,adc-res: List of resolutions in bits supported by the ADC. List size
18 - atmel,adc-res-names: Contains one identifier string for each resolution
19 in atmel,adc-res property. "lowres" and "highres"
[all …]

12345678910>>...86