summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/qca/qca8k.h
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-07-27 13:35:14 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-29 07:24:38 +0200
commit910746444313dc463396cd63024cdf54ef04ef39 (patch)
tree50c8e06604de60e39ab81606a94117fdd3e515d6 /drivers/net/dsa/qca/qca8k.h
parentnet: dsa: qca8k: move qca8k read/write/rmw and reg table to common code (diff)
downloadlinux-910746444313dc463396cd63024cdf54ef04ef39.tar.xz
linux-910746444313dc463396cd63024cdf54ef04ef39.zip
net: dsa: qca8k: move qca8k bulk read/write helper to common code
The same ATU function are used by drivers based on qca8k family switch. Move the bulk read/write helper to common code to declare these shared ATU functions in common code. These helper will be dropped when regmap correctly support bulk read/write. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/qca/qca8k.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca/qca8k.h b/drivers/net/dsa/qca/qca8k.h
index c9b753743dfd..df32c1e3a797 100644
--- a/drivers/net/dsa/qca/qca8k.h
+++ b/drivers/net/dsa/qca/qca8k.h
@@ -324,8 +324,13 @@ enum qca8k_mid_cmd {
QCA8K_MIB_CAST = 3,
};
+struct qca8k_priv;
+
struct qca8k_info_ops {
int (*autocast_mib)(struct dsa_switch *ds, int port, u64 *data);
+ /* TODO: remove these extra ops when we can support regmap bulk read/write */
+ int (*read_eth)(struct qca8k_priv *priv, u32 reg, u32 *val, int len);
+ int (*write_eth)(struct qca8k_priv *priv, u32 reg, u32 *val, int len);
};
struct qca8k_match_data {
@@ -431,4 +436,7 @@ int qca8k_read(struct qca8k_priv *priv, u32 reg, u32 *val);
int qca8k_write(struct qca8k_priv *priv, u32 reg, u32 val);
int qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 write_val);
+int qca8k_bulk_read(struct qca8k_priv *priv, u32 reg, u32 *val, int len);
+int qca8k_bulk_write(struct qca8k_priv *priv, u32 reg, u32 *val, int len);
+
#endif /* __QCA8K_H */