• Home
  • Raw
  • Download

Lines Matching refs:adc_priv

121 	struct iproc_adc_priv *adc_priv = iio_priv(indio_dev);  in iproc_adc_reg_dump()  local
123 iproc_adc_dbg_reg(dev, adc_priv, IPROC_REGCTL1); in iproc_adc_reg_dump()
124 iproc_adc_dbg_reg(dev, adc_priv, IPROC_REGCTL2); in iproc_adc_reg_dump()
125 iproc_adc_dbg_reg(dev, adc_priv, IPROC_INTERRUPT_THRES); in iproc_adc_reg_dump()
126 iproc_adc_dbg_reg(dev, adc_priv, IPROC_INTERRUPT_MASK); in iproc_adc_reg_dump()
127 iproc_adc_dbg_reg(dev, adc_priv, IPROC_INTERRUPT_STATUS); in iproc_adc_reg_dump()
128 iproc_adc_dbg_reg(dev, adc_priv, IPROC_CONTROLLER_STATUS); in iproc_adc_reg_dump()
129 iproc_adc_dbg_reg(dev, adc_priv, IPROC_ANALOG_CONTROL); in iproc_adc_reg_dump()
130 iproc_adc_dbg_reg(dev, adc_priv, IPROC_AUX_DATA); in iproc_adc_reg_dump()
131 iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_CONTROL); in iproc_adc_reg_dump()
132 iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA); in iproc_adc_reg_dump()
141 struct iproc_adc_priv *adc_priv = iio_priv(indio_dev); in iproc_adc_interrupt_thread() local
148 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status); in iproc_adc_interrupt_thread()
149 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &intr_mask); in iproc_adc_interrupt_thread()
162 struct iproc_adc_priv *adc_priv; in iproc_adc_interrupt_handler() local
170 adc_priv = iio_priv(indio_dev); in iproc_adc_interrupt_handler()
172 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status); in iproc_adc_interrupt_handler()
178 regmap_read(adc_priv->regmap, in iproc_adc_interrupt_handler()
180 IPROC_ADC_CHANNEL_OFFSET * adc_priv->chan_id, in iproc_adc_interrupt_handler()
184 regmap_read(adc_priv->regmap, in iproc_adc_interrupt_handler()
187 adc_priv->chan_id, in iproc_adc_interrupt_handler()
194 regmap_read(adc_priv->regmap, in iproc_adc_interrupt_handler()
197 adc_priv->chan_id, in iproc_adc_interrupt_handler()
198 &adc_priv->chan_val); in iproc_adc_interrupt_handler()
199 complete(&adc_priv->completion); in iproc_adc_interrupt_handler()
203 adc_priv->chan_id); in iproc_adc_interrupt_handler()
205 regmap_write(adc_priv->regmap, in iproc_adc_interrupt_handler()
208 adc_priv->chan_id, in iproc_adc_interrupt_handler()
212 regmap_write(adc_priv->regmap, in iproc_adc_interrupt_handler()
214 IPROC_ADC_CHANNEL_OFFSET * adc_priv->chan_id, in iproc_adc_interrupt_handler()
216 regmap_write(adc_priv->regmap, IPROC_INTERRUPT_STATUS, in iproc_adc_interrupt_handler()
233 struct iproc_adc_priv *adc_priv = iio_priv(indio_dev); in iproc_adc_do_read() local
235 mutex_lock(&adc_priv->mutex); in iproc_adc_do_read()
241 adc_priv->chan_val = -1; in iproc_adc_do_read()
242 adc_priv->chan_id = channel; in iproc_adc_do_read()
244 reinit_completion(&adc_priv->completion); in iproc_adc_do_read()
246 regmap_update_bits(adc_priv->regmap, IPROC_INTERRUPT_STATUS, in iproc_adc_do_read()
258 regmap_update_bits(adc_priv->regmap, (IPROC_ADC_CHANNEL_REGCTL1 + in iproc_adc_do_read()
263 regmap_update_bits(adc_priv->regmap, (IPROC_ADC_CHANNEL_REGCTL2 + in iproc_adc_do_read()
269 regmap_update_bits(adc_priv->regmap, (IPROC_ADC_CHANNEL_INTERRUPT_MASK + in iproc_adc_do_read()
274 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &val); in iproc_adc_do_read()
278 regmap_write(adc_priv->regmap, IPROC_INTERRUPT_MASK, val); in iproc_adc_do_read()
287 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &val_check); in iproc_adc_do_read()
295 regmap_update_bits(adc_priv->regmap, IPROC_INTERRUPT_MASK, in iproc_adc_do_read()
300 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &val_check); in iproc_adc_do_read()
313 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &val_check); in iproc_adc_do_read()
315 if (wait_for_completion_timeout(&adc_priv->completion, in iproc_adc_do_read()
319 *p_adc_data = adc_priv->chan_val & 0xFFFF; in iproc_adc_do_read()
332 mutex_unlock(&adc_priv->mutex); in iproc_adc_do_read()
337 regmap_update_bits(adc_priv->regmap, IPROC_INTERRUPT_MASK, in iproc_adc_do_read()
341 regmap_update_bits(adc_priv->regmap, IPROC_INTERRUPT_STATUS, in iproc_adc_do_read()
347 mutex_unlock(&adc_priv->mutex); in iproc_adc_do_read()
356 struct iproc_adc_priv *adc_priv = iio_priv(indio_dev); in iproc_adc_enable() local
360 ret = regmap_update_bits(adc_priv->regmap, IPROC_ANALOG_CONTROL, in iproc_adc_enable()
367 adc_priv->chan_val = -1; in iproc_adc_enable()
373 ret = regmap_read(adc_priv->regmap, IPROC_REGCTL2, &val); in iproc_adc_enable()
382 ret = regmap_write(adc_priv->regmap, IPROC_REGCTL2, val); in iproc_adc_enable()
389 ret = regmap_read(adc_priv->regmap, IPROC_REGCTL2, &val); in iproc_adc_enable()
397 ret = regmap_write(adc_priv->regmap, IPROC_REGCTL2, val); in iproc_adc_enable()
406 ret = regmap_write(adc_priv->regmap, in iproc_adc_enable()
416 ret = regmap_write(adc_priv->regmap, in iproc_adc_enable()
434 struct iproc_adc_priv *adc_priv = iio_priv(indio_dev); in iproc_adc_disable() local
436 ret = regmap_read(adc_priv->regmap, IPROC_REGCTL2, &val); in iproc_adc_disable()
444 ret = regmap_write(adc_priv->regmap, IPROC_REGCTL2, val); in iproc_adc_disable()
508 struct iproc_adc_priv *adc_priv; in iproc_adc_probe() local
513 sizeof(*adc_priv)); in iproc_adc_probe()
519 adc_priv = iio_priv(indio_dev); in iproc_adc_probe()
522 mutex_init(&adc_priv->mutex); in iproc_adc_probe()
524 init_completion(&adc_priv->completion); in iproc_adc_probe()
526 adc_priv->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in iproc_adc_probe()
528 if (IS_ERR(adc_priv->regmap)) { in iproc_adc_probe()
530 ret = PTR_ERR(adc_priv->regmap); in iproc_adc_probe()
534 adc_priv->adc_clk = devm_clk_get(&pdev->dev, "tsc_clk"); in iproc_adc_probe()
535 if (IS_ERR(adc_priv->adc_clk)) { in iproc_adc_probe()
538 ret = PTR_ERR(adc_priv->adc_clk); in iproc_adc_probe()
542 adc_priv->irqno = platform_get_irq(pdev, 0); in iproc_adc_probe()
543 if (adc_priv->irqno <= 0) in iproc_adc_probe()
546 ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, in iproc_adc_probe()
553 ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno, in iproc_adc_probe()
562 ret = clk_prepare_enable(adc_priv->adc_clk); in iproc_adc_probe()
592 clk_disable_unprepare(adc_priv->adc_clk); in iproc_adc_probe()
600 struct iproc_adc_priv *adc_priv = iio_priv(indio_dev); in iproc_adc_remove() local
604 clk_disable_unprepare(adc_priv->adc_clk); in iproc_adc_remove()