mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Javier Martinez Canillas <javier@dowhile0.org>,
	Enric Balletbo Serra <eballetbo@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	<linux-leds@vger.kernel.org>, <linux-input@vger.kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Pavel Machek <pavel@ucw.cz>, Mark Rutland <mark.rutland@arm.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH 4/4] mfd: tps65217: Instantiate sub-devices from device tree
Date: Thu, 8 Jun 2017 18:47:48 -0500	[thread overview]
Message-ID: <fba09819-7d7e-57bb-c147-46c39098cff8@ti.com> (raw)
In-Reply-To: <CABxcv=mN6=hbDSqrVkwSL8zccCntN7m_3DP6ZCbkOT6CLw+skQ@mail.gmail.com>



On 06/08/2017 05:30 PM, Javier Martinez Canillas wrote:
> On Thu, Jun 8, 2017 at 11:35 PM, Enric Balletbo Serra
> <eballetbo@gmail.com> wrote:
>> 2017-06-08 19:11 GMT+02:00 Grygorii Strashko <grygorii.strashko@ti.com>:
> 
> [snip]
> 
>>>>
>>>> &tps {
>>>>           charger {
>>>>                   interrupts = <0>, <1>;
>>>>                   interrupt-names = "USB", "AC";
>>>>                   status = "okay";
>>>>           };
>>>>
>>>>           pwrbutton {
>>>>                   interrupts = <2>;
>>>>                   status = "okay";
>>>>           };
>>>> };
>>>
>>> Sry, but this make no sense - those IRQ configuration is static,
>>> so it should be defined in arch/arm/boot/dts/tps65217.dtsi at least.
> 
> Agreed.
> 
>>
>> I was describing the state-of-art not what should be. If you mean that
>> what doesn't make sense have these interrupts portions in the DT and
>> the resources in the driver I'm completely agree. So we have two
>> options:
>>
>>   1) Get rid of the irq resources from tps65217 MFD driver and
>> configure all with the DT (these patches)
>>   2) Get rid of the DT portions as doesn't make sense have them in two places.
>>
>> If we select 2) at least we have the problem that currently all
>> sub-devices are instantiated and there is no way to disable a
>> sub-device (the problem I'm trying to solve) hence I proposed 1)
>>
> 
> There's also an option (3) AFAICT. To do (1) but instead of hardcoding
> in the DTS[i], to do it in the charger driver since it seems the
> sub-devices are only used for this particular MFD device, and so the
> IRQ numbers are always going to be the same (it's already hardcoded in
> the MFD driver anyways).
> 
> So you can just move TPS65217_IRQ_{AC,USB} to the driver. Not sure
> what's general opinion of having drivers calling irq_create_mapping()
> to get the virtual IRQ's though...
> 
> [snip]
> 
>>>
>>> I can't find links on corresponding discussions, but mfd_add_devices() is
>>> preferred for MDF devices. Below is one commit i've found. Also you can compare number of
>>> drivers using mfd_add_devices() and of_platform_populate().
> 
> I'm not sure if we should use that as an argument, it may well be
> that's just the drivers being half converted to DT (which is pretty
> common TBH).
> 
>>>
>>
>> I don't think this a valid argument, I can also provide you a commit
>> that does exactly the contrary, replaces mfd_add_devices for
>> of_platform_populate (commit bb03ffb96c72)
>>
>>>
> 
> [snip]
> 
>>
>>> ---
>>> commit 4531156db726d27e593d35800d43c74be4e393b9
>>> Author: Keerthy <j-keerthy@ti.com>
>>> Date:   Mon Sep 19 13:09:05 2016 +0530
>>>
>>>      mfd: tps65218: Use mfd_add_devices instead of of_platform_populate
>>>
>>>      mfd_add_devices enables parsing device tree nodes without compatibles
>>>      for regulators and gpio modules. Replace of_platform_populate with
>>>      mfd_add_devices. mfd_cell currently is populated with regulators,
>>>      gpio and powerbutton.
>>>
> 
> For tps65218 couldn't instead of using mfd_add_devices() for all the
> sub-devs, had used of_platform_populate() for the ones that have
> device nodes and mfd_add_devices() only for the "tps65218-regulator"?
> 
> The commit talks about nodes without compatibles but's actually about
> sub-devices without an associated device node. For me it makes sense
> to use of_platform_populate() when the MFD has device nodes for their
> sub-devices and mfd_add_devices() when DT knows nothing about the
> sub-devices.

FYI. Below is link discussion I'm referring to between Mark Brown and Andrew F. Davis 
https://lkml.org/lkml/2015/10/22/823
the same - https://groups.google.com/forum/#!topic/linux.kernel/wQsdSpPMroQ




-- 
regards,
-grygorii

  reply	other threads:[~2017-06-08 23:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 10:32 [PATCH 1/4] dt-bindings: tps65217: Update binding documentation Enric Balletbo i Serra
2017-06-07 10:32 ` [PATCH 2/4] ARM: dts: tps65217: Add backlight and pmic device Enric Balletbo i Serra
2017-06-07 10:32 ` [PATCH 3/4] regulator: tps65217: Fix module autoload for devices registered via OF Enric Balletbo i Serra
2017-06-07 10:32 ` [PATCH 4/4] mfd: tps65217: Instantiate sub-devices from device tree Enric Balletbo i Serra
2017-06-07 16:05   ` Grygorii Strashko
2017-06-08 13:16     ` Enric Balletbo Serra
2017-06-08 17:11       ` Grygorii Strashko
2017-06-08 21:35         ` Enric Balletbo Serra
2017-06-08 22:30           ` Javier Martinez Canillas
2017-06-08 23:47             ` Grygorii Strashko [this message]
2017-06-09  0:00               ` Javier Martinez Canillas
2017-06-09  9:55                 ` Enric Balletbo Serra
2017-06-09 14:03 ` [PATCH 1/4] dt-bindings: tps65217: Update binding documentation Rob Herring
2017-06-09 22:30   ` Enric Balletbo Serra
2017-06-13 14:43     ` Rob Herring

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=fba09819-7d7e-57bb-c147-46c39098cff8@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=broonie@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eballetbo@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=javier@dowhile0.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    --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

all inboxes | Powered by JetHome®