The Duke of Edinburgh is to voluntarily give up his driving licence, Buckingham Palace says.