Lines Matching refs:tseg
78 unsigned int sample_point_nominal, unsigned int tseg,
88 tseg2 = tseg + CAN_SYNC_SEG -
89 (sample_point_nominal * (tseg + CAN_SYNC_SEG)) /
92 tseg1 = tseg - tseg2;
95 tseg2 = tseg - tseg1;
98 sample_point = 1000 * (tseg + CAN_SYNC_SEG - tseg2) /
99 (tseg + CAN_SYNC_SEG);
127 unsigned int best_tseg = 0; /* current best value for tseg */
129 unsigned int brp, tsegall, tseg, tseg1 = 0, tseg2 = 0;
144 /* tseg even = round down, odd = round up */
145 for (tseg = (btc->tseg1_max + btc->tseg2_max) * 2 + 1;
146 tseg >= (btc->tseg1_min + btc->tseg2_min) * 2; tseg--) {
147 tsegall = CAN_SYNC_SEG + tseg / 2;
149 /* Compute all possible tseg choices (tseg=tseg1+tseg2) */
150 brp = priv->clock.freq / (tsegall * bt->bitrate) + tseg % 2;
160 /* tseg brp biterror */
168 can_update_sample_point(btc, sample_point_nominal, tseg / 2,
175 best_tseg = tseg / 2;