From patchwork Tue Jan 31 03:49:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 6462 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E145F23EB0 for ; Tue, 31 Jan 2012 03:50:13 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id C9CDEA18288 for ; Tue, 31 Jan 2012 03:50:13 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id r19so5134385bka.11 for ; Mon, 30 Jan 2012 19:50:13 -0800 (PST) Received: by 10.204.10.82 with SMTP id o18mr10091330bko.20.1327981813655; Mon, 30 Jan 2012 19:50:13 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.130.220 with SMTP id u28cs170419bks; Mon, 30 Jan 2012 19:50:13 -0800 (PST) Received: by 10.68.240.135 with SMTP id wa7mr46938975pbc.7.1327981812444; Mon, 30 Jan 2012 19:50:12 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com. [32.97.110.149]) by mx.google.com with ESMTPS id h6si19098020pba.53.2012.01.30.19.50.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jan 2012 19:50:12 -0800 (PST) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.149 as permitted sender) client-ip=32.97.110.149; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.149 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jan 2012 20:50:10 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Jan 2012 20:49:48 -0700 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 0B5023E40036; Mon, 30 Jan 2012 20:49:48 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0V3nlNb151192; Mon, 30 Jan 2012 20:49:47 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0V3nla7009237; Mon, 30 Jan 2012 20:49:47 -0700 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q0V3nluu008957; Mon, 30 Jan 2012 20:49:47 -0700 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id B38ECBFE5D; Mon, 30 Jan 2012 19:49:45 -0800 (PST) From: John Stultz To: Greg KH Cc: John Stultz , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Greg KH , Android Kernel Team Subject: [PATCH 11/11] android-alarm: Support old drivers via preprocessor aliasing Date: Mon, 30 Jan 2012 19:49:32 -0800 Message-Id: <1327981772-12329-12-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1327981772-12329-1-git-send-email-john.stultz@linaro.org> References: <1327981772-12329-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12013103-7282-0000-0000-0000060D72DD Older out of tree drivers that were desgined to the Android Alarm in-kernel API may not build due to the namespace collision fixed in an earlier patch. Per Arve's suggestion, this patch provides preprocessor macros that allow older drivers to build. CC: Arve Hjønnevåg CC: Greg KH CC: Android Kernel Team Signed-off-by: John Stultz --- drivers/staging/android/Kconfig | 8 ++++++++ drivers/staging/android/android_alarm.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index bbcfd2b..75ca225 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -122,6 +122,14 @@ config ANDROID_INTF_ALARM_DEV help Exports the alarm interface to user-space. +config ANDROID_ALARM_OLDDRV_COMPAT + bool "Android Alarm compatability with old drivers" + depends on ANDROID_INTF_ALARM + default n + help + Provides preprocessor alias to aid compatability with + older out-of-tree drivers that use the Android Alarm + in-kernel API. This will be removed eventually. endif # if ANDROID diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h index 9213581..6eecbde 100644 --- a/drivers/staging/android/android_alarm.h +++ b/drivers/staging/android/android_alarm.h @@ -76,6 +76,20 @@ ktime_t alarm_get_elapsed_realtime(void); /* set rtc while preserving elapsed realtime */ int android_alarm_set_rtc(const struct timespec ts); +#ifdef CONFIG_ANDROID_ALARM_OLDDRV_COMPAT +/* + * Some older drivers depend on the old API, + * so provide compatability macros for now. + */ +#define alarm android_alarm +#define alarm_init(x, y, z) android_alarm_init(x, y, z) +#define alarm_start_range(x, y, z) android_alarm_start_range(x, y, z) +#define alarm_try_to_cancel(x) android_alarm_try_to_cancel(x) +#define alarm_cancel(x) android_alarm_cancel(x) +#define alarm_set_rtc(x) android_alarm_set_rtc(x) +#endif + + #endif enum android_alarm_return_flags {