title: How do I pass platform data to my i2c driver from OF Device Tree?
body: <p>I am writing a driver for a chip that mainly communicates via i2c, but also uses a GPIO pin to signal. The relevant device tree node looks like this:</p>
  
  <pre><code>&amp;i2c1 {
  status = "okay";
  clock-frequency = &lt;100000&gt;;
  pinctrl-names = "default";
  pinctrl-0 = &lt;&amp;i2c1_pins&gt;;
  
  my_dev: my_dev@0c {
      compatible = "my_dev,my_dev";
      reg = &lt;0x0c&gt;;
      irq_gpio = &lt;&amp;gpio0 14 0&gt;; 
  };
  };
  </code></pre>
  
  <p>I want to be able to read the irq_gpio value from my driver, so I can request an irq(via gpio_to(irq()) and set things up. I found that I need to reach the of_node member of struct i2c_board_info. However, the probe function of the driver gets only i2c_client and i2c_device_id structs. How do I reach the desired of_node by starting from i2c_client or the device id?</p>