From 30a84ca859e19ec3fc601fe2009071fd6b0fc0bd Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Mon, 11 Apr 2022 18:44:21 +0800 Subject: [PATCH] sgm4154x:Bring up charger IC SGM41543D Rhode4G use SGM41543D as the 2nd charger IC. Bring up charger IC SGM41543D. Change-Id: Id1eb726b311d1f415942bb15508272a221bd686b Signed-off-by: Lei Chen Reviewed-on: https://gerrit.mot.com/2238618 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Wei Xu Reviewed-by: Haijian Ma Reviewed-by: Xiangpo Zhao Reviewed-by: Qiong Xie Tested-by: Jira Key Submit-Approved: Jira Key --- drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c | 9 +++++---- drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c index 0b843a89a073..116118699835 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c @@ -3076,13 +3076,12 @@ static int sgm4154x_probe(struct i2c_client *client, i2c_set_clientdata(client, sgm); ret = sgm4154x_hw_chipid_detect(sgm); - if ((ret & SGM4154x_PN_MASK) != #ifdef __SGM41513_CHIP_ID__ - SGM4154x_PN_41513_ID + if ((ret & SGM4154x_PN_MASK) != SGM4154x_PN_41513_ID)){ + #else - SGM4154x_PN_41542_ID + if (((ret & SGM4154x_PN_MASK) != SGM4154x_PN_41542_ID) && ((ret & SGM4154x_PN_MASK) != SGM4154x_PN_41543D_ID)){ #endif - ){ pr_info("[%s] device not found !!!\n", __func__); return ret; } @@ -3242,6 +3241,7 @@ static const struct i2c_device_id sgm4154x_i2c_ids[] = { { "sgm41516", 0 }, { "sgm41516D", 0 }, { "sgm41513", 0 }, + { "sgm41543D", 0}, {}, }; MODULE_DEVICE_TABLE(i2c, sgm4154x_i2c_ids); @@ -3252,6 +3252,7 @@ static const struct of_device_id sgm4154x_of_match[] = { { .compatible = "sgm,sgm41516" }, { .compatible = "sgm,sgm41516D" }, { .compatible = "sgm,sgm41513" }, + { .compatible = "sgm,sgm41543D"}, { }, }; MODULE_DEVICE_TABLE(of, sgm4154x_of_match); diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h index 960a4abbe18d..3da003eac4cd 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h @@ -88,6 +88,7 @@ #define SGM4154x_PN_41516_ID (BIT(6)| BIT(5)) #define SGM4154x_PN_41542_ID (BIT(6)| BIT(5)| BIT(3)) #define SGM4154x_PN_41516D_ID (BIT(6)| BIT(5)| BIT(3)) +#define SGM4154x_PN_41543D_ID (BIT(6)| BIT(3)) #define SGM4154x_PN_41513_ID 0 /* WDT TIMER SET */