Patent ID: 8117469

Claim:
A computer-implemented method, comprising: providing a power management device to control power provided to a peripheral device, coupled to a host device, according to a plurality of operating states of the power management device; and automatically determining, by auto-tuning logic, an operating parameter for at least one of the operating states of the power management device, wherein the operating parameter is an optimal current threshold for current sensing by the power management device in the at least one operating state, and wherein the optimal current threshold is the highest current level expected to be drawn from the power management device in the at least one operating state, and wherein said automatically determining the optimal current threshold comprises: transitioning the power management device to operate in a first of the plurality of operating states; setting a current set point to a default value; while the power management device is in the first operating state, performing one or more operations between the host device and the peripheral device to operate the peripheral device in its highest current draw mode that is expected in the first operating state of the power management device; measuring the current provided to the peripheral device while performing the one or more operations; comparing the current and a set current corresponding to the current set point; if the current provided to the peripheral device is higher than the set current: increasing the current set point to a higher value than the default value; and comparing the measured current provided to the peripheral device and a set current corresponding to the increased current set point; and if the current provided to the peripheral device is not higher than the set current, setting the current set point as the optimal current threshold.