Lines Matching refs:rom
92 int (*convert)(u8 rom[9]);
95 static inline int w1_DS18B20_convert_temp(u8 rom[9]);
96 static inline int w1_DS18S20_convert_temp(u8 rom[9]);
113 static inline int w1_DS18B20_convert_temp(u8 rom[9])
115 int t = (rom[1] << 8) | rom[0];
120 static inline int w1_DS18S20_convert_temp(u8 rom[9])
124 if (!rom[7])
127 if (rom[1] == 0)
128 t = ((s32)rom[0] >> 1)*1000;
130 t = 1000*(-1*(s32)(0x100-rom[0]) >> 1);
133 h = 1000*((s32)rom[7] - (s32)rom[6]);
134 h /= (s32)rom[7];
140 static inline int w1_convert_temp(u8 rom[9], u8 fid)
146 return w1_therm_families[i].convert(rom);
151 static int w1_therm_check_rom(u8 rom[9])
156 if (!memcmp(bad_roms[i], rom, 9))
166 u8 rom[9], crc, verdict;
181 memset(rom, 0, sizeof(rom));
199 if ((count = w1_read_block(dev, rom, 9)) != 9) {
203 crc = w1_calc_crc8(rom, 8);
205 if (rom[8] == crc && rom[0])
210 if (!w1_therm_check_rom(rom))
215 count += sprintf(buf + count, "%02x ", rom[i]);
219 memcpy(sl->rom, rom, sizeof(sl->rom));
224 count += sprintf(buf + count, "%02x ", sl->rom[i]);
226 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid));