[PATCH 4/7] rtc-cmos: allow strictly MMIO based configurations

From: Marc Zyngier
Date: Fri Apr 25 2014 - 05:35:31 EST


For those new fancy architectures lacking any kind of I/O ports,
and unwilling to emulate them, introduce the new config symbol
RTC_DRV_CMOS_MMIO_STRICT, which provides default (and explosive)
legacy I/O port accessors.

Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>
---
drivers/rtc/Kconfig | 4 ++++
drivers/rtc/rtc-cmos.c | 5 +++++
2 files changed, 9 insertions(+)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 7e88866..10974f7 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -680,6 +680,10 @@ config RTC_DRV_CMOS
config RTC_DRV_CMOS_MMIO
bool

+config RTC_DRV_CMOS_MMIO_STRICT
+ select RTC_DRV_CMOS_MMIO
+ bool
+
config RTC_DRV_ALPHA
bool "Alpha PC-style CMOS"
depends on ALPHA
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index d535e72..e2d1338 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -70,6 +70,11 @@ static const char driver_name[] = "rtc_cmos";
#ifdef CONFIG_RTC_DRV_CMOS_MMIO
static void __iomem *rtc_cmos_base;

+#ifdef CONFIG_RTC_DRV_CMOS_MMIO_STRICT
+#define CMOS_READ(reg) ({BUG(); 0;})
+#define CMOS_WRITE(val,reg) BUG();
+#endif
+
static u8 do_cmos_read(u8 reg)
{
u8 val;
--
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/