All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Wolfram Sang <wsa@the-dreams.de>, Simon Horman <horms@verge.net.au>
Cc: linux-arm-kernel@lists.infradead.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH V3] ARM: shmobile: Rework the PMIC IRQ line quirk
Date: Tue, 5 Jun 2018 11:57:02 +0200	[thread overview]
Message-ID: <3b06b61c-4527-9f0a-d397-5076513e196a@gmail.com> (raw)
In-Reply-To: <20180605092151.57ezynjgf23yunkf@ninjato>

On 06/05/2018 11:21 AM, Wolfram Sang wrote:
> Hi Marek,
> 
> On Tue, Jun 05, 2018 at 10:07:28AM +0200, Simon Horman wrote:
>> On Mon, Jun 04, 2018 at 07:59:11PM +0200, Marek Vasut wrote:
>>> Rather than hard-coding the quirk topology, which stopped scaling,
>>> parse the information from DT. The code looks for all compatible
>>> PMICs -- da9036 and da9210 -- and checks if their IRQ line is tied
>>> to the same pin. If so, the code sends a matching sequence to the
>>> PMIC to deassert the IRQ.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>>> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>> Cc: Simon Horman <horms+renesas@verge.net.au>
>>> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> From an I2C point of view:
> 
> Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Minor nits:
> 
>>> @@ -122,7 +143,13 @@ static struct notifier_block regulator_quirk_nb = {
>>>  
>>>  static int __init rcar_gen2_regulator_quirk(void)
>>>  {
>>> -	u32 mon;
>>> +	struct device_node *np;
>>> +	const struct of_device_id *id;
>>> +	struct regulator_quirk *quirk;
>>> +	struct regulator_quirk *pos;
> 
> Merge the last two lines into one?
> 
>>> +	struct of_phandle_args *argsa, *argsb;
>>> +	u32 mon, addr;
>>> +	int ret;
>>>  
>>>  	if (!of_machine_is_compatible("renesas,koelsch") &&
>>>  	    !of_machine_is_compatible("renesas,lager") &&
>>> @@ -130,6 +157,45 @@ static int __init rcar_gen2_regulator_quirk(void)
>>>  	    !of_machine_is_compatible("renesas,gose"))
>>>  		return -ENODEV;
>>>  
>>> +	for_each_matching_node_and_match(np, rcar_gen2_quirk_match, &id) {
>>> +		if (!np || !of_device_is_available(np))
> 
> Can '!np' actually happen? This is the exit condition of the for-loop,
> or am I overlooking something?

I had to take a look again, no, it's not needed.

-- 
Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3] ARM: shmobile: Rework the PMIC IRQ line quirk
Date: Tue, 5 Jun 2018 11:57:02 +0200	[thread overview]
Message-ID: <3b06b61c-4527-9f0a-d397-5076513e196a@gmail.com> (raw)
In-Reply-To: <20180605092151.57ezynjgf23yunkf@ninjato>

On 06/05/2018 11:21 AM, Wolfram Sang wrote:
> Hi Marek,
> 
> On Tue, Jun 05, 2018 at 10:07:28AM +0200, Simon Horman wrote:
>> On Mon, Jun 04, 2018 at 07:59:11PM +0200, Marek Vasut wrote:
>>> Rather than hard-coding the quirk topology, which stopped scaling,
>>> parse the information from DT. The code looks for all compatible
>>> PMICs -- da9036 and da9210 -- and checks if their IRQ line is tied
>>> to the same pin. If so, the code sends a matching sequence to the
>>> PMIC to deassert the IRQ.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>>> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>> Cc: Simon Horman <horms+renesas@verge.net.au>
>>> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> From an I2C point of view:
> 
> Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Minor nits:
> 
>>> @@ -122,7 +143,13 @@ static struct notifier_block regulator_quirk_nb = {
>>>  
>>>  static int __init rcar_gen2_regulator_quirk(void)
>>>  {
>>> -	u32 mon;
>>> +	struct device_node *np;
>>> +	const struct of_device_id *id;
>>> +	struct regulator_quirk *quirk;
>>> +	struct regulator_quirk *pos;
> 
> Merge the last two lines into one?
> 
>>> +	struct of_phandle_args *argsa, *argsb;
>>> +	u32 mon, addr;
>>> +	int ret;
>>>  
>>>  	if (!of_machine_is_compatible("renesas,koelsch") &&
>>>  	    !of_machine_is_compatible("renesas,lager") &&
>>> @@ -130,6 +157,45 @@ static int __init rcar_gen2_regulator_quirk(void)
>>>  	    !of_machine_is_compatible("renesas,gose"))
>>>  		return -ENODEV;
>>>  
>>> +	for_each_matching_node_and_match(np, rcar_gen2_quirk_match, &id) {
>>> +		if (!np || !of_device_is_available(np))
> 
> Can '!np' actually happen? This is the exit condition of the for-loop,
> or am I overlooking something?

I had to take a look again, no, it's not needed.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-06-05 10:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 17:59 [PATCH V3] ARM: shmobile: Rework the PMIC IRQ line quirk Marek Vasut
2018-06-04 17:59 ` Marek Vasut
2018-06-05  8:07 ` Simon Horman
2018-06-05  8:07   ` Simon Horman
2018-06-05  9:21   ` Wolfram Sang
2018-06-05  9:21     ` Wolfram Sang
2018-06-05  9:57     ` Marek Vasut [this message]
2018-06-05  9:57       ` Marek Vasut
2018-06-05  9:46   ` Marek Vasut
2018-06-05  9:46     ` Marek Vasut
2018-06-11  9:56 ` Geert Uytterhoeven
2018-06-11  9:56   ` Geert Uytterhoeven
2018-06-11 12:08   ` Marek Vasut
2018-06-11 12:08     ` Marek Vasut
2018-06-11 13:03     ` Geert Uytterhoeven
2018-06-11 13:03       ` Geert Uytterhoeven
2018-06-11 13:35       ` Marek Vasut
2018-06-11 13:35         ` Marek Vasut
2018-06-11 13:49         ` Geert Uytterhoeven
2018-06-11 13:49           ` Geert Uytterhoeven
2018-06-11 14:04           ` Marek Vasut
2018-06-11 14:04             ` Marek Vasut
2018-06-11 14:10             ` Geert Uytterhoeven
2018-06-11 14:10               ` Geert Uytterhoeven
2018-06-11 14:19               ` Marek Vasut
2018-06-11 14:19                 ` Marek Vasut
2018-06-11 14:30                 ` Geert Uytterhoeven
2018-06-11 14:30                   ` Geert Uytterhoeven
2018-06-11 15:26                   ` Marek Vasut
2018-06-11 15:26                     ` Marek Vasut
2018-06-13 11:28                     ` Geert Uytterhoeven
2018-06-13 11:28                       ` Geert Uytterhoeven
2018-06-13 20:53                       ` Marek Vasut
2018-06-13 20:53                         ` Marek Vasut

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=3b06b61c-4527-9f0a-d397-5076513e196a@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.