From: Quentin Schulz <quentin.sch...@cherry.de>

The ID of the PMIC is stored in the 2 16b registers but the only part
that matters right now is the 3 MSB, which make the 3 digits (in hex) of
the part number.

Right now, only RK808 was properly displayed, with this all currently
supported PMICs should display the proper part number.

Tested on RK806 (RK3588 Jaguar), RK808 (RK3399 Puma) and RK809 (PX30
Ringneck).

Signed-off-by: Quentin Schulz <quentin.sch...@cherry.de>
---
 drivers/power/pmic/rk8xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index 12ff26a0855..fe85fb13543 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -277,10 +277,10 @@ static int rk8xx_probe(struct udevice *dev)
                return ret;
 
        priv->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK;
-       show_variant = priv->variant;
+       /* All currently supported PMICs store the variant in the 3 MSB */
+       show_variant = priv->variant >> 4;
        switch (priv->variant) {
        case RK808_ID:
-               show_variant = 0x808;   /* RK808 hardware ID is 0 */
                break;
        case RK805_ID:
        case RK816_ID:

-- 
2.45.1

Reply via email to