Lines Matching refs:thermistor
543 struct ltc2983_thermistor *thermistor = to_thermistor(sensor); in ltc2983_thermistor_assign_chan() local
546 chan_val = LTC2983_CHAN_ASSIGN(thermistor->r_sense_chan); in ltc2983_thermistor_assign_chan()
547 chan_val |= LTC2983_THERMISTOR_CFG(thermistor->sensor_config); in ltc2983_thermistor_assign_chan()
549 LTC2983_THERMISTOR_EXC_CURRENT(thermistor->excitation_current); in ltc2983_thermistor_assign_chan()
551 if (thermistor->custom) { in ltc2983_thermistor_assign_chan()
555 thermistor->custom, in ltc2983_thermistor_assign_chan()
867 struct ltc2983_thermistor *thermistor; in ltc2983_thermistor_new() local
873 thermistor = devm_kzalloc(dev, sizeof(*thermistor), GFP_KERNEL); in ltc2983_thermistor_new()
874 if (!thermistor) in ltc2983_thermistor_new()
883 ret = of_property_read_u32(phandle, "reg", &thermistor->r_sense_chan); in ltc2983_thermistor_new()
890 thermistor->sensor_config = LTC2983_THERMISTOR_SGL(1); in ltc2983_thermistor_new()
894 thermistor->sensor_config = in ltc2983_thermistor_new()
897 thermistor->sensor_config = in ltc2983_thermistor_new()
901 if (!(thermistor->sensor_config & LTC2983_THERMISTOR_DIFF_MASK) && in ltc2983_thermistor_new()
922 thermistor->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermistor_new()
926 if (IS_ERR(thermistor->custom)) { in ltc2983_thermistor_new()
928 return ERR_CAST(thermistor->custom); in ltc2983_thermistor_new()
932 thermistor->sensor.fault_handler = ltc2983_common_fault_handler; in ltc2983_thermistor_new()
933 thermistor->sensor.assign_chan = ltc2983_thermistor_assign_chan; in ltc2983_thermistor_new()
941 thermistor->excitation_current = 0x03; in ltc2983_thermistor_new()
944 thermistor->excitation_current = 0x0c; in ltc2983_thermistor_new()
956 thermistor->excitation_current = 0x0c; in ltc2983_thermistor_new()
959 thermistor->excitation_current = 0x01; in ltc2983_thermistor_new()
962 thermistor->excitation_current = 0x02; in ltc2983_thermistor_new()
965 thermistor->excitation_current = 0x03; in ltc2983_thermistor_new()
968 thermistor->excitation_current = 0x04; in ltc2983_thermistor_new()
971 thermistor->excitation_current = 0x05; in ltc2983_thermistor_new()
974 thermistor->excitation_current = 0x06; in ltc2983_thermistor_new()
977 thermistor->excitation_current = 0x07; in ltc2983_thermistor_new()
980 thermistor->excitation_current = 0x08; in ltc2983_thermistor_new()
983 thermistor->excitation_current = 0x09; in ltc2983_thermistor_new()
986 thermistor->excitation_current = 0x0a; in ltc2983_thermistor_new()
989 thermistor->excitation_current = 0x0b; in ltc2983_thermistor_new()
1001 return &thermistor->sensor; in ltc2983_thermistor_new()