Deleted Added
full compact
asmc.c (177977) asmc.c (177979)
1/*-
2 * Copyright (c) 2007, 2008 Rui Paulo <rpaulo@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28/*
29 * Driver for Apple's System Management Console (SMC).
30 * SMC can be found on the MacBook, MacBook Pro and Mac Mini.
31 *
32 * Inspired by the Linux applesmc driver.
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007, 2008 Rui Paulo <rpaulo@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28/*
29 * Driver for Apple's System Management Console (SMC).
30 * SMC can be found on the MacBook, MacBook Pro and Mac Mini.
31 *
32 * Inspired by the Linux applesmc driver.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/dev/asmc/asmc.c 177977 2008-04-07 12:09:59Z rpaulo $");
36__FBSDID("$FreeBSD: head/sys/dev/asmc/asmc.c 177979 2008-04-07 12:58:43Z rpaulo $");
37
38#include "opt_intr_filter.h"
39
40#include <sys/param.h>
41#include <sys/bus.h>
42#include <sys/conf.h>
43#include <sys/kernel.h>
44#include <sys/lock.h>

--- 491 unchanged lines hidden (view full) ---

536
537 /*
538 * I'm not sure what this key does, but it seems to be
539 * required.
540 */
541 buf[0] = 0x01;
542 ASMC_DPRINTF(("sms flag key\n"));
543 asmc_key_write(dev, ASMC_KEY_SMS_FLAG, buf, 1);
37
38#include "opt_intr_filter.h"
39
40#include <sys/param.h>
41#include <sys/bus.h>
42#include <sys/conf.h>
43#include <sys/kernel.h>
44#include <sys/lock.h>

--- 491 unchanged lines hidden (view full) ---

536
537 /*
538 * I'm not sure what this key does, but it seems to be
539 * required.
540 */
541 buf[0] = 0x01;
542 ASMC_DPRINTF(("sms flag key\n"));
543 asmc_key_write(dev, ASMC_KEY_SMS_FLAG, buf, 1);
544 DELAY(200);
544 DELAY(100);
545
546 /*
547 * Wait up to 5 seconds for SMS initialization.
548 */
549 for (i = 0; i < 10000; i++) {
550 if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 &&
551 (buf[0] != 0x00 || buf[1] != 0x00)) {
552 error = 0;

--- 462 unchanged lines hidden ---
545
546 /*
547 * Wait up to 5 seconds for SMS initialization.
548 */
549 for (i = 0; i < 10000; i++) {
550 if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 &&
551 (buf[0] != 0x00 || buf[1] != 0x00)) {
552 error = 0;

--- 462 unchanged lines hidden ---