regulator: modify wl2864c iovdd current limit

wl2864c default iovdd current limit is 220mA.
OV02b iovdd current can reach to 235mA.
This may cause cci issue as all camera shared iovdd, include cci pullup voltage.

Change-Id: If7828cd0b294cf2d362ec9001d39fceaceb9b734
Signed-off-by: liuwang2 <liuwang2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1859122
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
liuwang2 2021-01-22 17:11:51 +08:00 • committed by Wang Liu
commit 84b34a32f6

View file

@ -245,7 +245,7 @@ static int wl2864c_i2c_probe(struct i2c_client *client,
{
struct device *dev = &client->dev;
struct wl2864c *chip;
int error, cs_gpio, ret;
int error, cs_gpio, ret, chip_rev, current_limit;
chip = devm_kzalloc(dev, sizeof(struct wl2864c), GFP_KERNEL);
if (!chip) {
@ -288,13 +288,21 @@ static int wl2864c_i2c_probe(struct i2c_client *client,
return error;
}
{
int chip_rev = 0;
ret = regmap_bulk_read(chip->regmap, 0x00, &chip_rev, 1);
ret = regmap_bulk_read(chip->regmap, WL2864C_CHIP_REV, &chip_rev, 1);
dev_err(chip->dev, "wl2864c chip rev: %02x\n", chip_rev);
printk("wl2864c chip rev: %02x\n", chip_rev);
ret = regmap_bulk_read(chip->regmap, WL2864C_CURRENT_LIMITSEL, &current_limit, 1);
dev_err(chip->dev, "default current limit is 0x%x\n", current_limit);
current_limit |= 0x40;
ret = regmap_write(chip->regmap, WL2864C_CURRENT_LIMITSEL, current_limit);
if (ret < 0) {
dev_err(chip->dev,"Failed to write current limit register\n");
}
ret = regmap_bulk_read(chip->regmap, WL2864C_CURRENT_LIMITSEL, &current_limit, 1);
dev_err(chip->dev, "modify current limit to 0x%x\n", current_limit);
ret = wl2864c_regulator_init(chip);
if (ret < 0) {
dev_err(chip->dev, "Failed to init regulator(%d)\n", ret);