fix pll5x rate calculation

This commit is contained in:
jmcneill 2014-11-12 21:27:48 +00:00
parent 48c555dba9
commit 44c3fb8a8a

View File

@ -1,4 +1,4 @@
/* $NetBSD: awin_board.c,v 1.27 2014/11/10 17:55:25 jmcneill Exp $ */
/* $NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.27 2014/11/10 17:55:25 jmcneill Exp $");
__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -518,7 +518,7 @@ awin_pll5x_get_rate(void)
AWIN_CCM_OFFSET + AWIN_PLL5_CFG_REG);
n = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_N);
k = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_K);
k = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_K) + 1;
p = __SHIFTOUT(cfg, AWIN_PLL5_OUT_EXT_DIV_P);
return (AWIN_REF_FREQ * n * k) >> p;