<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Platform driver don't call probe function. iMX8DXL in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Custom-Platform-driver-don-t-call-probe-function-iMX8DXL/m-p/1431425#M188436</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with iMX8DXL, kernel 5.10.72 (BSP).&lt;/P&gt;&lt;P&gt;I wrote a custom platform driver and I can't get the function probe to be called.&lt;/P&gt;&lt;P&gt;I tried to compile within kernel and also as a module and load it using insmod.&lt;/P&gt;&lt;P&gt;In my dts file I added a new node in root node:&lt;/P&gt;&lt;P&gt;/{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;my_gpio {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;compatible = "juanma,my-gpio-ctrl";&lt;BR /&gt;&amp;nbsp; &amp;nbsp;};&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;Also I tried to add: status = "okay";&lt;/P&gt;&lt;P&gt;In my_gpio.c I tried to register it from init function with "platform_driver_register" and directly using "module_platform_driver". None of them works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static int my_gpio_probe(struct platform_device *pdev)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s called!\n",__func__);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;static const struct of_device_id my_gpio_of_ids[] = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ .compatible = "juanma,my-gpio-ctrl", 0, },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{}&lt;BR /&gt;};&lt;BR /&gt;MODULE_DEVICE_TABLE(of, my_gpio_of_ids);&lt;/P&gt;&lt;P&gt;static struct platform_driver my_gpio_ctrl = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .probe = my_gpio_probe,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .remove = my_gpio_remove,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .driver = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .name = "my-gpio-ctrl",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .of_match_table = of_match_ptr(my_gpio_of_ids),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .owner = THIS_MODULE,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;module_platform_driver(my_gpio_ctrl);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use init function instead of 'module_platform_driver()'&lt;/P&gt;&lt;P&gt;static int __init my_gpio_init(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s: init\n", __func__);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; platform_driver_register(&amp;amp;my_gpio_ctrl);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s: driver registered.\n", __func__);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void __exit my_gpio_exit(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; platform_driver_unregister(&amp;amp;my_gpio_ctrl);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s exit\n", __func__);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;module_init(my_gpio_init);&lt;BR /&gt;module_exit(my_gpio_exit);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the print of my init function, but probe is not called either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 17:14:50 GMT</pubDate>
    <dc:creator>Juanma1</dc:creator>
    <dc:date>2022-03-21T17:14:50Z</dc:date>
    <item>
      <title>Custom Platform driver don't call probe function. iMX8DXL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-Platform-driver-don-t-call-probe-function-iMX8DXL/m-p/1431425#M188436</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with iMX8DXL, kernel 5.10.72 (BSP).&lt;/P&gt;&lt;P&gt;I wrote a custom platform driver and I can't get the function probe to be called.&lt;/P&gt;&lt;P&gt;I tried to compile within kernel and also as a module and load it using insmod.&lt;/P&gt;&lt;P&gt;In my dts file I added a new node in root node:&lt;/P&gt;&lt;P&gt;/{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;my_gpio {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;compatible = "juanma,my-gpio-ctrl";&lt;BR /&gt;&amp;nbsp; &amp;nbsp;};&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;Also I tried to add: status = "okay";&lt;/P&gt;&lt;P&gt;In my_gpio.c I tried to register it from init function with "platform_driver_register" and directly using "module_platform_driver". None of them works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static int my_gpio_probe(struct platform_device *pdev)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s called!\n",__func__);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;static const struct of_device_id my_gpio_of_ids[] = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ .compatible = "juanma,my-gpio-ctrl", 0, },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{}&lt;BR /&gt;};&lt;BR /&gt;MODULE_DEVICE_TABLE(of, my_gpio_of_ids);&lt;/P&gt;&lt;P&gt;static struct platform_driver my_gpio_ctrl = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .probe = my_gpio_probe,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .remove = my_gpio_remove,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .driver = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .name = "my-gpio-ctrl",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .of_match_table = of_match_ptr(my_gpio_of_ids),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .owner = THIS_MODULE,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;module_platform_driver(my_gpio_ctrl);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use init function instead of 'module_platform_driver()'&lt;/P&gt;&lt;P&gt;static int __init my_gpio_init(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s: init\n", __func__);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; platform_driver_register(&amp;amp;my_gpio_ctrl);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s: driver registered.\n", __func__);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void __exit my_gpio_exit(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; platform_driver_unregister(&amp;amp;my_gpio_ctrl);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; pr_info( "%s exit\n", __func__);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;module_init(my_gpio_init);&lt;BR /&gt;module_exit(my_gpio_exit);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the print of my init function, but probe is not called either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 17:14:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-Platform-driver-don-t-call-probe-function-iMX8DXL/m-p/1431425#M188436</guid>
      <dc:creator>Juanma1</dc:creator>
      <dc:date>2022-03-21T17:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Platform driver don't call probe function. iMX8DXL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-Platform-driver-don-t-call-probe-function-iMX8DXL/m-p/1438273#M188929</link>
      <description>&lt;P&gt;Solved!&lt;/P&gt;&lt;P&gt;A badly closed comment '/* .... */' hid the driver node in the root node.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 10:18:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-Platform-driver-don-t-call-probe-function-iMX8DXL/m-p/1438273#M188929</guid>
      <dc:creator>Juanma1</dc:creator>
      <dc:date>2022-04-04T10:18:53Z</dc:date>
    </item>
  </channel>
</rss>

