Periodic regimes and phase locking in the rf SQUID