Lines Matching defs:rate
422 * Returns maximum possible rate from capability supporting only DP 2.0
427 u32 rate = (val & DP_COMMON_CAP_RATE_MASK) >> DP_COMMON_CAP_RATE_SHIFT;
429 switch (rate) {
444 * Returns maximum possible rate from capability supporting DP 2.1
460 static inline bool tb_dp_is_uhbr_rate(unsigned int rate)
462 return rate >= 10000;
465 static inline u32 tb_dp_cap_set_rate(u32 val, u32 rate)
468 switch (rate) {
470 WARN(1, "invalid rate %u passed, defaulting to 1620 MB/s\n", rate);
525 static unsigned int tb_dp_bandwidth(unsigned int rate, unsigned int lanes)
528 if (tb_dp_is_uhbr_rate(rate))
529 return rate * lanes * 128 / 132;
530 return rate * lanes * 8 / 10;
556 * exceed the maximum rate and lanes supported by the DP OUT and
651 * Set new rate and number of lanes before writing it to
679 u32 rate, lanes;
693 * Get the non-reduced rate and lanes based on the lowest
711 rate = min(in_rate, out_rate);
713 tmp = tb_dp_bandwidth(rate, lanes);
715 tb_port_dbg(in, "non-reduced bandwidth %u Mb/s x%u = %u Mb/s\n", rate,
718 ret = usb4_dp_port_set_nrd(in, rate, lanes);
728 rate = min(in_rate, out_rate);
729 tmp = tb_dp_bandwidth(rate, lanes);
733 rate, lanes, tmp);
854 int ret, rate, lanes, nrd_bw;
869 rate = tb_dp_cap_get_rate_ext(cap);
870 if (tb_dp_is_uhbr_rate(rate)) {
879 * non-reduced rate and lanes.
881 ret = usb4_dp_port_nrd(in, &rate, &lanes);
886 nrd_bw = tb_dp_bandwidth(rate, lanes);
1015 static int tb_dp_read_dprx(struct tb_tunnel *tunnel, u32 *rate, u32 *lanes,
1035 *rate = tb_dp_cap_get_rate(val);
1039 tb_dp_bandwidth(*rate, *lanes));
1049 static int tb_dp_read_cap(struct tb_tunnel *tunnel, unsigned int cap, u32 *rate,
1074 *rate = tb_dp_cap_get_rate(val);
1078 tb_dp_bandwidth(*rate, *lanes));
1111 u32 rate = 0, lanes = 0;
1134 ret = tb_dp_read_dprx(tunnel, &rate, &lanes, 150);
1138 &rate, &lanes);
1143 ret = tb_dp_read_cap(tunnel, DP_REMOTE_CAP, &rate, &lanes);
1155 *consumed_down = tb_dp_bandwidth(rate, lanes);
1157 *consumed_up = tb_dp_bandwidth(rate, lanes);
1244 u32 dp_cap, rate, lanes;
1253 rate = tb_dp_cap_get_rate(dp_cap);
1257 rate, lanes, tb_dp_bandwidth(rate, lanes));
1265 rate = tb_dp_cap_get_rate(dp_cap);
1269 rate, lanes, tb_dp_bandwidth(rate, lanes));
1275 rate = tb_dp_cap_get_rate(dp_cap);
1279 rate, lanes, tb_dp_bandwidth(rate, lanes));
1795 tb_tunnel_warn(tunnel, "failed to read actual link rate\n");
1798 /* Use maximum link rate if the link valid is not set */
1801 tb_tunnel_warn(tunnel, "failed to read maximum link rate\n");
1807 * 90% of the max rate can be allocated for isochronous