Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752245Ab2BVGNH (ORCPT ); Wed, 22 Feb 2012 01:13:07 -0500 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:26943 "EHLO TX2EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750932Ab2BVGNF (ORCPT ); Wed, 22 Feb 2012 01:13:05 -0500 X-SpamScore: -16 X-BigFish: VS-16(zz9371I179dN1432N98dKzz1202hzz8275bhz2dh2a8h668h839h944h) X-Forefront-Antispam-Report: CIP:70.37.183.190;KIP:(null);UIP:(null);IPV:NLI;H:mail.freescale.net;RD:none;EFVD:NLI Date: Wed, 22 Feb 2012 14:21:02 +0800 From: Dong Aisheng To: Stephen Warren CC: Dong Aisheng , Linus Walleij , "B29396@freescale.com" , "s.hauer@pengutronix.de" , "shawn.guo@linaro.org" , "thomas.abraham@linaro.org" , "tony@atomide.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 08/20] pinctrl: Assume map table entries can't have a NULL name field Message-ID: <20120222062101.GA11087@shlinux2.ap.freescale.net> References: <1329720360-23227-1-git-send-email-swarren@nvidia.com> <1329720360-23227-9-git-send-email-swarren@nvidia.com> <74CDBE0F657A3D45AFBB94109FB122FF17BD8BC31C@HQMAIL01.nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF17BD8BC31C@HQMAIL01.nvidia.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3010 Lines: 70 On Tue, Feb 21, 2012 at 09:38:47AM -0800, Stephen Warren wrote: > Dong Aisheng wrote at Tuesday, February 21, 2012 6:08 AM: > > On Mon, Feb 20, 2012 at 2:45 PM, Stephen Warren wrote: > > > pinctrl_register_mappings() already requires that every mapping table > > > entry have a non-NULL name field. > > > > > > Logically, this makes sense too; drivers should always request a specific > > > named state so they know what they're getting. Relying on getting the > > > > Hmm? It makes me a little confused. > > IIRC we allow the driver to request NULL map name in the linaro > > connect discussion. > > For those devices they do not want to support multi states, they > > really don't want to care about the state name. > > The original way is convenient for such a case. > > With device tree, every state is always going to have /some/ name; the I remember the discussion is that pinctrl-name is optional and map name is always specified by pinctrl-name or automatically generated by the id of pinctrl property (e.g. for pinctrl-0, 0 is the name) However user may not want to care about it although there's a name. BTW my above comment may not right since i still have not read all you patches in the series and do not know if any difference on your implementation with the original proposal i will continue to read your patches. > binding we discussed didn't include any way to specify "no name" or > "default name" or "default state", so this will keeps things a little > more consistent. > > I possibly could be persuaded to allow NULL state names in the mapping > table. However, if so, I think they should work a little differently to > the code currently in pinctrl: Right now, a NULL parameter to pinmux_get() > allows matching against /any/ state name in the table. If we changed this Yes it's /any/ state but it's always the first state. > to only allow matching against mapping table with a NULL name, that might > be OK, since it'd be very explicit what it matched. But, as I mentione If that how about many states with NULL name? > above, migrating such a driver to device tree would require changing this I can see many changes, it looks just as the same as before (using first state as default state), did i understand right? > so I'm not inclined to like that solution without strong requirements. > > In other words, what we have right now is something like: > > if name: > match = !strcmp(name, map->name) > else: > match = true > > If we continue to allow NULL names, I think we should change that to: > > if name: > match = map->name && !strcmp(name, map->name) > else: > match = !map->name As above many states name may be NULL. So here it becomes the first NULL name state. Regards Dong Aisheng -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/