  Let $f=a{\tt x} +b{\tt x}^q+{\tt x}^{2q-1}\in\Bbb F_q[{\tt x}]$. We find
explicit conditions on $a$ and $b$ that are necessary and sufficient for $f$ to
be a permutation polynomial of $\Bbb F_{q^2}$. This result allows us to solve a
related problem. Let $g_{n,q}\in\Bbb F_p[{\tt x}]$ ($n\ge 0$,
$p=\text{char}\,\Bbb F_q$) be the polynomial defined by the functional equation
$\sum_{c\in\Bbb F_q}({\tt x}+c)^n=g_{n,q}({\tt x}^q-{\tt x})$. We determine all
$n$ of the form $n=q^\alpha-q^\beta-1$, $\alpha>\beta\ge 0$, for which
$g_{n,q}$ is a permutation polynomial of $\Bbb F_{q^2}$.
