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 10:35:19 +0000 (12:35 +0200)
commitb0bc75fe6775ca65c3e225a450eaefd4fae6a3a7
treeccc3673231bfb8c13698d8f2b2c16445dd31dfc1
parentfaabbb103d604e52bb5b0591b4fe86e349856131
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