summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2013-06-24 16:20:42 +0530
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:41:50 +0900
commit2898cce9f19e88447dc60666663b80afa79ad5eb (patch)
treee5b08227825705345321be3142e678b7bb95f977 /drivers/thermal
parented625f9c3342b2e7b66996d63b4494f3c8e6bad7 (diff)
downloadlinux-3.10-2898cce9f19e88447dc60666663b80afa79ad5eb.tar.gz
linux-3.10-2898cce9f19e88447dc60666663b80afa79ad5eb.tar.bz2
linux-3.10-2898cce9f19e88447dc60666663b80afa79ad5eb.zip
thermal: exynos: Add support to access common register for multistance
This patch adds support to parse one more common set of TMU register. First set of register belongs to each instance of TMU and second set belongs to common TMU registers. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 05b95c6bb95..31bf373734b 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -40,6 +40,7 @@
* @id: identifier of the one instance of the TMU controller.
* @pdata: pointer to the tmu platform/configuration data
* @base: base address of the single instance of the TMU controller.
+ * @base_common: base address of the common registers of the TMU controller.
* @irq: irq number of the TMU controller.
* @soc: id of the SOC type.
* @irq_work: pointer to the irq work structure.
@@ -53,6 +54,7 @@ struct exynos_tmu_data {
int id;
struct exynos_tmu_platform_data *pdata;
void __iomem *base;
+ void __iomem *base_common;
int irq;
enum soc_type soc;
struct work_struct irq_work;
@@ -478,6 +480,24 @@ static int exynos_map_dt_data(struct platform_device *pdev)
return -ENODEV;
}
data->pdata = pdata;
+ /*
+ * Check if the TMU shares some registers and then try to map the
+ * memory of common registers.
+ */
+ if (!TMU_SUPPORTS(pdata, SHARED_MEMORY))
+ return 0;
+
+ if (of_address_to_resource(pdev->dev.of_node, 1, &res)) {
+ dev_err(&pdev->dev, "failed to get Resource 1\n");
+ return -ENODEV;
+ }
+
+ data->base_common = devm_ioremap(&pdev->dev, res.start,
+ resource_size(&res));
+ if (!data->base) {
+ dev_err(&pdev->dev, "Failed to ioremap memory\n");
+ return -ENOMEM;
+ }
return 0;
}