/openbmc/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 …]
|
/openbmc/linux/drivers/iio/adc/ |
H A D | stm32-adc-core.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2016, STMicroelectronics - All Rights Reserved 8 * Inspired from: fsl-imx25-tsadc 29 #include "stm32-adc-core.h" 45 * struct stm32_adc_common_regs - stm32 common registers 48 * @eoc_msk: array of eoc (end of conversion flag) masks in csr for adc1..n 49 * @ovr_msk: array of ovr (overrun flag) masks in csr for adc1..n 65 * struct stm32_adc_priv_cfg - stm32 core compatible configuration data 85 * struct stm32_adc_priv - stm32 ADC core private data 92 * @booster: booster supply reference [all …]
|
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 | rcar-gyroadc.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Renesas R-Car GyroADC driver 26 #define DRIVER_NAME "rcar-gyroadc" 68 struct regulator *vref[8]; member 77 const unsigned long clk_mhz = clk_get_rate(priv->clk) / 1000000; in rcar_gyroadc_hw_init() 79 (priv->mode == RCAR_GYROADC_MODE_SELECT_1_MB88101A) ? 10 : 5; in rcar_gyroadc_hw_init() 83 * According to the R-Car Gen2 datasheet Rev. 1.01, Sept 08 2014, in rcar_gyroadc_hw_init() 84 * page 77-7, clock length must be even number. If it's odd number, in rcar_gyroadc_hw_init() 91 writel(0, priv->regs + RCAR_GYROADC_START_STOP); in rcar_gyroadc_hw_init() 94 if (priv->model == RCAR_GYROADC_MODEL_R8A7792) in rcar_gyroadc_hw_init() [all …]
|
H A D | ad7192.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright 2011-2015 Analog Devices Inc. 30 #define AD7192_REG_COMM 0 /* Communications Register (WO, 8-bit) */ 31 #define AD7192_REG_STAT 0 /* Status Register (RO, 8-bit) */ 32 #define AD7192_REG_MODE 1 /* Mode Register (RW, 24-bit */ 33 #define AD7192_REG_CONF 2 /* Configuration Register (RW, 24-bit) */ 34 #define AD7192_REG_DATA 3 /* Data Register (RO, 24/32-bit) */ 35 #define AD7192_REG_ID 4 /* ID Register (RO, 8-bit) */ 36 #define AD7192_REG_GPOCON 5 /* GPOCON Register (RO, 8-bit) */ 37 #define AD7192_REG_OFFSET 6 /* Offset Register (RW, 16-bit */ [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-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 | ad7292.c | 1 // SPDX-License-Identifier: GPL-2.0 92 st->d8[0] = AD7292_RD_FLAG_MSK(addr); in ad7292_spi_reg_read() 94 ret = spi_write_then_read(st->spi, st->d8, 1, &st->d16, 2); in ad7292_spi_reg_read() 98 return be16_to_cpu(st->d16); in ad7292_spi_reg_read() 104 unsigned int shift = 16 - (8 * len); in ad7292_spi_subreg_read() 107 st->d8[0] = AD7292_RD_FLAG_MSK(addr); in ad7292_spi_subreg_read() 108 st->d8[1] = sub_addr; in ad7292_spi_subreg_read() 110 ret = spi_write_then_read(st->spi, st->d8, 2, &st->d16, len); in ad7292_spi_subreg_read() 114 return (be16_to_cpu(st->d16) >> shift); in ad7292_spi_subreg_read() 124 .tx_buf = &st->d8, in ad7292_single_conversion() [all …]
|
/openbmc/u-boot/drivers/adc/ |
H A D | stm32-adc-core.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved 6 * Originally based on the Linux kernel v4.18 drivers/iio/adc/stm32-adc-core.c. 12 #include "stm32-adc-core.h" 14 /* STM32H7 - common registers for all ADC instances */ 17 /* STM32H7_ADC_CCR - bit fields */ 27 * struct stm32h7_adc_ck_spec - specification for stm32h7 adc clock 66 if (!clk_valid(&common->bclk)) { in stm32h7_adc_clk_sel() 67 dev_err(dev, "No bclk clock found\n"); in stm32h7_adc_clk_sel() 68 return -ENOENT; in stm32h7_adc_clk_sel() [all …]
|
H A D | adc-uclass.c | 1 // SPDX-License-Identifier: GPL-2.0+ 12 #include <dm/device-internal.h> 13 #include <dm/uclass-internal.h> 36 * 1-st and 3-rd are valid, then channel mask is: 0b1010, so request in check_channel() 39 if ((uc_pdata->channel_mask >= mask) && (uc_pdata->channel_mask & mask)) in check_channel() 42 printf("Error in %s/%s().\nWrong channel selection for device: %s\n", in check_channel() 43 __FILE__, caller_function, dev->name); in check_channel() 45 return -EINVAL; in check_channel() 54 if (uc_pdata->vdd_supply) { in adc_supply_enable() 56 ret = regulator_set_enable(uc_pdata->vdd_supply, true); in adc_supply_enable() [all …]
|
/openbmc/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.c | 1 // SPDX-License-Identifier: GPL-2.0-only 27 #define AD3552R_MASK_DEVICE_STATUS(n) BIT(4 + (n)) argument 103 #define AD3552R_REG_ADDR_CH_DAC_16B(ch) (0x2C - (1 - ch) * 2) 108 #define AD3552R_REG_ADDR_CH_INPUT_16B(ch) (0x36 - (1 - ch) * 2) 112 #define AD3552R_REG_ADDR_CH_DAC_24B(ch) (0x3D - (1 - ch) * 3) 117 #define AD3552R_REG_ADDR_CH_INPUT_24B(ch) (0x4B - (1 - ch) * 3) 134 /* Internal source with Vref I/O floating */ 136 /* Internal source with Vref I/O at 2.5V */ 138 /* External source with Vref I/O as input */ 154 /* Range from -5 V to 5 V. Requires Rfb2x connection */ [all …]
|
H A D | ad5380.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * multi-channel Digital to Analog Converters driver 35 * struct ad5380_chip_info - chip specific information 38 * @int_vref: internal vref in uV 47 * struct ad5380_state - driver instance specific data 50 * @vref_reg: vref supply regulator 51 * @vref: actual reference voltage used in uA 59 int vref; member 86 return sysfs_emit(buf, "%d\n", st->pwr_down); in ad5380_read_dac_powerdown() 101 mutex_lock(&st->lock); in ad5380_write_dac_powerdown() [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 52 outbuf[0] = (data->powerdown_mode + 1) << 4; in mcp4725_suspend() 54 data->powerdown = true; in mcp4725_suspend() 56 ret = i2c_master_send(data->client, outbuf, 2); in mcp4725_suspend() 60 return -EIO; in mcp4725_suspend() 72 outbuf[0] = (data->dac_value >> 8) & 0xf; in mcp4725_resume() 73 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> 40 * struct ad5449_chip_info - chip specific information 52 * struct ad5449 - driver instance specific data 55 * @vref_reg: vref supply regulators 92 mutex_lock(&st->lock); in ad5449_write() 93 st->data[0] = cpu_to_be16((addr << 12) | val); in ad5449_write() 94 ret = spi_write(st->spi, st->data, 2); in ad5449_write() 95 mutex_unlock(&st->lock); in ad5449_write() 107 .tx_buf = &st->data[0], in ad5449_read() [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/iio/dac/ |
H A D | adi,ad3552r.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 4 --- 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 11 - Nuno Sá <nuno.sa@analog.com> 16 https://www.analog.com/media/en/technical-documentation/data-sheets/ad3542r.pdf 17 https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf 22 - adi,ad3542r 23 - adi,ad3552r 28 spi-max-frequency: 31 reset-gpios: [all …]
|
/openbmc/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 52 /* regulator supplies for sgtl5000, VDDD is an optional external supply */ 61 /* vddd is optional supply */ 100 static const DECLARE_TLV_DB_SCALE(play_tlv, -3000, 100, 0); 101 static const DECLARE_TLV_DB_SCALE(dac_adc_tlv, -9600, 50, 0); 102 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); 124 if (es8328->deemph) { in es8328_set_deemph() 127 if (abs(deemph_settings[i].rate - es8328->playback_fs) < in es8328_set_deemph() [all …]
|
/openbmc/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 …]
|
/openbmc/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 …]
|
/openbmc/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). 151 /* leave chip selected when we're done, for quicker re-select? */ 158 /*--------------------------------------------------------------------------*/ [all …]
|
/openbmc/linux/arch/arm64/boot/dts/rockchip/ |
H A D | px30-ringneck.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 /dts-v1/; 8 #include <dt-bindings/leds/common.h> 18 emmc_pwrseq: emmc-pwrseq { 19 compatible = "mmc-pwrseq-emmc"; 20 pinctrl-0 = <&emmc_reset>; 21 pinctrl-names = "default"; 22 reset-gpios = <&gpio1 RK_PB3 GPIO_ACTIVE_HIGH>; 26 compatible = "gpio-leds"; 27 pinctrl-names = "default"; [all …]
|