diff mbox series

power: mp5416: Fix LDO SVAL for MP5416 PMIC

Message ID 20230924223022.313107-1-sidharth.prabukumar@gmail.com
State Under Review
Delegated to: Jaehoon Chung
Headers show
Series power: mp5416: Fix LDO SVAL for MP5416 PMIC | expand

Commit Message

Sidharth Prabukumar Sept. 24, 2023, 10:30 p.m. UTC
The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes
it by using the correct formula.

Signed-off-by: Sidharth Prabukumar <sidharth.prabukumar@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
---
 include/power/mp5416.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jaehoon Chung Oct. 31, 2023, 5:04 a.m. UTC | #1
On 9/25/23 07:30, Sidharth Prabukumar wrote:
> The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes
> it by using the correct formula.
> 
> Signed-off-by: Sidharth Prabukumar <sidharth.prabukumar@gmail.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  include/power/mp5416.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/power/mp5416.h b/include/power/mp5416.h
> index dc096fed3f..4326baaa42 100644
> --- a/include/power/mp5416.h
> +++ b/include/power/mp5416.h
> @@ -32,7 +32,7 @@ enum {
>  #define MP5416_VSET_SW3_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
>  #define MP5416_VSET_SW4_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
>  #define MP5416_VSET_LDO_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
> -#define MP5416_VSET_LDO_SVAL(x) ((((x) & 0x7f) * 25000) + 800000)
> +#define MP5416_VSET_LDO_SVAL(x) (((x) - 800000) / 25000)
>  #define MP5416_VSET_SW1_SVAL(x) (((x) - 600000) / 12500)
>  #define MP5416_VSET_SW2_SVAL(x) (((x) - 800000) / 25000)
>  #define MP5416_VSET_SW3_SVAL(x) (((x) - 600000) / 12500)
diff mbox series

Patch

diff --git a/include/power/mp5416.h b/include/power/mp5416.h
index dc096fed3f..4326baaa42 100644
--- a/include/power/mp5416.h
+++ b/include/power/mp5416.h
@@ -32,7 +32,7 @@  enum {
 #define MP5416_VSET_SW3_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
 #define MP5416_VSET_SW4_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
 #define MP5416_VSET_LDO_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
-#define MP5416_VSET_LDO_SVAL(x) ((((x) & 0x7f) * 25000) + 800000)
+#define MP5416_VSET_LDO_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW1_SVAL(x) (((x) - 600000) / 12500)
 #define MP5416_VSET_SW2_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW3_SVAL(x) (((x) - 600000) / 12500)