He says he will quit as Speaker and MP at the next election or on 31 October, whichever comes first.