linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [rtc-linux] [PATCH v2 2/4] rtc: sa1100: convert to run-time register mapping
Date: Sun, 10 May 2015 12:29:51 +0200	[thread overview]
Message-ID: <20150510102951.GG3338@piout.net> (raw)
In-Reply-To: <1430426233-7461-3-git-send-email-robh@kernel.org>

Hi,

On 30/04/2015 at 15:37:11 -0500, Rob Herring wrote :
> SA1100 and PXA differ only in register offsets which are currently
> hardcoded in a machine specific header. Some arm64 platforms (PXA1928)
> have this RTC block as well (and not the PXA270 variant).
> 
> Convert the driver to use ioremap and set the register offsets dynamically.
> Since we are touching all the register accesses, convert them all to
> readl_relaxed/writel_relaxed.
> 
> Currently, the rtc-sa1100 and rtc-pxa drivers co-exist as rtc-pxa has a
> superset of functionality. This commit makes the drivers one step closer
> to being mutually exclusive by using devm_ioremap_resource and claiming
> the resource. The sharing of overlapping resources does not work if both
> drivers claim the resource. That is not done currently, but will be done
> as the drivers are converted to DT and follow proper driver rules.
> Likely, the common portion of the 2 drivers will be made into library
> functions for the SA1100 and PXA drivers to shared.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: rtc-linux at googlegroups.com
> ---
> v2:
> - Rebase to v4.1-rc1
> - Use _relaxed accessors
> - Summarize discussion about supporting both SA1100 and PXA RTC drivers
> 
>  drivers/rtc/rtc-sa1100.c | 86 +++++++++++++++++++++++++++++++++---------------
>  1 file changed, 59 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
> index b6e1ca0..a21ead5 100644
> --- a/drivers/rtc/rtc-sa1100.c
> +++ b/drivers/rtc/rtc-sa1100.c
> @@ -35,12 +35,10 @@
>  #include <linux/bitops.h>
>  #include <linux/io.h>
> 
> -#include <mach/hardware.h>
> -#include <mach/irqs.h>
> -
> -#if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
> -#include <mach/regs-rtc.h>
> -#endif
> +#define RTSR_HZE	(1 << 3)	/* HZ interrupt enable */
> +#define RTSR_ALE	(1 << 2)	/* RTC alarm interrupt enable */
> +#define RTSR_HZ		(1 << 1)	/* HZ rising-edge detected */
> +#define RTSR_AL		(1 << 0)	/* RTC alarm detected */
> 

While at it, can you use BIT()?

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-05-10 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 20:37 [PATCH v2 0/4] SA1100 RTC clean-up for ARM64 Rob Herring
2015-04-30 20:37 ` [PATCH v2 1/4] ARM: pxa: add memory resource to RTC device Rob Herring
2015-05-01 16:17   ` Robert Jarzmik
2015-04-30 20:37 ` [PATCH v2 2/4] rtc: sa1100: convert to run-time register mapping Rob Herring
2015-05-01 16:13   ` Robert Jarzmik
2015-05-10 10:31     ` [rtc-linux] " Alexandre Belloni
2015-05-10 10:29   ` Alexandre Belloni [this message]
2015-04-30 20:37 ` [PATCH v2 3/4] ARM: sa1100: remove unused RTC register definitions Rob Herring
2015-04-30 20:37 ` [PATCH v2 4/4] ARM: mmp: " Rob Herring

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=20150510102951.GG3338@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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).