/linux/Documentation/devicetree/bindings/iio/adc/ |
H A D | ti,adc12138.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Texas Instruments ADC12138 and similar self-calibrating ADCs 10 - Akinobu Mita <akinobu.mita@gmail.com> 19 - ti,adc12130 20 - ti,adc12132 21 - ti,adc12138 34 vref-p-supply: 35 description: The regulator supply for positive analog voltage reference [all …]
|
/linux/drivers/iio/dac/ |
H A D | ad5764.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Analog devices AD5764, AD5764R, AD5744, AD5744R quad-channel 33 * struct ad5764_chip_info - chip specific information 34 * @int_vref: Value of the internal reference voltage in uV - 0 if external 44 * struct ad5764_state - driver instance specific data 47 * @vref_reg: vref supply regulators 90 .shift = 16 - (_bits), \ 130 mutex_lock(&st->lock); in ad5764_write() 131 st->data[0].d32 = cpu_to_be32((reg << 16) | val); in ad5764_write() 133 ret = spi_write(st->spi, &st->data[0].d8[1], 3); in ad5764_write() [all …]
|
H A D | ad5360.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * multi-channel Digital to Analog Converters driver 50 * struct ad5360_chip_info - chip specific information 54 * @num_vrefs: number of vref supplies for the chip 65 * struct ad5360_state - driver instance specific data 68 * @vref_reg: vref supply regulators 115 .shift = 16 - (bits), \ 175 /* The first groups have their own vref, while the remaining groups in ad5360_get_channel_vref_index() 176 * share the last vref */ in ad5360_get_channel_vref_index() 177 i = channel / st->chip_info->channels_per_group; in ad5360_get_channel_vref_index() [all …]
|
H A D | ad3552r-common.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // Copyright (c) 2010-2024 Analog Devices Inc. 18 [AD3552R_CH_OUTPUT_RANGE_NEG_5__5V] = { -5000, 5000 }, 19 [AD3552R_CH_OUTPUT_RANGE_NEG_10__10V] = { -10000, 10000 } 28 [AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V] = { -2500, 7500 }, 29 [AD3542R_CH_OUTPUT_RANGE_NEG_5__5V] = { -5000, 5000 } 41 u16 ad3552r_calc_custom_gain(u8 p, u8 n, s16 goffs) in ad3552r_calc_custom_gain() argument 45 FIELD_PREP(AD3552R_MASK_CH_GAIN_SCALING_N, n) | in ad3552r_calc_custom_gain() 54 s64 vref, tmp, common, offset, gn, gp; in ad3552r_get_custom_range() local 58 * Vmax = 2.5 - [(GainP + Offset / 1024) * 2.5 * Rfb * 1.03] in ad3552r_get_custom_range() [all …]
|
H A D | ad5064.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * AD5024, AD5025, AD5044, AD5045, AD5064, AD5064-1, AD5065, AD5625, AD5625R, 56 * enum ad5064_regmap_type - Register layout variant 68 * struct ad5064_chip_info - chip specific information 69 * @shared_vref: whether the vref supply is shared between channels 71 * internal vref. 91 * struct ad5064_state - driver instance specific data 94 * @vref_reg: vref supply regulators 197 return st->write(st, cmd, addr, val); in ad5064_write() 207 if (st->chip_info->regmap_type == AD5064_REGMAP_LTC) { in ad5064_sync_powerdown_mode() [all …]
|
H A D | mcp4725.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * mcp4725.c - Support for Microchip MCP4725/6 9 * driver for the Microchip I2C 12-bit digital-to-analog converter (DAC) 10 * (7-bit I2C slave address 0x60, the three LSBs can be configured in 57 outbuf[0] = (data->powerdown_mode + 1) << 4; in mcp4725_suspend() 59 data->powerdown = true; in mcp4725_suspend() 61 ret = i2c_master_send(data->client, outbuf, 2); in mcp4725_suspend() 65 return -EIO; in mcp4725_suspend() 77 outbuf[0] = (data->dac_value >> 8) & 0xf; in mcp4725_resume() 78 outbuf[1] = data->dac_value & 0xff; in mcp4725_resume() [all …]
|
H A D | ad5449.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 * Author: Lars-Peter Clausen <lars@metafoo.de> 38 * struct ad5449_chip_info - chip specific information 50 * struct ad5449 - driver instance specific data 53 * @vref_reg: vref supply regulators 90 mutex_lock(&st->lock); in ad5449_write() 91 st->data[0] = cpu_to_be16((addr << 12) | val); in ad5449_write() 92 ret = spi_write(st->spi, st->data, 2); in ad5449_write() 93 mutex_unlock(&st->lock); in ad5449_write() 105 .tx_buf = &st->data[0], in ad5449_read() [all …]
|
/linux/drivers/iio/adc/ |
H A D | ad7766.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 69 struct iio_dev *indio_dev = pf->indio_dev; in ad7766_trigger_handler() 73 ret = spi_sync(ad7766->spi, &ad7766->msg); in ad7766_trigger_handler() 77 iio_push_to_buffers_with_timestamp(indio_dev, ad7766->data, in ad7766_trigger_handler() 78 pf->timestamp); in ad7766_trigger_handler() 80 iio_trigger_notify_done(indio_dev->trig); in ad7766_trigger_handler() 90 ret = regulator_bulk_enable(ARRAY_SIZE(ad7766->reg), ad7766->reg); in ad7766_preenable() 92 dev_err(&ad7766->spi->dev, "Failed to enable supplies: %d\n", in ad7766_preenable() 97 ret = clk_prepare_enable(ad7766->mclk); in ad7766_preenable() 99 dev_err(&ad7766->spi->dev, "Failed to enable MCLK: %d\n", ret); in ad7766_preenable() [all …]
|
H A D | ad7173.c | 1 // SPDX-License-Identifier: GPL-2.0+ 7 * AD7172-2/AD7172-4/AD7173-8/AD7175-2 8 * AD7175-8/AD7176-2/AD7177-2 18 #include <linux/clk-provider.h> 147 (pin2) < st->info->num_voltage_in && \ 148 (pin2) >= st->info->num_voltage_in_div) 222 24845000, 24845000, 20725000, 20725000, /* 0-3 */ 223 15564000, 13841000, 10390000, 10390000, /* 4-7 */ 224 4994000, 2499000, 1000000, 500000, /* 8-11 */ 225 395500, 200000, 100000, 59890, /* 12-15 */ [all …]
|
H A D | ti-ads7950.c | 1 // SPDX-License-Identifier: GPL-2.0 12 * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ 36 * Device tree users encode that via the vref-supply regulator. 54 (((val) >> (dec)) & ((1 << (bits)) - 1)) 61 (TI_ADS7950_MAN_CMD(TI_ADS7950_CR_WRITE | st->cmd_settings_bitmask)) 64 (TI_ADS7950_GPIO_CMD(st->gpio_cmd_settings_bitmask)) 84 * [0-3] GPIO signal 87 * [6] Sets Vref range1(2.5v) or range2(5v) 95 * [0-3] GPIO direction 96 * [4-6] Different GPIO alarm mode configurations [all …]
|
H A D | ad7768-1.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Analog Devices AD7768-1 SPI ADC driver 156 struct regulator *vref; member 185 shift = 32 - (8 * len); in ad7768_spi_reg_read() 186 st->data.d8[0] = AD7768_RD_FLAG_MSK(addr); in ad7768_spi_reg_read() 188 ret = spi_write_then_read(st->spi, st->data.d8, 1, in ad7768_spi_reg_read() 189 &st->data.d32, len); in ad7768_spi_reg_read() 193 return (be32_to_cpu(st->data.d32) >> shift); in ad7768_spi_reg_read() 200 st->data.d8[0] = AD7768_WR_FLAG_MSK(addr); in ad7768_spi_reg_write() 201 st->data.d8[1] = val & 0xFF; in ad7768_spi_reg_write() [all …]
|
H A D | ad7780.c | 1 // SPDX-License-Identifier: GPL-2.0 100 gpiod_set_value(st->powerdown_gpio, val); in ad7780_set_mode() 118 voltage_uv = regulator_get_voltage(st->reg); in ad7780_read_raw() 122 *val = voltage_uv * st->gain; in ad7780_read_raw() 123 *val2 = chan->scan_type.realbits - 1; in ad7780_read_raw() 124 st->int_vref_mv = voltage_uv; in ad7780_read_raw() 127 *val = -(1 << (chan->scan_type.realbits - 1)); in ad7780_read_raw() 130 *val = st->odr; in ad7780_read_raw() 136 return -EINVAL; in ad7780_read_raw() 146 const struct ad7780_chip_info *chip_info = st->chip_info; in ad7780_write_raw() [all …]
|
H A D | ti-adc108s102.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2013-2015 Intel Corporation. 29 * In case of ACPI, we use the hard-wired 5000 mV of the Galileo and IOT2000 31 * via the vref-supply regulator. 38 * chips. The ADC108S102 effectively returns a 12-bit result with the 2 39 * least-significant bits unset. 45 * 16-bit SPI command format: 47 * [13:11] 3-bit channel address 53 * 16-bit SPI response format: 55 * [11:0] 12-bit ADC sample (for ADC108S102, [1:0] will always be 0). [all …]
|
H A D | ti-ads1298.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2023 - 2024 Topic Embedded Products 69 #define ADS1298_REG_CHnSET(n) (0x05 + n) argument 94 /* For reading and writing registers, we need a 3-byte buffer */ 96 /* Outputs status word and 'n' 24-bit samples, plus the command byte */ 97 #define ADS1298_SPI_RDATA_BUFFER_SIZE(n) (((n) + 1) * 3 + 1) argument 119 * >2 = Multiple DRDY during transfer, lost rdata_xfer_busy - 2 samples 173 .tx_buf = priv->cmd_buffer, in ads1298_write_cmd() 174 .rx_buf = priv->cmd_buffer, in ads1298_write_cmd() 183 priv->cmd_buffer[0] = command; in ads1298_write_cmd() [all …]
|
H A D | ad7791.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 71 .differential = (_channel2 == -1 ? 0 : 1), \ 99 __AD7991_CHANNEL(_si, _channel, -1, _address, _bits, \ 111 __AD7991_CHANNEL(_si, _channel, -1, _address, _bits, \ 112 _storagebits, _shift, "supply", IIO_VOLTAGE, \ 244 st->mode &= ~AD7791_MODE_SEL_MASK; in ad7791_set_mode() 245 st->mode |= AD7791_MODE_SEL(mode); in ad7791_set_mode() 247 return ad_sd_write_reg(sd, AD7791_REG_MODE, sizeof(st->mode), st->mode); in ad7791_set_mode() 263 bool unipolar = !!(st->mode & AD7791_MODE_UNIPOLAR); in ad7791_read_raw() [all …]
|
H A D | ti-ads131e08.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Texas Instruments ADS131E0x 4-, 6- and 8-Channel ADCs 166 ret = spi_write_then_read(st->spi, &cmd, 1, NULL, 0); in ads131e08_exec_cmd() 168 dev_err(&st->spi->dev, "Exec cmd(%02x) failed\n", cmd); in ads131e08_exec_cmd() 178 .tx_buf = &st->tx_buf, in ads131e08_read_reg() 181 .value = st->sdecode_delay_us, in ads131e08_read_reg() 185 .rx_buf = &st->rx_buf, in ads131e08_read_reg() 190 st->tx_buf[0] = ADS131E08_CMD_RREG(reg); in ads131e08_read_reg() 191 st->tx_buf[1] = 0; in ads131e08_read_reg() 193 ret = spi_sync_transfer(st->spi, transfer, ARRAY_SIZE(transfer)); in ads131e08_read_reg() [all …]
|
/linux/sound/soc/codecs/ |
H A D | es8328.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * es8328.c -- ES8328 ALSA SoC Audio driver 5 * Copyright 2014 Sutajio Ko-Usagi PTE LTD 51 /* regulator supplies for sgtl5000, VDDD is an optional external supply */ 60 /* vddd is optional supply */ 99 static const DECLARE_TLV_DB_SCALE(play_tlv, -3000, 100, 0); 100 static const DECLARE_TLV_DB_SCALE(dac_adc_tlv, -9600, 50, 0); 101 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); 123 if (es8328->deemph) { in es8328_set_deemph() 126 if (abs(deemph_settings[i].rate - es8328->playback_fs) < in es8328_set_deemph() [all …]
|
H A D | adau1701.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 99 #define ADAU1707_CLKDIV_UNSET (-1U) 167 dev_err(dev, "Unsupported register address: %d\n", reg); in adau1701_register_size() 191 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_write() 193 return -EINVAL; in adau1701_reg_write() 198 for (i = size + 1; i >= 2; --i) { in adau1701_reg_write() 209 return -EIO; in adau1701_reg_write() 222 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_read() 224 return -EINVAL; in adau1701_reg_read() [all …]
|
H A D | wm8400.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * wm8400.c -- WM8400 ALSA Soc Audio driver 5 * Copyright 2008-11 Wolfson Microelectronics PLC. 18 #include <linux/mfd/wm8400-audio.h> 19 #include <linux/mfd/wm8400-private.h> 32 .supply = "I2S1VDD", 35 .supply = "I2S2VDD", 38 .supply = "DCVDD", 41 .supply = "AVDD", 44 .supply = "FLLVDD", [all …]
|
H A D | wm8955.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * wm8955.c -- WM8955 ALSA SoC Audio driver 50 { 2, 0x0079 }, /* R2 - LOUT1 volume */ 51 { 3, 0x0079 }, /* R3 - ROUT1 volume */ 52 { 5, 0x0008 }, /* R5 - DAC Control */ 53 { 7, 0x000A }, /* R7 - Audio Interface */ 54 { 8, 0x0000 }, /* R8 - Sample Rate */ 55 { 10, 0x00FF }, /* R10 - Left DAC volume */ 56 { 11, 0x00FF }, /* R11 - Right DAC volume */ 57 { 12, 0x000F }, /* R12 - Bass control */ [all …]
|
/linux/drivers/mfd/ |
H A D | wm8350-core.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * wm8350-core.c -- Device access for Wolfson WM8350 27 #include <linux/mfd/wm8350/supply.h> 42 printk("\n"); \ 65 return regmap_update_bits(wm8350->regmap, reg, mask, 0); in wm8350_clear_bits() 71 return regmap_update_bits(wm8350->regmap, reg, mask, mask); in wm8350_set_bits() 80 err = regmap_read(wm8350->regmap, reg, &data); in wm8350_reg_read() 82 dev_err(wm8350->dev, "read from reg R%d failed\n", reg); in wm8350_reg_read() 92 ret = regmap_write(wm8350->regmap, reg, val); in wm8350_reg_write() 95 dev_err(wm8350->dev, "write to reg R%d failed\n", reg); in wm8350_reg_write() [all …]
|
/linux/arch/arm/boot/dts/st/ |
H A D | stm32mp15xx-dhcom-som.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 3 * Copyright (C) 2019-2020 Marek Vasut <marex@denx.de> 6 #include "stm32mp15-pinctrl.dtsi" 7 #include "stm32mp15xxaa-pinctrl.dtsi" 8 #include <dt-bindings/gpio/gpio.h> 9 #include <dt-bindings/mfd/st,stpmic1.h> 24 reserved-memory { 25 #address-cells = <1>; 26 #size-cells = <1>; 30 compatible = "shared-dma-pool"; [all …]
|
/linux/drivers/input/touchscreen/ |
H A D | ads7846.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 * - corgi_ts.c 11 * Copyright (C) 2004-2005 Richard Purdie 12 * - omap_ts.[hc], ads7846.h, ts_osk.c 39 * Support for ads7843 tested on Atmel at91sam926x-EK. 53 * note. The strength of filtering can be set in the board-* specific 76 * driver is used with DMA-based SPI controllers (like atmel_spi) on 77 * systems where main memory is not DMA-coherent (most non-x86 boards). 152 /* leave chip selected when we're done, for quicker re-select? */ 159 /*--------------------------------------------------------------------------*/ [all …]
|
/linux/arch/arm/boot/dts/nxp/imx/ |
H A D | imx6ull-dhcom-som.dtsi | 1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause 6 #include "imx6ull-dhcor-som.dtsi" 10 /delete-property/ spi2; 11 /delete-property/ spi3; 28 stdout-path = "serial0:115200n8"; 31 reg_ext_3v3_ref: regulator-ext-3v3-ref { 32 compatible = "regulator-fixed"; 33 regulator-always-on; 34 regulator-max-microvolt = <3300000>; 35 regulator-min-microvolt = <3300000>; [all …]
|
/linux/drivers/iio/pressure/ |
H A D | zpa2326.c | 1 // SPDX-License-Identifier: GPL-2.0-only 34 * - get device out of low power mode, 35 * - setup hardware sampling period, 36 * - at end of period, upon data ready interrupt: pop pressure samples out of 38 * - when no longer needed, stop sampling process by putting device into 70 /* 200 ms should be enough for the longest conversion time in one-shot mode. */ 78 * struct zpa2326_frequency - Hardware sampling frequency descriptor 102 ARRAY_SIZE(zpa2326_sampling_frequencies) - 1]; in zpa2326_highest_frequency() 106 * struct zpa2326_private - Per-device internal private state 121 * @vref: Power / voltage reference. [all …]
|