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: More const and unused member cleanups

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

Make static data const for code safety and drop some unused fields in
structs.

+31 -43
+1 -1
sound/soc/codecs/cs35l36.c
··· 129 129 {27000000, 0x3F, 0x0A}, 130 130 }; 131 131 132 - static struct reg_default cs35l36_reg[] = { 132 + static const struct reg_default cs35l36_reg[] = { 133 133 {CS35L36_TESTKEY_CTRL, 0x00000000}, 134 134 {CS35L36_USERKEY_CTL, 0x00000000}, 135 135 {CS35L36_OTP_CTRL1, 0x00002460},
+1 -1
sound/soc/codecs/da7218.c
··· 3033 3033 * Regmap configs 3034 3034 */ 3035 3035 3036 - static struct reg_default da7218_reg_defaults[] = { 3036 + static const struct reg_default da7218_reg_defaults[] = { 3037 3037 { DA7218_SYSTEM_ACTIVE, 0x00 }, 3038 3038 { DA7218_CIF_CTRL, 0x00 }, 3039 3039 { DA7218_SPARE1, 0x00 },
+2 -2
sound/soc/codecs/da7219.c
··· 2312 2312 * Regmap configs 2313 2313 */ 2314 2314 2315 - static struct reg_default da7219_reg_defaults[] = { 2315 + static const struct reg_default da7219_reg_defaults[] = { 2316 2316 { DA7219_MIC_1_SELECT, 0x00 }, 2317 2317 { DA7219_CIF_TIMEOUT_CTRL, 0x01 }, 2318 2318 { DA7219_SR_24_48, 0x00 }, ··· 2443 2443 .cache_type = REGCACHE_RBTREE, 2444 2444 }; 2445 2445 2446 - static struct reg_sequence da7219_rev_aa_patch[] = { 2446 + static const struct reg_sequence da7219_rev_aa_patch[] = { 2447 2447 { DA7219_REFERENCES, 0x08 }, 2448 2448 }; 2449 2449
+1 -1
sound/soc/codecs/es8375.c
··· 620 620 } 621 621 } 622 622 623 - static struct regmap_config es8375_regmap_config = { 623 + static const struct regmap_config es8375_regmap_config = { 624 624 .reg_bits = 8, 625 625 .val_bits = 8, 626 626 .max_register = ES8375_REG_MAX,
+1 -1
sound/soc/codecs/max98363.c
··· 14 14 15 15 #include "max98363.h" 16 16 17 - static struct reg_default max98363_reg[] = { 17 + static const struct reg_default max98363_reg[] = { 18 18 {MAX98363_R2021_ERR_MON_CTRL, 0x0}, 19 19 {MAX98363_R2022_SPK_MON_THRESH, 0x0}, 20 20 {MAX98363_R2023_SPK_MON_DURATION, 0x0},
+1 -1
sound/soc/codecs/max98373-i2c.c
··· 23 23 MAX98373_R20B6_BDE_CUR_STATE_READBACK, 24 24 }; 25 25 26 - static struct reg_default max98373_reg[] = { 26 + static const struct reg_default max98373_reg[] = { 27 27 {MAX98373_R2000_SW_RESET, 0x00}, 28 28 {MAX98373_R2001_INT_RAW1, 0x00}, 29 29 {MAX98373_R2002_INT_RAW2, 0x00},
+1 -1
sound/soc/codecs/max98373-sdw.c
··· 26 26 MAX98373_R20B6_BDE_CUR_STATE_READBACK, 27 27 }; 28 28 29 - static struct reg_default max98373_reg[] = { 29 + static const struct reg_default max98373_reg[] = { 30 30 {MAX98373_R0040_SCP_INIT_STAT_1, 0x00}, 31 31 {MAX98373_R0041_SCP_INIT_MASK_1, 0x00}, 32 32 {MAX98373_R0042_SCP_INIT_STAT_2, 0x00},
+1 -1
sound/soc/codecs/max98388.c
··· 18 18 #include <sound/tlv.h> 19 19 #include "max98388.h" 20 20 21 - static struct reg_default max98388_reg[] = { 21 + static const struct reg_default max98388_reg[] = { 22 22 {MAX98388_R2000_SW_RESET, 0x00}, 23 23 {MAX98388_R2001_INT_RAW1, 0x00}, 24 24 {MAX98388_R2002_INT_RAW2, 0x00},
+1 -1
sound/soc/codecs/max98390.c
··· 23 23 24 24 #include "max98390.h" 25 25 26 - static struct reg_default max98390_reg_defaults[] = { 26 + static const struct reg_default max98390_reg_defaults[] = { 27 27 {MAX98390_INT_EN1, 0xf0}, 28 28 {MAX98390_INT_EN2, 0x00}, 29 29 {MAX98390_INT_EN3, 0x00},
+2 -2
sound/soc/codecs/max98396.c
··· 16 16 "dvddio", 17 17 }; 18 18 19 - static struct reg_default max98396_reg[] = { 19 + static const struct reg_default max98396_reg[] = { 20 20 {MAX98396_R2000_SW_RESET, 0x00}, 21 21 {MAX98396_R2001_INT_RAW1, 0x00}, 22 22 {MAX98396_R2002_INT_RAW2, 0x00}, ··· 174 174 {MAX98396_R21FF_REVISION_ID, 0x00}, 175 175 }; 176 176 177 - static struct reg_default max98397_reg[] = { 177 + static const struct reg_default max98397_reg[] = { 178 178 {MAX98396_R2000_SW_RESET, 0x00}, 179 179 {MAX98396_R2001_INT_RAW1, 0x00}, 180 180 {MAX98396_R2002_INT_RAW2, 0x00},
+1 -1
sound/soc/codecs/max98504.c
··· 35 35 unsigned int brownout_release_rate; 36 36 }; 37 37 38 - static struct reg_default max98504_reg_defaults[] = { 38 + static const struct reg_default max98504_reg_defaults[] = { 39 39 { 0x01, 0}, 40 40 { 0x02, 0}, 41 41 { 0x03, 0},
+1 -1
sound/soc/codecs/max98520.c
··· 16 16 #include <sound/tlv.h> 17 17 #include "max98520.h" 18 18 19 - static struct reg_default max98520_reg[] = { 19 + static const struct reg_default max98520_reg[] = { 20 20 {MAX98520_R2000_SW_RESET, 0x00}, 21 21 {MAX98520_R2001_STATUS_1, 0x00}, 22 22 {MAX98520_R2002_STATUS_2, 0x00},
+1 -1
sound/soc/codecs/max98927.c
··· 19 19 #include <sound/tlv.h> 20 20 #include "max98927.h" 21 21 22 - static struct reg_default max98927_reg[] = { 22 + static const struct reg_default max98927_reg[] = { 23 23 {MAX98927_R0001_INT_RAW1, 0x00}, 24 24 {MAX98927_R0002_INT_RAW2, 0x00}, 25 25 {MAX98927_R0003_INT_RAW3, 0x00},
+1 -1
sound/soc/codecs/rt722-sdca-sdw.c
··· 147 147 } 148 148 } 149 149 150 - static struct regmap_sdw_mbq_cfg rt722_mbq_config = { 150 + static const struct regmap_sdw_mbq_cfg rt722_mbq_config = { 151 151 .mbq_size = rt722_sdca_mbq_size, 152 152 }; 153 153
-5
sound/soc/codecs/wcd9335.c
··· 312 312 u32 num_rx_port; 313 313 u32 num_tx_port; 314 314 315 - int sido_input_src; 316 315 enum wcd9335_sido_voltage sido_voltage; 317 316 318 317 struct wcd_slim_codec_dai_data dai[NUM_CODEC_DAIS]; ··· 4724 4725 4725 4726 static void wcd9335_enable_sido_buck(struct snd_soc_component *component) 4726 4727 { 4727 - struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); 4728 - 4729 4728 snd_soc_component_update_bits(component, WCD9335_ANA_RCO, 4730 4729 WCD9335_ANA_RCO_BG_EN_MASK, 4731 4730 WCD9335_ANA_RCO_BG_ENABLE); ··· 4737 4740 WCD9335_ANA_BUCK_CTL_VOUT_D_VREF_EXT); 4738 4741 /* 100us sleep needed after VREF settings */ 4739 4742 usleep_range(100, 110); 4740 - wcd->sido_input_src = SIDO_SOURCE_RCO_BG; 4741 4743 } 4742 4744 4743 4745 static int wcd9335_enable_efuse_sensing(struct snd_soc_component *comp) ··· 4867 4871 memcpy(wcd->rx_chs, wcd9335_rx_chs, sizeof(wcd9335_rx_chs)); 4868 4872 memcpy(wcd->tx_chs, wcd9335_tx_chs, sizeof(wcd9335_tx_chs)); 4869 4873 4870 - wcd->sido_input_src = SIDO_SOURCE_INTERNAL; 4871 4874 wcd->sido_voltage = SIDO_VOLTAGE_NOMINAL_MV; 4872 4875 4873 4876 return devm_snd_soc_register_component(dev, &wcd9335_component_drv,
-4
sound/soc/codecs/wcd934x.c
··· 537 537 int rate; 538 538 u32 version; 539 539 u32 hph_mode; 540 - int num_rx_port; 541 - int num_tx_port; 542 540 u32 tx_port_value[WCD934X_TX_MAX]; 543 541 u32 rx_port_value[WCD934X_RX_MAX]; 544 542 int sido_input_src; ··· 1926 1928 return -EINVAL; 1927 1929 } 1928 1930 1929 - wcd->num_rx_port = rx_num; 1930 1931 for (i = 0; i < rx_num; i++) { 1931 1932 wcd->rx_chs[i].ch_num = rx_slot[i]; 1932 1933 INIT_LIST_HEAD(&wcd->rx_chs[i].list); 1933 1934 } 1934 1935 1935 - wcd->num_tx_port = tx_num; 1936 1936 for (i = 0; i < tx_num; i++) { 1937 1937 wcd->tx_chs[i].ch_num = tx_slot[i]; 1938 1938 INIT_LIST_HEAD(&wcd->tx_chs[i].list);
-1
sound/soc/codecs/wcd937x.c
··· 88 88 struct wcd_mbhc_intr intr_ids; 89 89 struct wcd_clsh_ctrl *clsh_info; 90 90 struct irq_domain *virq; 91 - struct regmap_irq_chip *wcd_regmap_irq_chip; 92 91 struct regmap_irq_chip_data *irq_chip; 93 92 struct snd_soc_jack *jack; 94 93 unsigned long status_mask;
+8 -9
sound/soc/codecs/wcd938x.c
··· 158 158 struct wcd_mbhc_intr intr_ids; 159 159 struct wcd_clsh_ctrl *clsh_info; 160 160 struct irq_domain *virq; 161 - struct regmap_irq_chip *wcd_regmap_irq_chip; 162 161 struct regmap_irq_chip_data *irq_chip; 163 162 struct snd_soc_jack *jack; 164 163 unsigned long status_mask; ··· 167 168 u32 tx_mode[TX_ADC_MAX]; 168 169 int flyback_cur_det_disable; 169 170 int ear_rx_path; 170 - int variant; 171 171 struct gpio_desc *reset_gpio; 172 172 struct gpio_desc *us_euro_gpio; 173 173 struct mux_control *us_euro_mux; ··· 275 277 REGMAP_IRQ_REG(WCD938X_IRQ_HPHR_SURGE_DET_INT, 2, 0x08), 276 278 }; 277 279 278 - static struct regmap_irq_chip wcd938x_regmap_irq_chip = { 280 + static const struct regmap_irq_chip wcd938x_regmap_irq_chip = { 279 281 .name = "wcd938x", 280 282 .irqs = wcd938x_irqs, 281 283 .num_irqs = ARRAY_SIZE(wcd938x_irqs), ··· 3046 3048 struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev; 3047 3049 struct device *dev = component->dev; 3048 3050 unsigned long time_left; 3051 + unsigned int variant; 3049 3052 int ret, i; 3050 3053 3051 3054 time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete, ··· 3062 3063 if (ret < 0) 3063 3064 return ret; 3064 3065 3065 - wcd938x->variant = snd_soc_component_read_field(component, 3066 - WCD938X_DIGITAL_EFUSE_REG_0, 3067 - WCD938X_ID_MASK); 3066 + variant = snd_soc_component_read_field(component, 3067 + WCD938X_DIGITAL_EFUSE_REG_0, 3068 + WCD938X_ID_MASK); 3068 3069 3069 3070 wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X); 3070 3071 if (IS_ERR(wcd938x->clsh_info)) { ··· 3118 3119 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); 3119 3120 disable_irq_nosync(wcd938x->aux_pdm_wd_int); 3120 3121 3121 - switch (wcd938x->variant) { 3122 + switch (variant) { 3122 3123 case WCD9380: 3123 3124 ret = snd_soc_add_component_controls(component, wcd9380_snd_controls, 3124 3125 ARRAY_SIZE(wcd9380_snd_controls)); 3125 3126 if (ret < 0) { 3126 3127 dev_err(component->dev, 3127 3128 "%s: Failed to add snd ctrls for variant: %d\n", 3128 - __func__, wcd938x->variant); 3129 + __func__, variant); 3129 3130 goto err_free_aux_pdm_wd_int; 3130 3131 } 3131 3132 break; ··· 3135 3136 if (ret < 0) { 3136 3137 dev_err(component->dev, 3137 3138 "%s: Failed to add snd ctrls for variant: %d\n", 3138 - __func__, wcd938x->variant); 3139 + __func__, variant); 3139 3140 goto err_free_aux_pdm_wd_int; 3140 3141 } 3141 3142 break;
-1
sound/soc/codecs/wcd939x.c
··· 189 189 struct wcd_mbhc_intr intr_ids; 190 190 struct wcd_clsh_ctrl *clsh_info; 191 191 struct irq_domain *virq; 192 - struct regmap_irq_chip *wcd_regmap_irq_chip; 193 192 struct regmap_irq_chip_data *irq_chip; 194 193 struct snd_soc_jack *jack; 195 194 unsigned long status_mask;
+2 -2
sound/soc/codecs/wsa881x.c
··· 202 202 SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \ 203 203 snd_soc_get_volsw, wsa881x_put_pa_gain, tlv_array) 204 204 205 - static struct reg_default wsa881x_defaults[] = { 205 + static const struct reg_default wsa881x_defaults[] = { 206 206 { WSA881X_CHIP_ID0, 0x00 }, 207 207 { WSA881X_CHIP_ID1, 0x00 }, 208 208 { WSA881X_CHIP_ID2, 0x00 }, ··· 346 346 }; 347 347 348 348 /* Default register reset values for WSA881x rev 2.0 */ 349 - static struct reg_sequence wsa881x_rev_2_0[] = { 349 + static const struct reg_sequence wsa881x_rev_2_0[] = { 350 350 { WSA881X_RESET_CTL, 0x00, 0x00 }, 351 351 { WSA881X_TADC_VALUE_CTL, 0x01, 0x00 }, 352 352 { WSA881X_INTR_MASK, 0x1B, 0x00 },
+1 -1
sound/soc/codecs/wsa883x.c
··· 572 572 }, 573 573 }; 574 574 575 - static struct reg_default wsa883x_defaults[] = { 575 + static const struct reg_default wsa883x_defaults[] = { 576 576 { WSA883X_REF_CTRL, 0xD5 }, 577 577 { WSA883X_TEST_CTL_0, 0x06 }, 578 578 { WSA883X_BIAS_0, 0xD2 },
+1 -1
sound/soc/codecs/wsa884x.c
··· 899 899 }, 900 900 }; 901 901 902 - static struct reg_default wsa884x_defaults[] = { 902 + static const struct reg_default wsa884x_defaults[] = { 903 903 { WSA884X_BG_CTRL, 0xa5 }, 904 904 { WSA884X_ADC_CTRL, 0x00 }, 905 905 { WSA884X_BOP1_PROG, 0x22 },
+1 -1
sound/soc/fsl/fsl_asrc.c
··· 930 930 } 931 931 } 932 932 933 - static struct reg_default fsl_asrc_reg[] = { 933 + static const struct reg_default fsl_asrc_reg[] = { 934 934 { REG_ASRCTR, 0x0000 }, { REG_ASRIER, 0x0000 }, 935 935 { REG_ASRCNCR, 0x0000 }, { REG_ASRCFG, 0x0000 }, 936 936 { REG_ASRCSR, 0x0000 }, { REG_ASRCDR1, 0x0000 },
+2 -2
sound/soc/fsl/fsl_sai.c
··· 1059 1059 .legacy_dai_naming = 1, 1060 1060 }; 1061 1061 1062 - static struct reg_default fsl_sai_reg_defaults_ofs0[] = { 1062 + static const struct reg_default fsl_sai_reg_defaults_ofs0[] = { 1063 1063 {FSL_SAI_TCR1(0), 0}, 1064 1064 {FSL_SAI_TCR2(0), 0}, 1065 1065 {FSL_SAI_TCR3(0), 0}, ··· 1082 1082 {FSL_SAI_RMR, 0}, 1083 1083 }; 1084 1084 1085 - static struct reg_default fsl_sai_reg_defaults_ofs8[] = { 1085 + static const struct reg_default fsl_sai_reg_defaults_ofs8[] = { 1086 1086 {FSL_SAI_TCR1(8), 0}, 1087 1087 {FSL_SAI_TCR2(8), 0}, 1088 1088 {FSL_SAI_TCR3(8), 0},