Lines Matching refs:setup

394  * to MISC7. Each MISC register is associated with a setup; MISCN is associated
395 * with setup number N. The other 5 above mentioned types of registers have
396 * analogous structure. A setup is a set of those registers. For example,
397 * setup 1 comprises of MISC1, AFE1, FILTER1, FILTER_FS1, OFFSET1, and GAIN1
399 * CHANNEL_SETUP15). Each channel setup is associated with one of the 8 possible
417 struct ad4170_setup setup;
425 struct ad4170_setup setup; /* cached setup */
618 /* Immediately accept a matching setup. */
619 if (ad4170_setup_eq(target_setup, &setup_info->setup)) {
685 struct ad4170_setup *setup)
700 ret = regmap_write(st->regmap, AD4170_MISC_REG(setup_num), setup->misc);
704 ret = regmap_write(st->regmap, AD4170_AFE_REG(setup_num), setup->afe);
709 setup->filter);
714 setup->filter_fs);
719 setup->offset);
723 ret = regmap_write(st->regmap, AD4170_GAIN_REG(setup_num), setup->gain);
727 memcpy(&st->setup_infos[setup_num].setup, setup, sizeof(*setup));
742 * 1. Enabled and linked channel with setup changes:
743 * - Find a setup. If not possible, return error.
744 * - Unlink channel from current setup.
745 * - If the setup found has only disabled channels linked to it,
746 * unlink all channels, and write the new setup to it.
747 * - Link channel to new setup.
750 * - Find a setup. If not possible, return error.
751 * - If the setup found has only disabled channels linked to it,
752 * unlink all channels, and write the new setup to it.
753 * - Link channel to the setup.
755 * 3. Disabled and linked channel with setup changes:
756 * - Unlink channel from current setup.
759 * 5. Disabled and unlinked channel with setup changes:
780 ret = ad4170_find_setup(st, &chan_info->setup, &setup_num, &overwrite);
793 ret = ad4170_write_setup(st, setup_num, &chan_info->setup);
852 struct ad4170_setup *setup = &chan_info->setup;
883 setup->filter_fs = clamp(val, AD4170_SINC3_MIN_FS,
886 setup->filter_fs = clamp(val, AD4170_SINC5_MIN_FS,
889 setup->filter &= ~AD4170_FILTER_FILTER_TYPE_MSK;
890 setup->filter |= FIELD_PREP(AD4170_FILTER_FILTER_TYPE_MSK,
905 struct ad4170_setup *setup = &chan_info->setup;
907 return __ad4170_get_filter_type(setup->filter);
1278 struct ad4170_setup *setup = &chan_info->setup;
1293 pga = FIELD_GET(AD4170_AFE_PGA_GAIN_MSK, setup->afe);
1315 pga = FIELD_GET(AD4170_AFE_PGA_GAIN_MSK, setup->afe);
1319 f_type = __ad4170_get_filter_type(setup->filter);
1323 fs_idx = find_closest(setup->filter_fs,
1330 fs_idx = find_closest(setup->filter_fs,
1340 *val = setup->offset;
1343 *val = setup->gain;
1459 struct ad4170_setup *setup = &chan_info->setup;
1472 setup->afe &= ~AD4170_AFE_PGA_GAIN_MSK;
1473 setup->afe |= FIELD_PREP(AD4170_AFE_PGA_GAIN_MSK, pga);
1483 struct ad4170_setup *setup = &chan_info->setup;
1484 enum ad4170_filter_type f_type = __ad4170_get_filter_type(setup->filter);
1507 setup->filter_fs = ad4170_sinc5_filt_fs_tbl[i];
1509 setup->filter_fs = ad4170_sinc3_filt_fs_tbl[i];
1518 struct ad4170_setup *setup = &chan_info->setup;
1521 setup->offset = val;
1530 struct ad4170_setup *setup = &chan_info->setup;
1533 setup->gain = val;
1882 * Parses firmware data describing output current source setup. There are 4
1931 struct ad4170_setup *setup, u32 *exc_pins,
1992 "Failed to setup current chopping\n");
2007 setup->misc |= FIELD_PREP(AD4170_MISC_CHOP_IEXC_MSK,
2017 struct ad4170_setup *setup, u32 *exc_pins,
2032 return ad4170_setup_current_src(st, child, setup, exc_pins,
2051 setup->misc |= FIELD_PREP(AD4170_MISC_CHOP_ADC_MSK, 0x3);
2077 setup->misc |= FIELD_PREP(AD4170_MISC_CHOP_ADC_MSK, 0x2);
2120 struct ad4170_setup *setup, u32 *exc_pins,
2123 return ad4170_setup_current_src(st, child, setup, exc_pins,
2129 struct ad4170_setup *setup,
2172 ret = ad4170_setup_bridge(st, child, setup, exc_pins, exc_curs,
2175 ret = ad4170_setup_rtd(st, child, setup, exc_pins, exc_curs,
2183 struct ad4170_setup *setup)
2197 setup->afe |= FIELD_PREP(AD4170_AFE_REF_BUF_P_MSK,
2207 setup->afe |= FIELD_PREP(AD4170_AFE_REF_BUF_M_MSK,
2218 setup->afe |= FIELD_PREP(AD4170_AFE_REF_SELECT_MSK, aux);
2280 struct ad4170_setup *setup;
2305 setup = &chan_info->setup;
2306 ret = ad4170_parse_reference(st, child, setup);
2326 ret = ad4170_parse_external_sensor(st, child, setup, chan, s_type);
2336 setup->afe |= FIELD_PREP(AD4170_AFE_BIPOLAR_MSK, bipolar);
2346 ref_select = FIELD_GET(AD4170_AFE_REF_SELECT_MSK, setup->afe);
2383 struct ad4170_setup *setup = &st->chan_infos[chan_num].setup;
2392 setup->afe |= FIELD_PREP(AD4170_AFE_REF_SELECT_MSK,
2546 return dev_err_probe(dev, ret, "Failed to setup device clock\n");
2626 struct ad4170_setup *setup;
2635 setup = &chan_info->setup;
2636 setup->gain = AD4170_GAIN_REG_DEFAULT;
2640 "Failed to write channel setup\n");
2970 return dev_err_probe(dev, ret, "Failed to setup device\n");
2993 return dev_err_probe(dev, ret, "Failed to setup read buffer\n");