Techniques are disclosed to limit the current in a switch of a switching
power supply. An example switching regulator circuit includes a switch to
be coupled to an energy transfer element. A controller is coupled to the
switch to control switching of the switch. A current sensor is included
in the controller. The current sensor includes first and second
comparators coupled to compare a current in the switch with first and
second current limits, respectively. The controller is to open the switch
for a remainder of a current switching cycle of the switch until a next
switching cycle of the switch in response to the first or second
comparators. A frequency adjuster is also included in the controller and
coupled to the second comparator. The frequency adjuster is to adjust an
oscillating frequency of an oscillator included in the controller in
response to the second comparator.