tmu.c (ef34add89ee4d1473bd0e78f551efa6fc1feb0cd) tmu.c (12a14f2fca32332d065b64f6f654fa332c90475e)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt Time Management Unit (TMU) support
4 *
5 * Copyright (C) 2019, Intel Corporation
6 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
7 * Rajmohan Mani <rajmohan.mani@intel.com>
8 */

--- 374 unchanged lines hidden (view full) ---

383 */
384int tb_switch_tmu_disable(struct tb_switch *sw)
385{
386 /*
387 * No need to disable TMU on devices that don't support CLx since
388 * on these devices e.g. Alpine Ridge and earlier, the TMU mode
389 * HiFi bi-directional is enabled by default and we don't change it.
390 */
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt Time Management Unit (TMU) support
4 *
5 * Copyright (C) 2019, Intel Corporation
6 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
7 * Rajmohan Mani <rajmohan.mani@intel.com>
8 */

--- 374 unchanged lines hidden (view full) ---

383 */
384int tb_switch_tmu_disable(struct tb_switch *sw)
385{
386 /*
387 * No need to disable TMU on devices that don't support CLx since
388 * on these devices e.g. Alpine Ridge and earlier, the TMU mode
389 * HiFi bi-directional is enabled by default and we don't change it.
390 */
391 if (!tb_switch_is_clx_supported(sw))
391 if (!tb_switch_clx_is_supported(sw))
392 return 0;
393
394 /* Already disabled? */
395 if (sw->tmu.rate == TB_SWITCH_TMU_RATE_OFF)
396 return 0;
397
398 if (tb_route(sw)) {
399 bool unidirectional = sw->tmu.unidirectional;

--- 248 unchanged lines hidden (view full) ---

648 bool unidirectional = sw->tmu.unidirectional_request;
649 int ret;
650
651 /*
652 * No need to enable TMU on devices that don't support CLx since on
653 * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi
654 * bi-directional is enabled by default.
655 */
392 return 0;
393
394 /* Already disabled? */
395 if (sw->tmu.rate == TB_SWITCH_TMU_RATE_OFF)
396 return 0;
397
398 if (tb_route(sw)) {
399 bool unidirectional = sw->tmu.unidirectional;

--- 248 unchanged lines hidden (view full) ---

648 bool unidirectional = sw->tmu.unidirectional_request;
649 int ret;
650
651 /*
652 * No need to enable TMU on devices that don't support CLx since on
653 * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi
654 * bi-directional is enabled by default.
655 */
656 if (!tb_switch_is_clx_supported(sw))
656 if (!tb_switch_clx_is_supported(sw))
657 return 0;
658
659 if (tb_switch_tmu_is_enabled(sw))
660 return 0;
661
662 if (tb_switch_is_titan_ridge(sw) && unidirectional) {
663 /*
664 * Titan Ridge supports CL0s and CL1 only. CL0s and CL1 are
665 * enabled and supported together.
666 */
657 return 0;
658
659 if (tb_switch_tmu_is_enabled(sw))
660 return 0;
661
662 if (tb_switch_is_titan_ridge(sw) && unidirectional) {
663 /*
664 * Titan Ridge supports CL0s and CL1 only. CL0s and CL1 are
665 * enabled and supported together.
666 */
667 if (!tb_switch_is_clx_enabled(sw, TB_CL1))
667 if (!tb_switch_clx_is_enabled(sw, TB_CL1))
668 return -EOPNOTSUPP;
669
670 ret = tb_switch_tmu_disable_objections(sw);
671 if (ret)
672 return ret;
673 }
674
675 ret = tb_switch_tmu_set_time_disruption(sw, true);

--- 61 unchanged lines hidden ---
668 return -EOPNOTSUPP;
669
670 ret = tb_switch_tmu_disable_objections(sw);
671 if (ret)
672 return ret;
673 }
674
675 ret = tb_switch_tmu_set_time_disruption(sw, true);

--- 61 unchanged lines hidden ---