Commit 9b7a69d0 authored by Herve Codina's avatar Herve Codina

soc: fsl: cpm1: qmc: Introduce available timeslots masks

Available timeslots masks define timeslots available for the related
channel. These timeslots are defined by the QMC binding.

Timeslots used are initialized to available timeslots but can be a
subset of available timeslots.
This prepares the dynamic timeslots management (ie. changing timeslots
at runtime).
Signed-off-by: default avatarHerve Codina <herve.codina@bootlin.com>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20231205152116.122512-8-herve.codina@bootlin.com
parent ba3b7e47
...@@ -177,7 +177,9 @@ struct qmc_chan { ...@@ -177,7 +177,9 @@ struct qmc_chan {
struct qmc *qmc; struct qmc *qmc;
void __iomem *s_param; void __iomem *s_param;
enum qmc_mode mode; enum qmc_mode mode;
u64 tx_ts_mask_avail;
u64 tx_ts_mask; u64 tx_ts_mask;
u64 rx_ts_mask_avail;
u64 rx_ts_mask; u64 rx_ts_mask;
bool is_reverse_data; bool is_reverse_data;
...@@ -875,7 +877,8 @@ static int qmc_of_parse_chans(struct qmc *qmc, struct device_node *np) ...@@ -875,7 +877,8 @@ static int qmc_of_parse_chans(struct qmc *qmc, struct device_node *np)
of_node_put(chan_np); of_node_put(chan_np);
return ret; return ret;
} }
chan->tx_ts_mask = ts_mask; chan->tx_ts_mask_avail = ts_mask;
chan->tx_ts_mask = chan->tx_ts_mask_avail;
ret = of_property_read_u64(chan_np, "fsl,rx-ts-mask", &ts_mask); ret = of_property_read_u64(chan_np, "fsl,rx-ts-mask", &ts_mask);
if (ret) { if (ret) {
...@@ -884,7 +887,8 @@ static int qmc_of_parse_chans(struct qmc *qmc, struct device_node *np) ...@@ -884,7 +887,8 @@ static int qmc_of_parse_chans(struct qmc *qmc, struct device_node *np)
of_node_put(chan_np); of_node_put(chan_np);
return ret; return ret;
} }
chan->rx_ts_mask = ts_mask; chan->rx_ts_mask_avail = ts_mask;
chan->rx_ts_mask = chan->rx_ts_mask_avail;
mode = "transparent"; mode = "transparent";
ret = of_property_read_string(chan_np, "fsl,operational-mode", &mode); ret = of_property_read_string(chan_np, "fsl,operational-mode", &mode);
......
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