spmi: pmic-arb: correct duplicate APID to PPID mapping logic
authorDavid Collins <collinsd@codeaurora.org>
Fri, 30 Sep 2022 00:50:16 +0000 (17:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:17:07 +0000 (13:17 +0200)
commitfc0ce27192c9becf609f8055f91c86c649108012
tree82ebaebbf5d77e5169bf2b8eeaca01105fbc6e4b
parent16ef9963ec13ed2e2e4ca26642cca9a8e4c2e9f2
spmi: pmic-arb: correct duplicate APID to PPID mapping logic

[ Upstream commit 1f1693118c2476cb1666ad357edcf3cf48bf9b16 ]

Correct the way that duplicate PPID mappings are handled for PMIC
arbiter v5.  The final APID mapped to a given PPID should be the
one which has write owner = APPS EE, if it exists, or if not
that, then the first APID mapped to the PPID, if it exists.

Fixes: 40f318f0ed67 ("spmi: pmic-arb: add support for HW version 5")
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Link: https://lore.kernel.org/r/1655004286-11493-7-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20220930005019.2663064-8-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spmi/spmi-pmic-arb.c