Lines Matching refs:adc_dev

107 	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);  in mt6577_auxadc_read()  local
109 reg_channel = adc_dev->reg_base + MT6577_AUXADC_DAT0 + in mt6577_auxadc_read()
112 mutex_lock(&adc_dev->lock); in mt6577_auxadc_read()
114 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
130 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_CON1, in mt6577_auxadc_read()
136 if (adc_dev->dev_comp->check_global_idle) { in mt6577_auxadc_read()
138 ret = readl_poll_timeout(adc_dev->reg_base + MT6577_AUXADC_CON2, in mt6577_auxadc_read()
164 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
170 mutex_unlock(&adc_dev->lock); in mt6577_auxadc_read()
181 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_read_raw() local
192 if (adc_dev->dev_comp->sample_data_cali) in mt6577_auxadc_read_raw()
208 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_resume() local
211 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_resume()
217 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_resume()
227 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_suspend() local
229 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_suspend()
231 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_suspend()
238 struct mt6577_auxadc_device *adc_dev; in mt6577_auxadc_probe() local
243 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); in mt6577_auxadc_probe()
247 adc_dev = iio_priv(indio_dev); in mt6577_auxadc_probe()
254 adc_dev->reg_base = devm_platform_ioremap_resource(pdev, 0); in mt6577_auxadc_probe()
255 if (IS_ERR(adc_dev->reg_base)) { in mt6577_auxadc_probe()
257 return PTR_ERR(adc_dev->reg_base); in mt6577_auxadc_probe()
260 adc_dev->adc_clk = devm_clk_get(&pdev->dev, "main"); in mt6577_auxadc_probe()
261 if (IS_ERR(adc_dev->adc_clk)) { in mt6577_auxadc_probe()
263 return PTR_ERR(adc_dev->adc_clk); in mt6577_auxadc_probe()
266 ret = clk_prepare_enable(adc_dev->adc_clk); in mt6577_auxadc_probe()
272 adc_clk_rate = clk_get_rate(adc_dev->adc_clk); in mt6577_auxadc_probe()
279 adc_dev->dev_comp = device_get_match_data(&pdev->dev); in mt6577_auxadc_probe()
281 mutex_init(&adc_dev->lock); in mt6577_auxadc_probe()
283 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
298 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_probe()
301 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_probe()
308 struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); in mt6577_auxadc_remove() local
312 mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, in mt6577_auxadc_remove()
315 clk_disable_unprepare(adc_dev->adc_clk); in mt6577_auxadc_remove()