public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Hanumant Singh <hanumant@codeaurora.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bjorn Andersson <Bjorn.Andersson@sonymobile.com>,
	"Bird, Tim" <Tim.Bird@sonymobile.com>,
	ext Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] pinctrl: msm: Add support for MSM TLMM pinmux
Date: Wed, 07 Aug 2013 10:00:11 -0600	[thread overview]
Message-ID: <52026F0B.6020705@wwwdotorg.org> (raw)
In-Reply-To: <52018A8D.70608@codeaurora.org>

On 08/06/2013 05:45 PM, Hanumant Singh wrote:
> On 7/31/2013 5:17 PM, Hanumant Singh wrote:
>> On 7/31/2013 2:06 PM, Stephen Warren wrote:
>>> On 07/31/2013 01:46 PM, Hanumant Singh wrote:
>>>> On 7/30/2013 8:59 PM, Stephen Warren wrote:
>>>>> On 07/30/2013 06:13 PM, Hanumant Singh wrote:
>>>>>> On 7/30/2013 5:08 PM, Stephen Warren wrote:
>>>>>>> On 07/30/2013 06:01 PM, Hanumant Singh wrote:
>>>>>>>> On 7/30/2013 2:22 PM, Stephen Warren wrote:
>>>>>>>>> On 07/30/2013 03:10 PM, hanumant wrote:
>>>>>>>>> ...
>>>>>>>>>> We actually have the same TLMM pinmux used by several socs of a
>>>>>>>>>> family.
>>>>>>>>>> The number of pins on each soc may vary.
>>>>>>>>>> Also a given soc gets used in a number of boards.
>>>>>>>>>> The device tree for a given soc is split into the different
>>>>>>>>>> boards
>>>>>>>>>> that
>>>>>>>>>> its in ie the boards inherit a common soc.dtsi but have separate
>>>>>>>>>> dts.
>>>>>>>>>> The boards for the same soc may use different pin groups for
>>>>>>>>>> accomplishing a function, since we have multiple i2c, spi uart
>>>>>>>>>> etc
>>>>>>>>>> peripheral instances on a soc. A different instance of each of
>>>>>>>>>> the
>>>>>>>>>> above
>>>>>>>>>> peripherals, can be used in different boards, utilizing different
>>>>>>>>>> or subset of same pin groups.
>>>>>>>>>> Thus I would need to have multiple C files for one soc, based
>>>>>>>>>> on the
>>>>>>>>>> boards that it goes into.
>>>>>>>>>
>>>>>>>>> The pinctrl driver should be exposing the raw capabilities of
>>>>>>>>> the HW.
>>>>>>>>> All the board-specific configuration should be expressed in DT.
>>>>>>>>> So, the
>>>>>>>>> driver shouldn't have to know anything about different boards at
>>>>>>>>> compile-time.
>>>>>>>>>
>>>>>>>> I agree, so I wanted to keep the pin grouping information in DT, we
>>>>>>>> already have a board based differentiation of dts files in DT,
>>>>>>>> for the
>>>>>>>> same soc.
>>>>>>>
>>>>>>> That's the opposite of what I was saying. Pin groups are a
>>>>>>> feature of
>>>>>>> the SoC design, not the board.
>>>>>>>
>>>>>> Sorry I guess I wasn't clear.
>>>>>> Right now I have a soc-pinctrl.dtsi containing pin groupings.
>>>>>> This will be "inherited" by soc-boardtype.dts.
>>>>>> The pinctrl client device nodes in soc-boardtype.dts will point to
>>>>>> pin
>>>>>> groupings in soc-pinctrl.dtsi that are valid for that particular
>>>>>> boardtype.
>>>>>> Is this a valid design?
>>>>>
>>>>> OK, so you have two types of child node inside the pinctrl DT node;
>>>>> some
>>>>> define the pin groups the SoC has (in soc.dtsi) and some define
>>>>> pinctrl
>>>>> states that reference the pin group nodes and are referenced by the
>>>>> client nodes.
>>>>>
>>>>> That's probably fine. However, I'd still question putting the pin
>>>>> group
>>>>> nodes in DT at all; I'm not convinced it's better than just putting
>>>>> those into the driver itself. You end up with the same data tables
>>>>> after
>>>>> parsing the DT anyway.
>>>>>
>>>>
>>>> Any feedback for the rest of the patch?
>>>
>>> I'm certainly waiting for this aspect of the patch to be resolved; I
>>> think it will impact the rest of the patch so much that it's not worth
>>> reviewing until we decide on where to represent the pin groups (some DT
>>> parsing could would be removed if we put the pin group definitions into
>>> the driver, hence wouldn't need to be reviewed, and likewise there's be
>>> some new tables to review).
>>>
>>
>> I am trying to look at examples of what you are suggesting.
>> I was looking at the exynos implementation, and just from a brief glance
>> it seems like there too the pin grouping is being specified in the
>> device tree, using what looks like labels of the pins.
>> The labels are matched to group structures in soc specific files?
>>
>> By having the pin groupings in DT I am able to reuse the driver without
>> any SOC based code bloat.
>> As I mentioned earlier, we have entire families of SOCs using the same
>> TLMM hardware.
>> Its not a guarantee that for a given TLMM version,
>> the pin groupings on that hardware are the same for every SOC that its
>> in. Its infact most likely that I wont be able to use the pin groupings
>> from one SOC to the next even if they both use the same TLMM.
>> It will very quickly lead to a bloat of
>> pinctrl-<msm_soc>.c (containing the pin groupings replicated for each
>> soc)
>> which use TLMM version specific register programming implementation
>> pinctrl-tlmm-<version>.c
>> and the DT parsing and interface to framework (which remains unchanged).
>> pinctrl-msm.c.
>>
>> Thanks
>> Hanumant
>>
> 
> Any comments on this?

