static int wm8728_mute(struct snd_soc_dai *dai, int mute)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       u16 mute_reg = snd_soc_read(codec, WM8728_DACCTL);
+       struct snd_soc_component *component = dai->component;
+       u16 mute_reg = snd_soc_component_read32(component, WM8728_DACCTL);
 
        if (mute)
-               snd_soc_write(codec, WM8728_DACCTL, mute_reg | 1);
+               snd_soc_component_write(component, WM8728_DACCTL, mute_reg | 1);
        else
-               snd_soc_write(codec, WM8728_DACCTL, mute_reg & ~1);
+               snd_soc_component_write(component, WM8728_DACCTL, mute_reg & ~1);
 
        return 0;
 }
        struct snd_pcm_hw_params *params,
        struct snd_soc_dai *dai)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       u16 dac = snd_soc_read(codec, WM8728_DACCTL);
+       struct snd_soc_component *component = dai->component;
+       u16 dac = snd_soc_component_read32(component, WM8728_DACCTL);
 
        dac &= ~0x18;
 
                return -EINVAL;
        }
 
-       snd_soc_write(codec, WM8728_DACCTL, dac);
+       snd_soc_component_write(component, WM8728_DACCTL, dac);
 
        return 0;
 }
 static int wm8728_set_dai_fmt(struct snd_soc_dai *codec_dai,
                unsigned int fmt)
 {
-       struct snd_soc_codec *codec = codec_dai->codec;
-       u16 iface = snd_soc_read(codec, WM8728_IFCTL);
+       struct snd_soc_component *component = codec_dai->component;
+       u16 iface = snd_soc_component_read32(component, WM8728_IFCTL);
 
        /* Currently only I2S is supported by the driver, though the
         * hardware is more flexible.
                return -EINVAL;
        }
 
-       snd_soc_write(codec, WM8728_IFCTL, iface);
+       snd_soc_component_write(component, WM8728_IFCTL, iface);
        return 0;
 }
 
-static int wm8728_set_bias_level(struct snd_soc_codec *codec,
+static int wm8728_set_bias_level(struct snd_soc_component *component,
                                 enum snd_soc_bias_level level)
 {
-       struct wm8728_priv *wm8728 = snd_soc_codec_get_drvdata(codec);
+       struct wm8728_priv *wm8728 = snd_soc_component_get_drvdata(component);
        u16 reg;
 
        switch (level) {
        case SND_SOC_BIAS_ON:
        case SND_SOC_BIAS_PREPARE:
        case SND_SOC_BIAS_STANDBY:
-               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) {
+               if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
                        /* Power everything up... */
-                       reg = snd_soc_read(codec, WM8728_DACCTL);
-                       snd_soc_write(codec, WM8728_DACCTL, reg & ~0x4);
+                       reg = snd_soc_component_read32(component, WM8728_DACCTL);
+                       snd_soc_component_write(component, WM8728_DACCTL, reg & ~0x4);
 
                        /* ..then sync in the register cache. */
                        regcache_sync(wm8728->regmap);
                break;
 
        case SND_SOC_BIAS_OFF:
-               reg = snd_soc_read(codec, WM8728_DACCTL);
-               snd_soc_write(codec, WM8728_DACCTL, reg | 0x4);
+               reg = snd_soc_component_read32(component, WM8728_DACCTL);
+               snd_soc_component_write(component, WM8728_DACCTL, reg | 0x4);
                break;
        }
        return 0;
        .ops = &wm8728_dai_ops,
 };
 
-static const struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
-       .set_bias_level = wm8728_set_bias_level,
-       .suspend_bias_off = true,
-
-       .component_driver = {
-               .controls               = wm8728_snd_controls,
-               .num_controls           = ARRAY_SIZE(wm8728_snd_controls),
-               .dapm_widgets           = wm8728_dapm_widgets,
-               .num_dapm_widgets       = ARRAY_SIZE(wm8728_dapm_widgets),
-               .dapm_routes            = wm8728_intercon,
-               .num_dapm_routes        = ARRAY_SIZE(wm8728_intercon),
-       },
+static const struct snd_soc_component_driver soc_component_dev_wm8728 = {
+       .set_bias_level         = wm8728_set_bias_level,
+       .controls               = wm8728_snd_controls,
+       .num_controls           = ARRAY_SIZE(wm8728_snd_controls),
+       .dapm_widgets           = wm8728_dapm_widgets,
+       .num_dapm_widgets       = ARRAY_SIZE(wm8728_dapm_widgets),
+       .dapm_routes            = wm8728_intercon,
+       .num_dapm_routes        = ARRAY_SIZE(wm8728_intercon),
+       .suspend_bias_off       = 1,
+       .idle_bias_on           = 1,
+       .use_pmdown_time        = 1,
+       .endianness             = 1,
+       .non_legacy_dai_naming  = 1,
 };
 
 static const struct of_device_id wm8728_of_match[] = {
 
        spi_set_drvdata(spi, wm8728);
 
-       ret = snd_soc_register_codec(&spi->dev,
-                       &soc_codec_dev_wm8728, &wm8728_dai, 1);
+       ret = devm_snd_soc_register_component(&spi->dev,
+                       &soc_component_dev_wm8728, &wm8728_dai, 1);
 
        return ret;
 }
 
-static int wm8728_spi_remove(struct spi_device *spi)
-{
-       snd_soc_unregister_codec(&spi->dev);
-
-       return 0;
-}
-
 static struct spi_driver wm8728_spi_driver = {
        .driver = {
                .name   = "wm8728",
                .of_match_table = wm8728_of_match,
        },
        .probe          = wm8728_spi_probe,
-       .remove         = wm8728_spi_remove,
 };
 #endif /* CONFIG_SPI_MASTER */
 
 
        i2c_set_clientdata(i2c, wm8728);
 
-       ret =  snd_soc_register_codec(&i2c->dev,
-                       &soc_codec_dev_wm8728, &wm8728_dai, 1);
+       ret =  devm_snd_soc_register_component(&i2c->dev,
+                       &soc_component_dev_wm8728, &wm8728_dai, 1);
 
        return ret;
 }
 
-static int wm8728_i2c_remove(struct i2c_client *client)
-{
-       snd_soc_unregister_codec(&client->dev);
-       return 0;
-}
-
 static const struct i2c_device_id wm8728_i2c_id[] = {
        { "wm8728", 0 },
        { }
                .of_match_table = wm8728_of_match,
        },
        .probe =    wm8728_i2c_probe,
-       .remove =   wm8728_i2c_remove,
        .id_table = wm8728_i2c_id,
 };
 #endif