From patchwork Fri Apr 20 19:31:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 8000 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 2A44E23E12 for ; Fri, 20 Apr 2012 19:33:03 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id D846BA181AE for ; Fri, 20 Apr 2012 19:33:02 +0000 (UTC) Received: by yenl4 with SMTP id l4so6764858yen.11 for ; Fri, 20 Apr 2012 12:33:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=feSyYy+I9H3MG85xJe9i4gQd5ypLZgioAQ4kLDHIHu8=; b=VdTslZBMN5ooViY25GqU0TfpHRQHa284swJwIJ3z/03kJLSstRN+IkIfFVl1UvWnyw +p/2DMmSc//Kddn0zEmg1n+JMSOsz9E31ZUUoNPNr3A4DduQLRpXjCR6+xv0dN5qsCb3 qgwVxPQE8P4mTFY78W6QtCcLxH5tTPlywR6xATT7sz7yl3+aCGyX45xTAg6w//cvnmCj nLn13/sMBrjvrmoxkpPpO1ooxV5ORzWIG3Uk63pIO2Mm5uLL5AR1XC1jKw7K3h/ddKGZ EO2kdDbr/qVgUQSPeN7jaBQXH+HUgDh99jItKFmf4rzNgbdWnpbaxQpW7mUOl3rgszb6 HSpQ== Received: by 10.50.185.233 with SMTP id ff9mr63635igc.55.1334950382165; Fri, 20 Apr 2012 12:33:02 -0700 (PDT) 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.231.137.198 with SMTP id x6csp55923ibt; Fri, 20 Apr 2012 12:33:01 -0700 (PDT) Received: by 10.182.13.6 with SMTP id d6mr10378039obc.58.1334950381640; Fri, 20 Apr 2012 12:33:01 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com. [32.97.110.149]) by mx.google.com with ESMTPS id rz10si4127083obc.89.2012.04.20.12.33.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Apr 2012 12:33:01 -0700 (PDT) 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 ; Fri, 20 Apr 2012 13:33:01 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 20 Apr 2012 13:32:57 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 0D77119D804A; Fri, 20 Apr 2012 13:32:46 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3KJWbwE052632; Fri, 20 Apr 2012 13:32:43 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3KJWWBZ009263; Fri, 20 Apr 2012 13:32:32 -0600 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3KJWWPW009207; Fri, 20 Apr 2012 13:32:32 -0600 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id AA0E7C05C4; Fri, 20 Apr 2012 12:32:06 -0700 (PDT) From: John Stultz To: Linux Kernel Cc: John Stultz , Colin Cross , Thomas Gleixner , Greg KH , Android Kernel Team Subject: [PATCH 2/4] alarmtimer: Provide accessor to alarmtimer rtc device Date: Fri, 20 Apr 2012 12:31:45 -0700 Message-Id: <1334950307-403-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1334950307-403-1-git-send-email-john.stultz@linaro.org> References: <1334950307-403-1-git-send-email-john.stultz@linaro.org> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12042019-7282-0000-0000-0000085B6E70 X-Gm-Message-State: ALoCoQlqiiAl9NjWh6B+G8eT4Nroev8BUViHF4pCU8EO2/h0vWLJDhAV1kABSR7gK1RLEr6Nj/+z The Android alarm interface provides a settime call that sets both the alarmtimer RTC device and CLOCK_REALTIME to the same value. Since there may be multiple rtc devices, provide a hook to access the one the alarmtimer infrastructure is using. CC: Colin Cross CC: Thomas Gleixner CC: Greg KH CC: Android Kernel Team Signed-off-by: John Stultz --- include/linux/alarmtimer.h | 3 +++ kernel/time/alarmtimer.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h index 975009e..96c5c24 100644 --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h @@ -76,4 +76,7 @@ static inline int alarmtimer_callback_running(struct alarm *timer) } +/* Provide way to access the rtc device being used by alarmtimers */ +struct rtc_device *alarmtimer_get_rtcdev(void); + #endif diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 8a538c55..aa27d39 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -59,7 +59,7 @@ static DEFINE_SPINLOCK(rtcdev_lock); * If one has not already been chosen, it checks to see if a * functional rtc device is available. */ -static struct rtc_device *alarmtimer_get_rtcdev(void) +struct rtc_device *alarmtimer_get_rtcdev(void) { unsigned long flags; struct rtc_device *ret; @@ -115,7 +115,7 @@ static void alarmtimer_rtc_interface_remove(void) class_interface_unregister(&alarmtimer_rtc_interface); } #else -static inline struct rtc_device *alarmtimer_get_rtcdev(void) +struct rtc_device *alarmtimer_get_rtcdev(void) { return NULL; }