Loading drivers/thunderbolt/tb.c +4 −2 Original line number Original line Diff line number Diff line Loading @@ -282,9 +282,11 @@ static int tb_enable_tmu(struct tb_switch *sw) * highest accuracy. * highest accuracy. */ */ if (tb_switch_is_clx_enabled(sw, TB_CL1)) if (tb_switch_is_clx_enabled(sw, TB_CL1)) tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_NORMAL, true); ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_NORMAL, true); else else tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI, false); ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI, false); if (ret) return ret; /* If it is already enabled in correct mode, don't touch it */ /* If it is already enabled in correct mode, don't touch it */ if (tb_switch_tmu_is_enabled(sw)) if (tb_switch_tmu_is_enabled(sw)) Loading drivers/thunderbolt/tb.h +2 −3 Original line number Original line Diff line number Diff line Loading @@ -987,8 +987,7 @@ int tb_switch_tmu_init(struct tb_switch *sw); int tb_switch_tmu_post_time(struct tb_switch *sw); int tb_switch_tmu_post_time(struct tb_switch *sw); int tb_switch_tmu_disable(struct tb_switch *sw); int tb_switch_tmu_disable(struct tb_switch *sw); int tb_switch_tmu_enable(struct tb_switch *sw); int tb_switch_tmu_enable(struct tb_switch *sw); void tb_switch_tmu_configure(struct tb_switch *sw, int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_rate rate, enum tb_switch_tmu_rate rate, bool unidirectional); bool unidirectional); /** /** * tb_switch_tmu_is_enabled() - Checks if the specified TMU mode is enabled * tb_switch_tmu_is_enabled() - Checks if the specified TMU mode is enabled Loading drivers/thunderbolt/tmu.c +8 −5 Original line number Original line Diff line number Diff line Loading @@ -648,9 +648,6 @@ int tb_switch_tmu_enable(struct tb_switch *sw) bool unidirectional = sw->tmu.unidirectional_request; bool unidirectional = sw->tmu.unidirectional_request; int ret; int ret; if (unidirectional && !sw->tmu.has_ucap) return -EOPNOTSUPP; /* /* * No need to enable TMU on devices that don't support CLx since on * No need to enable TMU on devices that don't support CLx since on * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi Loading Loading @@ -724,10 +721,16 @@ int tb_switch_tmu_enable(struct tb_switch *sw) * * * Selects the rate of the TMU and directionality (uni-directional or * Selects the rate of the TMU and directionality (uni-directional or * bi-directional). Must be called before tb_switch_tmu_enable(). * bi-directional). Must be called before tb_switch_tmu_enable(). * * Returns %0 in success and negative errno otherwise. */ */ void tb_switch_tmu_configure(struct tb_switch *sw, int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_rate rate, enum tb_switch_tmu_rate rate, bool unidirectional) bool unidirectional) { { if (unidirectional && !sw->tmu.has_ucap) return -EINVAL; sw->tmu.unidirectional_request = unidirectional; sw->tmu.unidirectional_request = unidirectional; sw->tmu.rate_request = rate; sw->tmu.rate_request = rate; return 0; } } Loading
drivers/thunderbolt/tb.c +4 −2 Original line number Original line Diff line number Diff line Loading @@ -282,9 +282,11 @@ static int tb_enable_tmu(struct tb_switch *sw) * highest accuracy. * highest accuracy. */ */ if (tb_switch_is_clx_enabled(sw, TB_CL1)) if (tb_switch_is_clx_enabled(sw, TB_CL1)) tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_NORMAL, true); ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_NORMAL, true); else else tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI, false); ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_RATE_HIFI, false); if (ret) return ret; /* If it is already enabled in correct mode, don't touch it */ /* If it is already enabled in correct mode, don't touch it */ if (tb_switch_tmu_is_enabled(sw)) if (tb_switch_tmu_is_enabled(sw)) Loading
drivers/thunderbolt/tb.h +2 −3 Original line number Original line Diff line number Diff line Loading @@ -987,8 +987,7 @@ int tb_switch_tmu_init(struct tb_switch *sw); int tb_switch_tmu_post_time(struct tb_switch *sw); int tb_switch_tmu_post_time(struct tb_switch *sw); int tb_switch_tmu_disable(struct tb_switch *sw); int tb_switch_tmu_disable(struct tb_switch *sw); int tb_switch_tmu_enable(struct tb_switch *sw); int tb_switch_tmu_enable(struct tb_switch *sw); void tb_switch_tmu_configure(struct tb_switch *sw, int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_rate rate, enum tb_switch_tmu_rate rate, bool unidirectional); bool unidirectional); /** /** * tb_switch_tmu_is_enabled() - Checks if the specified TMU mode is enabled * tb_switch_tmu_is_enabled() - Checks if the specified TMU mode is enabled Loading
drivers/thunderbolt/tmu.c +8 −5 Original line number Original line Diff line number Diff line Loading @@ -648,9 +648,6 @@ int tb_switch_tmu_enable(struct tb_switch *sw) bool unidirectional = sw->tmu.unidirectional_request; bool unidirectional = sw->tmu.unidirectional_request; int ret; int ret; if (unidirectional && !sw->tmu.has_ucap) return -EOPNOTSUPP; /* /* * No need to enable TMU on devices that don't support CLx since on * No need to enable TMU on devices that don't support CLx since on * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi * these devices e.g. Alpine Ridge and earlier, the TMU mode HiFi Loading Loading @@ -724,10 +721,16 @@ int tb_switch_tmu_enable(struct tb_switch *sw) * * * Selects the rate of the TMU and directionality (uni-directional or * Selects the rate of the TMU and directionality (uni-directional or * bi-directional). Must be called before tb_switch_tmu_enable(). * bi-directional). Must be called before tb_switch_tmu_enable(). * * Returns %0 in success and negative errno otherwise. */ */ void tb_switch_tmu_configure(struct tb_switch *sw, int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_rate rate, enum tb_switch_tmu_rate rate, bool unidirectional) bool unidirectional) { { if (unidirectional && !sw->tmu.has_ucap) return -EINVAL; sw->tmu.unidirectional_request = unidirectional; sw->tmu.unidirectional_request = unidirectional; sw->tmu.rate_request = rate; sw->tmu.rate_request = rate; return 0; } }