Home
last modified time | relevance | path

Searched +full:adc +full:- +full:use +full:- +full:res (Results 1 – 25 of 47) sorted by relevance

12

/linux/Documentation/devicetree/bindings/iio/adc/
H A Datmel,sama9260-adc.yaml1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
3 ---
4 $id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: AT91 sama9260 and similar Analog to Digital Converter (ADC)
10 - Alexandre Belloni <alexandre.belloni@bootlin.com>
15 - atmel,at91sam9260-adc
16 - atmel,at91sam9rl-adc
17 - atmel,at91sam9g45-adc
18 - atmel,at91sam9x5-adc
[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 Dstm32-adc.c1 // SPDX-License-Identifier: GPL-2.0
3 * This file is part of STM32 ADC driver
5 * Copyright (C) 2016, STMicroelectronics - All Rights Reserved
12 #include <linux/dma-mapping.h>
16 #include <linux/iio/timer/stm32-lptim-trigger.h>
17 #include <linux/iio/timer/stm32-timer-trigger.h>
26 #include <linux/nvmem-consumer.h>
31 #include "stm32-adc-core.h"
36 /* BOOST bit must be set on STM32H7 when ADC clock is above 20MHz */
58 /* extsel - trigger mux selection value */
[all …]
H A Dstm32-adc-core.c1 // SPDX-License-Identifier: GPL-2.0
3 * This file is part of STM32 ADC driver
5 * Copyright (C) 2016, STMicroelectronics - All Rights Reserved
8 * Inspired from: fsl-imx25-tsadc
30 #include "stm32-adc-core.h"
46 * struct stm32_adc_common_regs - stm32 common registers
51 * @ier: interrupt enable register offset for each adc
66 * struct stm32_adc_priv_cfg - stm32 core compatible configuration data
70 * @ipid: adc identification number
73 * @num_adcs: maximum number of ADC instances in the common registers
[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 Dti-lmp92064.c1 // SPDX-License-Identifier: GPL-2.0
3 * Texas Instruments LMP92064 SPI ADC driver
7 * Based on linux/drivers/iio/adc/ti-tsc2046.c
46 * - IN Current (INC)
47 * - IN Voltage (INV)
126 static int lmp92064_read_meas(struct lmp92064_adc_priv *priv, u16 *res) in lmp92064_read_meas() argument
132 * The ADC only latches in new samples if all DATA registers are read in lmp92064_read_meas()
134 * The ADC auto-decrements the register index with each clocked byte. in lmp92064_read_meas()
140 ret = regmap_bulk_read(priv->regmap, TI_LMP92064_REG_DATA_COUT_MSB, in lmp92064_read_meas()
144 dev_err(&priv->spi->dev, "regmap_bulk_read failed: %pe\n", in lmp92064_read_meas()
[all …]
H A Dti-adc108s102.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * TI ADC108S102 SPI ADC driver
5 * Copyright (c) 2013-2015 Intel Corporation.
12 * The communication with ADC chip is via the SPI bus (mode 3).
29 * In case of ACPI, we use the hard-wired 5000 mV of the Galileo and IOT2000
31 * via the vref-supply regulator.
36 * Defining the ADC resolution being 12 bits, we can use the same driver for
38 * chips. The ADC108S102 effectively returns a 12-bit result with the 2
39 * least-significant bits unset.
45 * 16-bit SPI command format:
[all …]
H A Dti-ads1015.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * ADS1015 - Texas Instruments Analog-to-Digital Converter
7 * IIO driver for ADS1015 ADC 7-bit I2C slave address:
8 * * 0x48 - ADDR connected to Ground
9 * * 0x49 - ADDR connected to Vdd
10 * * 0x4A - ADDR connected to SDA
11 * * 0x4B - ADDR connected to SCL
111 * Translation from PGA bits to full-scale positive and negative input voltage
118 static const int ads1015_scale[] = { /* 12bit ADC */
127 static const int ads1115_scale[] = { /* 16bit ADC */
[all …]
H A Dad7124.c1 // SPDX-License-Identifier: GPL-2.0+
3 * AD7124 SPI ADC driver
23 #include <linux/iio/adc/ad_sigma_delta.h>
203 .name = "ad7124-4",
208 .name = "ad7124-8",
224 diff_new = abs(val - array[i]); in ad7124_find_closest_match()
243 ret = ad_sd_read_reg(&st->sd, addr, bytes, &readval); in ad7124_spi_write_mask()
250 return ad_sd_write_reg(&st->sd, addr, bytes, readval); in ad7124_spi_write_mask()
258 st->adc_control &= ~AD7124_ADC_CTRL_MODE_MSK; in ad7124_set_mode()
259 st->adc_control |= AD7124_ADC_CTRL_MODE(mode); in ad7124_set_mode()
[all …]
/linux/drivers/thermal/qcom/
H A Dqcom-spmi-temp-alarm.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2011-2015, 2017, 2020, The Linux Foundation. All rights reserved.
44 /* Over-temperature trip point values in mC */
66 /* Temperature in Milli Celsius reported during stage 0 if no ADC is present */
82 struct iio_channel *adc; member
94 ret = regmap_read(chip->map, chip->base + addr, &val); in qpnp_tm_read()
104 return regmap_write(chip->map, chip->base + addr, data); in qpnp_tm_write()
108 * qpnp_tm_decode_temp() - return temperature in mC corresponding to the
109 * specified over-temperature stage
111 * @stage: Over-temperature stage
[all …]
H A Dtsens.c1 // SPDX-License-Identifier: GPL-2.0
11 #include <linux/nvmem-consumer.h>
26 * struct tsens_irq_data - IRQ status and temperature violations
81 if (priv->num_sensors > MAX_SENSORS) in tsens_read_calibration()
82 return -EINVAL; in tsens_read_calibration()
88 ret = nvmem_cell_read_variable_le_u32(priv->dev, name, &mode); in tsens_read_calibration()
89 if (ret == -ENOENT) in tsens_read_calibration()
90 dev_warn(priv->dev, "Please migrate to separate nvmem cells for calibration data\n"); in tsens_read_calibration()
94 dev_dbg(priv->dev, "calibration mode is %d\n", mode); in tsens_read_calibration()
100 ret = nvmem_cell_read_variable_le_u32(priv->dev, name, &base1); in tsens_read_calibration()
[all …]
/linux/arch/arm/include/asm/
H A Ddiv64.h1 /* SPDX-License-Identifier: GPL-2.0 */
18 * In other words, a 64-bit dividend with a 32-bit divisor producing
19 * a 64-bit result and a 32-bit remainder. To accomplish this optimally
48 * we can force the use of the out-of-line version for
57 unsigned long long res; in __arch_xprod_64() local
63 : "=&r" (res) in __arch_xprod_64()
67 res = m; in __arch_xprod_64()
70 : "+&r" (res) in __arch_xprod_64()
77 "adc %Q0, %1, #0" in __arch_xprod_64()
78 : "=&r" (res), "+&r" (tmp) in __arch_xprod_64()
[all …]
H A Datomic.h1 /* SPDX-License-Identifier: GPL-2.0-only */
22 * strex/ldrex monitor on some implementations. The reason we can use it for
25 #define arch_atomic_read(v) READ_ONCE((v)->counter)
26 #define arch_atomic_set(v,i) WRITE_ONCE(((v)->counter), (i))
31 * ARMv6 UP and SMP safe atomic ops. We use load exclusive and
42 prefetchw(&v->counter); \
49 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
50 : "r" (&v->counter), "Ir" (i) \
60 prefetchw(&v->counter); \
68 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
[all …]
/linux/drivers/power/supply/
H A Dab8500_btemp.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) ST-Ericsson SA 2012
31 #include <linux/fixp-arith.h>
33 #include "ab8500-bm.h"
35 #define BTEMP_THERMAL_LOW_LIMIT -10
51 * struct ab8500_btemp_interrupts - ab8500 interrupts
77 * struct ab8500_btemp - ab8500 BTEMP device information
80 * @curr_source: What current source we use, in uA
85 * @adc_bat_ctrl: ADC channel for the battery control
124 * ab8500_btemp_batctrl_volt_to_res() - convert batctrl voltage to resistance
[all …]
H A Dug3105_battery.c1 // SPDX-License-Identifier: GPL-2.0+
5 * Note the uG3105 is not a full-featured autonomous fuel-gauge. Instead it is
6 * expected to be use in combination with some always on microcontroller reading
7 * its coulomb-counter before it can wrap (must be read every 400 seconds!).
9 * Since Linux does not monitor coulomb-counter changes while the device
19 * 4. Add some mechanism (needs userspace help, or maybe use efivar?) to remember
23 * and then use total_coulomb_count to report energy_now over time, resetting
25 * readings, esp. in the 30-70% range and allow userspace to estimate time
28 * capacity during run-time ?
32 * in a total_coulomb_count increase of 3277 units with a 5 milli-ohm sense R.
[all …]
/linux/drivers/iio/light/
H A Dgp2ap002.c1 // SPDX-License-Identifier: GPL-2.0-only
14 * https://lore.kernel.org/lkml/1315556546-7445-1-git-send-email-dg77.kim@samsung.com/
17 * https://lore.kernel.org/linux-input/20190125175045.22576-1-pawel.mikolaj.chmiel@gmail.com/
18 * Based partly on code from the Samsung GT-S7710 by <mjchen@sta.samsung.com>
28 #include <linux/iio/consumer.h> /* To get our ADC channel */
29 #include <linux/iio/types.h> /* To deal with our ADC channel */
42 /* ------------------------------------------------------------------------ */
45 /* ------------------------------------------------------------------------ */
52 /* ------------------------------------------------------------------------ */
54 /* LED0 :Select switch for LED driver's On-registence(0:2x higher, 1:normal)*/
[all …]
/linux/sound/soc/sunxi/
H A Dsun4i-codec.c1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com>
7 * Copyright 2016 Chen-Yu Tsai <wens@csie.org>
75 /* Codec ADC digital controls and FIFO registers */
88 /* Codec ADC side analog signal controls */
183 /* ADC mixer controls */
249 regmap_set_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, in sun4i_codec_start_playback()
253 regmap_set_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, in sun4i_codec_start_playback()
260 regmap_clear_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, in sun4i_codec_stop_playback()
266 /* Enable ADC DRQ */ in sun4i_codec_start_capture()
[all …]
/linux/drivers/input/keyboard/
H A DKconfig1 # SPDX-License-Identifier: GPL-2.0-only
17 tristate "ADC Ladder Buttons"
21 to an ADC using a resistor ladder.
23 Say Y here if your device has such buttons connected to an ADC. Your
24 board-specific setup logic must also provide a configuration data
38 be called adp5520-keys.
47 Say Y here if you want to use a ADP5588/87 attached to your
51 module will be called adp5588-keys.
57 Say Y here if you want to use a ADP5585/ADP5589 attached to your
61 module will be called adp5589-keys.
[all …]
H A Dsun4i-lradc-keys.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Allwinner sun4i low res adc attached tablet keys driver
14 * there are no boards known to use channel 1.
63 /* struct lradc_variant - Describe sun4i-a10-lradc-keys hardware variant
114 ints = readl(lradc->base + LRADC_INTS); in sun4i_lradc_irq()
122 input_report_key(lradc->input, lradc->chan0_keycode, 0); in sun4i_lradc_irq()
123 lradc->chan0_keycode = 0; in sun4i_lradc_irq()
126 if ((ints & CHAN0_KEYDOWN_IRQ) && lradc->chan0_keycode == 0) { in sun4i_lradc_irq()
127 val = readl(lradc->base + LRADC_DATA0) & 0x3f; in sun4i_lradc_irq()
128 voltage = val * lradc->vref / 63; in sun4i_lradc_irq()
[all …]
/linux/drivers/thermal/ti-soc-thermal/
H A Dti-bandgap.c1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
6 * Author: J Keerthy <j-keerthy@ti.com>
7 * Author: Moiz Sonasath <m-sonasath@ti.com>
36 #include "ti-bandgap.h"
47 * ti_bandgap_readl() - simple read helper function
56 return readl(bgp->base + reg); in ti_bandgap_readl()
60 * ti_bandgap_writel() - simple write helper function
69 writel(val, bgp->base + reg); in ti_bandgap_writel()
75 * RMW_BITS() - used to read, modify and update bandgap bitfields.
[all …]
/linux/sound/soc/codecs/
H A D88pm860x-codec.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * 88pm860x-codec.c -- 88PM860x ALSA SoC Audio Driver
26 #include "88pm860x-codec.h"
75 /* ADC Analog Register 1 (0xd0) */
117 * This widget should be just after DAC & PGA in DAPM power-on sequence and
118 * before DAC & PGA in DAPM power-off sequence.
149 /* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */
150 static const DECLARE_TLV_DB_SCALE(dpga_tlv, -9450, 150, 1);
152 /* -9dB to 0db in 3dB steps */
153 static const DECLARE_TLV_DB_SCALE(adc_tlv, -900, 300, 0);
[all …]
/linux/sound/soc/sprd/
H A Dsprd-mcdt.c1 // SPDX-License-Identifier: GPL-2.0
14 #include "sprd-mcdt.h"
121 u32 orig = readl_relaxed(mcdt->base + reg); in sprd_mcdt_update()
125 writel_relaxed(tmp, mcdt->base + reg); in sprd_mcdt_update()
187 writel_relaxed(val, mcdt->base + reg); in sprd_mcdt_dac_write_fifo()
195 *val = readl_relaxed(mcdt->base + reg); in sprd_mcdt_adc_read_fifo()
385 return !!(readl_relaxed(mcdt->base + reg) & BIT(shift)); in sprd_mcdt_chan_fifo_sts()
403 u32 r_addr = (readl_relaxed(mcdt->base + reg) >> in sprd_mcdt_dac_fifo_avail()
405 u32 w_addr = readl_relaxed(mcdt->base + reg) & MCDT_CH_FIFO_ADDR_MASK; in sprd_mcdt_dac_fifo_avail()
408 return 4 * (MCDT_FIFO_LENGTH - w_addr + r_addr); in sprd_mcdt_dac_fifo_avail()
[all …]
/linux/drivers/mfd/
H A Dstmpe.c1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) ST-Ericsson SA 2010
7 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
26 * struct stmpe_platform_data - STMPE platform data
28 * @blocks: bitmask of blocks to enable (use STMPE_BLOCK_*)
29 * @irq_trigger: IRQ trigger to use for the interrupt to the host
43 return stmpe->variant->enable(stmpe, blocks, true); in __stmpe_enable()
48 return stmpe->variant->enable(stmpe, blocks, false); in __stmpe_disable()
55 ret = stmpe->ci->read_byte(stmpe, reg); in __stmpe_reg_read()
57 dev_err(stmpe->dev, "failed to read reg %#x: %d\n", reg, ret); in __stmpe_reg_read()
[all …]
/linux/drivers/media/usb/gspca/stv06xx/
H A Dstv06xx_pb0100.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher
4 * Mark Cave-Ayland, Carlo E Prelz, Dick Streefland
9 * P/N 861050-0010: Sensor HDCS1000 ASIC STV0600
10 * P/N 861050-0020: Sensor Photobit PB100 ASIC STV0600-1 - QuickCam Express
11 * P/N 861055: Sensor ST VV6410 ASIC STV0610 - LEGO cam
12 * P/N 861075-0040: Sensor HDCS1000 ASIC
13 * P/N 961179-0700: Sensor ST VV6410 ASIC STV0602 - Dexxa WebCam USB
14 * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web
18 * The spec file for the PB-0100 suggests the following for best quality
[all …]
/linux/sound/pci/emu10k1/
H A Demufx.c1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * James Courtier-Dutton <James@superbug.co.uk>
25 #if 0 /* for testing purposes - digital out -> capture */
28 #if 0 /* for testing purposes - set S/PDIF to AC3 output */
31 #if 0 /* for testing purposes - feed the front signal to Center/LFE outputs */
37 MODULE_PARM_DESC(high_res_gpr_volume, "GPR mixer controls use 31-bit range.");
177 /* 0x12 */ "ADC Capture Left",
178 /* 0x13 */ "ADC Capture Right",
202 2, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1
319 static const DECLARE_TLV_DB_SCALE(snd_emu10k1_db_scale1, -4000, 40, 1);
[all …]

12