On 2024-06-17 18:48, Quentin Schulz wrote:
From: Quentin Schulz <quentin.sch...@cherry.de>

Commit 2ce40542e0eb ("power: rk8xx: properly print all supported PMICs
name") fixed all PMICs name that were broken but broke the only one that was not broken already: RK808. This one is a special case because the ID
registers are marked as reserved and always return 0, so the variant
cannot be derived the same way it is done for other PMICs from Rockchip.

Fixes: 2ce40542e0eb ("power: rk8xx: properly print all supported PMICs name")
Signed-off-by: Quentin Schulz <quentin.sch...@cherry.de>

Looking good to me, but I'd still suggest [1] that reading the MSB/LSB ID registers (i.e. 0x17 and 0x18) is skipped on the RK808 altogether, because the RK808 datasheet lists those two registers as reserved and provides no
methods for determining the chip name.

Reviewed-by: Dragan Simic <dsi...@manjaro.org>

[1] https://lore.kernel.org/u-boot/7ef07d9b9b8a1b9064eb506c96ca8...@manjaro.org/

---
Tested on RK3399 Puma.
---
 drivers/power/pmic/rk8xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index 617bb511e4e..4d5a5ceafad 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -281,6 +281,8 @@ static int rk8xx_probe(struct udevice *dev)
        show_variant = bitfield_extract_by_mask(priv->variant, RK8XX_ID_MSK);
        switch (priv->variant) {
        case RK808_ID:
+               /* RK808 ID is 0x0000, so fix show_variant for that PMIC */
+               show_variant = 0x808;
                break;
        case RK805_ID:
        case RK816_ID:

---
base-commit: e242cd95130b64cf91692da41363ac59b25fc08d
change-id: 20240617-rk808-show-variant-2121df41caf7

Best regards,

Reply via email to