From patchwork Mon Aug 16 20:39:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?G=C3=A1bor_Stefanik?= X-Patchwork-Id: 119795 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7GKdOhK025664 for ; Mon, 16 Aug 2010 20:39:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756545Ab0HPUjX (ORCPT ); Mon, 16 Aug 2010 16:39:23 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:41041 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755353Ab0HPUjW (ORCPT ); Mon, 16 Aug 2010 16:39:22 -0400 Received: by mail-fx0-f46.google.com with SMTP id 13so3130309fxm.19 for ; Mon, 16 Aug 2010 13:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=KJJiStYrzhynIY6sJ5LfsEAoy0EiHnpVWipbBqYTgmc=; b=IProy5+PeyJnT3b+4aCZsxytXgg+/zf3BCjxHo2VS8zQ/o2rEc3+T/+O6/8atlmECw B7R9DA+Uy2S+6OXWtt34yFBfpBEH57aLMOziMOAy2A5F1ckh/wra/V1RqYfiJJLtYkQA kHnRuwn/wrAAZZZnFfUTCnX9rmRfQ/1V4DOxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; b=N4Caz2mo101pT1oIzK5mWTpwIpehsozF/+naaoSxqGwSdS2IPQi/rfjiRIVyh1XtiE xTmSJy2IgWF1pH1TqjO4KOvzpk/3KxmWYcpychwwcMDjEdH5U7AZ6Apozx1acsptrcHS K2OHewSDrXvhe66LA/dGQhCjBOGvRGF9b3hR8= Received: by 10.223.107.137 with SMTP id b9mr5664187fap.17.1281991160221; Mon, 16 Aug 2010 13:39:20 -0700 (PDT) Received: from localhost.localdomain (pool-0010a.externet.hu [80.85.49.9]) by mx.google.com with ESMTPS id r4sm1897477faa.43.2010.08.16.13.39.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Aug 2010 13:39:19 -0700 (PDT) From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= To: John Linville , =?UTF-8?q?Michael=20B=C3=BCsch?= Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, Larry Finger , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , =?UTF-8?q?G=C3=A1bor=20Stefanik?= Subject: [PATCH 3/4] b43: N-PHY: Implement MAC PHY clock set Date: Mon, 16 Aug 2010 22:39:16 +0200 Message-Id: <1281991157-1557-3-git-send-email-netrolller.3d@gmail.com> X-Mailer: git-send-email 1.6.4.2 In-Reply-To: <1281991157-1557-2-git-send-email-netrolller.3d@gmail.com> References: <1281991157-1557-1-git-send-email-netrolller.3d@gmail.com> <1281991157-1557-2-git-send-email-netrolller.3d@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 16 Aug 2010 20:39:24 +0000 (UTC) diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index f1b5707..d2dab55 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c @@ -3074,6 +3074,17 @@ static int b43_nphy_cal_rx_iq(struct b43_wldev *dev, return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug); } +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */ +static void b43_nphy_mac_phy_clock_set(struct b43_wldev *dev, bool on) +{ + u32 tmslow = ssb_read32(dev->dev, SSB_TMSLOW); + if (on) + tmslow |= SSB_TMSLOW_PHYCLK; + else + tmslow &= ~SSB_TMSLOW_PHYCLK; + ssb_write32(dev->dev, SSB_TMSLOW, tmslow); +} + /* * Init N-PHY * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N @@ -3174,7 +3185,7 @@ int b43_phy_initn(struct b43_wldev *dev) b43_phy_write(dev, B43_NPHY_BBCFG, tmp & ~B43_NPHY_BBCFG_RSTCCA); b43_nphy_bmac_clock_fgc(dev, 0); - /* TODO N PHY MAC PHY Clock Set with argument 1 */ + b43_nphy_mac_phy_clock_set(dev, true); b43_nphy_pa_override(dev, false); b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX); diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index a6d5225..b2d4bed 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h @@ -97,6 +97,7 @@ #define SSB_TMSLOW_RESET 0x00000001 /* Reset */ #define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */ #define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ +#define SSB_TMSLOW_PHYCLK 0x00000010 /* MAC PHY Clock Control Enable */ #define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ #define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ #define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */