static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
-       unsigned long value = snd_soc_read(codec, CS42L51_PCM_MIXER)&3;
+       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+       unsigned long value = snd_soc_component_read32(component, CS42L51_PCM_MIXER)&3;
 
        switch (value) {
        default:
 static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
        unsigned char val;
 
        switch (ucontrol->value.enumerated.item[0]) {
                break;
        }
 
-       snd_soc_write(codec, CS42L51_PCM_MIXER, val);
+       snd_soc_component_write(component, CS42L51_PCM_MIXER, val);
 
        return 1;
 }
 static int cs42l51_pdn_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMD:
-               snd_soc_update_bits(codec, CS42L51_POWER_CTL1,
+               snd_soc_component_update_bits(component, CS42L51_POWER_CTL1,
                                    CS42L51_POWER_CTL1_PDN,
                                    CS42L51_POWER_CTL1_PDN);
                break;
        default:
        case SND_SOC_DAPM_POST_PMD:
-               snd_soc_update_bits(codec, CS42L51_POWER_CTL1,
+               snd_soc_component_update_bits(component, CS42L51_POWER_CTL1,
                                    CS42L51_POWER_CTL1_PDN, 0);
                break;
        }
 static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai,
                unsigned int format)
 {
-       struct snd_soc_codec *codec = codec_dai->codec;
-       struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = codec_dai->component;
+       struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(component);
 
        switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
        case SND_SOC_DAIFMT_I2S:
                cs42l51->audio_mode = format & SND_SOC_DAIFMT_FORMAT_MASK;
                break;
        default:
-               dev_err(codec->dev, "invalid DAI format\n");
+               dev_err(component->dev, "invalid DAI format\n");
                return -EINVAL;
        }
 
                cs42l51->func = MODE_SLAVE_AUTO;
                break;
        default:
-               dev_err(codec->dev, "Unknown master/slave configuration\n");
+               dev_err(component->dev, "Unknown master/slave configuration\n");
                return -EINVAL;
        }
 
 static int cs42l51_set_dai_sysclk(struct snd_soc_dai *codec_dai,
                int clk_id, unsigned int freq, int dir)
 {
-       struct snd_soc_codec *codec = codec_dai->codec;
-       struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = codec_dai->component;
+       struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(component);
 
        cs42l51->mclk = freq;
        return 0;
                struct snd_pcm_hw_params *params,
                struct snd_soc_dai *dai)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(component);
        int ret;
        unsigned int i;
        unsigned int rate;
 
        if (i == nr_ratios) {
                /* We did not find a matching ratio */
-               dev_err(codec->dev, "could not find matching ratio\n");
+               dev_err(component->dev, "could not find matching ratio\n");
                return -EINVAL;
        }
 
-       intf_ctl = snd_soc_read(codec, CS42L51_INTF_CTL);
-       power_ctl = snd_soc_read(codec, CS42L51_MIC_POWER_CTL);
+       intf_ctl = snd_soc_component_read32(component, CS42L51_INTF_CTL);
+       power_ctl = snd_soc_component_read32(component, CS42L51_MIC_POWER_CTL);
 
        intf_ctl &= ~(CS42L51_INTF_CTL_MASTER | CS42L51_INTF_CTL_ADC_I2S
                        | CS42L51_INTF_CTL_DAC_FORMAT(7));
                        fmt = CS42L51_DAC_DIF_RJ24;
                        break;
                default:
-                       dev_err(codec->dev, "unknown format\n");
+                       dev_err(component->dev, "unknown format\n");
                        return -EINVAL;
                }
                intf_ctl |= CS42L51_INTF_CTL_DAC_FORMAT(fmt);
                break;
        default:
-               dev_err(codec->dev, "unknown format\n");
+               dev_err(component->dev, "unknown format\n");
                return -EINVAL;
        }
 
        if (ratios[i].mclk)
                power_ctl |= CS42L51_MIC_POWER_CTL_MCLK_DIV2;
 
-       ret = snd_soc_write(codec, CS42L51_INTF_CTL, intf_ctl);
+       ret = snd_soc_component_write(component, CS42L51_INTF_CTL, intf_ctl);
        if (ret < 0)
                return ret;
 
-       ret = snd_soc_write(codec, CS42L51_MIC_POWER_CTL, power_ctl);
+       ret = snd_soc_component_write(component, CS42L51_MIC_POWER_CTL, power_ctl);
        if (ret < 0)
                return ret;
 
 
 static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute)
 {
-       struct snd_soc_codec *codec = dai->codec;
+       struct snd_soc_component *component = dai->component;
        int reg;
        int mask = CS42L51_DAC_OUT_CTL_DACA_MUTE|CS42L51_DAC_OUT_CTL_DACB_MUTE;
 
-       reg = snd_soc_read(codec, CS42L51_DAC_OUT_CTL);
+       reg = snd_soc_component_read32(component, CS42L51_DAC_OUT_CTL);
 
        if (mute)
                reg |= mask;
        else
                reg &= ~mask;
 
-       return snd_soc_write(codec, CS42L51_DAC_OUT_CTL, reg);
+       return snd_soc_component_write(component, CS42L51_DAC_OUT_CTL, reg);
 }
 
 static const struct snd_soc_dai_ops cs42l51_dai_ops = {
        .ops = &cs42l51_dai_ops,
 };
 
-static int cs42l51_codec_probe(struct snd_soc_codec *codec)
+static int cs42l51_component_probe(struct snd_soc_component *component)
 {
        int ret, reg;
 
         */
        reg = CS42L51_DAC_CTL_DATA_SEL(1)
                | CS42L51_DAC_CTL_AMUTE | CS42L51_DAC_CTL_DACSZ(0);
-       ret = snd_soc_write(codec, CS42L51_DAC_CTL, reg);
+       ret = snd_soc_component_write(component, CS42L51_DAC_CTL, reg);
        if (ret < 0)
                return ret;
 
        return 0;
 }
 
-static const struct snd_soc_codec_driver soc_codec_device_cs42l51 = {
-       .probe = cs42l51_codec_probe,
-
-       .component_driver = {
-               .controls               = cs42l51_snd_controls,
-               .num_controls           = ARRAY_SIZE(cs42l51_snd_controls),
-               .dapm_widgets           = cs42l51_dapm_widgets,
-               .num_dapm_widgets       = ARRAY_SIZE(cs42l51_dapm_widgets),
-               .dapm_routes            = cs42l51_routes,
-               .num_dapm_routes        = ARRAY_SIZE(cs42l51_routes),
-       },
+static const struct snd_soc_component_driver soc_component_device_cs42l51 = {
+       .probe                  = cs42l51_component_probe,
+       .controls               = cs42l51_snd_controls,
+       .num_controls           = ARRAY_SIZE(cs42l51_snd_controls),
+       .dapm_widgets           = cs42l51_dapm_widgets,
+       .num_dapm_widgets       = ARRAY_SIZE(cs42l51_dapm_widgets),
+       .dapm_routes            = cs42l51_routes,
+       .num_dapm_routes        = ARRAY_SIZE(cs42l51_routes),
+       .idle_bias_on           = 1,
+       .use_pmdown_time        = 1,
+       .endianness             = 1,
+       .non_legacy_dai_naming  = 1,
 };
 
 const struct regmap_config cs42l51_regmap = {
        dev_info(dev, "Cirrus Logic CS42L51, Revision: %02X\n",
                 val & CS42L51_CHIP_REV_MASK);
 
-       ret =  snd_soc_register_codec(dev,
-                       &soc_codec_device_cs42l51, &cs42l51_dai, 1);
+       ret = devm_snd_soc_register_component(dev,
+                       &soc_component_device_cs42l51, &cs42l51_dai, 1);
 error:
        return ret;
 }