LED Driver for AC and DC power supplies