devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yisen Zhuang <Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	yankejian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	huangdaode-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
	salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	lipeng321-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	liguozhu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	xieqianqian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	xuwei5-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
	linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: [PATCH v2 net-next 05/13] net: hns: add syscon operation for dsaf
Date: Sat, 23 Apr 2016 17:05:09 +0800	[thread overview]
Message-ID: <1461402317-136499-6-git-send-email-Yisen.Zhuang@huawei.com> (raw)
In-Reply-To: <1461402317-136499-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

This patch provides the read/write function for dsaf to
access the registers through syscon methods.

Signed-off-by: Daode Huang <huangdaode-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
Signed-off-by: Yisen Zhuang <yisen.zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
index ed0043a..6a03c94 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
@@ -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
@@ -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))
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-23  9:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23  9:05 [PATCH v2 net-next 00/13] net: hns: add support of debug dsaf device Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 02/13] net: hns: set debug port irq index to 0 Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 03/13] net: hns: add attribute port-idx-in-ae in enet node Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 06/13] net: hns: sort the header file by alphabetical order Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 07/13] net: hns: separate debug dsaf device from service dsaf device Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 08/13] net: hns: add attribute cpld_ctrl for dsaf port node Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 09/13] net: hns: add attribute port-rst-offset " Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 10/13] net: hns: add attribute port-mode-offset " Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 11/13] Documentation: Bindings: Update DT binding for separating dsaf dev support Yisen Zhuang
2016-04-26 12:48   ` Rob Herring
2016-04-27  3:33     ` Yisen Zhuang
2016-04-27 15:25       ` Rob Herring
2016-04-28  1:45         ` Yisen Zhuang
     [not found] ` <1461402317-136499-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-04-23  9:05   ` [PATCH v2 net-next 01/13] net: hns: add a new dsaf mode for debug port Yisen Zhuang
2016-04-23  9:05   ` [PATCH v2 net-next 04/13] net: hns: add attribute reset-field-offset for dsaf node Yisen Zhuang
2016-04-23  9:05   ` Yisen Zhuang [this message]
2016-04-23  9:05   ` [PATCH v2 net-next 12/13] Documentation: Bindings: add port-idx-in-ae for enet node Yisen Zhuang
2016-04-23  9:05 ` [PATCH v2 net-next 13/13] dts: hisi: update hns dst for separating dsaf dev support Yisen Zhuang
2016-04-26  5:11 ` [PATCH v2 net-next 00/13] net: hns: add support of debug dsaf device David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461402317-136499-6-git-send-email-Yisen.Zhuang@huawei.com \
    --to=yisen.zhuang-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=huangdaode-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=liguozhu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=lipeng321-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    --cc=xieqianqian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=xuwei5-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=yankejian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).