Lines Matching refs:hwmon
55 static int da9055_adc_manual_read(struct da9055_hwmon *hwmon, in da9055_adc_manual_read() argument
62 struct da9055 *da9055 = hwmon->da9055; in da9055_adc_manual_read()
67 mutex_lock(&hwmon->irq_lock); in da9055_adc_manual_read()
77 if (!wait_for_completion_timeout(&hwmon->done, in da9055_adc_manual_read()
102 mutex_unlock(&hwmon->irq_lock); in da9055_adc_manual_read()
108 struct da9055_hwmon *hwmon = irq_data; in da9055_auxadc_irq() local
110 complete(&hwmon->done); in da9055_auxadc_irq()
142 struct da9055_hwmon *hwmon = dev_get_drvdata(dev); in da9055_auto_ch_show() local
146 mutex_lock(&hwmon->hwmon_lock); in da9055_auto_ch_show()
148 ret = da9055_enable_auto_mode(hwmon->da9055, channel); in da9055_auto_ch_show()
154 adc = da9055_reg_read(hwmon->da9055, DA9055_REG_VSYS_RES + channel); in da9055_auto_ch_show()
160 ret = da9055_disable_auto_mode(hwmon->da9055, channel); in da9055_auto_ch_show()
164 mutex_unlock(&hwmon->hwmon_lock); in da9055_auto_ch_show()
169 da9055_disable_auto_mode(hwmon->da9055, channel); in da9055_auto_ch_show()
171 mutex_unlock(&hwmon->hwmon_lock); in da9055_auto_ch_show()
178 struct da9055_hwmon *hwmon = dev_get_drvdata(dev); in da9055_tjunc_show() local
182 tjunc = da9055_adc_manual_read(hwmon, DA9055_ADC_TJUNC); in da9055_tjunc_show()
186 toffset = da9055_reg_read(hwmon->da9055, DA9055_REG_T_OFFSET); in da9055_tjunc_show()
237 struct da9055_hwmon *hwmon; in da9055_hwmon_probe() local
241 hwmon = devm_kzalloc(dev, sizeof(struct da9055_hwmon), GFP_KERNEL); in da9055_hwmon_probe()
242 if (!hwmon) in da9055_hwmon_probe()
245 mutex_init(&hwmon->hwmon_lock); in da9055_hwmon_probe()
246 mutex_init(&hwmon->irq_lock); in da9055_hwmon_probe()
248 init_completion(&hwmon->done); in da9055_hwmon_probe()
249 hwmon->da9055 = dev_get_drvdata(pdev->dev.parent); in da9055_hwmon_probe()
258 "adc-irq", hwmon); in da9055_hwmon_probe()
260 dev_err(hwmon->da9055->dev, "DA9055 ADC IRQ failed ret=%d\n", in da9055_hwmon_probe()
266 hwmon, in da9055_hwmon_probe()