linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
To: Enric Balletbo i Serra
	<enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org
Subject: Re: [PATCH 3/4] mfd: tps65217: remove duplicated interrupt resources.
Date: Mon, 12 Jun 2017 17:41:22 -0500	[thread overview]
Message-ID: <bddc09a1-53d7-e7ed-5c04-a9ecf5310dde@ti.com> (raw)
In-Reply-To: <20170612212412.22719-3-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>



On 06/12/2017 04:24 PM, Enric Balletbo i Serra wrote:
> I don't think it makes sense to have the interrupt resources for charger
> and power button in two different places, the driver and the DT binding.
> That's confusing so remove the ones from the mfd driver in favour of
> having the interrupt resources only described in the DT. Having the
> resources in DT may help if there is or will be a similar pmic with
> different resource allocation.

Wouldn't this break DT compatibility? Old DTs do not contain IRQ resources
and so they work only because of IRQ definitions in code.

> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> ---
>   drivers/mfd/tps65217.c | 22 +---------------------
>   1 file changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index f769c7d..fd83bae 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -33,15 +33,6 @@
>   #include <linux/mfd/core.h>
>   #include <linux/mfd/tps65217.h>
>   
> -static struct resource charger_resources[] = {
> -	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_AC, "AC"),
> -	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_USB, "USB"),
> -};
> -
> -static struct resource pb_resources[] = {
> -	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"),
> -};
> -
>   static void tps65217_irq_lock(struct irq_data *data)
>   {
>   	struct tps65217 *tps = irq_data_get_irq_chip_data(data);
> @@ -97,14 +88,10 @@ static struct mfd_cell tps65217s[] = {
>   	},
>   	{
>   		.name = "tps65217-charger",
> -		.num_resources = ARRAY_SIZE(charger_resources),
> -		.resources = charger_resources,
>   		.of_compatible = "ti,tps65217-charger",
>   	},
>   	{
>   		.name = "tps65217-pwrbutton",
> -		.num_resources = ARRAY_SIZE(pb_resources),
> -		.resources = pb_resources,
>   		.of_compatible = "ti,tps65217-pwrbutton",
>   	},
>   };
> @@ -359,15 +346,8 @@ static int tps65217_probe(struct i2c_client *client,
>   		return ret;
>   	}
>   
> -	if (client->irq) {
> +	if (client->irq)
>   		tps65217_irq_init(tps, client->irq);
> -	} else {
> -		int i;
> -
> -		/* Don't tell children about IRQ resources which won't fire */
> -		for (i = 0; i < ARRAY_SIZE(tps65217s); i++)
> -			tps65217s[i].num_resources = 0;
> -	}
>   
>   	ret = devm_mfd_add_devices(tps->dev, -1, tps65217s,
>   				   ARRAY_SIZE(tps65217s), NULL, 0,
> 

-- 
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-06-12 22:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 21:24 [PATCH 1/4] ARM: dts: tps65217: Add charger interrupts to the common tps65217.dtsi file Enric Balletbo i Serra
2017-06-12 21:24 ` [PATCH 2/4] ARM: dts: tps65217: Add power button interrupt " Enric Balletbo i Serra
2017-06-13  7:35   ` Tony Lindgren
2017-06-13  9:08     ` Enric Balletbo Serra
     [not found]       ` <CAFqH_50syu5aHBQtJkh-Dpz8Yc_6w0X853DO46T3ZAAJ10F-Pw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-14  4:55         ` Tony Lindgren
     [not found]           ` <20170614045551.GB3730-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-08-10 16:24             ` Tony Lindgren
2017-06-12 21:24 ` [PATCH 3/4] mfd: tps65217: remove duplicated interrupt resources Enric Balletbo i Serra
     [not found]   ` <20170612212412.22719-3-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2017-06-12 22:41     ` Grygorii Strashko [this message]
     [not found]       ` <bddc09a1-53d7-e7ed-5c04-a9ecf5310dde-l0cyMroinI0@public.gmane.org>
2017-06-13  8:18         ` Enric Balletbo Serra
     [not found]           ` <CAFqH_51wYc-xXU9fAF=1KNJ4wC69oZToMXjVP==yCgrMVfwn+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-13 23:05             ` Grygorii Strashko
2017-06-12 21:24 ` [PATCH 4/4] power: supply: tps65217: able to disable the charger block Enric Balletbo i Serra

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=bddc09a1-53d7-e7ed-5c04-a9ecf5310dde@ti.com \
    --to=grygorii.strashko-l0cymroini0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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).