aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l32.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cs35l32.c')
-rw-r--r--sound/soc/codecs/cs35l32.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c
index f2b8aad21274..60598b230341 100644
--- a/sound/soc/codecs/cs35l32.c
+++ b/sound/soc/codecs/cs35l32.c
@@ -437,20 +437,13 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
437 } 437 }
438 438
439 /* Reset the Device */ 439 /* Reset the Device */
440 cs35l32->reset_gpio = devm_gpiod_get(&i2c_client->dev, 440 cs35l32->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
441 "reset-gpios"); 441 "reset", GPIOD_OUT_LOW);
442 if (IS_ERR(cs35l32->reset_gpio)) { 442 if (IS_ERR(cs35l32->reset_gpio))
443 ret = PTR_ERR(cs35l32->reset_gpio); 443 return PTR_ERR(cs35l32->reset_gpio);
444 if (ret != -ENOENT && ret != -ENOSYS) 444
445 return ret; 445 if (cs35l32->reset_gpio)
446
447 cs35l32->reset_gpio = NULL;
448 } else {
449 ret = gpiod_direction_output(cs35l32->reset_gpio, 0);
450 if (ret)
451 return ret;
452 gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); 446 gpiod_set_value_cansleep(cs35l32->reset_gpio, 1);
453 }
454 447
455 /* initialize codec */ 448 /* initialize codec */
456 ret = regmap_read(cs35l32->regmap, CS35L32_DEVID_AB, &reg); 449 ret = regmap_read(cs35l32->regmap, CS35L32_DEVID_AB, &reg);