| /OK3568_Linux_fs/kernel/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 25 #include "stm32-adc-core.h" 41 * struct stm32_adc_common_regs - stm32 common registers 44 * @eoc_msk: array of eoc (end of conversion flag) masks in csr for adc1..n 45 * @ovr_msk: array of ovr (overrun flag) masks in csr for adc1..n 61 * struct stm32_adc_priv_cfg - stm32 core compatible configuration data 79 * struct stm32_adc_priv - stm32 ADC core private data 85 * @booster: booster supply reference [all …]
|
| H A D | ad7766.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 70 struct iio_dev *indio_dev = pf->indio_dev; in ad7766_trigger_handler() 74 ret = spi_sync(ad7766->spi, &ad7766->msg); in ad7766_trigger_handler() 78 iio_push_to_buffers_with_timestamp(indio_dev, ad7766->data, in ad7766_trigger_handler() 79 pf->timestamp); in ad7766_trigger_handler() 81 iio_trigger_notify_done(indio_dev->trig); in ad7766_trigger_handler() 91 ret = regulator_bulk_enable(ARRAY_SIZE(ad7766->reg), ad7766->reg); in ad7766_preenable() 93 dev_err(&ad7766->spi->dev, "Failed to enable supplies: %d\n", in ad7766_preenable() 98 ret = clk_prepare_enable(ad7766->mclk); in ad7766_preenable() 100 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 | 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 184 shift = 32 - (8 * len); in ad7768_spi_reg_read() 185 st->data.d8[0] = AD7768_RD_FLAG_MSK(addr); in ad7768_spi_reg_read() 187 ret = spi_write_then_read(st->spi, st->data.d8, 1, in ad7768_spi_reg_read() 188 &st->data.d32, len); in ad7768_spi_reg_read() 192 return (be32_to_cpu(st->data.d32) >> shift); in ad7768_spi_reg_read() 199 st->data.d8[0] = AD7768_WR_FLAG_MSK(addr); in ad7768_spi_reg_write() 200 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 91 st->d8[0] = AD7292_RD_FLAG_MSK(addr); in ad7292_spi_reg_read() 93 ret = spi_write_then_read(st->spi, st->d8, 1, &st->d16, 2); in ad7292_spi_reg_read() 97 return be16_to_cpu(st->d16); in ad7292_spi_reg_read() 103 unsigned int shift = 16 - (8 * len); in ad7292_spi_subreg_read() 106 st->d8[0] = AD7292_RD_FLAG_MSK(addr); in ad7292_spi_subreg_read() 107 st->d8[1] = sub_addr; in ad7292_spi_subreg_read() 109 ret = spi_write_then_read(st->spi, st->d8, 2, &st->d16, len); in ad7292_spi_subreg_read() 113 return (be16_to_cpu(st->d16) >> shift); in ad7292_spi_subreg_read() 123 .tx_buf = &st->d8, in ad7292_single_conversion() [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 …]
|
| /OK3568_Linux_fs/kernel/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 spi-max-frequency: true 36 vref-p-supply: [all …]
|
| /OK3568_Linux_fs/kernel/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 | 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 | 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 48 * struct ad5380_state - driver instance specific data 51 * @vref_reg: vref supply regulator 52 * @vref: actual reference voltage used in uA 61 int vref; member 88 return sprintf(buf, "%d\n", st->pwr_down); in ad5380_read_dac_powerdown() 103 mutex_lock(&st->lock); in ad5380_write_dac_powerdown() [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 51 outbuf[0] = (data->powerdown_mode + 1) << 4; in mcp4725_suspend() 53 data->powerdown = true; in mcp4725_suspend() 55 return i2c_master_send(data->client, outbuf, 2); in mcp4725_suspend() 65 outbuf[0] = (data->dac_value >> 8) & 0xf; in mcp4725_resume() 66 outbuf[1] = data->dac_value & 0xff; in mcp4725_resume() 67 data->powerdown = false; 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 …]
|
| /OK3568_Linux_fs/kernel/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 62 /* regulator supplies for sgtl5000, VDDD is an optional external supply */ 71 /* vddd is optional supply */ 110 static const DECLARE_TLV_DB_SCALE(play_tlv, -3000, 100, 0); 111 static const DECLARE_TLV_DB_SCALE(dac_adc_tlv, -9600, 50, 0); 112 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); 134 if (es8328->deemph) { in es8328_set_deemph() 137 if (abs(deemph_settings[i].rate - es8328->playback_fs) < in es8328_set_deemph() [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 | adau1701.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 100 #define ADAU1707_CLKDIV_UNSET (-1U) 168 dev_err(dev, "Unsupported register address: %d\n", reg); in adau1701_register_size() 192 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_write() 194 return -EINVAL; in adau1701_reg_write() 199 for (i = size + 1; i >= 2; --i) { in adau1701_reg_write() 210 return -EIO; in adau1701_reg_write() 223 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_read() 225 return -EINVAL; in adau1701_reg_read() [all …]
|
| /OK3568_Linux_fs/kernel/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 …]
|
| /OK3568_Linux_fs/kernel/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 42 * Support for ads7843 tested on Atmel at91sam926x-EK. 56 * note. The strength of filtering can be set in the board-* specific 70 * with msbs zeroed). Instead, we read them as two 8-bit values, 83 * driver is used with DMA-based SPI controllers (like atmel_spi) on 84 * systems where main memory is not DMA-coherent (most non-x86 boards). 90 /* for ads7845 with mpc5121 psc spi we use 3-byte buffers */ [all …]
|
| /OK3568_Linux_fs/kernel/arch/arm/boot/dts/ |
| H A D | rk3288-evb-rk628.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 4 #include <dt-bindings/pwm/pwm.h> 5 #include <dt-bindings/input/input.h> 7 #include "rk3288-android.dtsi" 11 compatible = "rockchip,rk3288-evb-rk628", "rockchip,rk3288"; 14 …art8250,mmio32,0xff690000 vmalloc=496M console=ttyFIQ0 androidboot.baseband=N/A androidboot.verity… 17 adc-keys { 18 compatible = "adc-keys"; 19 io-channels = <&saradc 1>; 20 io-channel-names = "buttons"; [all …]
|
| /OK3568_Linux_fs/kernel/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 zpa_private - Per-device internal private state 121 * @vref: Power / voltage reference. [all …]
|
| /OK3568_Linux_fs/kernel/arch/arm64/boot/dts/rockchip/ |
| H A D | rk3562-evb.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 7 #include <dt-bindings/display/drm_mipi_dsi.h> 8 #include <dt-bindings/gpio/gpio.h> 9 #include <dt-bindings/input/input.h> 10 #include <dt-bindings/pinctrl/rockchip.h> 13 adc_keys: adc-keys { 14 compatible = "adc-keys"; 15 io-channels = <&saradc0 1>; 16 io-channel-names = "buttons"; 17 keyup-threshold-microvolt = <1800000>; [all …]
|
| H A D | rk3566-rk817-eink-w6.dts | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 7 /dts-v1/; 9 #include <dt-bindings/gpio/gpio.h> 10 #include <dt-bindings/pinctrl/rockchip.h> 11 #include <dt-bindings/input/rk-input.h> 12 #include <dt-bindings/sensor-dev.h> 13 #include <dt-bindings/display/drm_mipi_dsi.h> 15 #include "rk3568-android.dtsi" 16 #include "rk3566-eink.dtsi" 20 compatible = "rockchip,rk3566-rk817-eink-W6", "rockchip,rk3566"; [all …]
|