aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-06-29 19:44:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:36:04 -0400
commitb9562545ef0b13c0440ccd8d6dd4111fb77cb17a (patch)
treedadc32d04a6be328ec69c3ab6e6199e110f1e2dd
parent02817be0b2cd42412cf3c09f8f1667f39b6d020d (diff)
bcma: complete workaround for BCMA43224 and BCM4313
This code is based on the Broadcom SDK and brcmsmac. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/bcma/driver_chipcommon_pmu.c22
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h8
2 files changed, 25 insertions, 5 deletions
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
index 2d9ac3e325ae..a8fcdf0222eb 100644
--- a/drivers/bcma/driver_chipcommon_pmu.c
+++ b/drivers/bcma/driver_chipcommon_pmu.c
@@ -139,7 +139,11 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
139 139
140 switch (bus->chipinfo.id) { 140 switch (bus->chipinfo.id) {
141 case BCMA_CHIP_ID_BCM4313: 141 case BCMA_CHIP_ID_BCM4313:
142 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); 142 /* enable 12 mA drive strenth for 4313 and set chipControl
143 register bit 1 */
144 bcma_chipco_chipctl_maskset(cc, 0,
145 BCMA_CCTRL_4313_12MA_LED_DRIVE,
146 BCMA_CCTRL_4313_12MA_LED_DRIVE);
143 break; 147 break;
144 case BCMA_CHIP_ID_BCM4331: 148 case BCMA_CHIP_ID_BCM4331:
145 case BCMA_CHIP_ID_BCM43431: 149 case BCMA_CHIP_ID_BCM43431:
@@ -147,12 +151,20 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
147 bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true); 151 bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true);
148 break; 152 break;
149 case BCMA_CHIP_ID_BCM43224: 153 case BCMA_CHIP_ID_BCM43224:
154 case BCMA_CHIP_ID_BCM43421:
155 /* enable 12 mA drive strenth for 43224 and set chipControl
156 register bit 15 */
150 if (bus->chipinfo.rev == 0) { 157 if (bus->chipinfo.rev == 0) {
151 pr_err("Workarounds for 43224 rev 0 not fully " 158 bcma_cc_maskset32(cc, BCMA_CC_CHIPCTL,
152 "implemented\n"); 159 BCMA_CCTRL_43224_GPIO_TOGGLE,
153 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x00F000F0); 160 BCMA_CCTRL_43224_GPIO_TOGGLE);
161 bcma_chipco_chipctl_maskset(cc, 0,
162 BCMA_CCTRL_43224A0_12MA_LED_DRIVE,
163 BCMA_CCTRL_43224A0_12MA_LED_DRIVE);
154 } else { 164 } else {
155 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0xF0); 165 bcma_chipco_chipctl_maskset(cc, 0,
166 BCMA_CCTRL_43224B0_12MA_LED_DRIVE,
167 BCMA_CCTRL_43224B0_12MA_LED_DRIVE);
156 } 168 }
157 break; 169 break;
158 case BCMA_CHIP_ID_BCM43225: 170 case BCMA_CHIP_ID_BCM43225:
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 1e523cc61860..09f31ade1410 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -325,6 +325,14 @@
325#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ 325#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
326#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ 326#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
327 327
328/* 43224 chip-specific ChipControl register bits */
329#define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */
330#define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */
331#define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */
332
333/* 4313 Chip specific ChipControl register bits */
334#define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */
335
328/* Data for the PMU, if available. 336/* Data for the PMU, if available.
329 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 337 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
330 */ 338 */