Subsystems (6)
Subject: [PATCH v3 0/4] Add support for the Qualcomm PM8018 PMIC
In order to support the Qualcomm MDM9615 in the Sierra Wireless WP8548 Modules, add the PM8018 PMIC support into MFD, Regulator, RTC and input.
This patchset is part of a global SoC + Module + Board support for the Sierra Wireless mangOH Board support with the WP8548 module.
Patch "mfd: qcom-rpm: Add support for pm8018 RPM Regulator" depends on :
- "fix offset error for msm8660" at http://lkml.kernel.org/r/1465897725-16213-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
- "parametrize also ack selector size" at http://lkml.kernel.org/r/1466576837-21995-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Changes since v2 at http://lkml.kernel.org/r/1466759887-25394-1-git-send-email-narmstrong-rdvid1DuHRBWk0Htik3J/[email protected] :
- Dropped pwrkey changes
Changes since v1 at http://lkml.kernel.org/r/1466158929-19524-1-git-send-email-narmstrong-rdvid1DuHRBWk0Htik3J/[email protected] :
- Rebase mfd/qcom_rpm.c on top of Linus "fix offset error for msm8660" and "parametrize also ack selector size" patches
- Rename QCOM_RPM_NCP in to QCOM_RPM_PM8018_NCP
- Rebased qcom-rpm.h PM8018 defines numbers without a gap
- Dropped regulator corner
Neil Armstrong (4):
mfd: pm8921: Add support for pm8018
rtc: rtc-pm8xxx: Add support for pm8018 rtc
mfd: qcom-rpm: Add support for pm8018 RPM Regulator
regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
.../devicetree/bindings/mfd/qcom-pm8xxx.txt | 1 + Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 15 ++++ drivers/mfd/pm8921-core.c | 1 + drivers/mfd/qcom_rpm.c | 51 +++++++++++ drivers/regulator/qcom_rpm-regulator.c | 100 +++++++++++++++++++++ drivers/rtc/rtc-pm8xxx.c | 11 +++ include/dt-bindings/mfd/qcom-rpm.h | 22 +++++ 7 files changed, 201 insertions(+)
Signature · 11 lines
1.9.1 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
PATCH v3 1/4 mfd: pm8921: Add support for pm8018
In order to support the Qualcomm MDM9615 PMIC, add support for the pm8018 in pm8921 mfd driver.
--- drivers/mfd/pm8921-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/pm8921-core.c +1 -0
@@ -309,6 +309,7 @@ static const struct regmap_config ssbi_regmap_config = { };static const struct of_device_id pm8921_id_table[] = { + { .compatible ="qcom,pm8018" , }, { .compatible ="qcom,pm8058" , }, { .compatible ="qcom,pm8921" , }, { }
Signature · 11 lines
1.9.1 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
PATCH v3 2/4 rtc: rtc-pm8xxx: Add support for pm8018 rtc
In reply to Neil ArmstrongIn order to support RTC on Qualcomm MDM9615 SoC, add support for the pm8018 rtc in rtc-pm8xxx driver.
--- Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt | 1 + drivers/rtc/rtc-pm8xxx.c | 11 +++++++++++ 2 files changed, 12 insertions(+)
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt +1 -0
@@ -62,6 +62,7 @@ The below bindings specify the set of valid subnodes. "qcom,pm8058-rtc" "qcom,pm8921-rtc" "qcom,pm8941-rtc" + "qcom,pm8018-rtc" - reg: Usage: required
drivers/rtc/rtc-pm8xxx.c +11 -0
@@ -393,6 +393,16 @@ static int pm8xxx_rtc_enable(struct pm8xxx_rtc *rtc_dd)return 0 ; } +static const struct pm8xxx_rtc_regs pm8018_regs = { + .ctrl =0x11d , + .write =0x11f , + .read =0x123 , + .alarm_rw =0x127 , + .alarm_ctrl =0x11d , + .alarm_ctrl2 =0x11e , + .alarm_en =BIT (1 ), +}; +static const struct pm8xxx_rtc_regs pm8921_regs = { .ctrl =0x11d , .write =0x11f ,
@@ -428,6 +438,7 @@ static const struct pm8xxx_rtc_regs pm8941_regs = {*/ static const struct of_device_id pm8xxx_id_table[] = { { .compatible ="qcom,pm8921-rtc" , .data = &pm8921_regs }, + { .compatible ="qcom,pm8018-rtc" , .data = &pm8018_regs }, { .compatible ="qcom,pm8058-rtc" , .data = &pm8058_regs }, { .compatible ="qcom,pm8941-rtc" , .data = &pm8941_regs }, { },
Signature · 11 lines
1.9.1 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [PATCH v3 2/4] rtc: rtc-pm8xxx: Add support for pm8018 rtc
Quoted 7 lines · Neil Armstrong
drivers/rtc/rtc-pm8xxx.c +0
-0@@ -393,6 +393,16 @@ static int pm8xxx_rtc_enable(struct pm8xxx_rtc *rtc_dd)return 0 ; }
drivers/rtc/rtc-pm8xxx.c static int pm8xxx_rtc_enable(struct pm8xxx_rtc *rtc_dd) · line 404
Quoted 10 lines
drivers/rtc/rtc-pm8xxx.c +9
-0+static const struct pm8xxx_rtc_regs pm8018_regs = { + .ctrl =0x11d , + .write =0x11f , + .read =0x123 , + .alarm_rw =0x127 , + .alarm_ctrl =0x11d , + .alarm_ctrl2 =0x11e , + .alarm_en =BIT (1 ), +};
This is the same as pm8921_regs, so why do we need to duplicate it? Can't we point the new compatible at the same data?
Signature · 12 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
PATCH v3 3/4 mfd: qcom-rpm: Add support for pm8018 RPM Regulator
In reply to Neil ArmstrongIn order to support the Qualcomm MDM9615 SoC, add support for the RPM regulator entries in the qcom-rpm driver.
--- Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 1 + drivers/mfd/qcom_rpm.c | 51 ++++++++++++++++++++++ include/dt-bindings/mfd/qcom-rpm.h | 22 ++++++++++ 3 files changed, 74 insertions(+)
Documentation/devicetree/bindings/mfd/qcom-rpm.txt +1 -0
@@ -13,6 +13,7 @@ frequencies. "qcom,rpm-msm8660" "qcom,rpm-msm8960" "qcom,rpm-ipq8064" + "qcom,rpm-mdm9615" - reg: Usage: required
drivers/mfd/qcom_rpm.c +51 -0
62 lines not on this page · raw message
include/dt-bindings/mfd/qcom-rpm.h +22 -0
@@ -147,6 +147,28 @@#define QCOM_RPM_SMB208_S1b 137#define QCOM_RPM_SMB208_S2a 138#define QCOM_RPM_SMB208_S2b 139 +#define QCOM_RPM_PM8018_SMPS1 140 +#define QCOM_RPM_PM8018_SMPS2 141 +#define QCOM_RPM_PM8018_SMPS3 142 +#define QCOM_RPM_PM8018_SMPS4 143 +#define QCOM_RPM_PM8018_SMPS5 144 +#define QCOM_RPM_PM8018_LDO1 145 +#define QCOM_RPM_PM8018_LDO2 146 +#define QCOM_RPM_PM8018_LDO3 147 +#define QCOM_RPM_PM8018_LDO4 148 +#define QCOM_RPM_PM8018_LDO5 149 +#define QCOM_RPM_PM8018_LDO6 150 +#define QCOM_RPM_PM8018_LDO7 151 +#define QCOM_RPM_PM8018_LDO8 152 +#define QCOM_RPM_PM8018_LDO9 153 +#define QCOM_RPM_PM8018_LDO10 154 +#define QCOM_RPM_PM8018_LDO11 155 +#define QCOM_RPM_PM8018_LDO12 156 +#define QCOM_RPM_PM8018_LDO13 157 +#define QCOM_RPM_PM8018_LDO14 158 +#define QCOM_RPM_PM8018_LVS1 159 +#define QCOM_RPM_PM8018_NCP 160 +#define QCOM_RPM_VOLTAGE_CORNER 161/* * Constants used to select force mode for regulators.
Signature · 11 lines
1.9.1 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
PATCH v3 4/4 regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
In reply to Neil ArmstrongIn order to support eh Qualcomm MDM9615 SoC, add support for the PM8018 RPM regulator in the qcom_rpm-regulator driver.
--- Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 14 +++ drivers/regulator/qcom_rpm-regulator.c | 100 +++++++++++++++++++++ 2 files changed, 114 insertions(+)
Documentation/devicetree/bindings/mfd/qcom-rpm.txt +14 -0
@@ -60,6 +60,7 @@ Regulator nodes are identified by their compatible: "qcom,rpm-pm8058-regulators" "qcom,rpm-pm8901-regulators" "qcom,rpm-pm8921-regulators" + "qcom,rpm-pm8018-regulators" - vdd_l0_l1_lvs-supply: - vdd_l2_l11_l12-supply:
@@ -138,6 +139,15 @@ Regulator nodes are identified by their compatible: Definition: reference to regulator supplying the input pin, as described in the data sheet +- vin_lvs1-supply: +- vdd_l7-supply: +- vdd_l8-supply: +- vdd_l9_l10_l11_l12-supply: + Usage: optional (pm8018 only) + Value type: <phandle> + Definition: reference to regulator supplying the input pin, as + described in the data sheet + The regulator node houses sub-nodes for each regulator within the device. Each sub-node is identified using the node's name, with valid values listed for each of the pmics below.
@@ -157,6 +167,10 @@ pm8921: l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch, ncp +pm8018: + s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, + l12, l14, lvs1 + The content of each sub-node is defined by the standard binding for regulators - see regulator.txt - with additional custom properties described below:
drivers/regulator/qcom_rpm-regulator.c +100 -0
124 lines not on this page · raw message
Signature · 11 lines
1.9.1 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [PATCH v3 4/4] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
Quoted 1 line · Neil Armstrong
In order to support eh Qualcomm MDM9615 SoC, add support for the
s/eh/the/
Quoted 37 lines
PM8018 RPM regulator in the qcom_rpm-regulator driver.
Acked-by Mark Brown <[email protected]>drivers/regulator/qcom_rpm-regulator.c +24
-0@@ -70,6 +70,40 @@ struct qcom_rpm_reg {bool supports_force_mode_bypass; }; +static struct rpm_reg_parts rpm8018_ldo_parts = { + .request_len =2 , + .uV = {0 ,0x007FFFFF ,0 }, + .pd = {0 ,0x00800000 ,23 }, + .pc = {0 ,0x0F000000 ,24 }, + .pf = {0 ,0xF0000000 ,28 }, + .ip = {1 ,0x000003FF ,0 }, + .ia = {1 ,0x000FFC00 ,10 }, + .fm = {1 ,0x00700000 ,20 }, +}; + +static struct rpm_reg_parts rpm8018_smps_parts = { + .request_len =2 , + .uV = {0 ,0x007FFFFF ,0 }, + .pd = {0 ,0x00800000 ,23 }, + .pc = {0 ,0x0F000000 ,24 }, + .pf = {0 ,0xF0000000 ,28 }, + .ip = {1 ,0x000003FF ,0 }, + .ia = {1 ,0x000FFC00 ,10 }, + .fm = {1 ,0x00700000 ,20 }, + .pm = {1 ,0x00800000 ,23 }, + .freq = {1 ,0x1F000000 ,24 }, + .freq_clk_src = {1 ,0x60000000 ,29 }, +};
drivers/regulator/qcom_rpm-regulator.c struct qcom_rpm_reg { · line 106
Quoted 10 lines
drivers/regulator/qcom_rpm-regulator.c +10
-0+ +static struct rpm_reg_parts rpm8018_switch_parts = { + .request_len =1 , + .enable_state = {0 ,0x00000001 ,0 }, + .pd = {0 ,0x00000002 ,1 }, + .pc = {0 ,0x0000003C ,2 }, + .pf = {0 ,0x000003C0 ,6 }, + .hpm = {0 ,0x00000C00 ,10 }, +}; +
These are all the same as the rpm8960 ones, so why don't we reuse those structures?
Quoted 34 lines
drivers/regulator/qcom_rpm-regulator.c +27
-0static const struct rpm_reg_parts rpm8660_ldo_parts = { .request_len =2 , .mV = {0 ,0x00000FFF ,0 },@@ -448,6 +482,44 @@ static struct regulator_ops switch_ops = { };/* +* PM8018 regulators +*/ +static const struct qcom_rpm_reg pm8018_pldo = { + .desc.linear_ranges = pldo_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (pldo_ranges), + .desc.n_voltages =161 , + .desc.ops = &uV_ops, + .parts = &rpm8018_ldo_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +}; + +static const struct qcom_rpm_reg pm8018_nldo = { + .desc.linear_ranges = nldo_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (nldo_ranges), + .desc.n_voltages =64 , + .desc.ops = &uV_ops, + .parts = &rpm8018_ldo_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +}; + +static const struct qcom_rpm_reg pm8018_smps = { + .desc.linear_ranges = smps_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (smps_ranges), + .desc.n_voltages =154 , + .desc.ops = &uV_ops,
drivers/regulator/qcom_rpm-regulator.c static struct regulator_ops switch_ops = { · line 521
Quoted 10 lines
drivers/regulator/qcom_rpm-regulator.c +10
-0+ .parts = &rpm8018_smps_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +}; + +static const struct qcom_rpm_reg pm8018_switch = { + .desc.ops = &switch_ops, + .parts = &rpm8018_switch_parts, +}; +
These are all the same as the pm8921 ones too? So just use those instead?
We should probably rethink this design and have these structures based on PMIC derivatives instead of SoCs because things are quite similar across many PMICs.
Signature · 12 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [PATCH v3 4/4] regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulator
Hi Stephen,
Quoted 47 lines · Stephen Boyd
Quoted 1 line · Neil Armstrong
In order to support eh Qualcomm MDM9615 SoC, add support for the
s/eh/the/
Quoted 42 lines
PM8018 RPM regulator in the qcom_rpm-regulator driver.
Acked-by Mark Brown <[email protected]>drivers/regulator/qcom_rpm-regulator.c +29
-0@@ -70,6 +70,40 @@ struct qcom_rpm_reg {bool supports_force_mode_bypass; }; +static struct rpm_reg_parts rpm8018_ldo_parts = { + .request_len =2 , + .uV = {0 ,0x007FFFFF ,0 }, + .pd = {0 ,0x00800000 ,23 }, + .pc = {0 ,0x0F000000 ,24 }, + .pf = {0 ,0xF0000000 ,28 }, + .ip = {1 ,0x000003FF ,0 }, + .ia = {1 ,0x000FFC00 ,10 }, + .fm = {1 ,0x00700000 ,20 }, +}; + +static struct rpm_reg_parts rpm8018_smps_parts = { + .request_len =2 , + .uV = {0 ,0x007FFFFF ,0 }, + .pd = {0 ,0x00800000 ,23 }, + .pc = {0 ,0x0F000000 ,24 }, + .pf = {0 ,0xF0000000 ,28 }, + .ip = {1 ,0x000003FF ,0 }, + .ia = {1 ,0x000FFC00 ,10 }, + .fm = {1 ,0x00700000 ,20 }, + .pm = {1 ,0x00800000 ,23 }, + .freq = {1 ,0x1F000000 ,24 }, + .freq_clk_src = {1 ,0x60000000 ,29 }, +}; + +static struct rpm_reg_parts rpm8018_switch_parts = { + .request_len =1 , + .enable_state = {0 ,0x00000001 ,0 }, + .pd = {0 ,0x00000002 ,1 },
Quoted 8 lines
drivers/regulator/qcom_rpm-regulator.c struct qcom_rpm_reg { · line 106
Quoted 5 lines
drivers/regulator/qcom_rpm-regulator.c +5
-0+ .pc = { 0, 0x0000003C, 2}, + .pf = { 0, 0x000003C0, 6}, + .hpm = { 0, 0x00000C00, 10}, +}; +These are all the same as the rpm8960 ones, so why don't we reuse those structures?
Indeed, I will reuse them.
Quoted 39 lines
Quoted 39 lines
drivers/regulator/qcom_rpm-regulator.c +31
-0static const struct rpm_reg_parts rpm8660_ldo_parts = { .request_len =2 , .mV = {0 ,0x00000FFF ,0 },@@ -448,6 +482,44 @@ static struct regulator_ops switch_ops = { };/* +* PM8018 regulators +*/ +static const struct qcom_rpm_reg pm8018_pldo = { + .desc.linear_ranges = pldo_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (pldo_ranges), + .desc.n_voltages =161 , + .desc.ops = &uV_ops, + .parts = &rpm8018_ldo_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +}; + +static const struct qcom_rpm_reg pm8018_nldo = { + .desc.linear_ranges = nldo_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (nldo_ranges), + .desc.n_voltages =64 , + .desc.ops = &uV_ops, + .parts = &rpm8018_ldo_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +}; + +static const struct qcom_rpm_reg pm8018_smps = { + .desc.linear_ranges = smps_ranges, + .desc.n_linear_ranges =ARRAY_SIZE (smps_ranges), + .desc.n_voltages =154 , + .desc.ops = &uV_ops, + .parts = &rpm8018_smps_parts, + .supports_force_mode_auto = false, + .supports_force_mode_bypass = false, +};
Quoted 8 lines
drivers/regulator/qcom_rpm-regulator.c static struct regulator_ops switch_ops = { · line 521
Quoted 6 lines
drivers/regulator/qcom_rpm-regulator.c +6
-0+ +static const struct qcom_rpm_reg pm8018_switch = { + .desc.ops = &switch_ops, + .parts = &rpm8018_switch_parts, +}; +These are all the same as the pm8921 ones too? So just use those instead?
They look but the supports_force_mode_bypass is set to "true" for pm8921. These pm8018 structures are still needed.
Quoted 5 lines
We should probably rethink this design and have these structures based on PMIC derivatives instead of SoCs because things are quite similar across many PMICs.
This would help to support the huge pmic family !
Neil
Signature · 8 lines
You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.