hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/adau1977.c
....@@ -1,10 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ADAU1977/ADAU1978/ADAU1979 driver
34 *
45 * Copyright 2014 Analog Devices Inc.
56 * Author: Lars-Peter Clausen <lars@metafoo.de>
6
- *
7
- * Licensed under the GPL-2.
87 */
98
109 #include <linux/delay.h>
....@@ -885,13 +884,15 @@
885884 struct adau1977_platform_data *pdata = adau1977->dev->platform_data;
886885 unsigned int micbias;
887886
888
- if (pdata) {
887
+ if (pdata)
889888 micbias = pdata->micbias;
890
- if (micbias > ADAU1977_MICBIAS_9V0)
891
- return -EINVAL;
892
-
893
- } else {
889
+ else if (device_property_read_u32(adau1977->dev, "adi,micbias",
890
+ &micbias))
894891 micbias = ADAU1977_MICBIAS_8V5;
892
+
893
+ if (micbias > ADAU1977_MICBIAS_9V0) {
894
+ dev_err(adau1977->dev, "Invalid value for 'adi,micbias'\n");
895
+ return -EINVAL;
895896 }
896897
897898 return regmap_update_bits(adau1977->regmap, ADAU1977_REG_MICBIAS,