Lines Matching full:custom
259 struct ltc2983_custom_sensor *custom; member
266 struct ltc2983_custom_sensor *custom; member
275 struct ltc2983_custom_sensor *custom; member
300 struct ltc2983_custom_sensor *custom; member
361 struct ltc2983_custom_sensor *custom, in __ltc2983_chan_custom_sensor_assign() argument
365 u8 mult = custom->is_steinhart ? LTC2983_CUSTOM_STEINHART_ENTRY_SZ : in __ltc2983_chan_custom_sensor_assign()
369 * custom->size holds the raw size of the table. However, when in __ltc2983_chan_custom_sensor_assign()
374 const u8 len = custom->is_steinhart ? 0 : in __ltc2983_chan_custom_sensor_assign()
375 (custom->size / LTC2983_CUSTOM_SENSOR_ENTRY_SZ) - 1; in __ltc2983_chan_custom_sensor_assign()
380 if (custom->offset < 0) { in __ltc2983_chan_custom_sensor_assign()
383 * when this test was done (successfully) for this custom in __ltc2983_chan_custom_sensor_assign()
387 if (st->custom_table_size + custom->size > in __ltc2983_chan_custom_sensor_assign()
391 "Not space left(%d) for new custom sensor(%zu)", in __ltc2983_chan_custom_sensor_assign()
393 custom->size); in __ltc2983_chan_custom_sensor_assign()
397 custom->offset = st->custom_table_size / in __ltc2983_chan_custom_sensor_assign()
399 st->custom_table_size += custom->size; in __ltc2983_chan_custom_sensor_assign()
402 reg = (custom->offset * mult) + LTC2983_CUST_SENS_TBL_START_REG; in __ltc2983_chan_custom_sensor_assign()
405 *chan_val |= LTC2983_CUSTOM_ADDR(custom->offset); in __ltc2983_chan_custom_sensor_assign()
406 dev_dbg(dev, "Assign custom sensor, reg:0x%04X, off:%d, sz:%zu", in __ltc2983_chan_custom_sensor_assign()
407 reg, custom->offset, in __ltc2983_chan_custom_sensor_assign()
408 custom->size); in __ltc2983_chan_custom_sensor_assign()
409 /* write custom sensor table */ in __ltc2983_chan_custom_sensor_assign()
410 return regmap_bulk_write(st->regmap, reg, custom->table, custom->size); in __ltc2983_chan_custom_sensor_assign()
421 * For custom steinhart, the full u32 is taken. For all the others in __ltc2983_custom_sensor_new()
453 dev_err(dev, "No space left(%d) for new custom sensor(%zu)", in __ltc2983_custom_sensor_new()
547 if (thermo->custom) { in ltc2983_thermocouple_assign_chan()
550 ret = __ltc2983_chan_custom_sensor_assign(st, thermo->custom, in ltc2983_thermocouple_assign_chan()
569 if (rtd->custom) { in ltc2983_rtd_assign_chan()
572 ret = __ltc2983_chan_custom_sensor_assign(st, rtd->custom, in ltc2983_rtd_assign_chan()
591 if (thermistor->custom) { in ltc2983_thermistor_assign_chan()
595 thermistor->custom, in ltc2983_thermistor_assign_chan()
647 ret = __ltc2983_chan_custom_sensor_assign(st, temp->custom, &chan_val); in ltc2983_temp_assign_chan()
721 /* check custom sensor */ in ltc2983_thermocouple_new()
723 const char *propname = "adi,custom-thermocouple"; in ltc2983_thermocouple_new()
725 thermo->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermocouple_new()
728 if (IS_ERR(thermo->custom)) { in ltc2983_thermocouple_new()
729 ret = PTR_ERR(thermo->custom); in ltc2983_thermocouple_new()
854 /* check custom sensor */ in ltc2983_rtd_new()
856 rtd->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_rtd_new()
857 "adi,custom-rtd", in ltc2983_rtd_new()
859 if (IS_ERR(rtd->custom)) { in ltc2983_rtd_new()
860 ret = PTR_ERR(rtd->custom); in ltc2983_rtd_new()
965 /* check custom sensor */ in ltc2983_thermistor_new()
972 propname = "adi,custom-steinhart"; in ltc2983_thermistor_new()
974 propname = "adi,custom-thermistor"; in ltc2983_thermistor_new()
977 thermistor->custom = __ltc2983_custom_sensor_new(st, child, in ltc2983_thermistor_new()
981 if (IS_ERR(thermistor->custom)) { in ltc2983_thermistor_new()
982 ret = PTR_ERR(thermistor->custom); in ltc2983_thermistor_new()
993 /* Auto range is not allowed for custom sensors */ in ltc2983_thermistor_new()
1007 "Auto Range not allowed for custom sensors\n"); in ltc2983_thermistor_new()
1211 temp->custom = __ltc2983_custom_sensor_new(st, child, "adi,custom-temp", in ltc2983_temp_new()
1213 if (IS_ERR(temp->custom)) in ltc2983_temp_new()
1214 return ERR_CAST(temp->custom); in ltc2983_temp_new()