b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Büsch" <m@bues.ch>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	b43-dev@lists.infradead.org, larry.finger@lwfinger.net,
	florian@openwrt.org
Subject: [RFT][PATCH] b43: fix logic in GPIO configuration
Date: Tue, 6 Mar 2012 22:59:42 +0100	[thread overview]
Message-ID: <20120306225942.6a115221@milhouse> (raw)
In-Reply-To: <1331071898-3651-1-git-send-email-zajec5@gmail.com>

On Tue,  6 Mar 2012 23:11:38 +0100
Rafa? Mi?ecki <zajec5@gmail.com> wrote:

> By using reverted mask we were taking over pins we were not supporsed to
> touch. After fixing this workaround for BCM5354 should not be needed
> anymore.
> 
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
>  drivers/net/wireless/b43/main.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index 1d633f3..8a89885 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -2706,8 +2706,6 @@ static int b43_gpio_init(struct b43_wldev *dev)
>  		mask |= 0x0060;
>  		set |= 0x0060;
>  	}
> -	if (dev->dev->chip_id == 0x5354)
> -		set &= 0xff02;
>  	if (0 /* FIXME: conditional unknown */ ) {
>  		b43_write16(dev, B43_MMIO_GPIO_MASK,
>  			    b43_read16(dev, B43_MMIO_GPIO_MASK)
> @@ -2730,7 +2728,7 @@ static int b43_gpio_init(struct b43_wldev *dev)
>  	case B43_BUS_BCMA:
>  		bcma_cc_write32(&dev->dev->bdev->bus->drv_cc, BCMA_CC_GPIOCTL,
>  				(bcma_cc_read32(&dev->dev->bdev->bus->drv_cc,
> -					BCMA_CC_GPIOCTL) & mask) | set);
> +					BCMA_CC_GPIOCTL) & ~mask) | set);
>  		break;
>  #endif
>  #ifdef CONFIG_B43_SSB
> @@ -2739,7 +2737,7 @@ static int b43_gpio_init(struct b43_wldev *dev)
>  		if (gpiodev)
>  			ssb_write32(gpiodev, B43_GPIO_CONTROL,
>  				    (ssb_read32(gpiodev, B43_GPIO_CONTROL)
> -				    & mask) | set);
> +				    & ~mask) | set);
>  		break;
>  #endif
>  	}

This patch makes sense. Can you also check b43legacy? I guess it has the same problem.

And while we're at it, you could also remove these two lines:

2737         if (dev->dev->core_rev >= 2)
2738                 mask |= 0x0010; /* FIXME: This is redundant. */

because core_rev is always >= 2 in b43 and as the FIXME says the bit is already set.


Also, take a look at b43_gpio_cleanup() (in b43 and b43legacy).
It always forces all bits to zero. This clearly is wrong, too. It is supposed to
revert the changes done in the b43 GPIO setup. It seems too complicated to
fixup the code to actually do this, though. I think we should simply get rid of
b43_gpio_cleanup() completely and simply leave the GPIOs as-is. No kittens
will be hurt by doing so; so it's ok.

-- 
Greetings, Michael.

PGP encryption is encouraged / 908D8B0E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/b43-dev/attachments/20120306/68cb7f1b/attachment.sig>

  reply	other threads:[~2012-03-06 21:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 22:11 [RFT][PATCH] b43: fix logic in GPIO configuration Rafał Miłecki
2012-03-06 21:59 ` Michael Büsch [this message]
2012-03-06 22:55 ` Hauke Mehrtens
2012-03-06 23:32   ` Michael Büsch
2012-03-07  6:54     ` Rafał Miłecki
2012-03-07  6:52   ` Rafał Miłecki
2012-03-07  7:23     ` Rafał Miłecki
2012-03-09 23:17       ` Hauke Mehrtens
2012-03-10  4:50         ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120306225942.6a115221@milhouse \
    --to=m@bues.ch \
    --cc=b43-dev@lists.infradead.org \
    --cc=florian@openwrt.org \
    --cc=hauke@hauke-m.de \
    --cc=larry.finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).