Lines Matching refs:adc_dev
111 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_read() local
113 reg_channel = adc_dev->reg_base + MT6577_AUXADC_DAT0 + in mt6577_auxadc_read()
116 mutex_lock(&adc_dev->lock); in mt6577_auxadc_read()
118 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
134 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
140 if (adc_dev->dev_comp->check_global_idle) { in mt6577_auxadc_read()
142 ret = readl_poll_timeout(adc_dev->reg_base + MT6577_AUXADC_CON2, in mt6577_auxadc_read()
168 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
174 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
185 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_read_raw() local
196 if (adc_dev->dev_comp->sample_data_cali) in mt6577_auxadc_read_raw()
216 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_resume() local
219 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_resume()
225 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_resume()
235 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_suspend() local
237 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_suspend()
239 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_suspend()
246 struct mt6577_auxadc_device *adc_dev; in mt6577_auxadc_probe() local
251 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); in mt6577_auxadc_probe()
255 adc_dev = iio_priv(indio_dev); in mt6577_auxadc_probe()
262 adc_dev->reg_base = devm_platform_ioremap_resource(pdev, 0); in mt6577_auxadc_probe()
263 if (IS_ERR(adc_dev->reg_base)) { in mt6577_auxadc_probe()
265 return PTR_ERR(adc_dev->reg_base); in mt6577_auxadc_probe()
268 adc_dev->adc_clk = devm_clk_get(&pdev->dev, "main"); in mt6577_auxadc_probe()
269 if (IS_ERR(adc_dev->adc_clk)) { in mt6577_auxadc_probe()
271 return PTR_ERR(adc_dev->adc_clk); in mt6577_auxadc_probe()
274 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_probe()
280 adc_clk_rate = clk_get_rate(adc_dev->adc_clk); in mt6577_auxadc_probe()
287 adc_dev->dev_comp = device_get_match_data(&pdev->dev); in mt6577_auxadc_probe()
289 mutex_init(&adc_dev->lock); in mt6577_auxadc_probe()
291 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
306 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
309 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_probe()
316 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_remove() local
320 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_remove()
323 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_remove()