From 28d7a5783674c638ba7b4494c848fab34883c215 Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Mon, 15 Apr 2013 11:24:35 +0800 Subject: ARM: at91: using micro to calculate divisor Using micro to calculate divisor Add AT91_PMC_USBS_USB_PLLB definition Signed-off-by: Bo Shen --- arch/arm/include/asm/arch-at91/at91_pmc.h | 4 ++-- drivers/usb/host/ohci-at91.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h b/arch/arm/include/asm/arch-at91/at91_pmc.h index ca529778b7..1bc022529b 100644 --- a/arch/arm/include/asm/arch-at91/at91_pmc.h +++ b/arch/arm/include/asm/arch-at91/at91_pmc.h @@ -223,8 +223,8 @@ typedef struct at91_pmc { #endif #define AT91_PMC_USBS_USB_PLLA (0x0) /* USB Clock Input is PLLA */ #define AT91_PMC_USBS_USB_UPLL (0x1) /* USB Clock Input is UPLL */ -#define AT91_PMC_USBDIV_8 (0x7 << 8) /* USB Clock divided by 8 */ -#define AT91_PMC_USBDIV_10 (0x9 << 8) /* USB Clock divided by 10 */ +#define AT91_PMC_USBS_USB_PLLB (0x1) /* USB Clock Input is PLLB [AT91SAM9N12 only] */ +#define AT91_PMC_USBDIV_(x) (((x - 1) & 0xf) << 8) #ifdef CONFIG_AT91_LEGACY #define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */ diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index f3fd0d9852..076af18a5c 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -47,7 +47,7 @@ int usb_cpu_init(void) ; /* Select PLLA as input clock of OHCI */ - writel(AT91_PMC_USBS_USB_UPLL | AT91_PMC_USBDIV_10, &pmc->usb); + writel(AT91_PMC_USBS_USB_UPLL | AT91_PMC_USBDIV_(10), &pmc->usb); #endif #if defined(CONFIG_SAMA5D3) -- cgit v1.2.3