aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/sta350.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/sta350.c')
-rw-r--r--sound/soc/codecs/sta350.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/sound/soc/codecs/sta350.c b/sound/soc/codecs/sta350.c
index bda2ee18769e..669e3228241e 100644
--- a/sound/soc/codecs/sta350.c
+++ b/sound/soc/codecs/sta350.c
@@ -1213,27 +1213,15 @@ static int sta350_i2c_probe(struct i2c_client *i2c,
1213#endif 1213#endif
1214 1214
1215 /* GPIOs */ 1215 /* GPIOs */
1216 sta350->gpiod_nreset = devm_gpiod_get(dev, "reset"); 1216 sta350->gpiod_nreset = devm_gpiod_get_optional(dev, "reset",
1217 if (IS_ERR(sta350->gpiod_nreset)) { 1217 GPIOD_OUT_LOW);
1218 ret = PTR_ERR(sta350->gpiod_nreset); 1218 if (IS_ERR(sta350->gpiod_nreset))
1219 if (ret != -ENOENT && ret != -ENOSYS) 1219 return PTR_ERR(sta350->gpiod_nreset);
1220 return ret; 1220
1221 1221 sta350->gpiod_power_down = devm_gpiod_get(dev, "power-down",
1222 sta350->gpiod_nreset = NULL; 1222 GPIOD_OUT_LOW);
1223 } else { 1223 if (IS_ERR(sta350->gpiod_power_down))
1224 gpiod_direction_output(sta350->gpiod_nreset, 0); 1224 return PTR_ERR(sta350->gpiod_power_down);
1225 }
1226
1227 sta350->gpiod_power_down = devm_gpiod_get(dev, "power-down");
1228 if (IS_ERR(sta350->gpiod_power_down)) {
1229 ret = PTR_ERR(sta350->gpiod_power_down);
1230 if (ret != -ENOENT && ret != -ENOSYS)
1231 return ret;
1232
1233 sta350->gpiod_power_down = NULL;
1234 } else {
1235 gpiod_direction_output(sta350->gpiod_power_down, 0);
1236 }
1237 1225
1238 /* regulators */ 1226 /* regulators */
1239 for (i = 0; i < ARRAY_SIZE(sta350->supplies); i++) 1227 for (i = 0; i < ARRAY_SIZE(sta350->supplies); i++)