/**
* intel_mid_gpadc_gsmpulse_sample - do gpadc sample during gsm pulse.
- * @val: return the voltage value.
- * @cur: return the current value.
+ * @val: return the voltage value. caller should not access it before return.
+ * @cur: return the current value. caller should not access it before return.
*
* Returns 0 on success or an error code.
*
* @handle: the gpadc handle
* @sample_count: do sample serveral times and get the average value.
* @...: sampling resulting arguments of all channels. refer to sscanf.
+ * caller should not access it before return.
*
* Returns 0 on success or an error code.
*
if (!mgi->initialized)
return -ENODEV;
+ mutex_lock(&mgi->lock);
va_start(args, sample_count);
for (i = 0; i < rq->count; i++) {
val[i] = va_arg(args, int*);
}
va_end(args);
- mutex_lock(&mgi->lock);
pm_qos_add_request(&mgi->pm_qos_request,
PM_QOS_CPU_DMA_LATENCY, PM_QOS_ADC_DRV_VALUE);
gpadc_poweron(mgi, rq->vref);