Ejemplo n.º 1
0
static int rk_tsadcv2_get_temp(struct chip_tsadc_table table,
			       int chn, void __iomem *regs, int *temp)
{
	u32 val;

	val = readl_relaxed(regs + TSADCV2_DATA(chn));

	return rk_tsadcv2_code_to_temp(table, val, temp);
}
Ejemplo n.º 2
0
static int rk_tsadcv2_get_temp(int chn, void __iomem *regs, long *temp)
{
	u32 val;

	/* the A/D value of the channel last conversion need some time */
	val = readl_relaxed(regs + TSADCV2_DATA(chn));
	if (val == 0)
		return -EAGAIN;

	*temp = rk_tsadcv2_code_to_temp(val);

	return 0;
}