Lines Matching full:custom
263 struct ltc2983_custom_sensor *custom; member
270 struct ltc2983_custom_sensor *custom; member
279 struct ltc2983_custom_sensor *custom; member
304 struct ltc2983_custom_sensor *custom; member
365 struct ltc2983_custom_sensor *custom, in __ltc2983_chan_custom_sensor_assign() argument
369 u8 mult = custom->is_steinhart ? LTC2983_CUSTOM_STEINHART_ENTRY_SZ : in __ltc2983_chan_custom_sensor_assign()
373 * custom->size holds the raw size of the table. However, when in __ltc2983_chan_custom_sensor_assign()
378 const u8 len = custom->is_steinhart ? 0 : in __ltc2983_chan_custom_sensor_assign()
379 (custom->size / LTC2983_CUSTOM_SENSOR_ENTRY_SZ) - 1; in __ltc2983_chan_custom_sensor_assign()
384 if (custom->offset < 0) { in __ltc2983_chan_custom_sensor_assign()
387 * when this test was done (successfully) for this custom in __ltc2983_chan_custom_sensor_assign()
391 if (st->custom_table_size + custom->size > in __ltc2983_chan_custom_sensor_assign()
395 "Not space left(%d) for new custom sensor(%zu)", in __ltc2983_chan_custom_sensor_assign()
397 custom->size); in __ltc2983_chan_custom_sensor_assign()
401 custom->offset = st->custom_table_size / in __ltc2983_chan_custom_sensor_assign()
403 st->custom_table_size += custom->size; in __ltc2983_chan_custom_sensor_assign()
406 reg = (custom->offset * mult) + LTC2983_CUST_SENS_TBL_START_REG; in __ltc2983_chan_custom_sensor_assign()
409 *chan_val |= LTC2983_CUSTOM_ADDR(custom->offset); in __ltc2983_chan_custom_sensor_assign()
410 dev_dbg(dev, "Assign custom sensor, reg:0x%04X, off:%d, sz:%zu", in __ltc2983_chan_custom_sensor_assign()
411 reg, custom->offset, in __ltc2983_chan_custom_sensor_assign()
412 custom->size); in __ltc2983_chan_custom_sensor_assign()
413 /* write custom sensor table */ in __ltc2983_chan_custom_sensor_assign()
414 return regmap_bulk_write(st->regmap, reg, custom->table, custom->size); in __ltc2983_chan_custom_sensor_assign()
425 * For custom steinhart, the full u32 is taken. For all the others in __ltc2983_custom_sensor_new()
456 "No space left(%d) for new custom sensor(%zu)\n", in __ltc2983_custom_sensor_new()
548 if (thermo->custom) { in ltc2983_thermocouple_assign_chan()
551 ret = __ltc2983_chan_custom_sensor_assign(st, thermo->custom, in ltc2983_thermocouple_assign_chan()
570 if (rtd->custom) { in ltc2983_rtd_assign_chan()
573 ret = __ltc2983_chan_custom_sensor_assign(st, rtd->custom, in ltc2983_rtd_assign_chan()
592 if (thermistor->custom) { in ltc2983_thermistor_assign_chan()
596 thermistor->custom, in ltc2983_thermistor_assign_chan()
648 ret = __ltc2983_chan_custom_sensor_assign(st, temp->custom, &chan_val); in ltc2983_temp_assign_chan()
719 /* check custom sensor */ in ltc2983_thermocouple_new()
721 const char *propname = "adi,custom-thermocouple"; in ltc2983_thermocouple_new()
723 thermo->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermocouple_new()
726 if (IS_ERR(thermo->custom)) in ltc2983_thermocouple_new()
727 return ERR_CAST(thermo->custom); in ltc2983_thermocouple_new()
831 /* check custom sensor */ in ltc2983_rtd_new()
833 rtd->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_rtd_new()
834 "adi,custom-rtd", in ltc2983_rtd_new()
836 if (IS_ERR(rtd->custom)) in ltc2983_rtd_new()
837 return ERR_CAST(rtd->custom); in ltc2983_rtd_new()
929 /* check custom sensor */ in ltc2983_thermistor_new()
936 propname = "adi,custom-steinhart"; in ltc2983_thermistor_new()
938 propname = "adi,custom-thermistor"; in ltc2983_thermistor_new()
941 thermistor->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermistor_new()
945 if (IS_ERR(thermistor->custom)) in ltc2983_thermistor_new()
946 return ERR_CAST(thermistor->custom); in ltc2983_thermistor_new()
955 /* Auto range is not allowed for custom sensors */ in ltc2983_thermistor_new()
968 "Auto Range not allowed for custom sensors\n"); in ltc2983_thermistor_new()
1157 temp->custom = __ltc2983_custom_sensor_new(st, child, "adi,custom-temp", in ltc2983_temp_new()
1159 if (IS_ERR(temp->custom)) in ltc2983_temp_new()
1160 return ERR_CAST(temp->custom); in ltc2983_temp_new()