spmi: pmic-arb: Add register names in device tree

Improve readability and maintainability of the PMIC-arbiter
driver, by reading platform memory resources from device tree
by name rather then by index.

Change-Id: I10651e474210f0859d517d2b60fa04acdf77c9a4
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
This commit is contained in:
Gilad Avidov 2012-08-08 14:06:24 -06:00 committed by Stephen Boyd
parent 2781fdd451
commit 96c386e2c3
7 changed files with 11 additions and 4 deletions

View File

@ -3,6 +3,7 @@ Qualcomm SPMI Controller (PMIC Arbiter)
Required properties:
- cell-index : the bus identifier.
- compatible : should be "qcom,spmi-pmic-arb".
- reg-names : should be "core", "intr"
- reg : offset and length of the PMIC Arbiter Core register map.
- reg : offset and length of the PMIC Arbiter Interrupt controller register map.
- interrupts : the PMIC Arbiter interrupt.
@ -33,6 +34,7 @@ Example:
qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
interrupts = <0>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -66,6 +66,7 @@
spmi_bus: qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
/* 190,ee0_krait_hlos_spmi_periph_irq */

View File

@ -437,6 +437,7 @@
spmi_bus: qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
/* 190,ee0_krait_hlos_spmi_periph_irq */

View File

@ -248,6 +248,7 @@
spmi_bus: qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
/* 190,ee0_krait_hlos_spmi_periph_irq */

View File

@ -484,6 +484,7 @@
spmi_bus: qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
/* 190,ee0_krait_hlos_spmi_periph_irq */

View File

@ -232,6 +232,7 @@
spmi_bus: qcom,spmi@fc4c0000 {
cell-index = <0>;
compatible = "qcom,spmi-pmic-arb";
reg-names = "core", "intr";
reg = <0xfc4cf000 0x1000>,
<0Xfc4cb000 0x1000>;
/* 190,ee0_krait_hlos_spmi_periph_irq */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -581,7 +581,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
return -ENOMEM;
}
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mem_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
if (!mem_res) {
dev_err(&pdev->dev, "missing base memory resource\n");
return -ENODEV;
@ -594,7 +594,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
return -ENOMEM;
}
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
mem_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "intr");
if (!mem_res) {
dev_err(&pdev->dev, "missing mem resource (interrupts)\n");
return -ENODEV;