Lines Matching refs:diode
568 struct ltc2983_diode *diode = to_diode(sensor); in ltc2983_diode_assign_chan() local
571 chan_val = LTC2983_DIODE_CFG(diode->sensor_config); in ltc2983_diode_assign_chan()
572 chan_val |= LTC2983_DIODE_EXC_CURRENT(diode->excitation_current); in ltc2983_diode_assign_chan()
573 chan_val |= LTC2983_DIODE_IDEAL_FACTOR(diode->ideal_factor_value); in ltc2983_diode_assign_chan()
1014 struct ltc2983_diode *diode; in ltc2983_diode_new() local
1018 diode = devm_kzalloc(&st->spi->dev, sizeof(*diode), GFP_KERNEL); in ltc2983_diode_new()
1019 if (!diode) in ltc2983_diode_new()
1023 diode->sensor_config = LTC2983_DIODE_SGL(1); in ltc2983_diode_new()
1026 diode->sensor_config |= LTC2983_DIODE_3_CONV_CYCLE(1); in ltc2983_diode_new()
1029 diode->sensor_config |= LTC2983_DIODE_AVERAGE_ON(1); in ltc2983_diode_new()
1032 if (!(diode->sensor_config & LTC2983_DIODE_DIFF_MASK) && in ltc2983_diode_new()
1040 diode->sensor.fault_handler = ltc2983_common_fault_handler; in ltc2983_diode_new()
1041 diode->sensor.assign_chan = ltc2983_diode_assign_chan; in ltc2983_diode_new()
1048 diode->excitation_current = 0x00; in ltc2983_diode_new()
1051 diode->excitation_current = 0x01; in ltc2983_diode_new()
1054 diode->excitation_current = 0x02; in ltc2983_diode_new()
1057 diode->excitation_current = 0x03; in ltc2983_diode_new()
1070 diode->ideal_factor_value = __convert_to_raw(temp, 1048576); in ltc2983_diode_new()
1072 return &diode->sensor; in ltc2983_diode_new()