dm: sound: Start i2c IDs from 0
authorSimon Glass <sjg@chromium.org>
Mon, 10 Dec 2018 17:37:38 +0000 (10:37 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 13 Dec 2018 23:32:49 +0000 (16:32 -0700)
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>
drivers/sound/max98095.h
drivers/sound/sound-i2s.c
drivers/sound/wm8994.h

index 44b1e3a97b4aa16280c8940368a6bd321e0a50df..13ae177a86bde2e69fd3269babae69561f0f132f 100644 (file)
@@ -13,7 +13,7 @@
 
 /*  Available audio interface ports in wm8994 codec */
 enum en_max_audio_interface {
-       AIF1 = 1,
+       AIF1,
        AIF2,
 };
 
index ed130750b2e59ea887b58627315f4e1285f5c3b0..a2fc78154f176b3b1ff81e403bc222c30cf46652 100644 (file)
@@ -120,13 +120,11 @@ static int codec_init(const void *blob, struct i2s_uc_priv *pi2s_tx)
        debug("device = %s\n", codectype);
        if (!strcmp(codectype, "wm8994")) {
                /* Check the codec type and initialise the same */
-               ret = wm8994_init(blob, pi2s_tx->id + 1,
-                                 pi2s_tx->samplingrate,
+               ret = wm8994_init(blob, pi2s_tx->id, pi2s_tx->samplingrate,
                                  (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
                                  pi2s_tx->bitspersample, pi2s_tx->channels);
        } else if (!strcmp(codectype, "max98095")) {
-               ret = max98095_init(blob, pi2s_tx->id + 1,
-                                   pi2s_tx->samplingrate,
+               ret = max98095_init(blob, pi2s_tx->id, pi2s_tx->samplingrate,
                                    (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
                                    pi2s_tx->bitspersample);
        } else {
index ef2878f87ca5277fb07c617ca65ae6a83fb03708..e36e6269f0070cf1f76592a80353d9e35d8172ff 100644 (file)
@@ -15,7 +15,7 @@
 
 /*  Avilable audi interface ports in wm8994 codec */
 enum en_audio_interface {
-        WM8994_AIF1 = 1,
+        WM8994_AIF1,
         WM8994_AIF2,
         WM8994_AIF3
 };