/linux/drivers/iio/adc/ |
A D | palmas_gpadc.c | 543 adc); in palmas_gpadc_probe() 622 if (adc->wakeup1_enable || adc->wakeup2_enable) in palmas_gpadc_probe() 629 free_irq(adc->irq_auto_1, adc); in palmas_gpadc_probe() 632 free_irq(adc->irq_auto_0, adc); in palmas_gpadc_probe() 634 free_irq(adc->irq, adc); in palmas_gpadc_probe() 644 if (adc->wakeup1_enable || adc->wakeup2_enable) in palmas_gpadc_remove() 647 free_irq(adc->irq, adc); in palmas_gpadc_remove() 649 free_irq(adc->irq_auto_0, adc); in palmas_gpadc_remove() 651 free_irq(adc->irq_auto_1, adc); in palmas_gpadc_remove() 784 int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; in palmas_gpadc_suspend() [all …]
|
A D | stm32-adc.c | 1147 stm32_adc_writel(adc, adc->cfg->regs->smpr[0], adc->smpr_val[0]); in stm32_adc_conf_scan_seq() 1148 stm32_adc_writel(adc, adc->cfg->regs->smpr[1], adc->smpr_val[1]); in stm32_adc_conf_scan_seq() 1459 adc->buffer[adc->bufi] = stm32_adc_readw(adc, regs->dr); in stm32_adc_isr() 1462 if (adc->bufi >= adc->num_conv) { in stm32_adc_isr() 1602 size = adc->rx_buf_sz + i - adc->bufi; in stm32_adc_dma_residue() 1634 if (adc->bufi >= adc->rx_buf_sz) in stm32_adc_dma_buffer_done() 1650 adc->rx_buf_sz, adc->rx_buf_sz / 2); in stm32_adc_dma_start() 1655 adc->rx_buf_sz, adc->rx_buf_sz / 2, in stm32_adc_dma_start() 2195 adc->rx_buf, adc->rx_dma_buf); in stm32_adc_dma_request() 2325 adc->rx_buf, adc->rx_dma_buf); in stm32_adc_probe() [all …]
|
A D | ti-adc12138.c | 131 .tx_buf = adc->tx_buf, in adc12138_mode_programming() 132 .rx_buf = adc->rx_buf, in adc12138_mode_programming() 138 if (adc->id != adc12138) in adc12138_mode_programming() 141 adc->tx_buf[0] = mode; in adc12138_mode_programming() 343 mutex_lock(&adc->lock); in adc12138_trigger_handler() 370 ret = adc12138_read_conv_data(adc, &adc->data[i - 1]); in adc12138_trigger_handler() 401 struct adc12138 *adc; in adc12138_probe() local 409 adc->spi = spi; in adc12138_probe() 411 mutex_init(&adc->lock); in adc12138_probe() 418 switch (adc->id) { in adc12138_probe() [all …]
|
A D | stm32-dfsdm-adc.c | 819 size = adc->buf_sz + i - adc->bufi; in stm32_dfsdm_adc_dma_residue() 872 s32 *buffer = (s32 *)&adc->rx_buf[adc->bufi]; in stm32_dfsdm_dma_buffer_done() 878 if (adc->bufi >= adc->buf_sz) { in stm32_dfsdm_dma_buffer_done() 880 adc->cb(&adc->rx_buf[old_pos], in stm32_dfsdm_dma_buffer_done() 881 adc->buf_sz - old_pos, adc->cb_priv); in stm32_dfsdm_dma_buffer_done() 898 adc->cb(&adc->rx_buf[old_pos], adc->bufi - old_pos, in stm32_dfsdm_dma_buffer_done() 922 adc->buf_sz, adc->buf_sz / 2); in stm32_dfsdm_adc_dma_start() 935 adc->buf_sz, adc->buf_sz / 2, in stm32_dfsdm_adc_dma_start() 1338 adc->rx_buf, adc->dma_buf); in stm32_dfsdm_dma_release() 1426 adc->spi_freq = adc->dfsdm->spi_master_freq; in stm32_dfsdm_audio_init() [all …]
|
A D | mcp3911.c | 127 if (adc->vref) { in mcp3911_read_raw() 212 adc->dev_addr); in mcp3911_config() 215 dev_dbg(&adc->spi->dev, "use device address %i\n", adc->dev_addr); in mcp3911_config() 221 if (adc->vref) { in mcp3911_config() 230 if (adc->clki) { in mcp3911_config() 253 adc->spi = spi; in mcp3911_probe() 255 adc->vref = devm_regulator_get_optional(&adc->spi->dev, "vref"); in mcp3911_probe() 258 adc->vref = NULL; in mcp3911_probe() 272 adc->clki = devm_clk_get(&adc->spi->dev, NULL); in mcp3911_probe() 315 if (adc->vref) in mcp3911_probe() [all …]
|
A D | imx8qxp-adc.c | 211 mutex_lock(&adc->lock); in imx8qxp_adc_read_raw() 301 struct imx8qxp_adc *adc; in imx8qxp_adc_probe() local 314 adc->dev = dev; in imx8qxp_adc_probe() 316 mutex_init(&adc->lock); in imx8qxp_adc_probe() 318 if (IS_ERR(adc->regs)) in imx8qxp_adc_probe() 326 if (IS_ERR(adc->clk)) in imx8qxp_adc_probe() 330 if (IS_ERR(adc->ipg_clk)) in imx8qxp_adc_probe() 334 if (IS_ERR(adc->vref)) in imx8qxp_adc_probe() 371 imx8qxp_adc_reset(adc); in imx8qxp_adc_probe() 407 imx8qxp_adc_disable(adc); in imx8qxp_adc_remove() [all …]
|
A D | rzg2l_adc.c | 167 rzg2l_set_trigger(adc); in rzg2l_adc_conversion_setup() 242 mutex_lock(&adc->lock); in rzg2l_adc_read_raw() 249 *val = adc->last_val[ch]; in rzg2l_adc_read_raw() 250 mutex_unlock(&adc->lock); in rzg2l_adc_read_raw() 294 adc->last_val[ch] = rzg2l_adc_readl(adc, RZG2L_ADCR(ch)) & RZG2L_ADCR_AD_MASK; in rzg2l_adc_isr() 353 adc->data = data; in rzg2l_adc_parse_properties() 430 struct rzg2l_adc *adc; in rzg2l_adc_probe() local 444 mutex_init(&adc->lock); in rzg2l_adc_probe() 447 if (IS_ERR(adc->base)) in rzg2l_adc_probe() 451 if (IS_ERR(adc->pclk)) { in rzg2l_adc_probe() [all …]
|
A D | ingenic-adc.c | 116 mutex_lock(&adc->lock); in ingenic_adc_set_adcmd() 164 mutex_unlock(&adc->lock); in ingenic_adc_set_adcmd() 173 mutex_lock(&adc->lock); in ingenic_adc_set_config() 179 mutex_unlock(&adc->lock); in ingenic_adc_set_config() 202 mutex_lock(&adc->lock); in ingenic_adc_enable() 219 mutex_lock(&adc->lock); in ingenic_adc_capture() 271 clk_disable(adc->clk); in ingenic_adc_write_raw() 679 clk_disable(adc->clk); in ingenic_adc_read_chan_info_raw() 792 clk_disable(adc->clk); in ingenic_adc_buffer_disable() 856 if (IS_ERR(adc->base)) in ingenic_adc_probe() [all …]
|
A D | mcp320x.c | 126 ret = spi_sync(adc->spi, &adc->start_conv_msg); in mcp320x_adc_conversion() 134 memset(&adc->rx_buf, 0, sizeof(adc->rx_buf)); in mcp320x_adc_conversion() 139 ret = spi_sync(adc->spi, &adc->msg); in mcp320x_adc_conversion() 145 *val = (adc->rx_buf[0] << 5 | adc->rx_buf[1] >> 3); in mcp320x_adc_conversion() 150 *val = (adc->rx_buf[0] << 2 | adc->rx_buf[1] >> 6); in mcp320x_adc_conversion() 153 *val = (adc->rx_buf[0] << 7 | adc->rx_buf[1] >> 1); in mcp320x_adc_conversion() 158 *val = (adc->rx_buf[0] << 4 | adc->rx_buf[1] >> 4); in mcp320x_adc_conversion() 400 adc->transfer[0].tx_buf = &adc->tx_buf; in mcp320x_probe() 401 adc->transfer[0].len = sizeof(adc->tx_buf); in mcp320x_probe() 402 adc->transfer[1].rx_buf = adc->rx_buf; in mcp320x_probe() [all …]
|
A D | qcom-spmi-adc5.c | 160 return regmap_bulk_read(adc->regmap, adc->base + offset, data, len); in adc5_read() 165 return regmap_bulk_write(adc->regmap, adc->base + offset, data, len); in adc5_write() 170 return regmap_update_bits(adc->regmap, adc->base + offset, mask, val); in adc5_masked_write() 455 adc->data, in adc_read_raw_common() 817 adc->iio_chans = devm_kcalloc(adc->dev, adc->nchannels, in adc5_get_dt_data() 822 adc->chan_props = devm_kcalloc(adc->dev, adc->nchannels, in adc5_get_dt_data() 829 adc->data = of_device_get_match_data(adc->dev); in adc5_get_dt_data() 830 if (!adc->data) in adc5_get_dt_data() 834 ret = adc5_get_dt_channel_data(adc, &prop, child, adc->data); in adc5_get_dt_data() 883 adc->dev = dev; in adc5_probe() [all …]
|
A D | max1241.c | 58 .rx_buf = &adc->data, in max1241_read() 75 mutex_lock(&adc->lock); in max1241_read_raw() 77 if (adc->shutdown) { in max1241_read_raw() 80 ret = max1241_read(adc); in max1241_read_raw() 83 ret = max1241_read(adc); in max1241_read_raw() 139 struct max1241 *adc; in max1241_probe() local 147 adc->spi = spi; in max1241_probe() 148 mutex_init(&adc->lock); in max1241_probe() 151 if (IS_ERR(adc->vdd)) in max1241_probe() 166 if (IS_ERR(adc->vref)) in max1241_probe() [all …]
|
A D | ti-adc084s021.c | 79 ret = spi_sync(adc->spi, &adc->message); in adc084s021_adc_conversion() 150 mutex_lock(&adc->lock); in adc084s021_buffer_trigger_handler() 152 if (adc084s021_adc_conversion(adc, adc->scan.channels) < 0) in adc084s021_buffer_trigger_handler() 157 mutex_unlock(&adc->lock); in adc084s021_buffer_trigger_handler() 201 struct adc084s021 *adc; in adc084s021_probe() local 211 adc->spi = spi; in adc084s021_probe() 221 adc->spi_trans.tx_buf = adc->tx_buf; in adc084s021_probe() 222 adc->spi_trans.rx_buf = adc->rx_buf; in adc084s021_probe() 224 spi_message_init_with_transfers(&adc->message, &adc->spi_trans, 1); in adc084s021_probe() 227 if (IS_ERR(adc->reg)) in adc084s021_probe() [all …]
|
A D | ti-adc0832.c | 132 return (adc->rx_buf[0] << 2 & 0xff) | (adc->rx_buf[1] >> 6); in adc0831_adc_conversion() 146 if (!adc->mux_bits) in adc0832_adc_conversion() 150 adc->tx_buf[0] = 1 << (adc->mux_bits + 1); in adc0832_adc_conversion() 152 adc->tx_buf[0] |= differential ? 0 : (1 << adc->mux_bits); in adc0832_adc_conversion() 154 adc->tx_buf[0] |= (channel % 2) << (adc->mux_bits - 1); in adc0832_adc_conversion() 226 adc->data[i] = ret; in adc0832_trigger_handler() 255 adc->spi = spi; in adc0832_probe() 264 adc->mux_bits = 0; in adc0832_probe() 269 adc->mux_bits = 1; in adc0832_probe() 274 adc->mux_bits = 2; in adc0832_probe() [all …]
|
A D | lpc18xx_adc.c | 96 mutex_lock(&adc->lock); in lpc18xx_adc_read_raw() 98 mutex_unlock(&adc->lock); in lpc18xx_adc_read_raw() 138 struct lpc18xx_adc *adc; in lpc18xx_adc_probe() local 147 adc = iio_priv(indio_dev); in lpc18xx_adc_probe() 148 adc->dev = &pdev->dev; in lpc18xx_adc_probe() 149 mutex_init(&adc->lock); in lpc18xx_adc_probe() 152 if (IS_ERR(adc->base)) in lpc18xx_adc_probe() 156 if (IS_ERR(adc->clk)) in lpc18xx_adc_probe() 164 if (IS_ERR(adc->vref)) in lpc18xx_adc_probe() 191 adc->clk); in lpc18xx_adc_probe() [all …]
|
A D | mxs-lradc-adc.c | 402 complete(&adc->completion); in mxs_lradc_adc_handle_irq() 423 adc->buffer[j] = readl(adc->base + LRADC_CH(j)); in mxs_lradc_adc_trigger_handler() 471 adc->trig = trig; in mxs_lradc_adc_trigger_init() 692 struct mxs_lradc_adc *adc; in mxs_lradc_adc_probe() local 706 adc = iio_priv(iio); in mxs_lradc_adc_probe() 707 adc->lradc = lradc; in mxs_lradc_adc_probe() 708 adc->dev = dev; in mxs_lradc_adc_probe() 715 if (!adc->base) in mxs_lradc_adc_probe() 719 spin_lock_init(&adc->lock); in mxs_lradc_adc_probe() 791 mxs_lradc_adc_hw_init(adc); in mxs_lradc_adc_probe() [all …]
|
A D | qcom-pm8xxx-xoadc.c | 450 mutex_lock(&adc->lock); in pm8xxx_read_channel_rsv() 831 if (!adc->nchans) { in pm8xxx_xoadc_parse_channels() 835 dev_dbg(adc->dev, "found %d ADC channels\n", adc->nchans); in pm8xxx_xoadc_parse_channels() 837 adc->iio_chans = devm_kcalloc(adc->dev, adc->nchans, in pm8xxx_xoadc_parse_channels() 839 if (!adc->iio_chans) in pm8xxx_xoadc_parse_channels() 842 adc->chans = devm_kcalloc(adc->dev, adc->nchans, in pm8xxx_xoadc_parse_channels() 844 if (!adc->chans) in pm8xxx_xoadc_parse_channels() 849 ch = &adc->chans[i]; in pm8xxx_xoadc_parse_channels() 901 adc->dev = dev; in pm8xxx_xoadc_probe() 915 adc->map = map; in pm8xxx_xoadc_probe() [all …]
|
A D | ti-ads8344.c | 82 adc->tx_buf = ADS8344_START; in ads8344_adc_conversion() 94 ret = spi_read(spi, adc->rx_buf, sizeof(adc->rx_buf)); in ads8344_adc_conversion() 98 return adc->rx_buf[0] << 9 | adc->rx_buf[1] << 1 | adc->rx_buf[2] >> 7; in ads8344_adc_conversion() 109 mutex_lock(&adc->lock); in ads8344_read_raw() 112 mutex_unlock(&adc->lock); in ads8344_read_raw() 144 struct ads8344 *adc; in ads8344_probe() local 151 adc = iio_priv(indio_dev); in ads8344_probe() 152 adc->spi = spi; in ads8344_probe() 153 mutex_init(&adc->lock); in ads8344_probe() 162 if (IS_ERR(adc->reg)) in ads8344_probe() [all …]
|
A D | mcp3422.c | 101 adc->config = newconfig; in mcp3422_update_config() 137 mutex_lock(&adc->lock); in mcp3422_read_channel() 140 config = adc->config; in mcp3422_read_channel() 155 mutex_unlock(&adc->lock); in mcp3422_read_channel() 200 u8 config = adc->config; in mcp3422_write_raw() 236 if (adc->id > 4) in mcp3422_write_raw() 276 if (adc->id > 4) in mcp3422_show_samp_freqs() 337 struct mcp3422 *adc; in mcp3422_probe() local 349 adc->i2c = client; in mcp3422_probe() 352 mutex_init(&adc->lock); in mcp3422_probe() [all …]
|
A D | rn5t618-adc.c | 88 struct rn5t618_adc_data *adc = data; in rn5t618_adc_irq() local 103 complete(&adc->conv_completion); in rn5t618_adc_irq() 204 struct rn5t618_adc_data *adc; in rn5t618_adc_probe() local 213 adc = iio_priv(iio_dev); in rn5t618_adc_probe() 214 adc->dev = &pdev->dev; in rn5t618_adc_probe() 215 adc->rn5t618 = rn5t618; in rn5t618_adc_probe() 221 if (adc->irq <= 0) { in rn5t618_adc_probe() 241 ret = devm_request_threaded_irq(adc->dev, adc->irq, NULL, in rn5t618_adc_probe() 243 IRQF_ONESHOT, dev_name(adc->dev), in rn5t618_adc_probe() 244 adc); in rn5t618_adc_probe() [all …]
|
A D | ti-adc128s052.c | 39 mutex_lock(&adc->lock); in adc128_adc_conversion() 42 adc->buffer[1] = 0; in adc128_adc_conversion() 44 ret = spi_write(adc->spi, &adc->buffer, 2); in adc128_adc_conversion() 50 ret = spi_read(adc->spi, &adc->buffer, 2); in adc128_adc_conversion() 52 mutex_unlock(&adc->lock); in adc128_adc_conversion() 57 return ((adc->buffer[0] << 8 | adc->buffer[1]) & 0xFFF); in adc128_adc_conversion() 144 struct adc128 *adc; in adc128_probe() local 157 adc->spi = spi; in adc128_probe() 167 if (IS_ERR(adc->reg)) in adc128_probe() 174 adc->reg); in adc128_probe() [all …]
|
/linux/arch/arm/mach-s3c/ |
A D | adc.c | 138 adc->cur = next; in s3c_adc_try() 151 if (!adc) { in s3c_adc_start() 171 if (!adc->cur) in s3c_adc_start() 172 s3c_adc_try(adc); in s3c_adc_start() 318 adc->cur = NULL; in s3c_adc_irq() 320 s3c_adc_try(adc); in s3c_adc_irq() 340 adc = devm_kzalloc(dev, sizeof(*adc), GFP_KERNEL); in s3c_adc_probe() 341 if (!adc) in s3c_adc_probe() 346 adc->pdev = pdev; in s3c_adc_probe() 360 adc); in s3c_adc_probe() [all …]
|
/linux/drivers/mfd/ |
A D | pcf50633-adc.c | 72 head = adc->queue_head; in trigger_next_adc_job_if_any() 74 if (!adc->queue[head]) in trigger_next_adc_job_if_any() 77 adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg); in trigger_next_adc_job_if_any() 88 head = adc->queue_head; in adc_enqueue_request() 89 tail = adc->queue_tail; in adc_enqueue_request() 91 if (adc->queue[tail]) { in adc_enqueue_request() 97 adc->queue[tail] = req; in adc_enqueue_request() 176 head = adc->queue_head; in pcf50633_adc_irq() 201 adc = devm_kzalloc(&pdev->dev, sizeof(*adc), GFP_KERNEL); in pcf50633_adc_probe() 202 if (!adc) in pcf50633_adc_probe() [all …]
|
/linux/drivers/hwmon/ |
A D | adcxx.c | 61 if (adc->channels == 1) { in adcxx_show() 80 mutex_unlock(&adc->lock); in adcxx_show() 103 mutex_unlock(&adc->lock); in adcxx_max_show() 122 adc->reference = value; in adcxx_max_store() 154 struct adcxx *adc; in adcxx_probe() local 158 adc = devm_kzalloc(&spi->dev, sizeof(*adc), GFP_KERNEL); in adcxx_probe() 159 if (!adc) in adcxx_probe() 163 adc->reference = 3300; in adcxx_probe() 165 mutex_init(&adc->lock); in adcxx_probe() 167 mutex_lock(&adc->lock); in adcxx_probe() [all …]
|
/linux/Documentation/devicetree/bindings/iio/adc/ |
A D | samsung,exynos-adc.yaml | 4 $id: http://devicetree.org/schemas/iio/adc/samsung,exynos-adc.yaml# 19 - samsung,exynos7-adc 20 - samsung,s3c2410-adc 21 - samsung,s3c2416-adc 22 - samsung,s3c2440-adc 23 - samsung,s3c2443-adc 24 - samsung,s3c6410-adc 25 - samsung,s5pv210-adc 104 - const: adc 126 adc: adc@12d10000 { [all …]
|
A D | atmel,sama9260-adc.yaml | 4 $id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml# 16 - atmel,at91sam9rl-adc 36 atmel,adc-channels-used: 40 atmel,adc-startup-time: 45 atmel,adc-vref: 53 atmel,adc-use-res: 62 atmel,adc-sleep-mode: 70 atmel,adc-ts-wires: 74 NOTE: when adc touchscreen is enabled, the adc hardware trigger will be 98 - atmel,adc-vref [all …]
|