/Linux-v5.10/drivers/iio/adc/ |
D | qcom-spmi-adc5.c | 1 // SPDX-License-Identifier: GPL-2.0 21 #include <dt-bindings/iio/qcom,spmi-vadc.h> 22 #include "qcom-vadc-common.h" 103 * struct adc5_channel_prop - ADC channel property. 112 * @avg_samples: ability to provide single result from the ADC 132 * struct adc5_chip - ADC private structure. 135 * @base: base address for the ADC peripheral. 136 * @nchannels: number of ADC channels. 137 * @chan_props: array of ADC channel properties. 140 * @complete: ADC result notification after interrupt is received. [all …]
|
D | mxs-lradc-adc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Freescale MXS LRADC ADC driver 18 #include <linux/mfd/mxs-lradc.h> 43 "mxs-lradc-channel0", 44 "mxs-lradc-channel1", 45 "mxs-lradc-channel2", 46 "mxs-lradc-channel3", 47 "mxs-lradc-channel4", 48 "mxs-lradc-channel5", 52 "mxs-lradc-thresh0", [all …]
|
D | stm32-dfsdm-adc.c | 1 // 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> 13 #include <linux/iio/hw-consumer.h> 15 #include <linux/iio/timer/stm32-lptim-trigger.h> 16 #include <linux/iio/timer/stm32-timer-trigger.h> 27 #include "stm32-dfsdm.h" 42 /* Limit filter output resolution to 31 bits. (i.e. sample range is +/-2^30) */ [all …]
|
D | ti_am335x_adc.c | 2 * TI ADC MFD driver 4 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ 34 #include <linux/dma-mapping.h> 40 struct dma_chan *chan; member 62 static unsigned int tiadc_readl(struct tiadc_device *adc, unsigned int reg) in tiadc_readl() argument 64 return readl(adc->mfd_tscadc->tscadc_base + reg); in tiadc_readl() 67 static void tiadc_writel(struct tiadc_device *adc, unsigned int reg, in tiadc_writel() argument 70 writel(val, adc->mfd_tscadc->tscadc_base + reg); in tiadc_writel() 77 step_en = ((1 << adc_dev->channels) - 1); in get_adc_step_mask() 78 step_en <<= TOTAL_STEPS - adc_dev->channels + 1; in get_adc_step_mask() [all …]
|
D | stm32-adc.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * This file is part of STM32 ADC driver 5 * Copyright (C) 2016, STMicroelectronics - All Rights Reserved 11 #include <linux/dma-mapping.h> 15 #include <linux/iio/timer/stm32-lptim-trigger.h> 16 #include <linux/iio/timer/stm32-timer-trigger.h> 29 #include "stm32-adc-core.h" 34 /* BOOST bit must be set on STM32H7 when ADC clock is above 20MHz */ 55 /* extsel - trigger mux selection value */ 81 * struct stm32_adc_trig_info - ADC trigger info [all …]
|
D | stmpe-adc.c | 1 // 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 …]
|
D | rn5t618-adc.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * ADC driver for the RICOH RN5T618 power management chip family 26 /* average 4-time conversion mode */ 75 ret = regmap_bulk_read(rn5t618->regmap, reg, data, sizeof(data)); in rn5t618_read_adc_reg() 86 struct rn5t618_adc_data *adc = data; in rn5t618_adc_irq() local 91 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC1, 0); in rn5t618_adc_irq() 92 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC2, 0); in rn5t618_adc_irq() 94 ret = regmap_read(adc->rn5t618->regmap, RN5T618_IR_ADC3, &r); in rn5t618_adc_irq() 96 dev_err(adc->dev, "failed to read IRQ status: %d\n", ret); in rn5t618_adc_irq() 98 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC3, 0); in rn5t618_adc_irq() [all …]
|
D | ingenic-adc.c | 1 // 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> 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() [all …]
|
D | cc10001_adc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2014-2015 Imagination Technologies Ltd. 48 * As per device specification, wait six clock cycles after power-up to 70 writel(val, adc_dev->reg_base + reg); in cc10001_adc_write_reg() 76 return readl(adc_dev->reg_base + reg); in cc10001_adc_read_reg() 82 ndelay(adc_dev->start_delay_ns); in cc10001_adc_power_up() 147 indio_dev = pf->indio_dev; in cc10001_adc_trigger_h() 149 data = adc_dev->buf; in cc10001_adc_trigger_h() 151 mutex_lock(&adc_dev->lock); in cc10001_adc_trigger_h() 153 if (!adc_dev->shared) in cc10001_adc_trigger_h() [all …]
|
D | viperboard_adc.c | 1 // 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 …]
|
D | intel_mrfld_adc.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * ADC driver for Basin Cove PMIC 64 struct mrfld_adc *adc = iio_priv(indio_dev); in mrfld_adc_thread_isr() local 66 complete(&adc->completion); in mrfld_adc_thread_isr() 71 struct iio_chan_spec const *chan, in mrfld_adc_single_conv() argument 74 struct mrfld_adc *adc = iio_priv(indio_dev); in mrfld_adc_single_conv() local 75 struct regmap *regmap = adc->regmap; in mrfld_adc_single_conv() 81 reinit_completion(&adc->completion); in mrfld_adc_single_conv() 92 req = mrfld_adc_requests[chan->channel]; in mrfld_adc_single_conv() 97 timeout = wait_for_completion_interruptible_timeout(&adc->completion, in mrfld_adc_single_conv() [all …]
|
D | axp20x_adc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* ADC driver for AXP20X and AXP22X PMICs 5 * Quentin Schulz <quentin.schulz@free-electrons.com> 108 .consumer_dev_name = "axp20x-usb-power-supply", 112 .consumer_dev_name = "axp20x-usb-power-supply", 116 .consumer_dev_name = "axp20x-ac-power-supply", 120 .consumer_dev_name = "axp20x-ac-power-supply", 124 .consumer_dev_name = "axp20x-battery-power-supply", 128 .consumer_dev_name = "axp20x-battery-power-supply", 132 .consumer_dev_name = "axp20x-battery-power-supply", [all …]
|
D | at91_adc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Driver for the ADC present in the Atmel AT91 evaluation boards. 40 #define AT91_ADC_TSAMOD (3 << 0) /* ADC mode */ 41 #define AT91_ADC_TSAMOD_ADC_ONLY_MODE (0 << 0) /* ADC Mode */ 105 #define AT91_ADC_ACR_PENDETSENS (0x3 << 0) /* pull-up resistor */ 139 (st->registers->channel_base + (ch * 4)) 141 (readl_relaxed(st->reg_base + reg)) 143 (writel_relaxed(val, st->reg_base + reg)) 157 * struct at91_adc_reg_desc - Various informations relative to registers 163 * @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register [all …]
|
D | men_z188_adc.c | 1 // 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 …]
|
D | ti-adc161s626.c | 1 // 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 …]
|
D | sc27xx_adc.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/nvmem-consumer.h> 21 /* ADC controller registers definition */ 57 /* Timeout (us) for ADC data conversion according to ADC datasheet */ 61 /* Maximum ADC channel number */ 64 /* ADC voltage ratio definition */ 75 * subsystems which will access the unique ADC controller. 91 * According to the datasheet, we can convert one ADC value to one voltage value 93 * should use the small-scale graph, and if more than 1.2v, we should use the 94 * big-scale graph. [all …]
|
D | nau7802.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Driver for the Nuvoton NAU7802 ADC 63 #define NAU7802_CHANNEL(chan) { \ argument 66 .channel = (chan), \ 67 .scan_index = (chan), \ 87 for (i = 0; i < ARRAY_SIZE(st->scale_avail); i++) in nau7802_show_scales() 88 len += scnprintf(buf + len, PAGE_SIZE - len, "0.%09d ", in nau7802_show_scales() 89 st->scale_avail[i]); in nau7802_show_scales() 91 buf[len-1] = '\n'; in nau7802_show_scales() 115 mutex_lock(&st->lock); in nau7802_set_gain() [all …]
|
D | fsl-imx25-gcq.c | 1 // 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> 22 static const char * const driver_name = "mx25-gcq"; 54 #define MX25_CQG_CHAN(chan, id) {\ argument 57 .channel = chan,\ 86 regmap_read(priv->regs, MX25_ADCQ_SR, &stats); in mx25_gcq_irq() 89 regmap_update_bits(priv->regs, MX25_ADCQ_MR, in mx25_gcq_irq() [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/input/touchscreen/ |
D | ti-tsc-adc.txt | 1 * TI - TSC ADC (Touschscreen and analog digital converter) 5 - mfd 7 "ti,am3359-tscadc" for AM335x/AM437x SoCs 8 "ti,am654-tscadc", "ti,am3359-tscadc" for AM654 SoCs 9 - child "tsc" 10 compatible: Should be "ti,am3359-tsc". 13 ti,x-plate-resistance: X plate resistance 14 ti,coordinate-readouts: The sequencer supports a total of 16 22 remaining 4 can be used by the ADC. 23 ti,wire-config: Different boards could have a different order for [all …]
|
/Linux-v5.10/drivers/staging/comedi/drivers/ |
D | s626.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * COMEDI - Linux Control and Measurement Device Interface 10 * Copyright (C) 2002-2004 Sensoray Co., Inc. 69 * struct s626_private - Working data for s626 driver. 70 * @ai_cmd_running: non-zero if ai_cmd is running. 75 * @adc_items: number of items in ADC poll list. 76 * @rps_buf: DMA buffer used to hold ADC (RPS1) program. 77 * @ana_buf: DMA buffer used to receive ADC data and hold DAC data. 99 #define S626_INDXMASK(C) (1 << (((C) > 2) ? ((C) * 2 - 1) : ((C) * 2 + 4))) 111 writel(val, dev->mmio + reg); in s626_mc_enable() [all …]
|
/Linux-v5.10/arch/arm64/boot/dts/qcom/ |
D | pm8916.dtsi | 1 // SPDX-License-Identifier: GPL-2.0 2 #include <dt-bindings/iio/qcom,spmi-vadc.h> 3 #include <dt-bindings/input/linux-event-codes.h> 4 #include <dt-bindings/interrupt-controller/irq.h> 5 #include <dt-bindings/spmi/spmi.h> 10 compatible = "qcom,pm8916", "qcom,spmi-pmic"; 12 #address-cells = <1>; 13 #size-cells = <0>; 16 compatible = "qcom,pm8916-pon"; 18 mode-bootloader = <0x2>; [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/iio/adc/ |
D | qcom,spmi-vadc.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 4 $id: http://devicetree.org/schemas/iio/adc/qcom,spmi-vadc.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Qualcomm's SPMI PMIC ADC 10 - Andy Gross <agross@kernel.org> 11 - Bjorn Andersson <bjorn.andersson@linaro.org> 14 SPMI PMIC voltage ADC (VADC) provides interface to clients to read 15 voltage. The VADC is a 15-bit sigma-delta ADC. 16 SPMI PMIC5/PMIC7 voltage ADC (ADC) provides interface to clients to read [all …]
|
/Linux-v5.10/drivers/extcon/ |
D | extcon-adc-jack.c | 1 // 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 31 * @adc_conditions: list of adc value conditions. 37 * @chan: iio channel being queried. 51 struct iio_channel *chan; member [all …]
|
/Linux-v5.10/include/linux/iio/adc/ |
D | adi-axi-adc.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Analog Devices Generic AXI ADC IP core driver/library 6 * Copyright 2012-2020 Analog Devices Inc. 15 * struct adi_axi_adc_chip_info - Chip specific information 38 * struct adi_axi_adc_conv - data of the ADC attached to the AXI ADC 39 * @chip_info chip info details for the client ADC 40 * @preenable_setup op to run in the client before enabling the AXI ADC 41 * @reg_access IIO debugfs_reg_access hook for the client ADC 42 * @read_raw IIO read_raw hook for the client ADC 43 * @write_raw IIO write_raw hook for the client ADC [all …]
|
/Linux-v5.10/drivers/input/touchscreen/ |
D | resistive-adc-touch.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * ADC generic resistive touchscreen (GRTS) 4 * This is a generic input driver that connects to an ADC 21 #define DRIVER_NAME "resistive-adc-touch" 26 * grts_state - generic resistive touch screen information struct 52 if (st->pressure) in grts_cb() 55 if ((!x && !y) || (st->pressure && (press < st->pressure_min))) { in grts_cb() 57 input_report_key(st->input, BTN_TOUCH, 0); in grts_cb() 58 input_sync(st->input); in grts_cb() 63 touchscreen_report_pos(st->input, &st->prop, x, y, false); in grts_cb() [all …]
|