Lines Matching full:custom
229 struct ltc2983_custom_sensor *custom; member
236 struct ltc2983_custom_sensor *custom; member
245 struct ltc2983_custom_sensor *custom; member
326 struct ltc2983_custom_sensor *custom, in __ltc2983_chan_custom_sensor_assign() argument
330 u8 mult = custom->is_steinhart ? LTC2983_CUSTOM_STEINHART_ENTRY_SZ : in __ltc2983_chan_custom_sensor_assign()
334 * custom->size holds the raw size of the table. However, when in __ltc2983_chan_custom_sensor_assign()
339 const u8 len = custom->is_steinhart ? 0 : in __ltc2983_chan_custom_sensor_assign()
340 (custom->size / LTC2983_CUSTOM_SENSOR_ENTRY_SZ) - 1; in __ltc2983_chan_custom_sensor_assign()
345 if (custom->offset < 0) { in __ltc2983_chan_custom_sensor_assign()
348 * when this test was done (successfully) for this custom in __ltc2983_chan_custom_sensor_assign()
352 if (st->custom_table_size + custom->size > in __ltc2983_chan_custom_sensor_assign()
356 "Not space left(%d) for new custom sensor(%zu)", in __ltc2983_chan_custom_sensor_assign()
358 custom->size); in __ltc2983_chan_custom_sensor_assign()
362 custom->offset = st->custom_table_size / in __ltc2983_chan_custom_sensor_assign()
364 st->custom_table_size += custom->size; in __ltc2983_chan_custom_sensor_assign()
367 reg = (custom->offset * mult) + LTC2983_CUST_SENS_TBL_START_REG; in __ltc2983_chan_custom_sensor_assign()
370 *chan_val |= LTC2983_CUSTOM_ADDR(custom->offset); in __ltc2983_chan_custom_sensor_assign()
371 dev_dbg(dev, "Assign custom sensor, reg:0x%04X, off:%d, sz:%zu", in __ltc2983_chan_custom_sensor_assign()
372 reg, custom->offset, in __ltc2983_chan_custom_sensor_assign()
373 custom->size); in __ltc2983_chan_custom_sensor_assign()
374 /* write custom sensor table */ in __ltc2983_chan_custom_sensor_assign()
375 return regmap_bulk_write(st->regmap, reg, custom->table, custom->size); in __ltc2983_chan_custom_sensor_assign()
390 * For custom steinhart, the full u32 is taken. For all the others in __ltc2983_custom_sensor_new()
418 dev_err(dev, "No space left(%d) for new custom sensor(%zu)", in __ltc2983_custom_sensor_new()
507 if (thermo->custom) { in ltc2983_thermocouple_assign_chan()
510 ret = __ltc2983_chan_custom_sensor_assign(st, thermo->custom, in ltc2983_thermocouple_assign_chan()
529 if (rtd->custom) { in ltc2983_rtd_assign_chan()
532 ret = __ltc2983_chan_custom_sensor_assign(st, rtd->custom, in ltc2983_rtd_assign_chan()
551 if (thermistor->custom) { in ltc2983_thermistor_assign_chan()
555 thermistor->custom, in ltc2983_thermistor_assign_chan()
669 /* check custom sensor */ in ltc2983_thermocouple_new()
671 const char *propname = "adi,custom-thermocouple"; in ltc2983_thermocouple_new()
673 thermo->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermocouple_new()
676 if (IS_ERR(thermo->custom)) { in ltc2983_thermocouple_new()
678 return ERR_CAST(thermo->custom); in ltc2983_thermocouple_new()
798 /* check custom sensor */ in ltc2983_rtd_new()
800 rtd->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_rtd_new()
801 "adi,custom-rtd", in ltc2983_rtd_new()
803 if (IS_ERR(rtd->custom)) { in ltc2983_rtd_new()
805 return ERR_CAST(rtd->custom); in ltc2983_rtd_new()
910 /* check custom sensor */ in ltc2983_thermistor_new()
917 propname = "adi,custom-steinhart"; in ltc2983_thermistor_new()
919 propname = "adi,custom-thermistor"; 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()
938 /* Auto range is not allowed for custom sensors */ in ltc2983_thermistor_new()
952 "Auto Range not allowed for custom sensors\n"); in ltc2983_thermistor_new()