bit 7 of efuse value of temp ajust code indecates positive or negtive.
if bit 7 is set, it indecats a negtive ajust code.
Change-Id: I2b604b6b5e566df08b871c817cf25541292575bc
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
.mode = ADC_INCREMENT,
};
-static int rk3368_get_ajust_code(struct device_node *np, u8 *ajust_code)
+static int rk3368_get_ajust_code(struct device_node *np, int *ajust_code)
{
struct nvmem_cell *cell;
unsigned char *buf;
if (buf[0] == INVALID_EFUSE_VALUE)
return -EINVAL;
- *ajust_code = buf[0];
+ if (buf[0] & 0x80)
+ *ajust_code = -(buf[0] & 0x7f);
+ else
+ *ajust_code = buf[0];
+
kfree(buf);
return 0;
int i, j;
int error;
int uv;
- u8 ajust_code = 0;
+ int ajust_code = 0;
match = of_match_node(of_rk3368_thermal_match, np);
if (!match)