public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anjelique Melendez <quic_amelende@quicinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	<corbet@lwn.net>, <sre@kernel.org>, <robh+dt@kernel.org>,
	<agross@kernel.org>, <bjorn.andersson@linaro.org>
Cc: <krzysztof.kozlowski+dt@linaro.org>, <vkoul@kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string
Date: Fri, 19 Aug 2022 13:26:53 -0700	[thread overview]
Message-ID: <f9853511-e64c-9daf-b4e3-e334035771a8@quicinc.com> (raw)
In-Reply-To: <57f8d9c4-6f49-ad3d-fc82-7a0f66d1775a@linaro.org>



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@quicinc.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


  reply	other threads:[~2022-08-19 20:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 19:13 [PATCH v4 0/2] add support for PON GEN3 device Anjelique Melendez
2022-07-25 19:13 ` [PATCH v4 1/2] dt-bindings: power: reset: qcom-pon: update "reg" property details Anjelique Melendez
2022-07-26 10:25   ` Krzysztof Kozlowski
2022-08-19 20:26     ` Anjelique Melendez
2022-09-07 20:27       ` Anjelique Melendez
2022-09-08 14:55       ` Krzysztof Kozlowski
2022-09-08 23:57         ` Anjelique Melendez
2022-07-25 19:13 ` [PATCH v4 2/2] power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string Anjelique Melendez
2022-07-26 10:27   ` Krzysztof Kozlowski
2022-08-19 20:26     ` Anjelique Melendez [this message]
2022-09-07 20:28       ` Anjelique Melendez
2022-09-08 14:56       ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9853511-e64c-9daf-b4e3-e334035771a8@quicinc.com \
    --to=quic_amelende@quicinc.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox