The continued convergence of electronics and photonics on the chip scale can benefit from the voltage control of optical polarization for applications in communications, signal processing and sensing. It is challenging, however, to electrically manipulate the polarization state of light in planar optical waveguides. Here we introduce out-of-plane optical waveguides, allowing access to Berry's phase, a quantum-mechanical phenomenon of purely topological origin. As a result, electrically tunable optical polarization rotation on the chip scale is achieved. Devices fabricated in the silicon-on-insulator material platform are not limited to a single static polarization state. Rather, they can exhibit dynamic tuning of polarization from the fundamental transverse electric mode to the fundamental transverse magnetic mode. Electrical tuning of optical polarization over a 19 dB range of polarization extinction ratio is demonstrated with less than 1 dB of conversion loss at infrared wavelengths. Compact system architectures involving dynamic control of optical polarization in integrated circuits are envisioned.