title: How are am335x GPIOs numbered in device tree?
body: <p>I am trying to use a driver with a gpio interrupt on BeagleboneBlack. My device tree has the following entry for my custom device:</p>
  
  <pre><code>&amp;i2c1{...
  
  mydevice: mydevice@0c {
      compatible = "mydevice,mydeice";
      reg = &lt;0x0c&gt;;
      mag_irq_gpio = &lt;&amp;gpio1 13 0&gt;; /* INT line */ 
  };
  ...}
  </code></pre>
  
  <p>Its driver counterpart has this:</p>
  
  <pre><code>static int parse_dt(struct i2c_client *client)
  {
      struct device_node *node = client-&gt;dev.of_node;
      struct mydev_data *data = i2c_get_clientdata(client);
  
      return of_property_read_u32(node, "mag_irq_gpio", &amp;data-&gt;gpio);
  } 
  </code></pre>
  
  <p>The driver loads and works fine, except the gpio number is completely wrong. The property read function returns success, and reads 8 as the gpio number, even if I put a different number to the device tree.</p>
  
  <p>How am I supposed to pass a gpio number as generic data? The interrupt works if I manually override the gpio number inside my driver.</p>