From: Johan Hovold <johan@kernel.org>
To: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Andrew Victor <linux@maxim.org.za>,
Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, Johan Hovold <jhovold@gmail.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Douglas Gilbert <dgilbert@interlog.com>
Subject: Re: [PATCH v3 5/8] rtc: at91sam9: make use of syscon/regmap to access GPBR registers
Date: Thu, 11 Sep 2014 11:41:00 +0200 [thread overview]
Message-ID: <20140911094100.GB12295@localhost> (raw)
In-Reply-To: <1410425767-17874-6-git-send-email-boris.brezillon@free-electrons.com>
On Thu, Sep 11, 2014 at 10:56:04AM +0200, Boris BREZILLON wrote:
> The GPBR registers are not part of the RTT block and thus should not be
> defined in the reg property of the rtt node.
>
> Use syscon to provide a proper DT representation and reference the GPBR
> syscon device in a new "atmel,time-reg" property which store both the
> syscon device phandle and the register offset within the GPBR block.
>
> When using non DT boards, we won't be able to retrieve the syscon regmap,
> hence we need to create our own regmap using the memory region defined
> in the 2nd memory resource assigned to the RTT platform device.
>
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>
> Conflicts:
> drivers/rtc/rtc-at91sam9.c
You probably don't want this here.
> ---
> drivers/rtc/Kconfig | 1 +
> drivers/rtc/rtc-at91sam9.c | 58 +++++++++++++++++++++++++++++++++++++++-------
> 2 files changed, 50 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index a168e96..7d76da8 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1081,6 +1081,7 @@ config RTC_DRV_AT91RM9200
> config RTC_DRV_AT91SAM9
> tristate "AT91SAM9x/AT91CAP9 RTT as RTC"
> depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
> + select MFD_SYSCON
> help
> RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT
> (Real Time Timer). These timers are powered by the backup power
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index d72c34d..b953545 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -21,6 +21,8 @@
> #include <linux/slab.h>
> #include <linux/platform_data/atmel.h>
> #include <linux/io.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/regmap.h>
>
> /*
> * This driver uses two configurable hardware resources that live in the
> @@ -72,7 +74,8 @@ struct sam9_rtc {
> void __iomem *rtt;
> struct rtc_device *rtcdev;
> u32 imr;
> - void __iomem *gpbr;
> + struct regmap *gpbr;
> + unsigned int gpbr_offset;
> int irq;
> };
>
> @@ -81,10 +84,18 @@ struct sam9_rtc {
> #define rtt_writel(rtc, field, val) \
> writel((val), (rtc)->rtt + AT91_RTT_ ## field)
>
> -#define gpbr_readl(rtc) \
> - readl((rtc)->gpbr)
> -#define gpbr_writel(rtc, val) \
> - writel((val), (rtc)->gpbr)
> +static inline unsigned int gpbr_readl(struct sam9_rtc *rtc) {
Brace placement. Did you run checkpatch on the rest of the series?
Johan
WARNING: multiple messages have this Message-ID (diff)
From: johan@kernel.org (Johan Hovold)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/8] rtc: at91sam9: make use of syscon/regmap to access GPBR registers
Date: Thu, 11 Sep 2014 11:41:00 +0200 [thread overview]
Message-ID: <20140911094100.GB12295@localhost> (raw)
In-Reply-To: <1410425767-17874-6-git-send-email-boris.brezillon@free-electrons.com>
On Thu, Sep 11, 2014 at 10:56:04AM +0200, Boris BREZILLON wrote:
> The GPBR registers are not part of the RTT block and thus should not be
> defined in the reg property of the rtt node.
>
> Use syscon to provide a proper DT representation and reference the GPBR
> syscon device in a new "atmel,time-reg" property which store both the
> syscon device phandle and the register offset within the GPBR block.
>
> When using non DT boards, we won't be able to retrieve the syscon regmap,
> hence we need to create our own regmap using the memory region defined
> in the 2nd memory resource assigned to the RTT platform device.
>
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>
> Conflicts:
> drivers/rtc/rtc-at91sam9.c
You probably don't want this here.
> ---
> drivers/rtc/Kconfig | 1 +
> drivers/rtc/rtc-at91sam9.c | 58 +++++++++++++++++++++++++++++++++++++++-------
> 2 files changed, 50 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index a168e96..7d76da8 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1081,6 +1081,7 @@ config RTC_DRV_AT91RM9200
> config RTC_DRV_AT91SAM9
> tristate "AT91SAM9x/AT91CAP9 RTT as RTC"
> depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
> + select MFD_SYSCON
> help
> RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT
> (Real Time Timer). These timers are powered by the backup power
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index d72c34d..b953545 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -21,6 +21,8 @@
> #include <linux/slab.h>
> #include <linux/platform_data/atmel.h>
> #include <linux/io.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/regmap.h>
>
> /*
> * This driver uses two configurable hardware resources that live in the
> @@ -72,7 +74,8 @@ struct sam9_rtc {
> void __iomem *rtt;
> struct rtc_device *rtcdev;
> u32 imr;
> - void __iomem *gpbr;
> + struct regmap *gpbr;
> + unsigned int gpbr_offset;
> int irq;
> };
>
> @@ -81,10 +84,18 @@ struct sam9_rtc {
> #define rtt_writel(rtc, field, val) \
> writel((val), (rtc)->rtt + AT91_RTT_ ## field)
>
> -#define gpbr_readl(rtc) \
> - readl((rtc)->gpbr)
> -#define gpbr_writel(rtc, val) \
> - writel((val), (rtc)->gpbr)
> +static inline unsigned int gpbr_readl(struct sam9_rtc *rtc) {
Brace placement. Did you run checkpatch on the rest of the series?
Johan
next prev parent reply other threads:[~2014-09-11 9:41 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 8:55 [PATCH v3 0/8] rtc: at91sam9: add DT support Boris BREZILLON
2014-09-11 8:55 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 1/8] rtc: at91sam9: remove references to mach specific headers Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 2/8] rtc: at91sam9: use standard readl/writel functions instead of raw versions Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 3/8] rtc: at91sam9: replace devm_ioremap by devm_ioremap_resource Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 4/8] rtc: at91sam9: add DT support Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 5/8] rtc: at91sam9: make use of syscon/regmap to access GPBR registers Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 9:41 ` Johan Hovold [this message]
2014-09-11 9:41 ` Johan Hovold
2014-09-11 9:55 ` Boris BREZILLON
2014-09-11 9:55 ` Boris BREZILLON
2014-09-11 9:55 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 6/8] ARM: at91: add clk_lookup entry for RTT devices Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 7/8] rtc: at91sam9: use clk API instead of relying on AT91_SLOW_CLOCK Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` [PATCH v3 8/8] rtc: at91sam9: add DT bindings documentation Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 8:56 ` Boris BREZILLON
2014-09-11 9:42 ` Johan Hovold
2014-09-11 9:42 ` Johan Hovold
2014-09-11 9:56 ` Boris BREZILLON
2014-09-11 9:56 ` Boris BREZILLON
2014-09-11 9:56 ` Boris BREZILLON
2014-09-11 9:39 ` [PATCH v3 0/8] rtc: at91sam9: add DT support Johan Hovold
2014-09-11 9:39 ` Johan Hovold
2014-09-11 9:39 ` Johan Hovold
2014-09-11 10:06 ` Boris BREZILLON
2014-09-11 10:06 ` Boris BREZILLON
2014-09-11 10:06 ` Boris BREZILLON
2014-09-11 10:22 ` Johan Hovold
2014-09-11 10:22 ` Johan Hovold
2014-09-11 11:52 ` Nicolas Ferre
2014-09-11 11:52 ` Nicolas Ferre
2014-09-11 11:52 ` Nicolas Ferre
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=20140911094100.GB12295@localhost \
--to=johan@kernel.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=boris.brezillon@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=dgilbert@interlog.com \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jhovold@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=mark.rutland@arm.com \
--cc=nicolas.ferre@atmel.com \
--cc=pawel.moll@arm.com \
--cc=plagnioj@jcrosoft.com \
--cc=robh+dt@kernel.org \
--cc=rtc-linux@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.