- int val;
-
- /*
- * Setup TSET ( trip point ) register
- */
- val = ((CFG_DTT_MAX_TEMP * 2) << 7) & 0xff80; /* trip */
- if (dtt_write(sensor, DTT_TEMP_SET, val) != 0)
- return 1;
-
- /*
- * Setup THYST ( untrip point ) register - Hysteresis
- */
- val = (((CFG_DTT_MAX_TEMP - CFG_DTT_HYSTERESIS) * 2) << 7) & 0xff80;
- if (dtt_write(sensor, DTT_TEMP_HYST, val) != 0)
- return 1;
-
- /*
- * Setup configuraton register
- */
-#ifdef CONFIG_DTT_AD7414
- /* config = alert active low and disabled */
- val = 0x60;
-#else
- /* config = 6 sample integration, int mode, active low, and enable */
- val = 0x18;
-#endif
- if (dtt_write(sensor, DTT_CONFIG, val) != 0)
- return 1;