From patchwork Sun Jan 8 14:52:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 6091 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 88D5D23F7F for ; Sun, 8 Jan 2012 14:42:30 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 765DFA18041 for ; Sun, 8 Jan 2012 14:42:30 +0000 (UTC) Received: by bke17 with SMTP id 17so1409927bke.11 for ; Sun, 08 Jan 2012 06:42:30 -0800 (PST) Received: by 10.204.152.20 with SMTP id e20mr5482665bkw.117.1326033750113; Sun, 08 Jan 2012 06:42:30 -0800 (PST) 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.205.82.144 with SMTP id ac16cs24251bkc; Sun, 8 Jan 2012 06:42:29 -0800 (PST) Received: by 10.50.159.131 with SMTP id xc3mr5836307igb.27.1326033747496; Sun, 08 Jan 2012 06:42:27 -0800 (PST) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id hv9si25029964icc.113.2012.01.08.06.42.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 06:42:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iagf6 with SMTP id f6so6338053iag.37 for ; Sun, 08 Jan 2012 06:42:26 -0800 (PST) Received: by 10.43.117.194 with SMTP id fn2mr12351667icc.53.1326033746378; Sun, 08 Jan 2012 06:42:26 -0800 (PST) Received: from S2101-09.ap.freescale.net ([114.216.233.224]) by mx.google.com with ESMTPS id gh9sm10262418igb.3.2012.01.08.06.42.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 06:42:25 -0800 (PST) Date: Sun, 8 Jan 2012 22:52:56 +0800 From: Shawn Guo To: Richard Zhao Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, eric.miao@linaro.org, patches@linaro.org, Mark Brown Subject: Re: [PATCH 4/6] arm/dts: imx6q-sabrelite: add sgtl5000 audio codec Message-ID: <20120108145254.GE20216@S2101-09.ap.freescale.net> References: <1325820343-11875-1-git-send-email-richard.zhao@linaro.org> <1325820343-11875-5-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1325820343-11875-5-git-send-email-richard.zhao@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) On Fri, Jan 06, 2012 at 11:25:41AM +0800, Richard Zhao wrote: > Signed-off-by: Richard Zhao > --- > arch/arm/boot/dts/imx6q-sabrelite.dts | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts > index 3f4b45e..567b664 100644 > --- a/arch/arm/boot/dts/imx6q-sabrelite.dts > +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts > @@ -44,6 +44,18 @@ > uart2: uart@021e8000 { > status = "okay"; > }; > + > + i2c@021a0000 { /* I2C1 */ > + status = "okay"; > + clock-frequency = <100000>; > + > + codec: sgtl5000@0a { > + compatible = "fsl,sgtl5000"; > + reg = <0x0a>; > + VDDA-supply = <®_2P5V>; > + VDDIO-supply = <®_3P3V>; I would prefer to have them named vdda-supply and vddio-supply. But I just learnt that they do not work, because sgtl5000 driver (sound/soc/codecs/sgtl5000.c) has the supply_names in upper case, while unlike of_node_cmp() is strcasecmp(), of_prop_cmp() is just strcmp(). But the convention on property name is really all using lower case, and mixing cases there looks odd, so I'm thinking about the changes below on of_get_regulator(). Mark, how do you think? 8<--- --->8 Regards, Shawn > + }; > + }; > }; > }; > > -- > 1.7.5.4 > > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ca86f39..b89eb43 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -147,10 +148,15 @@ static struct device_node *of_get_regulator(struct device *dev, const char *supp { struct device_node *regnode = NULL; char prop_name[32]; /* 32 is max size of property name */ + int i = 0; dev_dbg(dev, "Looking up %s-supply from device tree\n", supply); snprintf(prop_name, 32, "%s-supply", supply); + while (prop_name[i] && i < 32) { + prop_name[i] = tolower(prop_name[i]); + i++; + } regnode = of_parse_phandle(dev->of_node, prop_name, 0); if (!regnode) {