mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
mfd: max96745: Fix power on reset
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> Change-Id: I8b325e09dff1e0e9bf2a5262d60e803986e52845
This commit is contained in:
@@ -95,33 +95,28 @@ static void max96745_power_off(void *data)
|
||||
gpiod_direction_output(max96745->enable_gpio, 0);
|
||||
}
|
||||
|
||||
static int max96745_power_on(struct max96745 *max96745)
|
||||
static void max96745_power_on(struct max96745 *max96745)
|
||||
{
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(max96745->regmap, 0x0107, &val);
|
||||
if (!ret && FIELD_GET(VID_TX_ACTIVE_A | VID_TX_ACTIVE_B, val))
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if (max96745->enable_gpio)
|
||||
gpiod_direction_output(max96745->enable_gpio, 1);
|
||||
else
|
||||
regmap_update_bits(max96745->regmap, 0x0010, RESET_ALL,
|
||||
FIELD_PREP(RESET_ALL, 1));
|
||||
msleep(200);
|
||||
|
||||
msleep(100);
|
||||
|
||||
ret = regmap_update_bits(max96745->regmap, 0x0010, RESET_ALL,
|
||||
FIELD_PREP(RESET_ALL, 1));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
msleep(100);
|
||||
|
||||
regmap_update_bits(max96745->regmap, 0x0100, VID_TX_EN,
|
||||
FIELD_PREP(VID_TX_EN, 0));
|
||||
regmap_update_bits(max96745->regmap, 0x0076, DIS_REM_CC,
|
||||
FIELD_PREP(DIS_REM_CC, 1));
|
||||
regmap_update_bits(max96745->regmap, 0x0086, DIS_REM_CC,
|
||||
FIELD_PREP(DIS_REM_CC, 1));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int max96745_i2c_probe(struct i2c_client *client)
|
||||
@@ -168,9 +163,7 @@ static int max96745_i2c_probe(struct i2c_client *client)
|
||||
return dev_err_probe(dev, PTR_ERR(max96745->lock_gpio),
|
||||
"failed to get lock GPIO\n");
|
||||
|
||||
ret = max96745_power_on(max96745);
|
||||
if (ret)
|
||||
return ret;
|
||||
max96745_power_on(max96745);
|
||||
|
||||
ret = devm_add_action_or_reset(dev, max96745_power_off, max96745);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user