diff mbox

[3/4] pinctrl: single: omap: Add SoC specific module for wake-up events

Message ID 688FBEF7C8277944BE5AED9A41FB1EBC1AB12D0F@DNCE05.ent.ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Quadros June 10, 2013, 10:03 a.m. UTC
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Comments

Tony Lindgren June 10, 2013, 3:21 p.m. UTC | #1
* Quadros, Roger <rogerq@ti.com> [130610 03:09]:
> +
> +static int __init pcs_omap_init(void)
> +{
> +       platform_driver_register(&pcs_omap_soc_driver);
> +       platform_driver_register(&pcs_omap_driver);
> +
> +       return 0;
> +}
> +module_init(pcs_omap_init);
> 
> It seems this has to be moved to an earlier place (e.g. subsys_initcall)
> else the pinctrl core fails to find the pinctrl device at the device creation
> time and bails out with -EPROBE_DEFER. Also, that device is never
> created again, so -EPROBE_DEFER doesn't seem to work there.

Ah here, found your other comment :)

That's not needed, the real fix is to make twl-core.c and friends to
be regular module_init. There are already patches queued for that.
 
Regards,

Tony
Roger Quadros June 11, 2013, 12:51 p.m. UTC | #2
On 06/10/2013 06:21 PM, Tony Lindgren wrote:
> * Quadros, Roger <rogerq@ti.com> [130610 03:09]:
>> +
>> +static int __init pcs_omap_init(void)
>> +{
>> +       platform_driver_register(&pcs_omap_soc_driver);
>> +       platform_driver_register(&pcs_omap_driver);
>> +
>> +       return 0;
>> +}
>> +module_init(pcs_omap_init);
>>
>> It seems this has to be moved to an earlier place (e.g. subsys_initcall)
>> else the pinctrl core fails to find the pinctrl device at the device creation
>> time and bails out with -EPROBE_DEFER. Also, that device is never
>> created again, so -EPROBE_DEFER doesn't seem to work there.
> 
> Ah here, found your other comment :)
> 
> That's not needed, the real fix is to make twl-core.c and friends to
> be regular module_init. There are already patches queued for that.

OK. I was testing with USB host driver and it seems to be loaded as fs_initcall() which
is the root of the problem. I will fix up the usb host driver to be loaded as module_init()

cheers,
-roger
Tony Lindgren June 12, 2013, 1:33 p.m. UTC | #3
* Roger Quadros <rogerq@ti.com> [130611 05:57]:
> On 06/10/2013 06:21 PM, Tony Lindgren wrote:
> > * Quadros, Roger <rogerq@ti.com> [130610 03:09]:
> >> +
> >> +static int __init pcs_omap_init(void)
> >> +{
> >> +       platform_driver_register(&pcs_omap_soc_driver);
> >> +       platform_driver_register(&pcs_omap_driver);
> >> +
> >> +       return 0;
> >> +}
> >> +module_init(pcs_omap_init);
> >>
> >> It seems this has to be moved to an earlier place (e.g. subsys_initcall)
> >> else the pinctrl core fails to find the pinctrl device at the device creation
> >> time and bails out with -EPROBE_DEFER. Also, that device is never
> >> created again, so -EPROBE_DEFER doesn't seem to work there.
> > 
> > Ah here, found your other comment :)
> > 
> > That's not needed, the real fix is to make twl-core.c and friends to
> > be regular module_init. There are already patches queued for that.
> 
> OK. I was testing with USB host driver and it seems to be loaded as fs_initcall() which
> is the root of the problem. I will fix up the usb host driver to be loaded as module_init()

OK good to hear.

Regards,

Tony
diff mbox

Patch

diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index 9bdaeb8..abf7f01 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -30,7 +30,8 @@  obj-$(CONFIG_PINCTRL_NOMADIK) += pinctrl-nomadik.o
 obj-$(CONFIG_PINCTRL_STN8815)  += pinctrl-nomadik-stn8815.o
 obj-$(CONFIG_PINCTRL_DB8500)   += pinctrl-nomadik-db8500.o
 obj-$(CONFIG_PINCTRL_DB8540)   += pinctrl-nomadik-db8540.o
-obj-$(CONFIG_PINCTRL_SINGLE)   += pinctrl-single.o
+pcs-$(CONFIG_ARCH_OMAP2PLUS)   += pinctrl-single-omap.o
+obj-$(CONFIG_PINCTRL_SINGLE)   += pinctrl-single.o $(pcs-y)
 obj-$(CONFIG_PINCTRL_SIRF)     += pinctrl-sirf.o
 obj-$(CONFIG_PINCTRL_SUNXI)    += pinctrl-sunxi.o
 obj-$(CONFIG_PINCTRL_TEGRA)    += pinctrl-tegra.o
diff --git a/drivers/pinctrl/pinctrl-single-omap.c b/drivers/pinctrl/pinctrl-single-omap.c
new file mode 100644
index 0000000..680cf81
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-single-omap.c
@@ -0,0 +1,287 @@ 
+/*
+ * pinctrl-single-omap - omap specific wake-up irq handler
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
<snip>

+
+static int __init pcs_omap_init(void)
+{
+       platform_driver_register(&pcs_omap_soc_driver);
+       platform_driver_register(&pcs_omap_driver);
+
+       return 0;
+}
+module_init(pcs_omap_init);

It seems this has to be moved to an earlier place (e.g. subsys_initcall)
else the pinctrl core fails to find the pinctrl device at the device creation
time and bails out with -EPROBE_DEFER. Also, that device is never
created again, so -EPROBE_DEFER doesn't seem to work there.

The code i'm talking about is in dt_to_map_one_config()
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/pinctrl/devicetree.c#n109

+
+static void __exit pcs_omap_exit(void)
+{
+       platform_driver_unregister(&pcs_omap_driver);
+       platform_driver_unregister(&pcs_omap_soc_driver);
+}
+module_exit(pcs_omap_exit);
+
+MODULE_ALIAS("platform: pinctrl-single-omap");
+MODULE_AUTHOR("Texas Instruments Inc.");
+MODULE_DESCRIPTION("pinctrl-single-omap driver");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/platform_data/pinctrl-single-omap.h b/include/linux/platform_data/pinctrl-single-omap.h
new file mode 100644
index 0000000..bd92efc
--- /dev/null
+++ b/include/linux/platform_data/pinctrl-single-omap.h
@@ -0,0 +1,4 @@ 
+struct pcs_omap_pdata {
+       int irq;
+       void (*reconfigure_io_chain)(void);
+};



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel