Lines Matching refs:tmdev
54 void compute_intercept_slope(struct tsens_device *tmdev, u32 *p1, in compute_intercept_slope() argument
60 for (i = 0; i < tmdev->num_sensors; i++) { in compute_intercept_slope()
61 dev_dbg(tmdev->dev, in compute_intercept_slope()
65 tmdev->sensor[i].slope = SLOPE_DEFAULT; in compute_intercept_slope()
74 tmdev->sensor[i].slope = num / den; in compute_intercept_slope()
77 tmdev->sensor[i].offset = (p1[i] * SLOPE_FACTOR) - in compute_intercept_slope()
79 tmdev->sensor[i].slope); in compute_intercept_slope()
80 dev_dbg(tmdev->dev, "offset:%d\n", tmdev->sensor[i].offset); in compute_intercept_slope()
103 int get_temp_common(struct tsens_device *tmdev, int id, int *temp) in get_temp_common() argument
105 struct tsens_sensor *s = &tmdev->sensor[id]; in get_temp_common()
111 ret = regmap_read(tmdev->map, status_reg, &code); in get_temp_common()
127 int __init init_common(struct tsens_device *tmdev) in init_common() argument
131 struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); in init_common()
138 tmdev->tm_offset = 0; in init_common()
141 tmdev->tm_offset = 0x1000; in init_common()
149 tmdev->map = devm_regmap_init_mmio(tmdev->dev, base, &tsens_config); in init_common()
150 if (IS_ERR(tmdev->map)) in init_common()
151 return PTR_ERR(tmdev->map); in init_common()