brcm47xx: update watchdog driver
[openwrt.git] / target / linux / brcm47xx / patches-3.6 / 545-bcma-add-bcma_chipco_alp_clock.patch
1 --- a/drivers/bcma/driver_chipcommon.c
2 +++ b/drivers/bcma/driver_chipcommon.c
3 @@ -4,6 +4,7 @@
4   *
5   * Copyright 2005, Broadcom Corporation
6   * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7 + * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
8   *
9   * Licensed under the GNU/GPL. See COPYING for details.
10   */
11 @@ -22,6 +23,14 @@ static inline u32 bcma_cc_write32_masked
12         return value;
13  }
14  
15 +static u32 bcma_chipco_alp_clock(struct bcma_drv_cc *cc)
16 +{
17 +       if (cc->capabilities & BCMA_CC_CAP_PMU)
18 +               return bcma_pmu_alp_clock(cc);
19 +
20 +       return 20000000;
21 +}
22 +
23  void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
24  {
25         if (cc->early_setup_done)
26 @@ -180,8 +189,7 @@ void bcma_chipco_serial_init(struct bcma
27         struct bcma_serial_port *ports = cc->serial_ports;
28  
29         if (ccrev >= 11 && ccrev != 15) {
30 -               /* Fixed ALP clock */
31 -               baud_base = bcma_pmu_alp_clock(cc);
32 +               baud_base = bcma_chipco_alp_clock(cc);
33                 if (ccrev >= 21) {
34                         /* Turn off UART clock before switching clocksource. */
35                         bcma_cc_write32(cc, BCMA_CC_CORECTL,