No. As I said, I personally want to see all the pingroups defined in the
pinctrl driver. But, if someone else acks/... the patches without it, I
probably won't nack it.

  reply	other threads:[~2013-08-07 16:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24 21:41 [PATCH] pinctrl: msm: Add support for MSM TLMM pinmux Hanumant Singh
2013-07-29 16:37 ` Linus Walleij
2013-07-29 17:32   ` Stephen Warren
2013-07-30 21:10   ` hanumant
2013-07-30 21:22     ` Stephen Warren
2013-07-31  0:01       ` Hanumant Singh
2013-07-31  0:08         ` Stephen Warren
2013-07-31  0:13           ` Hanumant Singh
2013-07-31  3:59             ` Stephen Warren
2013-07-31 19:46               ` Hanumant Singh
2013-07-31 21:06                 ` Stephen Warren
2013-08-01  0:17                   ` Hanumant Singh
2013-08-06 23:45                     ` Hanumant Singh
2013-08-07 16:00                       ` Stephen Warren [this message]
2013-08-14 19:16                         ` Linus Walleij
2013-07-29 23:39 ` Bjorn Andersson
2013-08-07 18:07   ` Hanumant Singh
2013-08-14 19:29   ` Linus Walleij
2013-08-15 17:44     ` Hanumant Singh
2013-08-15 20:47       ` Linus Walleij
2013-08-15 21:28         ` Hanumant Singh
2013-08-28  8:32           ` Linus Walleij
2013-08-15 21:50       ` Josh Cartwright
2013-08-15 21:58         ` Hanumant Singh
2013-08-15 23:10           ` Josh Cartwright
2013-08-15 23:14             ` Hanumant Singh
  -- strict thread matches above, loose matches on Subject: below --
2013-06-21 21:52 Hanumant Singh
2013-06-24 12:18 ` Linus Walleij
2013-06-25 17:41   ` hanumant
2013-06-27  8:26     ` Linus Walleij
2013-06-27 15:17       ` hanumant

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=52026F0B.6020705@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=Bjorn.Andersson@sonymobile.com \
    --cc=Tim.Bird@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hanumant@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.com \
    /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