mfd: palmas: Initialise client->of_node for dummy created client
authorLaxman Dewangan <ldewangan@nvidia.com>
Tue, 19 Mar 2013 08:58:20 +0000 (14:28 +0530)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Apr 2013 16:13:20 +0000 (18:13 +0200)
Palmas device have three different i2c addresses. The device creates
the two new dummy i2c clients for accessing the register by using
primary client adapter. This new dummy i2c client have their of_node
as NULL.

The dummy i2c client is used for registering interrupt and on this,
it creates irq domain handle. This created irq domain handle has
their of_node as NULL.

Now when any child of this device is registered through the DT as
follows:
         palmas: tps65913@58 {
          ::::::::::::::::::

          #interrupt-cells = <2>;
                interrupt-controller;

                palmas_rtc {
                       compatible = "ti,palmas-rtc";
                       interrupt-parent = <&palmas>;
                       interrupts = <8 0>;
                };
                ::::::::::;;;
         };

And child driver (palam-rtc in this case) get their irq number as
irq = platform_get_irq(pdev, 0);

The returned irq number is error in this case. The reason is that
the created irq_domain handle for the palmas interrupt does not have
valid node and so matching of node fails with palmas node.

Hence initialising the newly dummy created client->of_node with the
primary clients of_node so that irq_domain handle have proper of_node
for matching.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/palmas.c

index c01b69a5a4ee104e5f4a9787d26d619f6c870905..53e9fe638d32067c0b6210e5fb9957ba67f4e890 100644 (file)
@@ -349,6 +349,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
                                ret = -ENOMEM;
                                goto err;
                        }
+                       palmas->i2c_clients[i]->dev.of_node = of_node_get(node);
                }
                palmas->regmap[i] = devm_regmap_init_i2c(palmas->i2c_clients[i],
                                &palmas_regmap_config[i]);