Home
last modified time | relevance | path

Searched +full:adc +full:- +full:use +full:- +full:res (Results 1 – 25 of 38) 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 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 Dad7606_par.c1 // SPDX-License-Identifier: GPL-2.0
3 * AD7606 Parallel Interface ADC driver
5 * Copyright 2011 - 2024 Analog Devices Inc.
39 for (c = 0; c < indio_dev->num_channels; c++) { in ad7606_bi_update_scan_mode()
41 ret = iio_backend_chan_enable(st->back, c); in ad7606_bi_update_scan_mode()
43 ret = iio_backend_chan_disable(st->back, c); in ad7606_bi_update_scan_mode()
60 st->back = devm_iio_backend_get(dev, NULL); in ad7606_bi_setup_iio_backend()
61 if (IS_ERR(st->back)) in ad7606_bi_setup_iio_backend()
62 return PTR_ERR(st->back); in ad7606_bi_setup_iio_backend()
65 if (!st->cnvst_pwm) in ad7606_bi_setup_iio_backend()
[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 …]
/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/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 */
288 regmap_field_set_bits(scodec->reg_dac_fifoc, in sun4i_codec_start_playback()
292 regmap_field_set_bits(scodec->reg_dac_fifoc, in sun4i_codec_start_playback()
299 regmap_field_clear_bits(scodec->reg_dac_fifoc, in sun4i_codec_stop_playback()
305 /* 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.
62 /* struct lradc_variant - Describe sun4i-a10-lradc-keys hardware variant
113 ints = readl(lradc->base + LRADC_INTS); in sun4i_lradc_irq()
121 input_report_key(lradc->input, lradc->chan0_keycode, 0); in sun4i_lradc_irq()
122 lradc->chan0_keycode = 0; in sun4i_lradc_irq()
125 if ((ints & CHAN0_KEYDOWN_IRQ) && lradc->chan0_keycode == 0) { in sun4i_lradc_irq()
126 val = readl(lradc->base + LRADC_DATA0) & 0x3f; in sun4i_lradc_irq()
127 voltage = val * lradc->vref / 63; in sun4i_lradc_irq()
[all …]
/linux/arch/arm/include/asm/
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/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 …]
/linux/fs/fat/
H A Dnamei_msdos.c1 // SPDX-License-Identifier: GPL-2.0-only
6 * Hidden files 1995 by Albert Cahalan <albert@ccs.neu.edu> <adc@coe.neu.edu>
14 /* Characters that are undesirable in an MS-DOS file name */
18 /***** Formats an MS-DOS file name. Rejects invalid names. */
20 unsigned char *res, struct fat_mount_options *opts) in msdos_format_name() argument
22 * name is the proposed name, len is its length, res is in msdos_format_name()
23 * the resulting name, opts->name_check is either (r)elaxed, in msdos_format_name()
24 * (n)ormal or (s)trict, opts->dotsOK allows dots at the in msdos_format_name()
33 if (opts->dotsOK) { in msdos_format_name()
34 /* Get rid of dot - test for it elsewhere */ in msdos_format_name()
[all …]
/linux/drivers/thermal/mediatek/
H A Dauxadc_thermal.c1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/nvmem-consumer.h>
119 #define MT8173_TEMP_MIN -20000
474 * temperature sensors. We use each bank to measure a certain area of the
704 * raw_to_mcelsius_v1 - convert a raw ADC value to mcelsius
707 * @raw: raw ADC value
709 * This converts the raw ADC value to mcelsius using the SoC specific
719 tmp /= mt->conf->cali_val + mt->o_slope; in raw_to_mcelsius_v1()
720 tmp /= 10000 + mt->adc_ge; in raw_to_mcelsius_v1()
721 tmp *= raw - mt->vts[sensno] - 3350; in raw_to_mcelsius_v1()
[all …]
/linux/sound/soc/
H A Dsoc-jack.c1 // SPDX-License-Identifier: GPL-2.0+
3 // soc-jack.c -- ALSA SoC jack handling
20 * snd_soc_jack_report - Report the current status for a jack
39 if (!jack || !jack->jack) in snd_soc_jack_report()
43 dapm = &jack->card->dapm; in snd_soc_jack_report()
45 mutex_lock(&jack->mutex); in snd_soc_jack_report()
47 jack->status &= ~mask; in snd_soc_jack_report()
48 jack->status |= status & mask; in snd_soc_jack_report()
52 list_for_each_entry(pin, &jack->pins, list) { in snd_soc_jack_report()
53 int enable = pin->mask & jack->status; in snd_soc_jack_report()
[all …]
/linux/sound/pci/hda/
H A Dpatch_ca0132.c1 // SPDX-License-Identifier: GPL-2.0-or-later
74 #define DESKTOP_EFX_FILE "ctefx-desktop.bin"
75 #define R3DI_EFX_FILE "ctefx-r3di.bin"
115 #define VNODES_COUNT (VNODE_END_NID - VNODE_START_NID)
126 #define OUT_EFFECTS_COUNT (OUT_EFFECT_END_NID - OUT_EFFECT_START_NID)
134 #define IN_EFFECTS_COUNT (IN_EFFECT_END_NID - IN_EFFECT_START_NI
1516 codec_send_command(struct hda_codec * codec,hda_nid_t nid,unsigned int verb,unsigned int parm,unsigned int * res) codec_send_command() argument
1526 codec_set_converter_format(struct hda_codec * codec,hda_nid_t nid,unsigned short converter_format,unsigned int * res) codec_set_converter_format() argument
1534 codec_set_converter_stream_channel(struct hda_codec * codec,hda_nid_t nid,unsigned char stream,unsigned char channel,unsigned int * res) codec_set_converter_stream_channel() argument
1548 unsigned int res; chipio_send() local
1570 int res; chipio_write_address() local
1596 int res; chipio_write_data() local
1641 int res; chipio_read_data() local
2033 int res; dspio_send() local
2547 unsigned int res; dsp_reset() local
2888 int res; dsp_allocate_router_ports() local
7385 init_input(struct hda_codec * codec,hda_nid_t pin,hda_nid_t adc) init_input() argument
[all...]
/linux/drivers/spi/
H A Dspi-sprd-adi.c4 * SPDX-License-Identifier: GPL-2.0
36 #define REG_ADI_CHN_ADDR(id) (0x44 + (id - 2) * 4)
53 * ADI slave devices include RTC, ADC, regulator, charger, thermal and so on.
125 /* Use default timeout 50 ms that converts to watchdog values */
157 if (reg >= sadi->data->slave_addr_size) { in sprd_adi_check_addr()
158 dev_err(sadi->dev, in sprd_adi_check_addr()
161 return -EINVAL; in sprd_adi_check_addr()
173 sts = readl_relaxed(sadi->base + REG_ADI_ARM_FIFO_STS); in sprd_adi_drain_fifo()
178 } while (--timeout); in sprd_adi_drain_fifo()
181 dev_err(sadi->dev, "drain write fifo timeout\n"); in sprd_adi_drain_fifo()
[all …]
/linux/drivers/media/i2c/
H A Dbt819.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * bt819 - BT819A VideoStream Decoder (Rockwell Part)
12 * - moved over to linux>=2.4.x i2c protocol (9/9/2002)
25 #include <media/v4l2-device.h>
26 #include <media/v4l2-ctrls.h>
29 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
35 MODULE_PARM_DESC(debug, "Debug level (0-1)");
38 /* ----------------------------------------------------------------------- */
57 return &container_of(ctrl->handler, struct bt819, hdl)->sd; in to_sd()
71 {864 - 24, 20, 625 - 2, 1, 0x0504, 0x0000},
[all …]
/linux/sound/pci/
H A Dintel8x0.c1 // SPDX-License-Identifier: GPL-2.0-or-later
31 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
36 static int buggy_irq = -1; /* auto-check */
38 static int spdif_aclink = -1;
39 static int inside_vm = -1;
46 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = allowlist + auto-detect, 1 = force autodetect)…
56 MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");
75 ICH_REG_##name##_BDBAR = base + 0x0, /* dword - buffer descriptor list base address */ \
76 ICH_REG_##name##_CIV = base + 0x04, /* byte - current index value */ \
77 ICH_REG_##name##_LVI = base + 0x05, /* byte - last valid index */ \
[all …]

12