High-voltage and reverse polarity protection