)]}'
{
  "log": [
    {
      "commit": "c8626a1d7250c593f148530b559c20f6f6af18e8",
      "tree": "332279f151a0cf5c16e1c0229d07c5d6e8ee235f",
      "parents": [
        "4185108c77afee83674101319dc071599846a40b"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Sat Feb 23 15:23:44 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Sat Feb 23 17:12:14 2008 -0800"
      },
      "message": "rtc-cmos: display HPET emulation mode\n\nFor the \"cmos\" RTC, have /proc/driver/rtc say whether HPET based IRQ\nemulation is in effect.  Given the problems we\u0027ve had with this particular\nhardware maldesign (and the fact that most BIOS code seems not to provide\nthe IRQ routing needed to use the saner HPET modes), this should help\ntroubleshooting.\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "9d8af78b07976d4d84e0df491abd4e9db848d0ad",
      "tree": "c90b4bd57147a9607ed2e860888110aef497ded8",
      "parents": [
        "095b9d546f8fdac335989bd3d60405ff3af40ee9"
      ],
      "author": {
        "name": "Bernhard Walle",
        "email": "bwalle@suse.de",
        "time": "Wed Feb 06 01:38:52 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Wed Feb 06 10:41:14 2008 -0800"
      },
      "message": "rtc: add HPET RTC emulation to RTC_DRV_CMOS\n\nThat patch adds the RTC emulation of the HPET timer to the new RTC_DRV_CMOS.\nThe old drivers/char/rtc.ko driver had that functionality and it\u0027s important\non new systems.\n\n[akpm@linux-foundation.org: unbreak alpha build]\nSigned-off-by: Bernhard Walle \u003cbwalle@suse.de\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nCc: David Brownell \u003cdavid-b@pacbell.net\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: Andi Kleen \u003cak@suse.de\u003e\nCc: john stultz \u003cjohnstul@us.ibm.com\u003e\nCc: Robert Picco \u003cRobert.Picco@hp.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "8a0bdfd7a05f5bb0486fbe7146a2cf775957e95e",
      "tree": "2de49bb837ef636cd07c10ef7773194731f412da",
      "parents": [
        "739d340dba45ab786a5553144bbffbee0afe15dd"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Wed Feb 06 01:38:45 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Wed Feb 06 10:41:13 2008 -0800"
      },
      "message": "rtc-cmos alarm acts as oneshot\n\nStart making the rtc-cmos alarm act more like a oneshot alarm by disabling\nthat alarm after its IRQ fires.  (ACPI hooks are also needed.)\n\nThe Linux RTC framework has previously been a bit vague in this area, but\nany other behavior is problematic and not very portable.  RTCs with full\nYYYY-MM-DD HH:MM[:SS] alarms won\u0027t have a problem here.  Only ones with\npartial match criteria, with the most visible example being the PC RTC, get\nconfused.  (Because the criteria will match repeatedly.)\n\nUpdate comments relating to that oneshot behavior and timezone handling.\n(Timezones are another issue that\u0027s mostly visible with rtc-cmos.  That\u0027s\nbecause PCs often dual-boot MS-Windows, which likes its RTC to match local\nwall-clock time instead of UTC.)\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "e07e232cd96ef0092b2bddc72f9b7caf284633cb",
      "tree": "442ff1cc6f2548e27315ee6c8ad5252132e5d416",
      "parents": [
        "9974b6ea7b85a32f34f824443f47aa501c85ee8f"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Wed Feb 06 01:38:43 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Wed Feb 06 10:41:13 2008 -0800"
      },
      "message": "rtc-cmos: export nvram in sysfs\n\nThis makes rtc-cmos export its NVRAM, like several other RTC drivers.\n\nIt still works within the limits of the current CMOS_READ/CMOS_WRITE calls,\nwhich don\u0027t understand how to access multiple register banks.  The primary\nimpact of that limitation is that Linux can\u0027t access the uppermost 128\nbytes of NVRAM on many systems.\n\nNote that this isn\u0027t aiming to be a drop-in replacement for the legacy\n/dev/nvram support.  (Presumably that has real users, and isn\u0027t just\ngetting carried forward automatically?) Userspace handles more work:\n\n - When userspace code updates NVRAM, that will need to include\n   updating any platform-specific checksums that may apply.\n\n - No /proc/driver/nvram file will parse and display NVRAM data\n   according to whichever boot firmware your board expects.\n\nAlso minor pnp-related updates: update a comment, remove dead code.\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nSigned-off-by: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nCc: Bjorn Helgaas \u003cbjorn.helgaas@hp.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "615bb29ccbe9fa06d9f33b29d9c3f51340726656",
      "tree": "705059547b9564e8c57afb1645db04bc4b7e556c",
      "parents": [
        "b4f555081fdd27d13e6ff39d455d5aefae9d2c0c"
      ],
      "author": {
        "name": "Mark Lord",
        "email": "lkml@rtr.ca",
        "time": "Sat Nov 03 22:04:03 2007 -0400"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Sun Nov 04 13:13:09 2007 -0800"
      },
      "message": "rtc: ignore msb when reading back mday from alarm\n\nI have a system here that actively relies upon RTC wake alarms, and it\nhas been failing (again) for a few days when attempting to use the\n/sys/class/rtc/rtc?/wakealarm interface.\n\nThe old (fixed by Linus) /proc/ interface still works, but I\u0027d like to\nget it using the new one.\n\nThis patch fixes rtc-cmos to ignore the two upper bits when reading the\nBCD mday (day of month) register from CMOS.  Some systems (eg.  mine)\nseem to have the top bit set to \"1\" for some reason.\n\nThe older /proc/ interface ignores the upper bits, and so we should too.\n\nSigned-off-by: Mark Lord \u003cmlord@pobox.com\u003e\nAcked-by: David Brownell \u003cdavid-b@pacbell.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "05440dfcfcabde6fcf7297dfa5a29f0355b78ffb",
      "tree": "31cdb76cee66c890ab4e337e0d5c9cea31b992a7",
      "parents": [
        "0e36a9a4a788e4e92407774df76c545910810d35"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Tue Oct 16 01:28:21 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Oct 16 09:43:13 2007 -0700"
      },
      "message": "rtc-cmos probe() cleanup\n\nSome cleanups for the rtc-cmos probe logic:\n\n - Claim i/o ports with request_region() not request_resource(),\n   for better coexistence betwen platform and pnp bus glues.\n\n - Claim those ports earlier, to help work around procfs bugs\n   (it allows duplicate names, like /proc/driver/rtc).\n\n - Fix some glitches in cleanup code, notably a cut\u0027n\u0027paste-o\n   where the i/o port region might not get released during\n   cleanup after a probe fault.\n\nAnd some comment clarifications, including noting that this code\nmust work with PNPBIOS not just PNPACPI..\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Russell King \u003crmk@arm.linux.org.uk\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "97144c67566241db46633727f2860e6428373fe4",
      "tree": "b3863ed198037668cb80df710678a6e249842654",
      "parents": [
        "d691eb901e044065de10756ea78a5758d457c7fd"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Tue Oct 16 01:28:16 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Oct 16 09:43:13 2007 -0700"
      },
      "message": "rtc_irq_set_freq() requires power-of-two and associated kerneldoc\n\nRTC periodic IRQs are only defined to work for 2^N Hz values.  This patch\nmoves that validity check into the infrastructure, so drivers don\u0027t need to\ncheck it; and adds kerneldoc for the two interface functions related to\nperiodic IRQs.  (One of which was quite mysterious until its first use was\nrecently checked in!)\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "57deb52622f3700d154e32662f36cd5f4053f6ed",
      "tree": "d27cc97a2d87c8c55dfadc73442afbb746f9516a",
      "parents": [
        "c7d51402d2a64c5b96531f9900bb368020ebbbbb"
      ],
      "author": {
        "name": "Alessandro Zummo",
        "email": "alessandro.zummo@towertech.it",
        "time": "Thu Jul 19 01:49:21 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Thu Jul 19 10:04:52 2007 -0700"
      },
      "message": "RTC: add periodic irq support to rtc-cmos\n\nAdds support for periodic irq enabling in rtc-cmos.  This could be used by\nthe ALSA driver and is already being tested with the zaptel ztdummy module.\n\nSigned-off-by: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nCc: David Brownell \u003cdavid-b@pacbell.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "6cd8fa87fbf31b2ab77b8aaec497e7f6a3757578",
      "tree": "25a8ac89d09f7b8f2cd3e4a33068d309cfdbc76f",
      "parents": [
        "926b28984da035ac407e6b8f22ee8b4f94f51cf1"
      ],
      "author": {
        "name": "Matthew Garrett",
        "email": "mjg59@srcf.ucam.org",
        "time": "Fri Jun 01 00:46:51 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Fri Jun 01 08:18:29 2007 -0700"
      },
      "message": "RTC: use fallback IRQ if PNP tables don\u0027t provide one\n\nIntel Macs (and possibly other machines) provide a PNP entry for the RTC,\nbut provide no IRQ.  As a result the rtc-cmos driver doesn\u0027t allow wakeup\nalarms.  If the RTC is located at the legacy ioport range, assume that it\u0027s\non IRQ 8 unless the tables say otherwise.\n\nSigned-off-by: Matthew Garrett \u003cmjg59@srcf.ucam.org\u003e\nCc: Matthieu CASTET \u003ccastet.matthieu@free.fr\u003e\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "41ac8df9d5b731a4dd8f1f4e5a9de6ef8768383d",
      "tree": "83b54a07e5bc95007fe10d2beb8aba01bc3591b0",
      "parents": [
        "f8245c26886c912627ebc49f714e4491261224c4"
      ],
      "author": {
        "name": "Marko Vrh",
        "email": "mvrh@freeshells.ch",
        "time": "Tue May 08 00:34:09 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue May 08 11:15:19 2007 -0700"
      },
      "message": "rtc-cmos: make it load on PNPBIOS systems\n\nReplace CONFIG_PNPACPI with CONFIG_PNP, so it loads on ACPI-less PNPBIOS\nsystems.\n\nSigned-off-by: Marko Vrh \u003cmvrh@freeshells.ch\u003e\nAcked-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "87ac84f42a7a580d0dd72ae31d6a5eb4bfe04c6d",
      "tree": "e0750f2ee2146c990d048737aff0fb91942e4c54",
      "parents": [
        "9b5ef64a3a73757f1acdfb8565b5105115fc6e62"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Tue May 08 00:34:00 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue May 08 11:15:18 2007 -0700"
      },
      "message": "rtc-cmos wakeup interface\n\nI finally got around to testing the updated wakeup event hooks for rtc-cmos,\nand they follow in two patches:\n\n - Interface update ... when a simple enable_irq_wake() doesn\u0027t suffice,\n   the platform data can hold suspend/resume callback hooks.\n\n - ACPI implementation ... provides callback hooks to do ACPI magic, and\n   eliminate the legacy /proc/acpi/alarm file.\n\nThe interface update could go into 2.6.21, but that\u0027s not essential; they\nwill be NOPs on most PCs, without the ACPI stuff.\n\nI suspect the ACPI folk may have opinions about how to merge that second\npatch, and how to obsolete that legacy procfs file.  I\u0027d like to see that\nmerge into 2.6.22 if possible...\n\nAs for how to kick it in ... two ways:\n\n - The appended \"rtcwake\" program; updated since the last time it was\n   posted, it deals much better with timezones and DST.\n\n - Write the /sys/class/rtc/.../wakealarm file, then go to sleep.\n\nFor some reason RTC wake from \"swsusp\" stopped working on a system where\nit previously worked; the alarm setting appears to get clobbered.  But\non the bright side, RTC wake from \"standby\" worked on a system that had\nnever been able to resume from that state before ... IDEACPI is my guess\nas to why it finally started to work.  It\u0027s the old \"two steps forward,\none step back\" dance, I guess.\n\n- Dave\n\n/* gcc -Wall -Os -o rtcwake rtcwake.c */\n\n#include \u003cstdio.h\u003e\n#include \u003cgetopt.h\u003e\n#include \u003cfcntl.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cstring.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003cerrno.h\u003e\n#include \u003ctime.h\u003e\n\n#include \u003csys/ioctl.h\u003e\n#include \u003csys/time.h\u003e\n#include \u003csys/types.h\u003e\n\n#include \u003clinux/rtc.h\u003e\n\n/* constants from legacy PC/AT hardware */\n#define\tRTC_PF\t0x40\n#define\tRTC_AF\t0x20\n#define\tRTC_UF\t0x10\n\n/*\n * rtcwake -- enter a system sleep state until specified wakeup time.\n *\n * This uses cross-platform Linux interfaces to enter a system sleep state,\n * and leave it no later than a specified time.  It uses any RTC framework\n * driver that supports standard driver model wakeup flags.\n *\n * This is normally used like the old \"apmsleep\" utility, to wake from a\n * suspend state like ACPI S1 (standby) or S3 (suspend-to-RAM).  Most\n * platforms can implement those without analogues of BIOS, APM, or ACPI.\n *\n * On some systems, this can also be used like \"nvram-wakeup\", waking\n * from states like ACPI S4 (suspend to disk).  Not all systems have\n * persistent media that are appropriate for such suspend modes.\n *\n * The best way to set the system\u0027s RTC is so that it holds the current\n * time in UTC.  Use the \"-l\" flag to tell this program that the system\n * RTC uses a local timezone instead (maybe you dual-boot MS-Windows).\n */\n\nstatic char\t\t*progname;\n\n#ifdef\tDEBUG\n#define\tVERSION\t\"1.0 dev (\" __DATE__ \" \" __TIME__ \")\"\n#else\n#define\tVERSION\t\"0.9\"\n#endif\n\nstatic unsigned\t\tverbose;\nstatic int\t\trtc_is_utc \u003d -1;\n\nstatic int may_wakeup(const char *devname)\n{\n\tchar\tbuf[128], *s;\n\tFILE\t*f;\n\n\tsnprintf(buf, sizeof buf, \"/sys/class/rtc/%s/device/power/wakeup\",\n\t\t\tdevname);\n\tf \u003d fopen(buf, \"r\");\n\tif (!f) {\n\t\tperror(buf);\n\t\treturn 0;\n\t}\n\tfgets(buf, sizeof buf, f);\n\tfclose(f);\n\n\ts \u003d strchr(buf, \u0027\\n\u0027);\n\tif (!s)\n\t\treturn 0;\n\t*s \u003d 0;\n\n\t/* wakeup events could be disabled or not supported */\n\treturn strcmp(buf, \"enabled\") \u003d\u003d 0;\n}\n\n/* all times should be in UTC */\nstatic time_t\tsys_time;\nstatic time_t\trtc_time;\n\nstatic int get_basetimes(int fd)\n{\n\tstruct tm\ttm;\n\tstruct rtc_time\trtc;\n\n\t/* this process works in RTC time, except when working\n\t * with the system clock (which always uses UTC).\n\t */\n\tif (rtc_is_utc)\n\t\tsetenv(\"TZ\", \"UTC\", 1);\n\ttzset();\n\n\t/* read rtc and system clocks \"at the same time\", or as\n\t * precisely (+/- a second) as we can read them.\n\t */\n\tif (ioctl(fd, RTC_RD_TIME, \u0026rtc) \u003c 0) {\n\t\tperror(\"read rtc time\");\n\t\treturn 0;\n\t}\n\tsys_time \u003d time(0);\n\tif (sys_time \u003d\u003d (time_t)-1) {\n\t\tperror(\"read system time\");\n\t\treturn 0;\n\t}\n\n\t/* convert rtc_time to normal arithmetic-friendly form,\n\t * updating tm.tm_wday as used by asctime().\n\t */\n\tmemset(\u0026tm, 0, sizeof tm);\n\ttm.tm_sec \u003d rtc.tm_sec;\n\ttm.tm_min \u003d rtc.tm_min;\n\ttm.tm_hour \u003d rtc.tm_hour;\n\ttm.tm_mday \u003d rtc.tm_mday;\n\ttm.tm_mon \u003d rtc.tm_mon;\n\ttm.tm_year \u003d rtc.tm_year;\n\ttm.tm_isdst \u003d rtc.tm_isdst;\t/* stays unspecified? */\n\trtc_time \u003d mktime(\u0026tm);\n\n\tif (rtc_time \u003d\u003d (time_t)-1) {\n\t\tperror(\"convert rtc time\");\n\t\treturn 0;\n\t}\n\n\tif (verbose) {\n\t\tif (!rtc_is_utc) {\n\t\t\tprintf(\"\\ttzone   \u003d %ld\\n\", timezone);\n\t\t\tprintf(\"\\ttzname  \u003d %s\\n\", tzname[daylight]);\n\t\t\tgmtime_r(\u0026rtc_time, \u0026tm);\n\t\t}\n\t\tprintf(\"\\tsystime \u003d %ld, (UTC) %s\",\n\t\t\t\t(long) sys_time, asctime(gmtime(\u0026sys_time)));\n\t\tprintf(\"\\trtctime \u003d %ld, (UTC) %s\",\n\t\t\t\t(long) rtc_time, asctime(\u0026tm));\n\t}\n\n\treturn 1;\n}\n\nstatic int setup_alarm(int fd, time_t *wakeup)\n{\n\tstruct tm\t\t*tm;\n\tstruct rtc_wkalrm\twake;\n\n\ttm \u003d gmtime(wakeup);\n\n\twake.time.tm_sec \u003d tm-\u003etm_sec;\n\twake.time.tm_min \u003d tm-\u003etm_min;\n\twake.time.tm_hour \u003d tm-\u003etm_hour;\n\twake.time.tm_mday \u003d tm-\u003etm_mday;\n\twake.time.tm_mon \u003d tm-\u003etm_mon;\n\twake.time.tm_year \u003d tm-\u003etm_year;\n\twake.time.tm_wday \u003d tm-\u003etm_wday;\n\twake.time.tm_yday \u003d tm-\u003etm_yday;\n\twake.time.tm_isdst \u003d tm-\u003etm_isdst;\n\n\t/* many rtc alarms only support up to 24 hours from \u0027now\u0027 ... */\n\tif ((rtc_time + (24 * 60 * 60)) \u003e *wakeup) {\n\t\tif (ioctl(fd, RTC_ALM_SET, \u0026wake.time) \u003c 0) {\n\t\t\tperror(\"set rtc alarm\");\n\t\t\treturn 0;\n\t\t}\n\t\tif (ioctl(fd, RTC_AIE_ON, 0) \u003c 0) {\n\t\t\tperror(\"enable rtc alarm\");\n\t\t\treturn 0;\n\t\t}\n\n\t/* ... so use the \"more than 24 hours\" request only if we must */\n\t} else {\n\t\t/* avoid an extra AIE_ON call */\n\t\twake.enabled \u003d 1;\n\n\t\tif (ioctl(fd, RTC_WKALM_SET, \u0026wake) \u003c 0) {\n\t\t\tperror(\"set rtc wake alarm\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\treturn 1;\n}\n\nstatic void suspend_system(const char *suspend)\n{\n\tFILE\t*f \u003d fopen(\"/sys/power/state\", \"w\");\n\n\tif (!f) {\n\t\tperror(\"/sys/power/state\");\n\t\treturn;\n\t}\n\n\tfprintf(f, \"%s\\n\", suspend);\n\tfflush(f);\n\n\t/* this executes after wake from suspend */\n\tfclose(f);\n}\n\nint main(int argc, char **argv)\n{\n\tstatic char\t\t*devname \u003d \"rtc0\";\n\tstatic unsigned\t\tseconds \u003d 0;\n\tstatic char\t\t*suspend \u003d \"standby\";\n\n\tint\t\tt;\n\tint\t\tfd;\n\ttime_t\t\talarm \u003d 0;\n\n\tprogname \u003d strrchr(argv[0], \u0027/\u0027);\n\tif (progname)\n\t\tprogname++;\n\telse\n\t\tprogname \u003d argv[0];\n\tif (chdir(\"/dev/\") \u003c 0) {\n\t\tperror(\"chdir /dev\");\n\t\treturn 1;\n\t}\n\n\twhile ((t \u003d getopt(argc, argv, \"d:lm:s:t:uVv\")) !\u003d EOF) {\n\t\tswitch (t) {\n\n\t\tcase \u0027d\u0027:\n\t\t\tdevname \u003d optarg;\n\t\t\tbreak;\n\n\t\tcase \u0027l\u0027:\n\t\t\trtc_is_utc \u003d 0;\n\t\t\tbreak;\n\n\t\t/* what system power mode to use?  for now handle only\n\t\t * standardized mode names; eventually when systems define\n\t\t * their own state names, parse /sys/power/state.\n\t\t *\n\t\t * \"on\" is used just to test the RTC alarm mechanism,\n\t\t * bypassing all the wakeup-from-sleep infrastructure.\n\t\t */\n\t\tcase \u0027m\u0027:\n\t\t\tif (strcmp(optarg, \"standby\") \u003d\u003d 0\n\t\t\t\t\t|| strcmp(optarg, \"mem\") \u003d\u003d 0\n\t\t\t\t\t|| strcmp(optarg, \"disk\") \u003d\u003d 0\n\t\t\t\t\t|| strcmp(optarg, \"on\") \u003d\u003d 0\n\t\t\t\t\t) {\n\t\t\t\tsuspend \u003d optarg;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tprintf(\"%s: unrecognized suspend state \u0027%s\u0027\\n\",\n\t\t\t\t\tprogname, optarg);\n\t\t\tgoto usage;\n\n\t\t/* alarm time, seconds-to-sleep (relative) */\n\t\tcase \u0027s\u0027:\n\t\t\tt \u003d atoi(optarg);\n\t\t\tif (t \u003c 0) {\n\t\t\t\tprintf(\"%s: illegal interval %s seconds\\n\",\n\t\t\t\t\t\tprogname, optarg);\n\t\t\t\tgoto usage;\n\t\t\t}\n\t\t\tseconds \u003d t;\n\t\t\tbreak;\n\n\t\t/* alarm time, time_t (absolute, seconds since 1/1 1970 UTC) */\n\t\tcase \u0027t\u0027:\n\t\t\tt \u003d atoi(optarg);\n\t\t\tif (t \u003c 0) {\n\t\t\t\tprintf(\"%s: illegal time_t value %s\\n\",\n\t\t\t\t\t\tprogname, optarg);\n\t\t\t\tgoto usage;\n\t\t\t}\n\t\t\talarm \u003d t;\n\t\t\tbreak;\n\n\t\tcase \u0027u\u0027:\n\t\t\trtc_is_utc \u003d 1;\n\t\t\tbreak;\n\n\t\tcase \u0027v\u0027:\n\t\t\tverbose++;\n\t\t\tbreak;\n\n\t\tcase \u0027V\u0027:\n\t\t\tprintf(\"%s: version %s\\n\", progname, VERSION);\n\t\t\tbreak;\n\n\t\tdefault:\nusage:\n\t\t\tprintf(\"usage: %s [options]\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-d rtc0|rtc1|...\\t(select rtc)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-l\\t\\t\\t(RTC uses local timezone)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-m standby|mem|...\\t(sleep mode)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-s seconds\\t\\t(seconds to sleep)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-t time_t\\t\\t(time to wake)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-u\\t\\t\\t(RTC uses UTC)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-v\\t\\t\\t(verbose messages)\"\n\t\t\t\t\"\\n\\t\"\n\t\t\t\t\"-V\\t\\t\\t(show version)\"\n\t\t\t\t\"\\n\",\n\t\t\t\tprogname);\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tif (!alarm \u0026\u0026 !seconds) {\n\t\tprintf(\"%s: must provide wake time\\n\", progname);\n\t\tgoto usage;\n\t}\n\n\t/* REVISIT:  if /etc/adjtime exists, read it to see what\n\t * the util-linux version of hwclock assumes.\n\t */\n\tif (rtc_is_utc \u003d\u003d -1) {\n\t\tprintf(\"%s: assuming RTC uses UTC ...\\n\", progname);\n\t\trtc_is_utc \u003d 1;\n\t}\n\n\t/* this RTC must exist and (if we\u0027ll sleep) be wakeup-enabled */\n\tfd \u003d open(devname, O_RDONLY);\n\tif (fd \u003c 0) {\n\t\tperror(devname);\n\t\treturn 1;\n\t}\n\tif (strcmp(suspend, \"on\") !\u003d 0 \u0026\u0026 !may_wakeup(devname)) {\n\t\tprintf(\"%s: %s not enabled for wakeup events\\n\",\n\t\t\t\tprogname, devname);\n\t\treturn 1;\n\t}\n\n\t/* relative or absolute alarm time, normalized to time_t */\n\tif (!get_basetimes(fd))\n\t\treturn 1;\n\tif (verbose)\n\t\tprintf(\"alarm %ld, sys_time %ld, rtc_time %ld, seconds %u\\n\",\n\t\t\t\talarm, sys_time, rtc_time, seconds);\n\tif (alarm) {\n\t\tif (alarm \u003c sys_time) {\n\t\t\tprintf(\"%s: time doesn\u0027t go backward to %s\",\n\t\t\t\t\tprogname, ctime(\u0026alarm));\n\t\t\treturn 1;\n\t\t}\n\t\talarm +\u003d sys_time - rtc_time;\n\t} else\n\t\talarm \u003d rtc_time + seconds + 1;\n\tif (setup_alarm(fd, \u0026alarm) \u003c 0)\n\t\treturn 1;\n\n\tsync();\n\tprintf(\"%s: wakeup from \\\"%s\\\" using %s at %s\",\n\t\t\tprogname, suspend, devname,\n\t\t\tctime(\u0026alarm));\n\tfflush(stdout);\n\tusleep(10 * 1000);\n\n\tif (strcmp(suspend, \"on\") !\u003d 0)\n\t\tsuspend_system(suspend);\n\telse {\n\t\tunsigned long data;\n\n\t\tdo {\n\t\t\tt \u003d read(fd, \u0026data, sizeof data);\n\t\t\tif (t \u003c 0) {\n\t\t\t\tperror(\"rtc read\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (verbose)\n\t\t\t\tprintf(\"... %s: %03lx\\n\", devname, data);\n\t\t} while (!(data \u0026 RTC_AF));\n\t}\n\n\tif (ioctl(fd, RTC_AIE_OFF, 0) \u003c 0)\n\t\tperror(\"disable rtc alarm interrupt\");\n\n\tclose(fd);\n\treturn 0;\n}\n\nThis patch:\n\nMake rtc-cmos do the relevant magic so this RTC can wake the system from a\nsleep state.  That magic comes in two basic flavors:\n\n - Straightforward:  enable_irq_wake(), the way it\u0027d work on most SOC chips;\n   or generally with system sleep states which don\u0027t disable core IRQ logic.\n\n - Roundabout, using non-IRQ platform hooks.  This is needed with ACPI and\n   one almost-clone chip which uses a special wakeup-only alarm.  (That\u0027s\n   the RTC used on Footbridge boards, FWIW, which don\u0027t do PM in Linux.)\n\nA separate patch implements those hooks for ACPI platforms, so that rtc_cmos\ncan issue system wakeup events (and its sysfs \"wakealarm\" attribute works on\nat least some systems).\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nCc: Len Brown \u003clenb@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "cd9662094edf4173e87f0452e57e4eacc228f8ff",
      "tree": "819d487aad05c7e61531bd25e3e7a0d4c08c6616",
      "parents": [
        "7d9f99eccc8f94ace31030a2a7ff73cf5f8c12a0"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Tue May 08 00:33:40 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue May 08 11:15:18 2007 -0700"
      },
      "message": "rtc: remove rest of class_device\n\nFinish converting the RTC framework so it no longer uses class_device.\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nAcked-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\nAcked-By: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "ab6a2d70d18edc7a716ef3127b9e13382faec98c",
      "tree": "6de624dfcbd0181e54e21f1730d2a52ae9822c47",
      "parents": [
        "5726fb2012f0d96153113ddb7f988a0daea587ce"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Tue May 08 00:33:30 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue May 08 11:15:18 2007 -0700"
      },
      "message": "rtc: rtc interfaces don\u0027t use class_device\n\nThis patch removes class_device from the programming interface that the RTC\nframework exposes to the rest of the kernel.  Now an rtc_device is passed,\nwhich is more type-safe and streamlines all the relevant code.\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nAcked-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\nAcked-By: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "bcd9b89c02295b075fda4bdb666f6641f8212226",
      "tree": "b566062a9754fb8fb5a47975312da89b0798dddc",
      "parents": [
        "a2b091dbfb355d0cd35756c6ace0988c9855f3f7"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Sun Apr 01 23:49:47 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Mon Apr 02 10:06:09 2007 -0700"
      },
      "message": "[PATCH] rtc-cmos lockdep fix, irq updates\n\nLockdep reported cmos_suspend() and cmos_resume() calling rtc_update_irq()\nwith IRQs enabled; not allowed.\n\nAlso fix problems seen on some hardware, whereby false alarm IRQs could be\nreported (primarily to userspace); and update two comments to match changes\nin ACPI.  Those make up most of this patch, by volume.\n\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "7be2c7c96aff2871240d61fef508c41176c688b5",
      "tree": "37d39d2869b99021d0157f2ac3982a03901e0943",
      "parents": [
        "f1f8810cf48dd88ee70e974924f2dd76e5669dd5"
      ],
      "author": {
        "name": "David Brownell",
        "email": "david-b@pacbell.net",
        "time": "Sat Feb 10 01:46:02 2007 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Sun Feb 11 10:51:32 2007 -0800"
      },
      "message": "[PATCH] RTC framework driver for CMOS RTCs\n\nThis is an \"RTC framework\" driver for the \"CMOS\" RTCs which are standard on\nPCs and some other platforms.  That\u0027s MC146818 compatible silicon.\nAdvantages of this vs.  drivers/char/rtc.c (use one _or_ the other, only\none will be able to claim the RTC irq) include:\n\n - This leverages both the new RTC framework and the driver model; both\n   PNPACPI and platform device modes are supported.  (A separate patch\n   creates a platform device on PCs where PNPACPI isn\u0027t configured.)\n\n - It supports common extensions like longer alarms.  (A separate patch\n   exports that information from ACPI through platform_data.)\n\n - Likewise, system wakeup events use \"real driver model support\", with\n   policy control via sysfs \"wakeup\" attributes and and using normal rtc\n   ioctls to manage wakeup.  (Patch in the works.  The ACPI hooks are\n   known; /proc/acpi/alarm can vanish.  Making it work with EFI will\n   be a minor challenge to someone with e.g. a MiniMac.)\n\nIt\u0027s not yet been tested on non-x86 systems, without ACPI, or with HPET.\nAnd the RTC framework will surely have teething pains on \"mainstream\"\nPC-based systems (though must embedded Linux systems use it heavily), not\nlimited to sorting out the \"/dev/rtc0\" issue (udev easily tweaked).  Also,\nthe ALSA rtctimer code doesn\u0027t use the new RTC API.\n\nOtherwise, this should be a no-known-regressions replacement for the old\ndrivers/char/rtc.c driver, and should help the non-embedded distros (and\nthe new timekeeping code) start to switch to the framework.\n\nNote also that any systems using \"rtc-m48t86\" are candidates to switch over\nto this more functional driver; the platform data is different, and the way\nbytes are read is different, but otherwise those chips should be compatible.\n\n[akpm@osdl.org: sparc32 fix]\n[akpm@osdl.org: sparc64 fix]\nSigned-off-by: David Brownell \u003cdbrownell@users.sourceforge.net\u003e\nCc: Woody Suwalski \u003cwoodys@xandros.com\u003e\nCc: Alessandro Zummo \u003calessandro.zummo@towertech.it\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    }
  ]
}
