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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: wcd93xx: Drop enums for chipid values

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Minor cleanup while preparing for adding WCD9378 support: do not use
enum for values which are not an enumeration.

+20 -21
+2 -4
sound/soc/codecs/wcd937x.c
··· 24 24 #include "wcd-mbhc-v2.h" 25 25 #include "wcd937x.h" 26 26 27 - enum { 28 - CHIPID_WCD9370 = 0, 29 - CHIPID_WCD9375 = 5, 30 - }; 27 + #define CHIPID_WCD9370 0x0 28 + #define CHIPID_WCD9375 0x5 31 29 32 30 /* Z value defined in milliohm */ 33 31 #define WCD937X_ZDET_VAL_32 (32000)
+5 -7
sound/soc/codecs/wcd938x.c
··· 25 25 #include "wcd-mbhc-v2.h" 26 26 #include "wcd938x.h" 27 27 28 + #define CHIPID_WCD9380 0x0 29 + #define CHIPID_WCD9385 0x5 30 + 28 31 #define WCD938X_MAX_MICBIAS (4) 29 32 #define WCD938X_MBHC_MAX_BUTTONS (8) 30 33 #define TX_ADC_MAX (4) ··· 74 71 #define WCD938X_EAR_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \ 75 72 SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, snd_soc_get_volsw, \ 76 73 wcd938x_ear_pa_put_gain, tlv_array) 77 - 78 - enum { 79 - WCD9380 = 0, 80 - WCD9385 = 5, 81 - }; 82 74 83 75 enum { 84 76 /* INTR_CTRL_INT_MASK_0 */ ··· 3117 3119 disable_irq_nosync(wcd938x->aux_pdm_wd_int); 3118 3120 3119 3121 switch (variant) { 3120 - case WCD9380: 3122 + case CHIPID_WCD9380: 3121 3123 ret = snd_soc_add_component_controls(component, wcd9380_snd_controls, 3122 3124 ARRAY_SIZE(wcd9380_snd_controls)); 3123 3125 if (ret < 0) { ··· 3127 3129 goto err_free_aux_pdm_wd_int; 3128 3130 } 3129 3131 break; 3130 - case WCD9385: 3132 + case CHIPID_WCD9385: 3131 3133 ret = snd_soc_add_component_controls(component, wcd9385_snd_controls, 3132 3134 ARRAY_SIZE(wcd9385_snd_controls)); 3133 3135 if (ret < 0) {
+13 -10
sound/soc/codecs/wcd939x.c
··· 36 36 #define TX_ADC_MAX (4) 37 37 #define WCD_MBHC_HS_V_MAX 1600 38 38 39 + #define CHIPID_WCD9390 0x0 40 + #define CHIPID_WCD9395 0x5 41 + 42 + /* Version major: 1.x */ 43 + #define CHIPID_WCD939X_VER_MAJOR_1 0x0 44 + /* Version minor: x.1 */ 45 + #define CHIPID_WCD939X_VER_MINOR_1 0x3 46 + 39 47 enum { 40 48 WCD939X_VERSION_1_0 = 0, 41 49 WCD939X_VERSION_1_1, ··· 92 84 93 85 /* Z value compared in milliOhm */ 94 86 #define WCD939X_ANA_MBHC_ZDET_CONST (1018 * 1024) 95 - 96 - enum { 97 - WCD9390 = 0, 98 - WCD9395 = 5, 99 - }; 100 87 101 88 enum { 102 89 /* INTR_CTRL_INT_MASK_0 */ ··· 1486 1483 if (mode_val == wcd939x->hph_mode) 1487 1484 return 0; 1488 1485 1489 - if (wcd939x->variant == WCD9390) { 1486 + if (wcd939x->variant == CHIPID_WCD9390) { 1490 1487 switch (mode_val) { 1491 1488 case CLS_H_NORMAL: 1492 1489 case CLS_H_LP: ··· 3068 3065 disable_irq_nosync(wcd939x->ear_pdm_wd_int); 3069 3066 3070 3067 switch (wcd939x->variant) { 3071 - case WCD9390: 3068 + case CHIPID_WCD9390: 3072 3069 ret = snd_soc_add_component_controls(component, wcd9390_snd_controls, 3073 3070 ARRAY_SIZE(wcd9390_snd_controls)); 3074 3071 if (ret < 0) { ··· 3078 3075 goto err_free_ear_pdm_wd_int; 3079 3076 } 3080 3077 break; 3081 - case WCD9395: 3078 + case CHIPID_WCD9395: 3082 3079 ret = snd_soc_add_component_controls(component, wcd9395_snd_controls, 3083 3080 ARRAY_SIZE(wcd9395_snd_controls)); 3084 3081 if (ret < 0) { ··· 3454 3451 regmap_read(wcd939x->regmap, WCD939X_DIGITAL_CHIP_ID1, &id1); 3455 3452 regmap_read(wcd939x->regmap, WCD939X_EAR_STATUS_REG_1, &status1); 3456 3453 3457 - if (id1 == 0) 3458 - version = ((status1 & 0x3) ? WCD939X_VERSION_1_1 : WCD939X_VERSION_1_0); 3454 + if (id1 == CHIPID_WCD939X_VER_MAJOR_1) 3455 + version = ((status1 & CHIPID_WCD939X_VER_MINOR_1) ? WCD939X_VERSION_1_1 : WCD939X_VERSION_1_0); 3459 3456 else 3460 3457 version = WCD939X_VERSION_2_0; 3461 3458