[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9853511-e64c-9daf-b4e3-e334035771a8@quicinc.com>
Date: Fri, 19 Aug 2022 13:26:53 -0700
From: Anjelique Melendez <quic_amelende@...cinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
<corbet@....net>, <sre@...nel.org>, <robh+dt@...nel.org>,
<agross@...nel.org>, <bjorn.andersson@...aro.org>
CC: <krzysztof.kozlowski+dt@...aro.org>, <vkoul@...nel.org>,
<linux-doc@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/2] power: reset: qcom-pon: add support for
qcom,pmk8350-pon compatible string
On 7/26/2022 3:27 AM, Krzysztof Kozlowski wrote:
> On 25/07/2022 21:13, Anjelique Melendez wrote:
>> Add support for the new "qcom,pmk8350-pon" comptaible string.
>>
>> Signed-off-by: Anjelique Melendez <quic_amelende@...cinc.com>
>> ---
>> drivers/power/reset/qcom-pon.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
>> index 4a688741a88a..16bc01738be9 100644
>> --- a/drivers/power/reset/qcom-pon.c
>> +++ b/drivers/power/reset/qcom-pon.c
>> @@ -82,6 +82,7 @@ static const struct of_device_id pm8916_pon_id_table[] = {
>> { .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
>> { .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
>> { .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT },
>> + { .compatible = "qcom,pmk8350-pon", .data = (void *)GEN2_REASON_SHIFT },
>> { }
>> };
>> MODULE_DEVICE_TABLE(of, pm8916_pon_id_table);
>
> This is now confusing. The new device has entirely different first and
> second IO address spaces, but you do not code here any differences.
>
Based on previous responses to this patch series, it was decided that a new
"qcom,pmk8350-pon" compatible string is needed to differentiate between gen1/gen2
vs gen3 children pon devices. Currently the child handles obtaining the register
address(es) from its parent's regmap in drivers/input/misc/pm8941-pwrkey.c
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/input/misc/pm8941-pwrkey.c?h=v6.0-rc1#n287).
The patch that handled that change can be found at
https://lore.kernel.org/linux-arm-msm/20220422191239.6271-4-quic_amelende@quicinc.com/.
This driver, as the parent, does not actually need any changes besides adding the
new parent compatible string. Specifically this driver handles reboot mode support.
Everything needed to handle reboot mode is in the first register and reboot mode
is handled the same as a "qcom,pm8998-pon" parent. The split of the pon register
in pmk8350 does not affect reboot mode. This is why before we added a new compatible
string "qcom,pm8998-pon" still worked for gen3 children devices. Even though 2
registers could be defined in the device tree, as a 2nd register is optional for gen3
children devices,the fact that this driver uses of_property_read_u32() will ensure that
the base address used for reboot mode comes from the first register.
I do understand that this can be confusing but since "qcom,pmk8350-pon" still needs the
shift reason = 1 we could do
#define GEN1_REASON_SHIFT 2
#define GEN2_REASON_SHIFT 1
+ #define GEN3_REASON_SHIFT 1
{ .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
{ .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
{ .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT },
+ { .compatible = "qcom,pmk8350-pon", .data = (void *)GEN3_REASON_SHIFT },
{ }
It would still have the exact same functionality but it may visually make more sense.
Thanks,
Anjelique
Powered by blists - more mailing lists