summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98390.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/max98390.c')
-rw-r--r--sound/soc/codecs/max98390.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
index 40fd6f363f35..2a6b1648c884 100644
--- a/sound/soc/codecs/max98390.c
+++ b/sound/soc/codecs/max98390.c
@@ -1014,14 +1014,14 @@ static void max98390_slot_config(struct i2c_client *i2c,
max98390->i_l_slot = 1;
}
-static int max98390_i2c_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+static int max98390_i2c_probe(struct i2c_client *i2c)
{
int ret = 0;
int reg = 0;
struct max98390_priv *max98390 = NULL;
struct i2c_adapter *adapter = i2c->adapter;
+ struct gpio_desc *reset_gpio;
ret = i2c_check_functionality(adapter,
I2C_FUNC_SMBUS_BYTE
@@ -1073,6 +1073,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c,
return ret;
}
+ reset_gpio = devm_gpiod_get_optional(&i2c->dev,
+ "reset", GPIOD_OUT_HIGH);
+
+ /* Power on device */
+ if (reset_gpio) {
+ usleep_range(1000, 2000);
+ /* bring out of reset */
+ gpiod_set_value_cansleep(reset_gpio, 0);
+ usleep_range(1000, 2000);
+ }
+
/* Check Revision ID */
ret = regmap_read(max98390->regmap,
MAX98390_R24FF_REV_ID, &reg);
@@ -1121,7 +1132,7 @@ static struct i2c_driver max98390_i2c_driver = {
.acpi_match_table = ACPI_PTR(max98390_acpi_match),
.pm = &max98390_pm,
},
- .probe = max98390_i2c_probe,
+ .probe_new = max98390_i2c_probe,
.id_table = max98390_i2c_id,
};