Loading Documentation/devicetree/bindings/arm/msm/rpm-stats.txt +15 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,14 @@ The required properties for rpm-stats are: - compatible: "qcom,rpm-stats" - reg: The address on the RPM RAM from where stats are read. Second register(optional) specifies the offset of the rpm stats start address pointer. If the second register is available, the offset value read is added to the first register address to read the stats. - reg-names: Name given the register holding address. - qcom,sleep-stats-version: Version number. Example: Example 1: qcom,rpm-stats@fc19dbd0 { compatible = "qcom,rpm-stats"; Loading @@ -20,3 +24,13 @@ qcom,rpm-stats@fc19dbd0 { reg-names = "phys_addr_base"; qcom,sleep-stats-version = <2>; }; Example 2: qcom,rpm-stats@fc000000 { compatible = "qcom,rpm-stats"; reg = <0xfc000000 0x1000>, <0xfc190014 0x4>; reg-names = "phys_addr_base"; qcom,sleep-stats-version = <2>; }; drivers/soc/qcom/rpm_stats.c +18 −4 Original line number Diff line number Diff line Loading @@ -315,8 +315,10 @@ static int msm_rpmstats_probe(struct platform_device *pdev) struct dentry *dent = NULL; struct msm_rpmstats_platform_data *pdata; struct msm_rpmstats_platform_data *pd; struct resource *res = NULL; struct resource *res = NULL, *offset = NULL; struct device_node *node = NULL; uint32_t offset_addr = 0; void __iomem *phys_ptr = NULL; int ret = 0; if (!pdev) Loading @@ -328,11 +330,23 @@ static int msm_rpmstats_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -EINVAL; pdata->phys_addr_base = res->start; offset = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (offset) { /* Remap the rpm-stats pointer */ phys_ptr = ioremap_nocache(offset->start, SZ_4); if (!phys_ptr) { pr_err("%s: Failed to ioremap address: %x\n", __func__, offset_addr); return -ENODEV; } offset_addr = readl_relaxed(phys_ptr); iounmap(phys_ptr); } pdata->phys_addr_base = res->start + offset_addr; pdata->phys_size = resource_size(res); node = pdev->dev.of_node; Loading Loading
Documentation/devicetree/bindings/arm/msm/rpm-stats.txt +15 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,14 @@ The required properties for rpm-stats are: - compatible: "qcom,rpm-stats" - reg: The address on the RPM RAM from where stats are read. Second register(optional) specifies the offset of the rpm stats start address pointer. If the second register is available, the offset value read is added to the first register address to read the stats. - reg-names: Name given the register holding address. - qcom,sleep-stats-version: Version number. Example: Example 1: qcom,rpm-stats@fc19dbd0 { compatible = "qcom,rpm-stats"; Loading @@ -20,3 +24,13 @@ qcom,rpm-stats@fc19dbd0 { reg-names = "phys_addr_base"; qcom,sleep-stats-version = <2>; }; Example 2: qcom,rpm-stats@fc000000 { compatible = "qcom,rpm-stats"; reg = <0xfc000000 0x1000>, <0xfc190014 0x4>; reg-names = "phys_addr_base"; qcom,sleep-stats-version = <2>; };
drivers/soc/qcom/rpm_stats.c +18 −4 Original line number Diff line number Diff line Loading @@ -315,8 +315,10 @@ static int msm_rpmstats_probe(struct platform_device *pdev) struct dentry *dent = NULL; struct msm_rpmstats_platform_data *pdata; struct msm_rpmstats_platform_data *pd; struct resource *res = NULL; struct resource *res = NULL, *offset = NULL; struct device_node *node = NULL; uint32_t offset_addr = 0; void __iomem *phys_ptr = NULL; int ret = 0; if (!pdev) Loading @@ -328,11 +330,23 @@ static int msm_rpmstats_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -EINVAL; pdata->phys_addr_base = res->start; offset = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (offset) { /* Remap the rpm-stats pointer */ phys_ptr = ioremap_nocache(offset->start, SZ_4); if (!phys_ptr) { pr_err("%s: Failed to ioremap address: %x\n", __func__, offset_addr); return -ENODEV; } offset_addr = readl_relaxed(phys_ptr); iounmap(phys_ptr); } pdata->phys_addr_base = res->start + offset_addr; pdata->phys_size = resource_size(res); node = pdev->dev.of_node; Loading