hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/tscs454.c
....@@ -22,7 +22,6 @@
2222
2323 #include "tscs454.h"
2424
25
-static const unsigned int PLL_48K_RATE = (48000 * 256);
2625 static const unsigned int PLL_44_1K_RATE = (44100 * 256);
2726
2827 #define COEFF_SIZE 3
....@@ -354,12 +353,7 @@
354353 for (cnt = 0; cnt < coeff_cnt; cnt++, coeff_addr++) {
355354
356355 for (trys = 0; trys < DACCRSTAT_MAX_TRYS; trys++) {
357
- ret = snd_soc_component_read(component, r_stat, &val);
358
- if (ret < 0) {
359
- dev_err(component->dev,
360
- "Failed to read stat (%d)\n", ret);
361
- return ret;
362
- }
356
+ val = snd_soc_component_read(component, r_stat);
363357 if (!val)
364358 break;
365359 }
....@@ -445,12 +439,7 @@
445439 mutex_lock(&tscs454->pll1.lock);
446440 mutex_lock(&tscs454->pll2.lock);
447441
448
- ret = snd_soc_component_read(component, R_PLLSTAT, &val);
449
- if (ret < 0) {
450
- dev_err(component->dev, "Failed to read PLL status (%d)\n",
451
- ret);
452
- goto exit;
453
- }
442
+ val = snd_soc_component_read(component, R_PLLSTAT);
454443 if (val) { /* PLLs locked */
455444 ret = write_coeff_ram(component, coeff_ram,
456445 r_stat, r_addr, r_wr,
....@@ -2643,13 +2632,10 @@
26432632 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component);
26442633 unsigned int val;
26452634 int bclk_dai;
2646
- int ret;
26472635
26482636 dev_dbg(component->dev, "%s(): freq = %u\n", __func__, freq);
26492637
2650
- ret = snd_soc_component_read(component, R_PLLCTL, &val);
2651
- if (ret < 0)
2652
- return ret;
2638
+ val = snd_soc_component_read(component, R_PLLCTL);
26532639
26542640 bclk_dai = (val & FM_PLLCTL_BCLKSEL) >> FB_PLLCTL_BCLKSEL;
26552641 if (bclk_dai != dai->id)
....@@ -3129,18 +3115,17 @@
31293115 unsigned int width;
31303116 int ret;
31313117
3132
- switch (format) {
3133
- case SNDRV_PCM_FORMAT_S16_LE:
3118
+ switch (snd_pcm_format_width(format)) {
3119
+ case 16:
31343120 width = FV_WL_16;
31353121 break;
3136
- case SNDRV_PCM_FORMAT_S20_3LE:
3122
+ case 20:
31373123 width = FV_WL_20;
31383124 break;
3139
- case SNDRV_PCM_FORMAT_S24_3LE:
3125
+ case 24:
31403126 width = FV_WL_24;
31413127 break;
3142
- case SNDRV_PCM_FORMAT_S24_LE:
3143
- case SNDRV_PCM_FORMAT_S32_LE:
3128
+ case 32:
31443129 width = FV_WL_32;
31453130 break;
31463131 default:
....@@ -3205,10 +3190,7 @@
32053190 }
32063191
32073192 if (!aifs_active(&tscs454->aifs_status)) { /* First active aif */
3208
- ret = snd_soc_component_read(component, R_ISRC, &val);
3209
- if (ret < 0)
3210
- goto exit;
3211
-
3193
+ val = snd_soc_component_read(component, R_ISRC);
32123194 if ((val & FM_ISRC_IBR) == FV_IBR_48)
32133195 tscs454->internal_rate.pll = &tscs454->pll1;
32143196 else
....@@ -3338,6 +3320,7 @@
33383320 .num_dapm_routes = ARRAY_SIZE(tscs454_intercon),
33393321 .controls = tscs454_snd_controls,
33403322 .num_controls = ARRAY_SIZE(tscs454_snd_controls),
3323
+ .endianness = 1,
33413324 };
33423325
33433326 #define TSCS454_RATES SNDRV_PCM_RATE_8000_96000
....@@ -3459,7 +3442,7 @@
34593442 /* Sync pg sel reg with cache */
34603443 regmap_write(tscs454->regmap, R_PAGESEL, 0x00);
34613444
3462
- ret = snd_soc_register_component(&i2c->dev, &soc_component_dev_tscs454,
3445
+ ret = devm_snd_soc_register_component(&i2c->dev, &soc_component_dev_tscs454,
34633446 tscs454_dais, ARRAY_SIZE(tscs454_dais));
34643447 if (ret) {
34653448 dev_err(&i2c->dev, "Failed to register component (%d)\n", ret);