Vehicles have been developed to perform an engine stop when idle-stop conditions are met and then to automatically restart the engine when restart conditions are met.  Such idle-stop systems enable fuel savings, reduced exhaust emissions, reduced vehicle noise, and the like. 
Other engines may be configured with variable cam timing mechanisms wherein cam timing can be adjusted at engine shut-down to reduce engine emissions and the potential for engine misfire.  By repositioning the cam in response to a request to stop the engine, pumping of air to the exhaust system can be reduced so that engine emissions can be improved.  Cam timing may also be adjusted during engine restarting to reduce engine speed flare. 
However, the inventors herein have recognized that there may be conflicting requirements when the engine is automatically shut-down by an engine controller of the idle-stop system (e.g., in response to selected idle-stop conditions being met and without an operator request to stop the engine) versus when the engine is shutdown by the operator.  For example, if an engine is stopped via a controller to save fuel during an engine idle period, it may be reasonably expected that the engine will be restarted within a short time period to provide torque to propel the vehicle since the driver has not requested that the engine be stopped.  Restarting the engine when the engine is warm and has relatively low friction as compared to when the engine is cold may require less engine torque.  As such, a reduced cylinder air charge may be necessary to restart the engine.  Further, by reducing the amount of air supplied to engine cylinders during a warm engine restart, it may be possible to reduce engine emission and engine speed overshoot to improve engine starting.  In addition, a short engine start time driven by an operator torque request and facilitated by determining engine position at stop may be expected by the operator.  Thus, it may be desirable to position the intake valve cam in a retarded position during engine shutdown (e.g., the time between an engine stop request and zero engine rotation) so that the engine may be restarted during warm conditions with a reduced air charge. 
On the other hand, if an operator requests to stop the engine (e.g., via a key-off or push-button depression), it may be reasonably expected that the operator intends to not operate the engine for a period of time.  If the engine remains in an off state for an extended period of time, the engine may cool down such that engine friction is higher during an engine restart as compared to when the engine is restarted during warm conditions.  Further, since the engine may be cold the operator may expect a longer starting time.  Consequently, engine intake valve timing and engine air charge requirements may be different between controller and operator initiated engine stops. 
Thus, in one example, some of the above issues may be addressed by a method of controlling an engine that is automatically deactivated in response to selected idle-stop conditions.  In one example, the method comprises, adjusting an intake valve closing timing to a first timing in response to an operator requested engine stop, and adjusting the intake valve closing timing to a second timing in response to an automatic controller requested engine stop. 
By adjusting intake valve closing timing to timings that depend on whether the engine stop request was generated via an engine controller or an operator, it may be possible to pre-position intake valve closing timing such that the engine is better prepared for a subsequent engine restart.  For example, if the engine is stopped automatically via a controller during warm ambient conditions, cam timing can be retarded in anticipation that a smaller cylinder air charge may be used to restart the engine and limit engine speed overshoot.  Further, retarded valve timing may reduce engine shake during engine stopping.  Conversely, if the engine is stopped via an operator request, cam timing can be set to a more advanced position so that the engine cylinders receive additional air during a subsequent engine restart.  In this way, the engine may be restarted with increased torque during cold conditions to positively accelerate the engine. 
In some examples, while the engine is spinning to rest following a controller engine stop request, the vehicle operator may have a change of mind (COM) and may wish to restart the engine.  Thus, in one example, while the engine is spinning to rest, the valve timing may be further adjusted based on the engine speed.  Thus, when the engine speed is above a threshold speed that can support the driver COM restart request, the valve timing may be adjusted to increase cylinder air charge.  In contrast, when the engine speed is lower than the threshold, the valve timing may be adjusted to a different timing that supports pumping less air through the engine and restarting the engine during warm conditions. 
In some examples, the transmission may be tied-up during the engine idle-stop shutdown to reduce engine restart times when restart conditions are met.  Thus, during the controller initiated engine stop, the valve timing may also be adjusted based on transmission speed and transmission tie-up torque to compensate for air charge adjustments in view of the idle-stop transmission tie-up. 
In this way, by adjusting the valve timing differently based on the differences between an engine idle-stop and an engine operator shutdown request, as well as the various engine adjustments performed during an engine idle-stop, the engine may be kept engine restart ready. 
It should be understood that the summary above is provided to introduce in simplified form a selection of concepts that are further described in the detailed description.  It is not meant to identify key or essential features of the claimed subject matter, the scope of which is defined uniquely by the claims that follow the detailed description.  Furthermore, the claimed subject matter is not limited to implementations that solve any disadvantages noted above or in any part of this disclosure.