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

ASoC: tlv320aic3x: remove support for platform data

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dmitry Torokhov and committed by
Mark Brown
426c7bf4 faf3b5cb

+48 -72
-65
include/sound/tlv320aic3x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Platform data for Texas Instruments TLV320AIC3x codec 4 - * 5 - * Author: Jarkko Nikula <jarkko.nikula@bitmer.com> 6 - */ 7 - #ifndef __TLV320AIC3x_H__ 8 - #define __TLV320AIC3x_H__ 9 - 10 - /* GPIO API */ 11 - enum { 12 - AIC3X_GPIO1_FUNC_DISABLED = 0, 13 - AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1, 14 - AIC3X_GPIO1_FUNC_CLOCK_MUX = 2, 15 - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3, 16 - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4, 17 - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5, 18 - AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6, 19 - AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7, 20 - AIC3X_GPIO1_FUNC_INPUT = 8, 21 - AIC3X_GPIO1_FUNC_OUTPUT = 9, 22 - AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10, 23 - AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11, 24 - AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12, 25 - AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13, 26 - AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14, 27 - AIC3X_GPIO1_FUNC_ALL_IRQ = 16 28 - }; 29 - 30 - enum { 31 - AIC3X_GPIO2_FUNC_DISABLED = 0, 32 - AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2, 33 - AIC3X_GPIO2_FUNC_INPUT = 3, 34 - AIC3X_GPIO2_FUNC_OUTPUT = 4, 35 - AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5, 36 - AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8, 37 - AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9, 38 - AIC3X_GPIO2_FUNC_ALL_IRQ = 10, 39 - AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11, 40 - AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12, 41 - AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13, 42 - AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14, 43 - AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 44 - }; 45 - 46 - enum aic3x_micbias_voltage { 47 - AIC3X_MICBIAS_OFF = 0, 48 - AIC3X_MICBIAS_2_0V = 1, 49 - AIC3X_MICBIAS_2_5V = 2, 50 - AIC3X_MICBIAS_AVDDV = 3, 51 - }; 52 - 53 - struct aic3x_setup_data { 54 - unsigned int gpio_func[2]; 55 - }; 56 - 57 - struct aic3x_pdata { 58 - int gpio_reset; /* < 0 if not used */ 59 - struct aic3x_setup_data *setup; 60 - 61 - /* Selects the micbias voltage */ 62 - enum aic3x_micbias_voltage micbias_vg; 63 - }; 64 - 65 - #endif
+5 -7
sound/soc/codecs/tlv320aic3x.c
··· 45 45 #include <sound/soc.h> 46 46 #include <sound/initval.h> 47 47 #include <sound/tlv.h> 48 - #include <sound/tlv320aic3x.h> 49 48 50 49 #include "tlv320aic3x.h" 51 50 ··· 63 64 struct aic3x_disable_nb { 64 65 struct notifier_block nb; 65 66 struct aic3x_priv *aic3x; 67 + }; 68 + 69 + struct aic3x_setup_data { 70 + unsigned int gpio_func[2]; 66 71 }; 67 72 68 73 /* codec private data */ ··· 1751 1748 1752 1749 int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver_data) 1753 1750 { 1754 - struct aic3x_pdata *pdata = dev->platform_data; 1755 1751 struct aic3x_priv *aic3x; 1756 1752 struct aic3x_setup_data *ai3x_setup; 1757 1753 struct device_node *np = dev->of_node; ··· 1770 1768 regcache_cache_only(aic3x->regmap, true); 1771 1769 1772 1770 dev_set_drvdata(dev, aic3x); 1773 - if (pdata) { 1774 - aic3x->gpio_reset = pdata->gpio_reset; 1775 - aic3x->setup = pdata->setup; 1776 - aic3x->micbias_vg = pdata->micbias_vg; 1777 - } else if (np) { 1771 + if (np) { 1778 1772 ai3x_setup = devm_kzalloc(dev, sizeof(*ai3x_setup), GFP_KERNEL); 1779 1773 if (!ai3x_setup) 1780 1774 return -ENOMEM;
+43
sound/soc/codecs/tlv320aic3x.h
··· 298 298 #define AIC3X_BUTTON_DEBOUNCE_SHIFT 0 299 299 #define AIC3X_BUTTON_DEBOUNCE_MASK 3 300 300 301 + /* GPIO API */ 302 + enum { 303 + AIC3X_GPIO1_FUNC_DISABLED = 0, 304 + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1, 305 + AIC3X_GPIO1_FUNC_CLOCK_MUX = 2, 306 + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3, 307 + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4, 308 + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5, 309 + AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6, 310 + AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7, 311 + AIC3X_GPIO1_FUNC_INPUT = 8, 312 + AIC3X_GPIO1_FUNC_OUTPUT = 9, 313 + AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10, 314 + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11, 315 + AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12, 316 + AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13, 317 + AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14, 318 + AIC3X_GPIO1_FUNC_ALL_IRQ = 16 319 + }; 320 + 321 + enum { 322 + AIC3X_GPIO2_FUNC_DISABLED = 0, 323 + AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2, 324 + AIC3X_GPIO2_FUNC_INPUT = 3, 325 + AIC3X_GPIO2_FUNC_OUTPUT = 4, 326 + AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5, 327 + AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8, 328 + AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9, 329 + AIC3X_GPIO2_FUNC_ALL_IRQ = 10, 330 + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11, 331 + AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12, 332 + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13, 333 + AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14, 334 + AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 335 + }; 336 + 337 + enum aic3x_micbias_voltage { 338 + AIC3X_MICBIAS_OFF = 0, 339 + AIC3X_MICBIAS_2_0V = 1, 340 + AIC3X_MICBIAS_2_5V = 2, 341 + AIC3X_MICBIAS_AVDDV = 3, 342 + }; 343 + 301 344 #endif /* _AIC3X_H */