Lines Matching full:custom
235 struct ltc2983_custom_sensor *custom; member
242 struct ltc2983_custom_sensor *custom; member
251 struct ltc2983_custom_sensor *custom; member
332 struct ltc2983_custom_sensor *custom, in __ltc2983_chan_custom_sensor_assign() argument
336 u8 mult = custom->is_steinhart ? LTC2983_CUSTOM_STEINHART_ENTRY_SZ : in __ltc2983_chan_custom_sensor_assign()
340 * custom->size holds the raw size of the table. However, when in __ltc2983_chan_custom_sensor_assign()
345 const u8 len = custom->is_steinhart ? 0 : in __ltc2983_chan_custom_sensor_assign()
346 (custom->size / LTC2983_CUSTOM_SENSOR_ENTRY_SZ) - 1; in __ltc2983_chan_custom_sensor_assign()
351 if (custom->offset < 0) { in __ltc2983_chan_custom_sensor_assign()
354 * when this test was done (successfully) for this custom in __ltc2983_chan_custom_sensor_assign()
358 if (st->custom_table_size + custom->size > in __ltc2983_chan_custom_sensor_assign()
362 "Not space left(%d) for new custom sensor(%zu)", in __ltc2983_chan_custom_sensor_assign()
364 custom->size); in __ltc2983_chan_custom_sensor_assign()
368 custom->offset = st->custom_table_size / in __ltc2983_chan_custom_sensor_assign()
370 st->custom_table_size += custom->size; in __ltc2983_chan_custom_sensor_assign()
373 reg = (custom->offset * mult) + LTC2983_CUST_SENS_TBL_START_REG; in __ltc2983_chan_custom_sensor_assign()
376 *chan_val |= LTC2983_CUSTOM_ADDR(custom->offset); in __ltc2983_chan_custom_sensor_assign()
377 dev_dbg(dev, "Assign custom sensor, reg:0x%04X, off:%d, sz:%zu", in __ltc2983_chan_custom_sensor_assign()
378 reg, custom->offset, in __ltc2983_chan_custom_sensor_assign()
379 custom->size); in __ltc2983_chan_custom_sensor_assign()
380 /* write custom sensor table */ in __ltc2983_chan_custom_sensor_assign()
381 return regmap_bulk_write(st->regmap, reg, custom->table, custom->size); in __ltc2983_chan_custom_sensor_assign()
392 * For custom steinhart, the full u32 is taken. For all the others in __ltc2983_custom_sensor_new()
424 dev_err(dev, "No space left(%d) for new custom sensor(%zu)", in __ltc2983_custom_sensor_new()
518 if (thermo->custom) { in ltc2983_thermocouple_assign_chan()
521 ret = __ltc2983_chan_custom_sensor_assign(st, thermo->custom, in ltc2983_thermocouple_assign_chan()
540 if (rtd->custom) { in ltc2983_rtd_assign_chan()
543 ret = __ltc2983_chan_custom_sensor_assign(st, rtd->custom, in ltc2983_rtd_assign_chan()
562 if (thermistor->custom) { in ltc2983_thermistor_assign_chan()
566 thermistor->custom, in ltc2983_thermistor_assign_chan()
676 /* check custom sensor */ in ltc2983_thermocouple_new()
678 const char *propname = "adi,custom-thermocouple"; in ltc2983_thermocouple_new()
680 thermo->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermocouple_new()
683 if (IS_ERR(thermo->custom)) { in ltc2983_thermocouple_new()
684 ret = PTR_ERR(thermo->custom); in ltc2983_thermocouple_new()
809 /* check custom sensor */ in ltc2983_rtd_new()
811 rtd->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_rtd_new()
812 "adi,custom-rtd", in ltc2983_rtd_new()
814 if (IS_ERR(rtd->custom)) { in ltc2983_rtd_new()
815 ret = PTR_ERR(rtd->custom); in ltc2983_rtd_new()
920 /* check custom sensor */ in ltc2983_thermistor_new()
927 propname = "adi,custom-steinhart"; in ltc2983_thermistor_new()
929 propname = "adi,custom-thermistor"; in ltc2983_thermistor_new()
932 thermistor->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermistor_new()
936 if (IS_ERR(thermistor->custom)) { in ltc2983_thermistor_new()
937 ret = PTR_ERR(thermistor->custom); in ltc2983_thermistor_new()
948 /* Auto range is not allowed for custom sensors */ in ltc2983_thermistor_new()
962 "Auto Range not allowed for custom sensors\n"); in ltc2983_thermistor_new()