Lines Matching refs:custom

232 	struct ltc2983_custom_sensor *custom;
239 struct ltc2983_custom_sensor *custom;
248 struct ltc2983_custom_sensor *custom;
328 struct ltc2983_custom_sensor *custom,
332 u8 mult = custom->is_steinhart ? LTC2983_CUSTOM_STEINHART_ENTRY_SZ :
336 * custom->size holds the raw size of the table. However, when
341 const u8 len = custom->is_steinhart ? 0 :
342 (custom->size / LTC2983_CUSTOM_SENSOR_ENTRY_SZ) - 1;
347 if (custom->offset < 0) {
350 * when this test was done (successfully) for this custom
354 if (st->custom_table_size + custom->size >
358 "Not space left(%d) for new custom sensor(%zu)",
360 custom->size);
364 custom->offset = st->custom_table_size /
366 st->custom_table_size += custom->size;
369 reg = (custom->offset * mult) + LTC2983_CUST_SENS_TBL_START_REG;
372 *chan_val |= LTC2983_CUSTOM_ADDR(custom->offset);
373 dev_dbg(dev, "Assign custom sensor, reg:0x%04X, off:%d, sz:%zu",
374 reg, custom->offset,
375 custom->size);
376 /* write custom sensor table */
377 return regmap_bulk_write(st->regmap, reg, custom->table, custom->size);
392 * For custom steinhart, the full u32 is taken. For all the others
420 dev_err(dev, "No space left(%d) for new custom sensor(%zu)",
509 if (thermo->custom) {
512 ret = __ltc2983_chan_custom_sensor_assign(st, thermo->custom,
531 if (rtd->custom) {
534 ret = __ltc2983_chan_custom_sensor_assign(st, rtd->custom,
553 if (thermistor->custom) {
557 thermistor->custom,
671 /* check custom sensor */
673 const char *propname = "adi,custom-thermocouple";
675 thermo->custom = __ltc2983_custom_sensor_new(st, child,
678 if (IS_ERR(thermo->custom)) {
680 return ERR_CAST(thermo->custom);
800 /* check custom sensor */
802 rtd->custom = __ltc2983_custom_sensor_new(st, child,
803 "adi,custom-rtd",
805 if (IS_ERR(rtd->custom)) {
807 return ERR_CAST(rtd->custom);
912 /* check custom sensor */
919 propname = "adi,custom-steinhart";
921 propname = "adi,custom-thermistor";
924 thermistor->custom = __ltc2983_custom_sensor_new(st, child,
928 if (IS_ERR(thermistor->custom)) {
930 return ERR_CAST(thermistor->custom);
940 /* Auto range is not allowed for custom sensors */
954 "Auto Range not allowed for custom sensors\n");