summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2017-02-15 09:35:25 -0700
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-02-21 21:22:59 +0100
commit8ccbd360068af1993a9359f1d31db70cf5eb8825 (patch)
tree8106745279380a94625c21d1b5f507a74266be07 /arch/arm
parent5e8bb41c514506358241c5eef09900b126190f54 (diff)
downloadlinux-8ccbd360068af1993a9359f1d31db70cf5eb8825.tar.gz
linux-8ccbd360068af1993a9359f1d31db70cf5eb8825.tar.xz
ARM: Orion5x: ts78xx: allow rtc-m48t86 to manage it's own resources
The rtc-m48t86 driver can now handle it's own resources and do the read/write operations internally. Pass the necessary resources to the driver and remove the m48t86_ops platform data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-By: Alexander Clouter <alex+kernel@digriz.org.uk> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index cb4c3747214a..7ef80a8304c0 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -16,7 +16,6 @@
#include <linux/platform_device.h>
#include <linux/mv643xx_eth.h>
#include <linux/ata_platform.h>
-#include <linux/platform_data/rtc-m48t86.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/timeriomem-rng.h>
@@ -80,33 +79,19 @@ static struct mv_sata_platform_data ts78xx_sata_data = {
/*****************************************************************************
* RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c
****************************************************************************/
-#define TS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE + 0x808)
-#define TS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE + 0x80c)
+#define TS_RTC_CTRL (TS78XX_FPGA_REGS_PHYS_BASE + 0x808)
+#define TS_RTC_DATA (TS78XX_FPGA_REGS_PHYS_BASE + 0x80c)
-static unsigned char ts78xx_ts_rtc_readbyte(unsigned long addr)
-{
- writeb(addr, TS_RTC_CTRL);
- return readb(TS_RTC_DATA);
-}
-
-static void ts78xx_ts_rtc_writebyte(unsigned char value, unsigned long addr)
-{
- writeb(addr, TS_RTC_CTRL);
- writeb(value, TS_RTC_DATA);
-}
-
-static struct m48t86_ops ts78xx_ts_rtc_ops = {
- .readbyte = ts78xx_ts_rtc_readbyte,
- .writebyte = ts78xx_ts_rtc_writebyte,
+static struct resource ts78xx_ts_rtc_resources[] = {
+ DEFINE_RES_MEM(TS_RTC_CTRL, 0x01),
+ DEFINE_RES_MEM(TS_RTC_DATA, 0x01),
};
static struct platform_device ts78xx_ts_rtc_device = {
.name = "rtc-m48t86",
.id = -1,
- .dev = {
- .platform_data = &ts78xx_ts_rtc_ops,
- },
- .num_resources = 0,
+ .resource = ts78xx_ts_rtc_resources,
+ .num_resources = ARRAY_SIZE(ts78xx_ts_rtc_resources),
};
static int ts78xx_ts_rtc_load(void)