The current research on metasurfaces is mostly focused on its ability to manipulate electromagnetic waves in space, which requires a large number of subwavelength structures to control, thus making it difficult to avoid the problem of large device size. However, it also has great development potential in the conversion of space light to guided waves. In this paper, we propose a compact structure consisting of silicon nanoantennas and waveguides for controlling the conversion of linearly polarized light in free space into guided waves and propagating along the waveguide. The device is capable of efficiently coupling and splitting linearly polarized light at any polarization angle in free space, and realizing wavelength routing functions with the directivity can reach up to 23.74 dB, and the maximum transmission rate is 12.5%. The results not only prove that the integration of nanoantennas with waveguides can achieve polarization multiplexing functions on a chip and achieve high working efficiency but also provide more possibilities for chip applications such as mode conversion in photonic integrated circuits.