Wigan have confirmed the signing of Norwich defender Leon Barnett on a three-year deal for an undisclosed fee.