<?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 Re: Implementing NXP Hardware in Device Tree in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1569859#M7192</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The solution was to target the correct i2c bus the Accelerometer was connected to. This ended up being i2c2, not i2c0. This solved my issue.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 15:50:59 GMT</pubDate>
    <dc:creator>DillonM</dc:creator>
    <dc:date>2022-12-14T15:50:59Z</dc:date>
    <item>
      <title>Implementing NXP Hardware in Device Tree</title>
      <link>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1569163#M7190</link>
      <description>&lt;P&gt;I currently attempting to implement the mma8452 driver for my mma8451Q accelerometer by adding it to the the Linux Device Tree.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I am taking the route of creating a device tree overlay file (dtbo) that contains the addition to the device tree describing the accelerometer. It loads properly at boot and correctly pulls in the designated mma8452 driver. The driver however returns the following error in my dmesg log on boot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[ 23.2352] mma8452: probe of 0-001c failed with error -121&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what this means or how to fix it? Perhaps an overlay is not the correct way to do this and instead I should create a dtsi file or modify the source dts file? I can access the accelerometer from the console using the i2c-tools package at the SA0 address 0x1C.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The driver supplied by NXP can be found here&amp;nbsp;&lt;A href="https://elixir.bootlin.com/linux/v4.19.94/source/drivers/iio/accel/mma8452.c" target="_blank" rel="noopener"&gt;mma8452.c Driver&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dtbo file can be seen below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*
 * MIRA custom cape device tree overlay
 * Supports MMA8451Q Accelerometer  
 */
/dts-v1/;
/plugin/;

#include &amp;lt;dt-bindings/interrupt-controller/irq.h&amp;gt;

/ {
        /*
         * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
         */
        fragment@0 {
                target-path="/";
                __overlay__ {

                        chosen {
                                overlays {
                                        MIRA_EXTENSIONS = __TIMESTAMP__;
                                };
                        };
                };
        };

        fragment@1 {
                target = &amp;lt;&amp;amp;i2c0&amp;gt;;

                __overlay__ {
                        status = "okay";
                        #address-cells = &amp;lt;1&amp;gt;;
                        #size-cells = &amp;lt;0&amp;gt;;
                        accel@1C {
                                compatible = "fsl,mma8451";
                                reg = &amp;lt;0x1C&amp;gt;;
                                interrupt-parent = &amp;lt;&amp;amp;gpio1&amp;gt;;
                                interrupts = &amp;lt;16 IRQ_TYPE_EDGE_RISING&amp;gt;;
                                interrupt-names = "INT1";
                        };
                };
        };
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The target = &amp;lt;&amp;amp;i2c0&amp;gt; was chosen simply because it was an i2c node in another dtsi file. No other reason. May be wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 22:31:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1569163#M7190</guid>
      <dc:creator>DillonM</dc:creator>
      <dc:date>2022-12-13T22:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing NXP Hardware in Device Tree</title>
      <link>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1569859#M7192</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The solution was to target the correct i2c bus the Accelerometer was connected to. This ended up being i2c2, not i2c0. This solved my issue.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 15:50:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1569859#M7192</guid>
      <dc:creator>DillonM</dc:creator>
      <dc:date>2022-12-14T15:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing NXP Hardware in Device Tree</title>
      <link>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1716521#M7568</link>
      <description>&lt;P&gt;Did you use the Yocto Project for your distribution? If so, could you explain how exactly did you manage to add your device tree to the linux-imx kernel source?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 13:08:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Implementing-NXP-Hardware-in-Device-Tree/m-p/1716521#M7568</guid>
      <dc:creator>rockerr</dc:creator>
      <dc:date>2023-09-04T13:08:01Z</dc:date>
    </item>
  </channel>
</rss>

