sound: Use the general GpioOps paramater for max98357a
authorXing Zheng <zhengxing@rock-chips.com>
Thu, 19 May 2016 06:44:34 +0000 (14:44 +0800)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 26 May 2016 19:24:52 +0000 (12:24 -0700)
Because the GpioCfg is the private structure and only is used on the
Intel platform. The max98357a is a common DAC driver, it should be
referred by any other SoCs. We need to use the GpioOps to instead of it.

BRANCH=none
BUG=chrome-os-partner:52172
TEST=boot kevin rev1, press ctrl+u and hear the beep voice.

Change-Id: I297790ab4eba3f217d2152cc7f45baf51c3ffc3f
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/345744
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
src/board/kunimitsu/board.c
src/board/lars/board.c
src/drivers/sound/max98357a.c
src/drivers/sound/max98357a.h

index 3f172ae..8c8d59c 100755 (executable)
@@ -154,7 +154,7 @@ static int board_setup(void)
                sound_set_ops(&sound->ops);
        } else {
                /* Speaker Amp codec MAX98357A */
-               GpioCfg *sdmode_gpio = new_skylake_gpio_output(GPP_E3, 0);
+               GpioOps *sdmode_gpio = &new_skylake_gpio_output(GPP_E3, 0)->ops;
                max98357aCodec *speaker_amp =
                        new_max98357a_codec(sdmode_gpio);
 
index 892bdea..6cb689a 100755 (executable)
@@ -77,7 +77,7 @@ static int board_setup(void)
                        &fixed_block_dev_controllers);
 
        /* Speaker Amp codec MAX98357A */
-       GpioCfg *sdmode_gpio = new_skylake_gpio_output(GPP_B2, 0);
+       GpioOps *sdmode_gpio = &new_skylake_gpio_output(GPP_B2, 0)->ops;
        max98357aCodec *speaker_amp =
                new_max98357a_codec(sdmode_gpio);
 
index 2328ac5..44cb4a8 100644 (file)
@@ -26,11 +26,11 @@ static int max98357a_enable(SoundRouteComponentOps *me)
        return gpio_set(codec->sdmode_gpio, 1);
 }
 
-max98357aCodec *new_max98357a_codec(GpioCfg *sdmode)
+max98357aCodec *new_max98357a_codec(GpioOps *ops)
 {
        max98357aCodec *codec = xzalloc(sizeof(*codec));
 
-       codec->sdmode_gpio = &sdmode->ops;
+       codec->sdmode_gpio = ops;
        codec->component.ops.enable = &max98357a_enable;
 
        return codec;
index d1a4a2d..f289512 100644 (file)
@@ -18,7 +18,6 @@
 #define __DRIVERS_SOUND_MAX98357A_H__
 
 #include "drivers/gpio/gpio.h"
-#include "drivers/gpio/skylake.h"
 #include "drivers/sound/route.h"
 
 typedef struct
@@ -28,6 +27,6 @@ typedef struct
 
 } max98357aCodec;
 
-max98357aCodec *new_max98357a_codec(struct GpioCfg *);
+max98357aCodec *new_max98357a_codec(GpioOps *);
 
 #endif /* __DRIVERS_SOUND_MAX98357A_H__ */