Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: adau1977: remove platform data and move micbias bindings include

The change removes the platform_data include/definition. It only contains
some values for the MICBIAS.
These are moved into 'dt-bindings/sound/adi,adau1977.h' so that they can be
used inside device-trees. When moving then, they need to be converted to
pre-compiler defines, so that the DT compiler can understand them.

The driver then, also needs to include the new
'dt-bindings/sound/adi,adau1977.h' file.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201019105313.24862-1-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Alexandru Ardelean and committed by
Mark Brown
ab589bac 76b5f68b

+18 -50
+15
include/dt-bindings/sound/adi,adau1977.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef __DT_BINDINGS_ADI_ADAU1977_H__ 3 + #define __DT_BINDINGS_ADI_ADAU1977_H__ 4 + 5 + #define ADAU1977_MICBIAS_5V0 0x0 6 + #define ADAU1977_MICBIAS_5V5 0x1 7 + #define ADAU1977_MICBIAS_6V0 0x2 8 + #define ADAU1977_MICBIAS_6V5 0x3 9 + #define ADAU1977_MICBIAS_7V0 0x4 10 + #define ADAU1977_MICBIAS_7V5 0x5 11 + #define ADAU1977_MICBIAS_8V0 0x6 12 + #define ADAU1977_MICBIAS_8V5 0x7 13 + #define ADAU1977_MICBIAS_9V0 0x8 14 + 15 + #endif /* __DT_BINDINGS_ADI_ADAU1977_H__ */
-44
include/linux/platform_data/adau1977.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * ADAU1977/ADAU1978/ADAU1979 driver 4 - * 5 - * Copyright 2014 Analog Devices Inc. 6 - * Author: Lars-Peter Clausen <lars@metafoo.de> 7 - */ 8 - 9 - #ifndef __LINUX_PLATFORM_DATA_ADAU1977_H__ 10 - #define __LINUX_PLATFORM_DATA_ADAU1977_H__ 11 - 12 - /** 13 - * enum adau1977_micbias - ADAU1977 MICBIAS pin voltage setting 14 - * @ADAU1977_MICBIAS_5V0: MICBIAS is set to 5.0 V 15 - * @ADAU1977_MICBIAS_5V5: MICBIAS is set to 5.5 V 16 - * @ADAU1977_MICBIAS_6V0: MICBIAS is set to 6.0 V 17 - * @ADAU1977_MICBIAS_6V5: MICBIAS is set to 6.5 V 18 - * @ADAU1977_MICBIAS_7V0: MICBIAS is set to 7.0 V 19 - * @ADAU1977_MICBIAS_7V5: MICBIAS is set to 7.5 V 20 - * @ADAU1977_MICBIAS_8V0: MICBIAS is set to 8.0 V 21 - * @ADAU1977_MICBIAS_8V5: MICBIAS is set to 8.5 V 22 - * @ADAU1977_MICBIAS_9V0: MICBIAS is set to 9.0 V 23 - */ 24 - enum adau1977_micbias { 25 - ADAU1977_MICBIAS_5V0 = 0x0, 26 - ADAU1977_MICBIAS_5V5 = 0x1, 27 - ADAU1977_MICBIAS_6V0 = 0x2, 28 - ADAU1977_MICBIAS_6V5 = 0x3, 29 - ADAU1977_MICBIAS_7V0 = 0x4, 30 - ADAU1977_MICBIAS_7V5 = 0x5, 31 - ADAU1977_MICBIAS_8V0 = 0x6, 32 - ADAU1977_MICBIAS_8V5 = 0x7, 33 - ADAU1977_MICBIAS_9V0 = 0x8, 34 - }; 35 - 36 - /** 37 - * struct adau1977_platform_data - Platform configuration data for the ADAU1977 38 - * @micbias: Specifies the voltage for the MICBIAS pin 39 - */ 40 - struct adau1977_platform_data { 41 - enum adau1977_micbias micbias; 42 - }; 43 - 44 - #endif
+3 -6
sound/soc/codecs/adau1977.c
··· 12 12 #include <linux/i2c.h> 13 13 #include <linux/init.h> 14 14 #include <linux/module.h> 15 - #include <linux/platform_data/adau1977.h> 16 15 #include <linux/regmap.h> 17 16 #include <linux/regulator/consumer.h> 18 17 #include <linux/slab.h> ··· 22 23 #include <sound/pcm_params.h> 23 24 #include <sound/soc.h> 24 25 #include <sound/tlv.h> 26 + 27 + #include <dt-bindings/sound/adi,adau1977.h> 25 28 26 29 #include "adau1977.h" 27 30 ··· 882 881 883 882 static int adau1977_setup_micbias(struct adau1977 *adau1977) 884 883 { 885 - struct adau1977_platform_data *pdata = adau1977->dev->platform_data; 886 884 unsigned int micbias; 887 885 888 - if (pdata) 889 - micbias = pdata->micbias; 890 - else if (device_property_read_u32(adau1977->dev, "adi,micbias", 891 - &micbias)) 886 + if (device_property_read_u32(adau1977->dev, "adi,micbias", &micbias)) 892 887 micbias = ADAU1977_MICBIAS_8V5; 893 888 894 889 if (micbias > ADAU1977_MICBIAS_9V0) {