Lines Matching defs:btc
77 can_update_sample_point(const struct can_bittiming_const *btc,
91 tseg2 = clamp(tseg2, btc->tseg2_min, btc->tseg2_max);
93 if (tseg1 > btc->tseg1_max) {
94 tseg1 = btc->tseg1_max;
118 const struct can_bittiming_const *btc)
145 for (tseg = (btc->tseg1_max + btc->tseg2_max) * 2 + 1;
146 tseg >= (btc->tseg1_min + btc->tseg2_min) * 2; tseg--) {
153 brp = (brp / btc->brp_inc) * btc->brp_inc;
154 if (brp < btc->brp_min || brp > btc->brp_max)
168 can_update_sample_point(btc, sample_point_nominal, tseg / 2,
198 bt->sample_point = can_update_sample_point(btc, sample_point_nominal,
210 if (!bt->sjw || !btc->sjw_max) {
214 if (bt->sjw > btc->sjw_max)
215 bt->sjw = btc->sjw_max;
231 const struct can_bittiming_const *btc)
244 const struct can_bittiming_const *btc)
253 if (bt->sjw > btc->sjw_max ||
254 tseg1 < btc->tseg1_min || tseg1 > btc->tseg1_max ||
255 bt->phase_seg2 < btc->tseg2_min || bt->phase_seg2 > btc->tseg2_max)
259 if (btc->brp_inc > 1)
260 do_div(brp64, btc->brp_inc);
263 if (btc->brp_inc > 1)
264 brp64 *= btc->brp_inc;
267 if (bt->brp < btc->brp_min || bt->brp > btc->brp_max)
298 const struct can_bittiming_const *btc,
309 if (!bt->tq && bt->bitrate && btc)
310 err = can_calc_bittiming(dev, bt, btc);
311 else if (bt->tq && !bt->bitrate && btc)
312 err = can_fixup_bittiming(dev, bt, btc);