A switching circuit operates with a first operating state and a second operating state. During the first operating state, the switching circuit allows a switching current to linearly increase. During the second operating state, the switching circuit allows the switching current to linearly decrease. A control circuit is coupled to the switching circuit for controlling the switching circuit to operate with the first operating state or the second operating state. A setting circuit generates a threshold signal for the control circuit to ensure that during the first operating state the switching current linearly increases to become higher than or equal to a current value set by the threshold signal. Thereby, the switching current is prevented from linearly decreasing to reverse polarity during the second operating state.