aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-12-18 01:29:30 -0500
committerOlof Johansson <olof@lixom.net>2011-12-19 20:54:20 -0500
commit68fb669554a7def658873afdb9460f9a6289d6d9 (patch)
tree497b6b43e8b6a3b49a2081a6aeb1351d862171ee /drivers
parent92891da11a3f913b50a685c3facff6a5891a45ba (diff)
i2c: tegra: Support DVC controller in device tree
One of the Tegra I2C blocks is inside the DVC (Digital Voltage Controller) block. This block is identical to the rest of the I2C blocks, except that it only supports master mode, it has registers moved around, and it needs some extra init to get it into I2C mode. The register moves are handled by i2c_readl and i2c_writel This patch adds a new compatible value for controllers of this "DVC" type; I figured that this approach was reasonable, as opposed to adding an is-dvc property under the existing compatible value, since the HW truly is different. v2: Call of_device_is_compatible() to determine is_dvc, instead of storing the flag in tegra_i2c_of_match[]'s .data field. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-tegra.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index e8560ed3d3c8..6381604696d3 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -636,7 +636,10 @@ static int __devinit tegra_i2c_probe(struct platform_device *pdev)
636 i2c_dev->bus_clk_rate = be32_to_cpup(prop); 636 i2c_dev->bus_clk_rate = be32_to_cpup(prop);
637 } 637 }
638 638
639 if (pdev->id == 3) 639 if (pdev->dev.of_node)
640 i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node,
641 "nvidia,tegra20-i2c-dvc");
642 else if (pdev->id == 3)
640 i2c_dev->is_dvc = 1; 643 i2c_dev->is_dvc = 1;
641 init_completion(&i2c_dev->msg_complete); 644 init_completion(&i2c_dev->msg_complete);
642 645
@@ -742,6 +745,7 @@ static int tegra_i2c_resume(struct platform_device *pdev)
742/* Match table for of_platform binding */ 745/* Match table for of_platform binding */
743static const struct of_device_id tegra_i2c_of_match[] __devinitconst = { 746static const struct of_device_id tegra_i2c_of_match[] __devinitconst = {
744 { .compatible = "nvidia,tegra20-i2c", }, 747 { .compatible = "nvidia,tegra20-i2c", },
748 { .compatible = "nvidia,tegra20-i2c-dvc", },
745 {}, 749 {},
746}; 750};
747MODULE_DEVICE_TABLE(of, tegra_i2c_of_match); 751MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);