Add support for DMI matching in calculating RTC_ALWAYS_BCD
Subsystems (2)
PATCH 1/1 Add support for DMI matching in calculating RTC_ALWAYS_BCD
From 037d9b44c9a18e6c2e3dedde2b8391215accc236 Mon Sep 17 00:00:00 2001
From: Nigel <[email protected]>
Date: Mon, 31 Dec 2012 10:58:54 +1100
Subject: [PATCH] Add support for DMI matching in calculating RTC_ALWAYS_BCD.
The Sony Vaio VPCSE15FG needs RTC_ALWAYS_BCD to be false rather than the otherwise universal value of true. Add support for catching this model via DMI matching.
There have been no BIOS updates for the VPCSE15FG, so I've not specified a BIOS version in the criteria for matching.
Signed-off-by Nigel Cunningham <[email protected]>
--- arch/x86/include/asm/mc146818rtc.h | 2 +- drivers/rtc/Makefile | 1 + drivers/rtc/dmi.c | 46 ++++++++++++++++++++++++++++++++++++ include/linux/rtc.h | 6 +++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 drivers/rtc/dmi.c
arch/x86/include/asm/mc146818rtc.h +1 -1
@@ -10,7 +10,7 @@#ifndef RTC_PORT #define RTC_PORT (x) (0x70 + (x)) -#define RTC_ALWAYS_BCD 1/* RTC operates in binary mode */ +#define RTC_ALWAYS_BCD (rtc_always_bcd)/* Does the RTC operate in binary mode? */ #endif #if defined(CONFIG_X86_32 ) && defined(__HAVE_ARCH_CMPXCHG)
drivers/rtc/Makefile +1 -0
@@ -12,6 +12,7 @@ rtc-core-y := class.o interface.o rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o +rtc-core-$(CONFIG_DMI) += dmi.o # Keep the list ordered.
drivers/rtc/dmi.c new file +46 -0
46 lines not on this page · raw message
include/linux/rtc.h +6 -0
@@ -164,6 +164,12 @@ extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled);extern int rtc_dev_update_irq_enable_emul (struct rtc_device *rtc,unsigned int enabled); +#ifdef CONFIG_DMI +extern int rtc_always_bcd; +#else +#define rtc_always_bcd (1) +#endif +void rtc_handle_legacy_irq (struct rtc_device *rtc,int num,int mode);void rtc_aie_update_irq (void *private);void rtc_uie_update_irq (void *private);
Signature · 1 line
1.7.10.4