Lines Matching refs:data
50 * to PVT data and vice-versa are following:
121 * fraction representation), data power and the rational fraction divider
125 static long pvt_calc_poly(const struct pvt_poly *poly, long data)
134 tmp = mult_frac(tmp, data, term->divider);
141 static inline u32 pvt_update(void __iomem *reg, u32 mask, u32 data)
146 writel((old & ~mask) | (data & mask), reg);
202 * IRQs being periodically raised to get the data cache/alarms status up to
211 * thresholds comparator is enabled right after the data conversion is
217 * data conversion completion. The best driver design would be to have the
219 * driver data cache. This solution is implemented if hwmon alarms are enabled
228 static irqreturn_t pvt_soft_isr(int irq, void *data)
231 struct pvt_hwmon *pvt = data;
236 * DVALID bit will be cleared by reading the data. We need to save the
256 * corresponds to one. Then we read the data. By doing so we also
257 * recharge the data conversion. After this the mode corresponding
275 * We can now update the data cache with data just retrieved from the
277 * data.
281 cache->data = FIELD_GET(PVT_DATA_DATA_MASK, val);
286 * While PVT core is doing the next mode data conversion, we'll check
319 u32 data;
323 data = cache->data;
327 *val = pvt_calc_poly(&poly_N_to_temp, data);
329 *val = pvt_calc_poly(&poly_N_to_volt, data);
337 u32 data;
340 data = readl(pvt->regs + pvt_info[type].thres_base);
343 data = FIELD_GET(PVT_THRES_LO_MASK, data);
345 data = FIELD_GET(PVT_THRES_HI_MASK, data);
348 *val = pvt_calc_poly(&poly_N_to_temp, data);
350 *val = pvt_calc_poly(&poly_N_to_volt, data);
358 u32 data, limit, mask;
363 data = pvt_calc_poly(&poly_temp_to_N, val);
366 data = pvt_calc_poly(&poly_volt_to_N, val);
378 data = clamp_val(data, PVT_DATA_MIN, limit);
379 data = FIELD_PREP(PVT_THRES_LO_MASK, data);
383 data = clamp_val(data, limit, PVT_DATA_MAX);
384 data = FIELD_PREP(PVT_THRES_HI_MASK, data);
388 pvt_update(pvt->regs + pvt_info[type].thres_base, mask, data);
432 static irqreturn_t pvt_hard_isr(int irq, void *data)
434 struct pvt_hwmon *pvt = data;
446 * Nothing special for alarm-less driver. Just read the data, update
451 dev_err(pvt->dev, "Got IRQ when data isn't valid\n");
457 WRITE_ONCE(cache->data, FIELD_GET(PVT_DATA_DATA_MASK, val));
481 u32 data;
485 * Lock PVT conversion interface until data cache is updated. The
486 * data read procedure is following: set the requested PVT sensor
488 * then disable conversion and IRQ, and read the cached data.
517 data = READ_ONCE(cache->data);
525 *val = pvt_calc_poly(&poly_N_to_temp, data);
527 *val = pvt_calc_poly(&poly_N_to_volt, data);
586 static umode_t pvt_hwmon_is_visible(const void *data,
638 u32 data;
640 data = readl(pvt->regs + PVT_CTRL);
641 *val = FIELD_GET(PVT_CTRL_TRIM_MASK, data) * PVT_TRIM_STEP;
687 u32 data;
716 data = ktime_divns(kt * rate, NSEC_PER_SEC);
727 pvt_set_tout(pvt, data);
871 static void pvt_clear_data(void *data)
873 struct pvt_hwmon *pvt = data;
896 dev_err(dev, "Can't add PVT data clear action\n");
935 static void pvt_disable_clks(void *data)
937 struct pvt_hwmon *pvt = data;
974 u32 data;
981 * data read procedure will either return -ETIMEDOUT (for the
994 data = readl(pvt->regs + PVT_DATA);
995 if (!(data & PVT_DATA_VALID)) {
1018 * accidentally have ISR executed before the driver data is fully
1032 * sensors data samples in the driver data so not to recalculate it
1033 * each time on the data requests and timeout reads. It consists of the
1103 static void pvt_disable_iface(void *data)
1105 struct pvt_hwmon *pvt = data;
1125 * Enable sensors data conversion and IRQ. We need to lock the