Skip to content

Commit

Permalink
net: hns: add syscon operation for dsaf
Browse files Browse the repository at this point in the history
This patch provides the read/write function for dsaf to
access the registers through syscon methods.

Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yisen.Zhuang\(Zhuangyuzeng\) authored and David S. Miller committed Apr 26, 2016
1 parent 422c310 commit 86897c9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef _DSAF_REG_H_
#define _DSAF_REG_H_

#include <linux/regmap.h>
#define HNS_DEBUG_RING_IRQ_IDX 0
#define HNS_SERVICE_RING_IRQ_IDX 59
#define HNSV2_SERVICE_RING_IRQ_IDX 25
Expand Down Expand Up @@ -989,6 +990,19 @@ static inline u32 dsaf_read_reg(u8 __iomem *base, u32 reg)
return readl(reg_addr + reg);
}

static inline void dsaf_write_syscon(struct regmap *base, u32 reg, u32 value)
{
regmap_write(base, reg, value);
}

static inline u32 dsaf_read_syscon(struct regmap *base, u32 reg)
{
unsigned int val;

regmap_read(base, reg, &val);
return val;
}

#define dsaf_read_dev(a, reg) \
dsaf_read_reg((a)->io_base, (reg))

Expand Down

0 comments on commit 86897c9

Please sign in to comment.