Commit 6c986cfef4a104ad39faf381014b7c315984cab8

Authored by Simon Glass
1 parent a1b17e4f4c

dm: sound: Start i2c IDs from 0

The current ID enums start from 1 but there does not seem to be any reason
that they cannot start with 0. Adjust the code to avoid the +1 in
codec_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 3 changed files with 4 additions and 6 deletions Side-by-side Diff

drivers/sound/max98095.h
... ... @@ -13,7 +13,7 @@
13 13  
14 14 /* Available audio interface ports in wm8994 codec */
15 15 enum en_max_audio_interface {
16   - AIF1 = 1,
  16 + AIF1,
17 17 AIF2,
18 18 };
19 19  
drivers/sound/sound-i2s.c
... ... @@ -120,13 +120,11 @@
120 120 debug("device = %s\n", codectype);
121 121 if (!strcmp(codectype, "wm8994")) {
122 122 /* Check the codec type and initialise the same */
123   - ret = wm8994_init(blob, pi2s_tx->id + 1,
124   - pi2s_tx->samplingrate,
  123 + ret = wm8994_init(blob, pi2s_tx->id, pi2s_tx->samplingrate,
125 124 (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
126 125 pi2s_tx->bitspersample, pi2s_tx->channels);
127 126 } else if (!strcmp(codectype, "max98095")) {
128   - ret = max98095_init(blob, pi2s_tx->id + 1,
129   - pi2s_tx->samplingrate,
  127 + ret = max98095_init(blob, pi2s_tx->id, pi2s_tx->samplingrate,
130 128 (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
131 129 pi2s_tx->bitspersample);
132 130 } else {
drivers/sound/wm8994.h
... ... @@ -15,7 +15,7 @@
15 15  
16 16 /* Avilable audi interface ports in wm8994 codec */
17 17 enum en_audio_interface {
18   - WM8994_AIF1 = 1,
  18 + WM8994_AIF1,
19 19 WM8994_AIF2,
20 20 WM8994_AIF3
21 21 };