/Linux-v5.15/drivers/iio/adc/ |
D | qcom-spmi-adc5.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include <linux/iio/adc/qcom-vadc-common.h> 23 #include <dt-bindings/iio/qcom,spmi-vadc.h> 104 * struct adc5_channel_prop - ADC channel property. 113 * @avg_samples: ability to provide single result from the ADC 133 * struct adc5_chip - ADC private structure. 136 * @base: base address for the ADC peripheral. 137 * @nchannels: number of ADC channels. 138 * @chan_props: array of ADC channel properties. 141 * @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 | 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 | rn5t618-adc.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * ADC driver for the RICOH RN5T618 power management chip family 28 /* average 4-time conversion mode */ 77 ret = regmap_bulk_read(rn5t618->regmap, reg, data, sizeof(data)); in rn5t618_read_adc_reg() 88 struct rn5t618_adc_data *adc = data; in rn5t618_adc_irq() local 93 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC1, 0); in rn5t618_adc_irq() 94 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC2, 0); in rn5t618_adc_irq() 96 ret = regmap_read(adc->rn5t618->regmap, RN5T618_IR_ADC3, &r); in rn5t618_adc_irq() 98 dev_err(adc->dev, "failed to read IRQ status: %d\n", ret); in rn5t618_adc_irq() 100 regmap_write(adc->rn5t618->regmap, RN5T618_IR_ADC3, 0); in rn5t618_adc_irq() [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 | 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> 100 int (*init_clk_div)(struct device *dev, struct ingenic_adc *adc); 114 struct ingenic_adc *adc = iio_priv(iio_dev); in ingenic_adc_set_adcmd() local 116 mutex_lock(&adc->lock); in ingenic_adc_set_adcmd() 119 readl(adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd() 126 adc->base + JZ_ADC_REG_ADCMD); in ingenic_adc_set_adcmd() [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. 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 …]
|
D | rzg2l_adc.c | 1 // SPDX-License-Identifier: GPL-2.0 7 * Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> 23 #define DRIVER_NAME "rzg2l-adc" 92 static unsigned int rzg2l_adc_readl(struct rzg2l_adc *adc, u32 reg) in rzg2l_adc_readl() argument 94 return readl(adc->base + reg); in rzg2l_adc_readl() 97 static void rzg2l_adc_writel(struct rzg2l_adc *adc, unsigned int reg, u32 val) in rzg2l_adc_writel() argument 99 writel(val, adc->base + reg); in rzg2l_adc_writel() 102 static void rzg2l_adc_pwr(struct rzg2l_adc *adc, bool on) in rzg2l_adc_pwr() argument 106 reg = rzg2l_adc_readl(adc, RZG2L_ADM(0)); in rzg2l_adc_pwr() 111 rzg2l_adc_writel(adc, RZG2L_ADM(0), reg); in rzg2l_adc_pwr() [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 | mt6360-adc.c | 1 // SPDX-License-Identifier: GPL-2.0 60 /* Due to only one set of ADC control, this lock is used to prevent the race condition */ 73 mutex_lock(&mad->adc_lock); in mt6360_adc_read_channel() 75 /* Select the preferred ADC channel */ in mt6360_adc_read_channel() 76 ret = regmap_update_bits(mad->regmap, MT6360_REG_PMUADCRPT1, MT6360_PREFERCH_MASK, in mt6360_adc_read_channel() 82 ret = regmap_raw_write(mad->regmap, MT6360_REG_PMUADCCFG, &adc_enable, sizeof(adc_enable)); in mt6360_adc_read_channel() 86 predict_end_t = ktime_add_ms(mad->last_off_timestamps[channel], 2 * ADC_WAIT_TIME_MS); in mt6360_adc_read_channel() 94 ret = -ERESTARTSYS; in mt6360_adc_read_channel() 100 ret = regmap_raw_read(mad->regmap, MT6360_REG_PMUADCRPT1, rpt, sizeof(rpt)); in mt6360_adc_read_channel() 105 * There are two functions, ZCV and TypeC OTP, running ADC VBAT and TS in in mt6360_adc_read_channel() [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 …]
|
/Linux-v5.15/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.15/drivers/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.15/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 …]
|
D | pm8994.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> 8 thermal-zones { 9 pm8994-thermal { 10 polling-delay-passive = <250>; 11 polling-delay = <1000>; 13 thermal-sensors = <&pm8994_temp>; [all …]
|
/Linux-v5.15/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.15/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.15/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 …]
|