From: Hauke Mehrtens Date: Wed, 25 Jul 2012 21:08:54 +0000 (+0200) Subject: bcma: fix invalid PMU chip control masks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f03bf06e4e3b8ed9a69e7fc4cdb1be4c6c6c819;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git bcma: fix invalid PMU chip control masks Commit b9562545ef0b ("bcma: complete workaround for BCMA43224 and BCM4313") introduced the wrong masks for setting the chip control registers - the "mask" parameter is inverse. It should be the mask of bits *not* changed, which is admittedly a bit non-intuitive. The incorrect mask not only causes the driver to not work correctly on the chips affected (eg the BCM43224 on the Macbook Air 4,2) but the state persists over a soft reset, causing the next boot to not necessarily see the device correctly. Reported-and-tested-by: Linus Torvalds Tested-by: Seth Forshee Cc: Hauke Mehrtens Cc: Arend Van Spriel Cc: Pieter-Paul Giesberts Cc: Brett Rudley Signed-off-by: Linus Torvalds --- diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c index 44326178db29..c9a4f46c5143 100644 --- a/drivers/bcma/driver_chipcommon_pmu.c +++ b/drivers/bcma/driver_chipcommon_pmu.c @@ -110,7 +110,7 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc) /* enable 12 mA drive strenth for 4313 and set chipControl register bit 1 */ bcma_chipco_chipctl_maskset(cc, 0, - BCMA_CCTRL_4313_12MA_LED_DRIVE, + ~BCMA_CCTRL_4313_12MA_LED_DRIVE, BCMA_CCTRL_4313_12MA_LED_DRIVE); break; case BCMA_CHIP_ID_BCM4331: @@ -124,14 +124,14 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc) register bit 15 */ if (bus->chipinfo.rev == 0) { bcma_cc_maskset32(cc, BCMA_CC_CHIPCTL, - BCMA_CCTRL_43224_GPIO_TOGGLE, + ~BCMA_CCTRL_43224_GPIO_TOGGLE, BCMA_CCTRL_43224_GPIO_TOGGLE); bcma_chipco_chipctl_maskset(cc, 0, - BCMA_CCTRL_43224A0_12MA_LED_DRIVE, + ~BCMA_CCTRL_43224A0_12MA_LED_DRIVE, BCMA_CCTRL_43224A0_12MA_LED_DRIVE); } else { bcma_chipco_chipctl_maskset(cc, 0, - BCMA_CCTRL_43224B0_12MA_LED_DRIVE, + ~BCMA_CCTRL_43224B0_12MA_LED_DRIVE, BCMA_CCTRL_43224B0_12MA_LED_DRIVE); } break;