From patchwork Mon Jan 9 00:56:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 6096 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 5D97F23E0C for ; Mon, 9 Jan 2012 00:45:38 +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 41C0EA180BC for ; Mon, 9 Jan 2012 00:45:38 +0000 (UTC) Received: by bke17 with SMTP id 17so1674584bke.11 for ; Sun, 08 Jan 2012 16:45:38 -0800 (PST) Received: by 10.205.139.66 with SMTP id iv2mr6443123bkc.27.1326069937924; Sun, 08 Jan 2012 16:45:37 -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 ac16cs36939bkc; Sun, 8 Jan 2012 16:45:36 -0800 (PST) Received: by 10.50.183.166 with SMTP id en6mr16638642igc.7.1326069934994; Sun, 08 Jan 2012 16:45:34 -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 hv9si25815403icc.61.2012.01.08.16.45.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 16:45:34 -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 f6so6972077iag.37 for ; Sun, 08 Jan 2012 16:45:34 -0800 (PST) Received: by 10.50.186.169 with SMTP id fl9mr16844176igc.28.1326069933971; Sun, 08 Jan 2012 16:45:33 -0800 (PST) Received: from S2101-09.ap.freescale.net ([114.216.232.184]) by mx.google.com with ESMTPS id uc6sm65981959igb.4.2012.01.08.16.45.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 16:45:32 -0800 (PST) Date: Mon, 9 Jan 2012 08:56:05 +0800 From: Shawn Guo To: Mark Brown Cc: Richard Zhao , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, eric.miao@linaro.org, patches@linaro.org, Grant Likely , Rob Herring Subject: Re: [PATCH 4/6] arm/dts: imx6q-sabrelite: add sgtl5000 audio codec Message-ID: <20120109005603.GA1835@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> <20120108145254.GE20216@S2101-09.ap.freescale.net> <20120108205504.GF29065@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120108205504.GF29065@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.21 (2010-09-15) On Sun, Jan 08, 2012 at 12:55:05PM -0800, Mark Brown wrote: > On Sun, Jan 08, 2012 at 10:52:56PM +0800, Shawn Guo wrote: > > On Fri, Jan 06, 2012 at 11:25:41AM +0800, Richard Zhao wrote: > > > > + 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(). > > > snprintf(prop_name, 32, "%s-supply", supply); > > + while (prop_name[i] && i < 32) { > > + prop_name[i] = tolower(prop_name[i]); > > + i++; > > + } > > There's two big problems here. One is that we clearly shouldn't be > open coding this here but adding a function for it. The other is that > this is going to break any existing device tree which has upper cased > supplies. If we were going to do something here I'd go with case > insensitve matching though I'm not sure it's a real problem. Ok, let's test device tree maintainers. Grant, Rob, Could the problem we are seeing here be a good reason to make the following change? diff --git a/include/linux/of.h b/include/linux/of.h index a75a831..c26c20f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -147,7 +147,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) /* Default string compare functions, Allow arch asm/prom.h to override */ #if !defined(of_compat_cmp) #define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2)) -#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) +#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) #endif