Lines Matching defs:clx
15 module_param_named(clx, clx_enabled, bool, 0444);
16 MODULE_PARM_DESC(clx, "allow low power states on the high-speed lanes (default: true)");
18 static const char *clx_name(unsigned int clx)
20 switch (clx) {
68 static bool tb_port_clx_supported(struct tb_port *port, unsigned int clx)
88 if (clx & TB_CL0S)
90 if (clx & TB_CL1)
92 if (clx & TB_CL2)
103 static int tb_port_clx_set(struct tb_port *port, unsigned int clx, bool enable)
108 if (clx & TB_CL0S)
110 if (clx & TB_CL1)
112 if (clx & TB_CL2)
132 static int tb_port_clx_disable(struct tb_port *port, unsigned int clx)
134 return tb_port_clx_set(port, clx, false);
137 static int tb_port_clx_enable(struct tb_port *port, unsigned int clx)
139 return tb_port_clx_set(port, clx, true);
168 * @clx: Mask of CL states to check
172 bool tb_port_clx_is_enabled(struct tb_port *port, unsigned int clx)
174 return !!(tb_port_clx(port) & clx);
189 unsigned int clx, tmp;
203 clx = tb_port_clx(up);
205 if (clx != tmp)
207 clx, tmp);
209 tb_sw_dbg(sw, "CLx: current mode: %s\n", clx_name(clx));
211 sw->clx = clx;
298 static bool validate_mask(unsigned int clx)
301 if (clx & TB_CL1)
302 return (clx & TB_CL0S) == TB_CL0S;
309 * @clx: The CLx state to enable
318 int tb_switch_clx_enable(struct tb_switch *sw, unsigned int clx)
325 if (!clx || sw->clx == clx)
328 if (!validate_mask(clx))
340 if ((clx & TB_CL2) &&
352 up_clx_support = tb_port_clx_supported(up, clx);
353 down_clx_support = tb_port_clx_supported(down, clx);
355 tb_port_dbg(up, "CLx: %s %ssupported\n", clx_name(clx),
357 tb_port_dbg(down, "CLx: %s %ssupported\n", clx_name(clx),
363 ret = tb_port_clx_enable(up, clx);
367 ret = tb_port_clx_enable(down, clx);
369 tb_port_clx_disable(up, clx);
375 tb_port_clx_disable(up, clx);
376 tb_port_clx_disable(down, clx);
380 sw->clx |= clx;
382 tb_sw_dbg(sw, "CLx: %s enabled\n", clx_name(clx));
398 unsigned int clx = sw->clx;
405 if (!clx)
411 ret = tb_port_clx_disable(up, clx);
415 ret = tb_port_clx_disable(down, clx);
419 sw->clx = 0;
421 tb_sw_dbg(sw, "CLx: %s disabled\n", clx_name(clx));
422 return clx;