thermal: tsens: Rename map field in order to add a second address map
The TSENS driver currently only uses a limited set of registers from the TM address space. So it was ok to map just that set of registers and call it "map". We'd now like to map a second set: SROT registers to introduce new functionality. Rename the "map" field to a more appropriate "tm_map". The 8960 doesn't have a clear split between TM and SROT registers. To avoid complicating the data structure, it will switchover to using tm_map for its maps. There is no functional change with this patch. Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:

committed by
Eduardo Valentin

parent
caac52bce6
commit
67b0f5e064
@@ -99,8 +99,7 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp)
|
||||
int last_temp = 0, ret;
|
||||
|
||||
status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * SN_ADDR_OFFSET;
|
||||
ret = regmap_read(tmdev->map, status_reg, &code);
|
||||
|
||||
ret = regmap_read(tmdev->tm_map, status_reg, &code);
|
||||
if (ret)
|
||||
return ret;
|
||||
last_temp = code & SN_ST_TEMP_MASK;
|
||||
@@ -118,7 +117,7 @@ static const struct regmap_config tsens_config = {
|
||||
|
||||
int __init init_common(struct tsens_device *tmdev)
|
||||
{
|
||||
void __iomem *base;
|
||||
void __iomem *tm_base;
|
||||
struct resource *res;
|
||||
struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node);
|
||||
|
||||
@@ -134,13 +133,13 @@ int __init init_common(struct tsens_device *tmdev)
|
||||
}
|
||||
|
||||
res = platform_get_resource(op, IORESOURCE_MEM, 0);
|
||||
base = devm_ioremap_resource(&op->dev, res);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
tm_base = devm_ioremap_resource(&op->dev, res);
|
||||
if (IS_ERR(tm_base))
|
||||
return PTR_ERR(tm_base);
|
||||
|
||||
tmdev->map = devm_regmap_init_mmio(tmdev->dev, base, &tsens_config);
|
||||
if (IS_ERR(tmdev->map))
|
||||
return PTR_ERR(tmdev->map);
|
||||
tmdev->tm_map = devm_regmap_init_mmio(tmdev->dev, tm_base, &tsens_config);
|
||||
if (IS_ERR(tmdev->tm_map))
|
||||
return PTR_ERR(tmdev->tm_map);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user