Lines Matching refs:adc_dev

116 	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);  in mt6577_auxadc_read()  local
118 reg_channel = adc_dev->reg_base + MT6577_AUXADC_DAT0 + in mt6577_auxadc_read()
121 mutex_lock(&adc_dev->lock); in mt6577_auxadc_read()
123 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
139 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
145 if (adc_dev->dev_comp->check_global_idle) { in mt6577_auxadc_read()
147 ret = readl_poll_timeout(adc_dev->reg_base + MT6577_AUXADC_CON2, in mt6577_auxadc_read()
173 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
179 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
190 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_read_raw() local
201 if (adc_dev->dev_comp->sample_data_cali) in mt6577_auxadc_read_raw()
221 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_resume() local
224 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_resume()
230 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_resume()
240 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_suspend() local
242 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_suspend()
244 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_suspend()
251 struct mt6577_auxadc_device *adc_dev; in mt6577_auxadc_probe() local
256 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); in mt6577_auxadc_probe()
260 adc_dev = iio_priv(indio_dev); in mt6577_auxadc_probe()
267 adc_dev->reg_base = devm_platform_ioremap_resource(pdev, 0); in mt6577_auxadc_probe()
268 if (IS_ERR(adc_dev->reg_base)) { in mt6577_auxadc_probe()
270 return PTR_ERR(adc_dev->reg_base); in mt6577_auxadc_probe()
273 adc_dev->adc_clk = devm_clk_get(&pdev->dev, "main"); in mt6577_auxadc_probe()
274 if (IS_ERR(adc_dev->adc_clk)) { in mt6577_auxadc_probe()
276 return PTR_ERR(adc_dev->adc_clk); in mt6577_auxadc_probe()
279 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_probe()
285 adc_clk_rate = clk_get_rate(adc_dev->adc_clk); in mt6577_auxadc_probe()
292 adc_dev->dev_comp = device_get_match_data(&pdev->dev); in mt6577_auxadc_probe()
294 mutex_init(&adc_dev->lock); in mt6577_auxadc_probe()
296 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
311 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
314 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_probe()
321 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_remove() local
325 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_remove()
328 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_remove()