Commit 701e73a8 authored by Mika Westerberg's avatar Mika Westerberg

thunderbolt: Rework Titan Ridge TMU objection disable function

Now this is split into two with one having a misleading name
(tb_switch_tmu_unidirectional_enable()).

Make this easier to read, rename and consolidate the two functions into
one with name that explains what it actually does. Use the two constants
as well that were added but never used to make it clear which bits are
being set.

No functional changes.
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 826f55d5
...@@ -503,8 +503,10 @@ static int tb_switch_tmu_enable_bidirectional(struct tb_switch *sw) ...@@ -503,8 +503,10 @@ static int tb_switch_tmu_enable_bidirectional(struct tb_switch *sw)
return ret; return ret;
} }
static int tb_switch_tmu_objection_mask(struct tb_switch *sw) /* Only needed for Titan Ridge */
static int tb_switch_tmu_disable_objections(struct tb_switch *sw)
{ {
struct tb_port *up = tb_upstream_port(sw);
u32 val; u32 val;
int ret; int ret;
...@@ -515,17 +517,15 @@ static int tb_switch_tmu_objection_mask(struct tb_switch *sw) ...@@ -515,17 +517,15 @@ static int tb_switch_tmu_objection_mask(struct tb_switch *sw)
val &= ~TB_TIME_VSEC_3_CS_9_TMU_OBJ_MASK; val &= ~TB_TIME_VSEC_3_CS_9_TMU_OBJ_MASK;
return tb_sw_write(sw, &val, TB_CFG_SWITCH, ret = tb_sw_write(sw, &val, TB_CFG_SWITCH,
sw->cap_vsec_tmu + TB_TIME_VSEC_3_CS_9, 1); sw->cap_vsec_tmu + TB_TIME_VSEC_3_CS_9, 1);
} if (ret)
return ret;
static int tb_switch_tmu_unidirectional_enable(struct tb_switch *sw)
{
struct tb_port *up = tb_upstream_port(sw);
return tb_port_tmu_write(up, TMU_ADP_CS_6, return tb_port_tmu_write(up, TMU_ADP_CS_6,
TMU_ADP_CS_6_DISABLE_TMU_OBJ_MASK, TMU_ADP_CS_6_DISABLE_TMU_OBJ_MASK,
TMU_ADP_CS_6_DISABLE_TMU_OBJ_MASK); TMU_ADP_CS_6_DISABLE_TMU_OBJ_CL1 |
TMU_ADP_CS_6_DISABLE_TMU_OBJ_CL2);
} }
/* /*
...@@ -670,11 +670,7 @@ int tb_switch_tmu_enable(struct tb_switch *sw) ...@@ -670,11 +670,7 @@ int tb_switch_tmu_enable(struct tb_switch *sw)
if (!tb_switch_is_clx_enabled(sw, TB_CL1)) if (!tb_switch_is_clx_enabled(sw, TB_CL1))
return -EOPNOTSUPP; return -EOPNOTSUPP;
ret = tb_switch_tmu_objection_mask(sw); ret = tb_switch_tmu_disable_objections(sw);
if (ret)
return ret;
ret = tb_switch_tmu_unidirectional_enable(sw);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment