* [PATCH] gpio: palmas: add dt support
@ 2013-03-21 14:30 Laxman Dewangan
[not found] ` <1363876214-25933-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-27 13:00 ` Linus Walleij
0 siblings, 2 replies; 9+ messages in thread
From: Laxman Dewangan @ 2013-03-21 14:30 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ
Cc: rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
swarren-DDmLM1+adcrQT0dZR+AlfA, Laxman Dewangan
Add of_device_id table for Palma GPIO to be enable the
driver from DT file.
The driver can be registered from DT file as:
palmas: tps65913@58 {
:::::::::::
palmas_gpio: palmas_gpio {
compatible = "ti,palmas-gpio";
gpio-controller;
#gpio-cells = <2>;
};
};
Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/gpio/gpio-palmas.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e3a4e56..fddaa0d 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -134,7 +134,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
palmas_gpio->gpio_chip.get = palmas_gpio_get;
palmas_gpio->gpio_chip.dev = &pdev->dev;
#ifdef CONFIG_OF_GPIO
- palmas_gpio->gpio_chip.of_node = palmas->dev->of_node;
+ palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
#endif
palmas_pdata = dev_get_platdata(palmas->dev);
if (palmas_pdata && palmas_pdata->gpio_base)
@@ -159,9 +159,18 @@ static int palmas_gpio_remove(struct platform_device *pdev)
return gpiochip_remove(&palmas_gpio->gpio_chip);
}
+#ifdef CONFIG_OF
+static struct of_device_id of_palmas_gpio_match[] = {
+ { .compatible = "ti,palmas-gpio"},
+ { },
+};
+MODULE_DEVICE_TABLE(of, of_palmas_gpio_match);
+#endif
+
static struct platform_driver palmas_gpio_driver = {
.driver.name = "palmas-gpio",
.driver.owner = THIS_MODULE,
+ .driver.of_match_table = of_match_ptr(of_palmas_gpio_match),
.probe = palmas_gpio_probe,
.remove = palmas_gpio_remove,
};
--
1.7.1.1
^ permalink raw reply related [flat|nested] 9+ messages in thread[parent not found: <1363876214-25933-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] gpio: palmas: add dt support
[not found] ` <1363876214-25933-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2013-03-21 17:29 ` Stephen Warren
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Warren @ 2013-03-21 17:29 UTC (permalink / raw)
To: Laxman Dewangan
Cc: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
swarren-DDmLM1+adcrQT0dZR+AlfA, Graeme Gregory, Ian Lartey,
J, KEERTHY, Kristo, Tero
On 03/21/2013 08:30 AM, Laxman Dewangan wrote:
> Add of_device_id table for Palma GPIO to be enable the
> driver from DT file.
On this, the RTC patches, and the regulator patches, I think you should
be Ccing the Slimlogic guys (CC'd now) and perhaps some people from TI
(CC'd now; I hope the right people) , to make sure so that you're all on
the same page w.r.t. how the DT bindings work, and so you don't step on
each-others toes.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gpio: palmas: add dt support
2013-03-21 14:30 [PATCH] gpio: palmas: add dt support Laxman Dewangan
[not found] ` <1363876214-25933-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2013-03-27 13:00 ` Linus Walleij
2013-03-27 15:57 ` Stephen Warren
[not found] ` <CACRpkdY_9pEkNfp7L82nGjsjFOi-VXwPHo7_3XwjCz8XcN8osg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 2 replies; 9+ messages in thread
From: Linus Walleij @ 2013-03-27 13:00 UTC (permalink / raw)
To: Laxman Dewangan
Cc: grant.likely, rob.herring, linux-kernel, linux-tegra, swarren
On Thu, Mar 21, 2013 at 3:30 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> #ifdef CONFIG_OF_GPIO
> - palmas_gpio->gpio_chip.of_node = palmas->dev->of_node;
> + palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
> #endif
OK I think that #ifdef is necessary...
> +#ifdef CONFIG_OF
> +static struct of_device_id of_palmas_gpio_match[] = {
> + { .compatible = "ti,palmas-gpio"},
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, of_palmas_gpio_match);
> +#endif
But please drop the #ifdef here unless it causes compile errors
(I don't think it will.)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] gpio: palmas: add dt support
2013-03-27 13:00 ` Linus Walleij
@ 2013-03-27 15:57 ` Stephen Warren
[not found] ` <51531706.4040608-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
[not found] ` <CACRpkdY_9pEkNfp7L82nGjsjFOi-VXwPHo7_3XwjCz8XcN8osg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 1 reply; 9+ messages in thread
From: Stephen Warren @ 2013-03-27 15:57 UTC (permalink / raw)
To: Linus Walleij
Cc: Laxman Dewangan, grant.likely, rob.herring, linux-kernel,
linux-tegra, swarren
On 03/27/2013 07:00 AM, Linus Walleij wrote:
> On Thu, Mar 21, 2013 at 3:30 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>
>> #ifdef CONFIG_OF_GPIO
>> - palmas_gpio->gpio_chip.of_node = palmas->dev->of_node;
>> + palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
>> #endif
>
> OK I think that #ifdef is necessary...
Laxman,
Don't we need to resolve and agree on the final DT bindings before we
can start making changes like this? It's not clear yet whether everyone
is on the same page re: how the MFD sub-devices are modelled in DT -
whether each sub-component really is a standalone device, or whether the
MFD itself instantiates all its children based on internal static tables
rather than DT.
Presumably, the answer to that question directly determines whether the
code change above is correct; the correct of_node might be either the
main Palmas node (if DT doesn't represent the MFD components) or it
might be the regulator sub-node (if DT is used to represent MFD components).
Given that, I'm not sure why the Slimlogic people aren't CC'd on this
patch:-(
^ permalink raw reply [flat|nested] 9+ messages in thread[parent not found: <CACRpkdY_9pEkNfp7L82nGjsjFOi-VXwPHo7_3XwjCz8XcN8osg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] gpio: palmas: add dt support
[not found] ` <CACRpkdY_9pEkNfp7L82nGjsjFOi-VXwPHo7_3XwjCz8XcN8osg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-03-28 5:59 ` Laxman Dewangan
[not found] ` <5153DC24.7040309-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Laxman Dewangan @ 2013-03-28 5:59 UTC (permalink / raw)
To: Linus Walleij
Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren
On Wednesday 27 March 2013 06:30 PM, Linus Walleij wrote:
> On Thu, Mar 21, 2013 at 3:30 PM, Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>
>> +#ifdef CONFIG_OF
>> +static struct of_device_id of_palmas_gpio_match[] = {
>> + { .compatible = "ti,palmas-gpio"},
>> + { },
>> +};
>> +MODULE_DEVICE_TABLE(of, of_palmas_gpio_match);
>> +#endif
> But please drop the #ifdef here unless it causes compile errors
> (I don't think it will.)
>
I am using this table as
driver.of_match_table = of_match_ptr(of_palmas_gpio_match),
of_match_ptr is macro which is NULL in case of CONFIG_OF not defined.
So if I remove ifdefs then it may create build warning as unused variable.
Therefore, I think it is require here.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-04-02 15:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 14:30 [PATCH] gpio: palmas: add dt support Laxman Dewangan
[not found] ` <1363876214-25933-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-21 17:29 ` Stephen Warren
2013-03-27 13:00 ` Linus Walleij
2013-03-27 15:57 ` Stephen Warren
[not found] ` <51531706.4040608-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-28 6:05 ` Laxman Dewangan
[not found] ` <CACRpkdY_9pEkNfp7L82nGjsjFOi-VXwPHo7_3XwjCz8XcN8osg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-28 5:59 ` Laxman Dewangan
[not found] ` <5153DC24.7040309-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-28 14:55 ` Stephen Warren
[not found] ` <515459D8.4010001-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-02 9:01 ` Linus Walleij
[not found] ` <CACRpkdYTcEzVMK-7V_T1qxtz1Pbw_um8pzasM=pTJ+vFnZasAg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-02 15:30 ` Stephen Warren
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).