From patchwork Thu Sep 8 14:59:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3983 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4A11623E54 for ; Thu, 8 Sep 2011 14:59:59 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 38BB0A18061 for ; Thu, 8 Sep 2011 14:59:59 +0000 (UTC) Received: by fxd18 with SMTP id 18so2365029fxd.11 for ; Thu, 08 Sep 2011 07:59:59 -0700 (PDT) Received: by 10.223.22.14 with SMTP id l14mr480558fab.100.1315493998946; Thu, 08 Sep 2011 07:59:58 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs178457lab; Thu, 8 Sep 2011 07:59:58 -0700 (PDT) Received: by 10.213.3.194 with SMTP id 2mr306610ebo.68.1315493995904; Thu, 08 Sep 2011 07:59:55 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id fd13si3723963wbb.135.2011.09.08.07.59.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Sep 2011 07:59:55 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by wyg19 with SMTP id 19so776249wyg.37 for ; Thu, 08 Sep 2011 07:59:55 -0700 (PDT) Received: by 10.216.134.155 with SMTP id s27mr810963wei.98.1315493995202; Thu, 08 Sep 2011 07:59:55 -0700 (PDT) Received: from arm.com (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id fd4sm4476962wbb.21.2011.09.08.07.59.51 (version=SSLv3 cipher=OTHER); Thu, 08 Sep 2011 07:59:52 -0700 (PDT) Date: Thu, 8 Sep 2011 15:59:46 +0100 From: Dave Martin To: Shawn Guo Cc: netdev@vger.kernel.org, patches@linaro.org, devicetree-discuss@lists.ozlabs.org, Grant Likely , Steve Glendinning , "David S. Miller" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3] net/smsc911x: add device tree probe support Message-ID: <20110908145946.GE2070@arm.com> References: <1311587040-8988-1-git-send-email-shawn.guo@linaro.org> <1312050360-15767-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1312050360-15767-1-git-send-email-shawn.guo@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Shawn, On Sun, Jul 31, 2011 at 02:26:00AM +0800, Shawn Guo wrote: > It adds device tree probe support for smsc911x driver. > > Signed-off-by: Shawn Guo > Cc: Grant Likely > Cc: Steve Glendinning > Cc: David S. Miller > Reviewed-by: Grant Likely > --- > Changes since v2: > * Fix a typo in smsc911x.txt > > Changes since v1: > * Instead of getting irq line from gpio number, it use irq domain > to keep platform_get_resource(IORESOURCE_IRQ) works for dt too. > * Use 'lan9115' the first model that smsc911x supports in the match > table > * Use reg-shift and reg-io-width which already used in of_serial for > shift and access size binding When using this patch with vexpress, I found that 16-bit register access mode doesn't seem to be getting set correctly. Can you take a look at this additional patch and let me know if it looks correct? Cheers ---Dave From: Dave Martin Date: Wed, 7 Sep 2011 17:26:31 +0100 Subject: [PATCH] net/smsc911x: Correctly configure 16-bit register access from DT The SMSC911X_USE_16BIT needs to be set when using 16-bit register access. However, currently no flag is set if the DT doesn't specify 32-bit access. This patch should set the SMSC911X_USE_16BIT flag in a manner consistent with the documented DT bindings. Signed-off-by: Dave Martin Acked-by: Shawn Guo --- drivers/net/smsc911x.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 75c08a5..1a35c25 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -2121,6 +2121,8 @@ static int __devinit smsc911x_probe_config_dt( of_property_read_u32(np, "reg-io-width", &width); if (width == 4) config->flags |= SMSC911X_USE_32BIT; + else + config->flags |= SMSC911X_USE_16BIT; if (of_get_property(np, "smsc,irq-active-high", NULL)) config->irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH;