From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] arm/dts: imx6q-sabrelite: add sgtl5000 audio codec
Date: Sun, 08 Jan 2012 21:38:39 -0600 [thread overview]
Message-ID: <4F0A613F.80509@gmail.com> (raw)
In-Reply-To: <20120109005603.GA1835@S2101-09.ap.freescale.net>
On 01/08/2012 06:56 PM, Shawn Guo wrote:
> 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
Device-trees are case sensitive, so I don't think we want to go globally
changing that behavior.
If you want lower case names, then change the sgtl5000 code to lower
case names.
Rob
next prev parent reply other threads:[~2012-01-09 3:38 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 3:25 [PATCH 0/6] imx patches when I enable imx6q sabrelite audio Richard Zhao
2012-01-06 3:25 ` [PATCH 1/6] ARM: mxc: make imx_dma_is_general_purpose more generic for sdma Richard Zhao
2012-01-06 9:07 ` Sascha Hauer
2012-01-06 3:25 ` [PATCH 2/6] ARM: imx6q: add cko1 clock Richard Zhao
2012-01-06 3:25 ` [PATCH 3/6] arm/dts: imx6q-sabrelite: add 2P5V and 3P3V regulators Richard Zhao
2012-01-08 9:06 ` Shawn Guo
2012-01-08 9:14 ` Richard Zhao
2012-01-08 9:47 ` Shawn Guo
2012-01-06 3:25 ` [PATCH 4/6] arm/dts: imx6q-sabrelite: add sgtl5000 audio codec Richard Zhao
2012-01-08 14:52 ` Shawn Guo
2012-01-08 20:55 ` Mark Brown
2012-01-09 0:56 ` Shawn Guo
2012-01-09 3:38 ` Rob Herring [this message]
2012-01-09 5:05 ` Eric Miao
2012-01-09 5:58 ` Richard Zhao
2012-01-09 6:25 ` Mark Brown
2012-01-09 6:52 ` Shawn Guo
2012-01-09 6:43 ` Mark Brown
2012-01-09 7:17 ` Shawn Guo
2012-01-09 7:12 ` Mark Brown
2012-01-11 0:57 ` Richard Zhao
2012-01-11 0:59 ` Mark Brown
2012-01-09 6:47 ` Shawn Guo
2012-01-11 1:33 ` Fabio Estevam
2012-01-11 1:40 ` Richard Zhao
2012-01-06 3:25 ` [PATCH 5/6] ARM: mxc: add dt support for audmux-v2 Richard Zhao
2012-01-06 8:56 ` Russell King - ARM Linux
2012-01-06 9:14 ` Richard Zhao
2012-01-06 9:13 ` Sascha Hauer
2012-01-06 9:21 ` Richard Zhao
2012-01-06 9:38 ` Sascha Hauer
2012-01-11 5:26 ` Shawn Guo
2012-01-11 13:02 ` Richard Zhao
2012-01-11 17:38 ` Mark Brown
2012-01-12 8:54 ` Richard Zhao
2012-01-06 3:25 ` [PATCH 6/6] ARM: imx6q-sabrelite: add audmux support Richard Zhao
2012-01-08 15:02 ` Shawn Guo
2012-01-08 14:58 ` Richard Zhao
2012-01-09 1:19 ` Shawn Guo
2012-01-09 5:27 ` Shawn Guo
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=4F0A613F.80509@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).