Commit graph

24 commits

Author SHA1 Message Date
Pramod Gurav 2a838c6484 staging: alarm-dev: Set the license to GPL
Adding "GPL" license to fix a warning while compiling as
module.

CC: Brian Swetland <swetland@google.com>
Signed-off-by: Pramod Gurav <pramod.gurav.etc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-20 08:28:01 -07:00
Seunghun Lee 10f62861b4 staging: android: fix missing a blank line after declarations
This patch fixes "Missing a blank line after declarations" warnings.

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:46:30 -04:00
SeongJae Park 5230a5f585 staging: alarm-dev: Seperate functions with one blank line
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19 15:33:39 -08:00
SeongJae Park 027c440971 staging: alarm-dev: Remove unnecessary blank lines
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19 15:33:39 -08:00
SeongJae Park 6eaf842a24 staging: alarm-dev: Remove unnecessary parenthesis
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19 15:33:39 -08:00
Cruz Julian Bishop b59f105c7e staging/android: Add kerneldoc to one function in alarm-dev.c
Sorry. I thought that this would be a nice easy class to document fully.
Turns out I was very wrong - I will have to research the Linux alarm and
timer subsystem one day next week and try again.

Here is what I started out with, anyway. It's not much, but it's better
than nothing!

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:47:40 -07:00
Dan Carpenter 60bba385c5 staging: alarm-dev: information leak in alarm_compat_ioctl()
If we pass an invalid clock type then "ts" is never set.  We need to
check for errors earlier, otherwise we end up passing uninitialized
stack data to userspace.

Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 10:26:14 -07:00
Dan Carpenter e919b86c3b staging: alarm-dev: information leak in alarm_ioctl()
Smatch complains that if we pass an invalid clock type then "ts" is
never set.  We need to check for errors earlier, otherwise we end up
passing uninitialized stack data to userspace.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 13:38:55 -07:00
John Stultz 532572b948 staging: alarm-dev: Implement compat_ioctl support
Implement compat_ioctl support for the alarm-dev ioctl.

Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18 12:37:11 -08:00
John Stultz cec8bb73a2 staging: alarm-dev: Refactor alarm-dev ioctl code in prep for compat_ioctl
Cleanup the Android alarm-dev driver's ioctl code to refactor it
in preparation for compat_ioctl support.

Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18 12:37:11 -08:00
John Stultz be1a3e38ad staging: alarm-dev: Drop pre Android 1.0 _OLD ioctls
Per Colin's comment:
"The "support old userspace code" comment for those two ioctls has
been there since pre-Android 1.0.  Those apis are not exposed to
Android apps, I don't see any problem deleting them."

Thus this patch removes the ANDROID_ALARM_SET_OLD and
ANDROID_ALARM_SET_AND_WAIT_OLD ioctl compatability
logic.

Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18 12:37:11 -08:00
Dae S. Kim 147cd16575 Staging: android: Alarm driver cleanups
Little cleanups. Enum value ANDROID_ALARM_TYPE_COUNT was treated as
an alarm type within a switch statement. That condition was unreachable
though.

Signed-off-by: Dae S. Kim <dae@velatum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:23:33 -07:00
Devendra Naga 71f882fe71 staging: android: alarm: remove unnecessary goto statement
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13 16:16:49 -07:00
Sachin Kamat 592314e9e1 staging: Android: Fix NULL pointer related warning in alarm-dev.c file
Fixes the following sparse warning:
drivers/staging/android/alarm-dev.c:259:35: warning: Using plain integer as NULL pointer

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 11:20:17 -07:00
Joe Perches 8a7245ea2c Staging: android: alarm: Rename pr_alarm to alarm_dbg
Rename a macro to make it explicit it's for debugging.

Use %s: __func__ instead of embedding function names.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-04 21:04:32 -07:00
John Stultz a180c0d659 staging: android-alarm: Switch from wakelocks to wakeup sources
In their current AOSP tree, the Android in-kernel wakelock
infrastructure has been reimplemented in terms of wakeup
sources:
http://git.linaro.org/gitweb?p=people/jstultz/android.git;a=commitdiff;h=e9911f4efdc55af703b8b3bb8c839e6f5dd173bb

The Android alarm driver currently has stubbed out calls
to wakelock functionality. So this patch simply converts
the stubbed out wakelock calls to wakeup source calls, and
removes the empty wakelock macros

Greg, would you mind queuing this in staging-next?

CC: Colin Cross <ccross@android.com>
CC: Arve Hjønnevåg <arve@android.com>
CC: Greg KH <gregkh@linuxfoundation.org>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:01:45 -07:00
John Stultz b879326098 staging: android-alarm: Rework alarm-dev.c to use upstreamed alarmtimers
This reworks the alarm-dev.c to use the upstreamed alarmtimers
interface.

CC: Colin Cross <ccross@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 14:59:03 -07:00
John Stultz e2d8ccef0a staging: android-alarm: Convert ALARM_ELAPSED_REALTIME to use CLOCK_BOOTTIME
The ALARM_ELAPSED_REALTIME clock domain in Android pointed
to the need for something similar in linux system-wide
(instead of limited to just the alarm interface).

Thus CLOCK_BOOTTIME was introduced into the upstream kernel
in 2.6.39.

This patch attempts to convert the android alarm timer to utilize
the kernel's CLOCK_BOOTTIME clockid for ALARM_ELAPSED_REALTIME,
instead of managing it itself.

CC: Colin Cross <ccross@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 14:53:37 -07:00
Masanari Iida ad220db422 staging: Fix typo within android drivers.
Fix spelling typo in comments within android drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:49:00 -07:00
John Stultz 79ef07162f staging: android-alarm: HACK: wakelock workaround
Allow Android alarmtimer device to build while wakelocks are still
out of tree.

CC: Arve Hjønnevåg <arve@android.com>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:06:19 -08:00
John Stultz f2f28eacf2 staging: android-alarm: Fix namespace collision with upstreamed alarmtimers
The upstreamed alarmtimers are similar but not quite 100% API
compatibile with the android in-kernel alarm api. To aid the
transition, prefix the the android in-kernel api with android_

CC: Arve Hjønnevåg <arve@android.com>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:06:19 -08:00
John Stultz d47908b20c staging: android-alarm: Fix include compile issues
The file asm/mach/time.h doesn't exist on all arches,
so include <linux/time.h>. Also linux/sysdev.h is gone
so kill it.

CC: Arve Hjønnevåg <arve@android.com>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:06:19 -08:00
Andy Green bf647ea717 staging: android-alarm: Add needed module.h includes
Add module.h includes required to build

CC: Arve Hjønnevåg <arve@android.com>
CC: Android Kernel Team <kernel-team@android.com>
CC: Andy Green <andy.green@linaro.org>
Signed-off-by: Andy Green <andy.green@linaro.org>
[jstultz: Tweaked commit subject, folded two patches
into one]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:06:18 -08:00
Arve Hjønnevåg 841cb11c6f staging: android-alarm: Add android alarm driver & in-kernel alarm interface
Drivers can now create alarms that will use an hrtimer while the
system is running and the rtc to wake up from suspend.

CC: Arve Hjønnevåg <arve@android.com>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
[Fold and move alarm driver and interface to staging,
 fix whitespace issue, drop kconfig & make file changes
 as it currently doesn't build  -jstultz]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:05:42 -08:00