1. Field of the Invention
The invention relates to computer, and more specifically, to power switching in a computer.
2. Description of the Prior Art
Most computer components have undergone substantial improvements since first development. The need for improvement of a given component may arise from shortcomings of that component or from improvements in other components. For years, the preferred computer power switch was a simple manual switch that physically connected a power supply to the motherboard of the computer. However, with the recent development of advanced operating systems that allow for software power-down and power-save states, the old manual switch is no longer adequate nor desirable.
One type of improved power switch is a pushbutton that toggles power to the computer. When the computer is off and such power button is depressed, the computer is turned on. When the computer is on and the power button is depressed and held down for four seconds, the computer is turned off. This type of power switch is independent of the operating system of the computer since it interfaces directly with low-level circuitry.
Another type of improved power switch is one that is controlled and configured by the operating system itself. One of the most common type of these is not a physical switch at all, but simply a software command that triggers the operating system to initiate shutdown of the computer.
Currently, many computers incorporate the functionality of both types of improved power switches by simply providing both switches to the user. This is a short-sighted approach that ignores user inconvenience and confusion as to which switch to use.
It is therefore a primary objective of the invention to provide a computer having a multifunction power button.
Briefly summarized, the invention includes an input/output (I/O) chip, a power button coupled to the I/O chip, and a controller coupled to the power button. In a first operational mode, the I/O chip switches power to the computer in response to an actuation of the power button. In a second operational mode, the controller forwards a command to an operating system in response to an actuation of the power button, and the I/O chip switches power to the computer in response to a held actuation of the power button.
It is an advantage that the invention realizes simplified power switching to the computer, in which a single power button controls on/off functionality as well as power saving features.
These and other objectives of the invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
The power button 110 is a two-position switch such as a pushbutton that may be spring loaded, self resilient (i.e. a membrane button), or have similar mechanical or electrical mechanism so that one state is default and the other state is only entered when the switch is actuated. The power button 110 may also be a computer keyboard key, for example. For clarity of this description, a simple spring loaded pushbutton will be assumed. The power button 110 is said to be depressed or pushed when a person actuates it, and released when the person no longer actuates it. The power button 110 can also be held down in the depressed position. When a different variety of power switch or button is used, it may have a different method of actuation, such as a turn, pull, touch, etc.
Generally, the computer 100 and operating system 120 conform to the advanced configuration and power interface (ACPI) specification that, among other things, suggests various computer power states as shown in Table 1. While the computer 100 is started, the computer 100 transitions from a non-ACPI-capable BIOS boot sequence to the ACPI-capable operating system 120.
Furthermore, the CPU 102 can typically support various power-save states, which, from full to minimum power, are designated C0-C7. The CPU 102 power-save state C0 is known as the working state, in which all sections and functions of the CPU 102 receive full power. Progressing from state C1 to C6, an increasing quantity of various sections and features of the CPU 102 are denied power until state C7 in which the CPU 102 receives virtually no power and is said to be off. Not all CPUs support power-save states and some support fewer states than mentioned, however, the invention applies to CPUs that support at least one reduced-power state.
In general, the I/O chip 109 supports the power button 110 at all times, while the controller 112 (through the USB interface 114) supports the power button 110 after the driver 122 has been loaded into the RAM 104. However, during the boot of the computer 100, the I/O chip 109 changes functionality so that it will only cut power to the computer 100 when the power button 110 is depressed and held for a specific threshold duration (four seconds is typical, but not limiting). This change in operation of the I/O chip 109 is well known and frequently implemented.
The operation of the invention is described in more detail referring to a state diagram 200 of
After or during loading of the operating system 120, the driver 122 is loaded for the power button 110, and the computer 100 enters a working state 208. At this time, any depression or push of the power button 110 is detected by the driver 122. Upon detecting a push to the power button 110, the driver 122 instructs the operating system 120 to switch between a predetermined power-save state 210, such as the previously described CPU power-save states (C1-C7), and the working state 208. Since the I/O chip 109 still handles the power button 110 when the power button 110 is held for a specific threshold duration such as four seconds (designated by “hold 4 seconds” in
The exact time of transition of power-button functionality provided by the I/O chip 109 is not important. For instance, this transition can occur at any time from early in the BIOS power-on self-test (POST) to the later stages of operating system loading. Also, since the computer 100 spends most of its time in the working or power-save states 208, 210, the exact time that the power-button driver 122 is loaded is also not too critical. What's key is that after the driver 122 is loaded and in response to a push and release of the power button 110 of less than the threshold duration, the controller 112 triggers the USB interface 114 to issue a command through the driver 122 to the operating system 120. This command instructs the operating system 120 to toggle the CPU power-save state between an increased-power state (e.g. C0) and a reduced-power state (e.g. C1-C7). In another embodiment, the command instructs the operating system 120 to toggle the computer power state (i.e. between S0, S1, S2, S3, or S4).
To better explain the state arrangement of
The measurement of a depression duration of the power button 110 can be performed at the hardware level in the controller 112 or at the software level in program code of the driver 122 or operating system 120. This measurement can also be performed by a combination of hardware and software. Moreover, the depression threshold duration need not be four seconds, any other suitable duration will do. The driver 122 can also be coded to provide a default state to the operating system 120. That is, when the driver 122 is first loaded, it can send a command requesting a specific state (e.g. C0-C7, S0-S4) to the operating system 120. Equivalently, the default state can be left for the operating system 120 to determine. In both cases, the driver 122 can simply send a command demanding a specific state or a command to toggle the current state.
It should be noted that if the power-button driver 122 fails to load, the power button 110 still retains all functionality provided by the I/O chip 109. The computer 100 may also have other power-down functionality provided by the operating system 120, such software power control being fully compatible with the invention.
Referring to
When the switch of the power button 110 is closed, the USB microcontroller 402 detects that the normally high line is pulled to ground. Then, the USB microcontroller 402 can pass this information as a command to the USB interface 114.
In order to realize the invention in computers that have modern BIOS chips, a modification to the BIOS code is likely to be required. Please refer to
Provided that substantially the same result is achieved, the steps of the boot process 500 need not be in the exact order shown and need not be contiguous, that is, other steps can be intermediate. Most steps can be changed and adapted to other situations, however, the main concern is that the BIOS 108 does not contain a command that reports the presence of the power button 110 to the operating system 120, or that the BIOS 108 is otherwise prevented from reporting the power button 110 to the operating system 120.
The embodiments discussed can be complemented by additional components, such as a de-bounce processor for smoothing the power button depress signal. The de-bounce processor may form part of the power button 110 or controller 112, for example. In typical implementations, the computer 100 will include other common components such as a hard drive, a compact disc drive, a mouse and keyboard, and a display device.
In contrast to the prior art, the invention provides a simplified power switching scheme in which a single power button controls on/off functionality as well as power saving features.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.