};
 
 struct rt5645_priv {
-       struct snd_soc_codec *codec;
+       struct snd_soc_component *component;
        struct rt5645_platform_data pdata;
        struct regmap *regmap;
        struct i2c_client *i2c;
        int v_id;
 };
 
-static int rt5645_reset(struct snd_soc_codec *codec)
+static int rt5645_reset(struct snd_soc_component *component)
 {
-       return snd_soc_write(codec, RT5645_RESET, 0);
+       return snd_soc_component_write(component, RT5645_RESET, 0);
 }
 
 static bool rt5645_volatile_register(struct device *dev, unsigned int reg)
 static int set_dmic_clk(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 rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        int idx, rate;
 
        rate = rt5645->sysclk / rl6231_get_pre_div(rt5645->regmap,
                RT5645_ADDA_CLK1, RT5645_I2S_PD1_SFT);
        idx = rl6231_calc_dmic_clk(rate);
        if (idx < 0)
-               dev_err(codec->dev, "Failed to set DMIC clock\n");
+               dev_err(component->dev, "Failed to set DMIC clock\n");
        else
-               snd_soc_update_bits(codec, RT5645_DMIC_CTRL1,
+               snd_soc_component_update_bits(component, RT5645_DMIC_CTRL1,
                        RT5645_DMIC_CLK_MASK, idx << RT5645_DMIC_CLK_SFT);
        return idx;
 }
 static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
        unsigned int val;
 
-       val = snd_soc_read(codec, RT5645_GLB_CLK);
+       val = snd_soc_component_read32(component, RT5645_GLB_CLK);
        val &= RT5645_SCLK_SRC_MASK;
        if (val == RT5645_SCLK_SRC_PLL1)
                return 1;
 static int is_using_asrc(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
        unsigned int reg, shift, val;
 
        switch (source->shift) {
                return 0;
        }
 
-       val = (snd_soc_read(codec, reg) >> shift) & 0xf;
+       val = (snd_soc_component_read32(component, reg) >> shift) & 0xf;
        switch (val) {
        case 1:
        case 2:
 
 }
 
-static int rt5645_enable_hweq(struct snd_soc_codec *codec)
+static int rt5645_enable_hweq(struct snd_soc_component *component)
 {
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        int i;
 
        for (i = 0; i < RT5645_HWEQ_NUM; i++) {
 
 /**
  * rt5645_sel_asrc_clk_src - select ASRC clock source for a set of filters
- * @codec: SoC audio codec device.
+ * @component: SoC audio component device.
  * @filter_mask: mask of filters.
  * @clk_src: clock source
  *
  * set of filters specified by the mask. And the codec driver will turn on ASRC
  * for these filters if ASRC is selected as their clock source.
  */
-int rt5645_sel_asrc_clk_src(struct snd_soc_codec *codec,
+int rt5645_sel_asrc_clk_src(struct snd_soc_component *component,
                unsigned int filter_mask, unsigned int clk_src)
 {
        unsigned int asrc2_mask = 0;
        }
 
        if (asrc2_mask)
-               snd_soc_update_bits(codec, RT5645_ASRC_2,
+               snd_soc_component_update_bits(component, RT5645_ASRC_2,
                        asrc2_mask, asrc2_value);
 
        if (asrc3_mask)
-               snd_soc_update_bits(codec, RT5645_ASRC_3,
+               snd_soc_component_update_bits(component, RT5645_ASRC_3,
                        asrc3_mask, asrc3_value);
 
        return 0;
        SOC_DAPM_SINGLE_AUTODISABLE("Switch", RT5645_PDM_OUT_CTRL,
                RT5645_M_PDM1_R, 1, 1);
 
-static void hp_amp_power(struct snd_soc_codec *codec, int on)
+static void hp_amp_power(struct snd_soc_component *component, int on)
 {
        static int hp_amp_power_count;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        if (on) {
                if (hp_amp_power_count <= 0) {
                        if (rt5645->codec_type == CODEC_TYPE_RT5650) {
-                               snd_soc_write(codec, RT5645_DEPOP_M2, 0x3100);
-                               snd_soc_write(codec, RT5645_CHARGE_PUMP,
+                               snd_soc_component_write(component, RT5645_DEPOP_M2, 0x3100);
+                               snd_soc_component_write(component, RT5645_CHARGE_PUMP,
                                        0x0e06);
-                               snd_soc_write(codec, RT5645_DEPOP_M1, 0x000d);
+                               snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        RT5645_HP_DCC_INT1, 0x9f01);
                                msleep(20);
-                               snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                               snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                        RT5645_HP_CO_MASK, RT5645_HP_CO_EN);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        0x3e, 0x7400);
-                               snd_soc_write(codec, RT5645_DEPOP_M3, 0x0737);
+                               snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        RT5645_MAMP_INT_REG2, 0xfc00);
-                               snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
+                               snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140);
                                msleep(90);
                                rt5645->hp_on = true;
                        } else {
                                /* depop parameters */
-                               snd_soc_update_bits(codec, RT5645_DEPOP_M2,
+                               snd_soc_component_update_bits(component, RT5645_DEPOP_M2,
                                        RT5645_DEPOP_MASK, RT5645_DEPOP_MAN);
-                               snd_soc_write(codec, RT5645_DEPOP_M1, 0x000d);
+                               snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        RT5645_HP_DCC_INT1, 0x9f01);
                                mdelay(150);
                                /* headphone amp power on */
-                               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+                               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                        RT5645_PWR_FV1 | RT5645_PWR_FV2, 0);
-                               snd_soc_update_bits(codec, RT5645_PWR_VOL,
+                               snd_soc_component_update_bits(component, RT5645_PWR_VOL,
                                        RT5645_PWR_HV_L | RT5645_PWR_HV_R,
                                        RT5645_PWR_HV_L | RT5645_PWR_HV_R);
-                               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+                               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                        RT5645_PWR_HP_L | RT5645_PWR_HP_R |
                                        RT5645_PWR_HA,
                                        RT5645_PWR_HP_L | RT5645_PWR_HP_R |
                                        RT5645_PWR_HA);
                                mdelay(5);
-                               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+                               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                        RT5645_PWR_FV1 | RT5645_PWR_FV2,
                                        RT5645_PWR_FV1 | RT5645_PWR_FV2);
 
-                               snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                               snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                        RT5645_HP_CO_MASK | RT5645_HP_SG_MASK,
                                        RT5645_HP_CO_EN | RT5645_HP_SG_EN);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                        if (rt5645->codec_type == CODEC_TYPE_RT5650) {
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        0x3e, 0x7400);
-                               snd_soc_write(codec, RT5645_DEPOP_M3, 0x0737);
+                               snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737);
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        RT5645_MAMP_INT_REG2, 0xfc00);
-                               snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
+                               snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140);
                                msleep(100);
-                               snd_soc_write(codec, RT5645_DEPOP_M1, 0x0001);
+                               snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0001);
 
                        } else {
-                               snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                               snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                        RT5645_HP_SG_MASK |
                                        RT5645_HP_L_SMT_MASK |
                                        RT5645_HP_R_SMT_MASK,
                                        RT5645_HP_L_SMT_DIS |
                                        RT5645_HP_R_SMT_DIS);
                                /* headphone amp power down */
-                               snd_soc_write(codec, RT5645_DEPOP_M1, 0x0000);
-                               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+                               snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0000);
+                               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                        RT5645_PWR_HP_L | RT5645_PWR_HP_R |
                                        RT5645_PWR_HA, 0);
-                               snd_soc_update_bits(codec, RT5645_DEPOP_M2,
+                               snd_soc_component_update_bits(component, RT5645_DEPOP_M2,
                                        RT5645_DEPOP_MASK, 0);
                        }
                }
 static int rt5645_hp_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 rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
-               hp_amp_power(codec, 1);
+               hp_amp_power(component, 1);
                /* headphone unmute sequence */
                if (rt5645->codec_type == CODEC_TYPE_RT5645) {
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M3,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M3,
                                RT5645_CP_FQ1_MASK | RT5645_CP_FQ2_MASK |
                                RT5645_CP_FQ3_MASK,
                                (RT5645_CP_FQ_192_KHZ << RT5645_CP_FQ1_SFT) |
                                (RT5645_CP_FQ_192_KHZ << RT5645_CP_FQ3_SFT));
                        regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                RT5645_MAMP_INT_REG2, 0xfc00);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_SMT_TRIG_MASK, RT5645_SMT_TRIG_EN);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_RSTN_MASK, RT5645_RSTN_EN);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_RSTN_MASK | RT5645_HP_L_SMT_MASK |
                                RT5645_HP_R_SMT_MASK, RT5645_RSTN_DIS |
                                RT5645_HP_L_SMT_EN | RT5645_HP_R_SMT_EN);
                        msleep(40);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_HP_SG_MASK | RT5645_HP_L_SMT_MASK |
                                RT5645_HP_R_SMT_MASK, RT5645_HP_SG_DIS |
                                RT5645_HP_L_SMT_DIS | RT5645_HP_R_SMT_DIS);
        case SND_SOC_DAPM_PRE_PMD:
                /* headphone mute sequence */
                if (rt5645->codec_type == CODEC_TYPE_RT5645) {
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M3,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M3,
                                RT5645_CP_FQ1_MASK | RT5645_CP_FQ2_MASK |
                                RT5645_CP_FQ3_MASK,
                                (RT5645_CP_FQ_96_KHZ << RT5645_CP_FQ1_SFT) |
                                (RT5645_CP_FQ_96_KHZ << RT5645_CP_FQ3_SFT));
                        regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                RT5645_MAMP_INT_REG2, 0xfc00);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_HP_SG_MASK, RT5645_HP_SG_EN);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_RSTP_MASK, RT5645_RSTP_EN);
-                       snd_soc_update_bits(codec, RT5645_DEPOP_M1,
+                       snd_soc_component_update_bits(component, RT5645_DEPOP_M1,
                                RT5645_RSTP_MASK | RT5645_HP_L_SMT_MASK |
                                RT5645_HP_R_SMT_MASK, RT5645_RSTP_DIS |
                                RT5645_HP_L_SMT_EN | RT5645_HP_R_SMT_EN);
                        msleep(30);
                }
-               hp_amp_power(codec, 0);
+               hp_amp_power(component, 0);
                break;
 
        default:
 static int rt5645_spk_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_POST_PMU:
-               rt5645_enable_hweq(codec);
-               snd_soc_update_bits(codec, RT5645_PWR_DIG1,
+               rt5645_enable_hweq(component);
+               snd_soc_component_update_bits(component, RT5645_PWR_DIG1,
                        RT5645_PWR_CLS_D | RT5645_PWR_CLS_D_R |
                        RT5645_PWR_CLS_D_L,
                        RT5645_PWR_CLS_D | RT5645_PWR_CLS_D_R |
                        RT5645_PWR_CLS_D_L);
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL3,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL3,
                        RT5645_DET_CLK_MASK, RT5645_DET_CLK_MODE1);
                break;
 
        case SND_SOC_DAPM_PRE_PMD:
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL3,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL3,
                        RT5645_DET_CLK_MASK, RT5645_DET_CLK_DIS);
-               snd_soc_write(codec, RT5645_EQ_CTRL2, 0);
-               snd_soc_update_bits(codec, RT5645_PWR_DIG1,
+               snd_soc_component_write(component, RT5645_EQ_CTRL2, 0);
+               snd_soc_component_update_bits(component, RT5645_PWR_DIG1,
                        RT5645_PWR_CLS_D | RT5645_PWR_CLS_D_R |
                        RT5645_PWR_CLS_D_L, 0);
                break;
 static int rt5645_lout_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_POST_PMU:
-               hp_amp_power(codec, 1);
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               hp_amp_power(component, 1);
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                        RT5645_PWR_LM, RT5645_PWR_LM);
-               snd_soc_update_bits(codec, RT5645_LOUT1,
+               snd_soc_component_update_bits(component, RT5645_LOUT1,
                        RT5645_L_MUTE | RT5645_R_MUTE, 0);
                break;
 
        case SND_SOC_DAPM_PRE_PMD:
-               snd_soc_update_bits(codec, RT5645_LOUT1,
+               snd_soc_component_update_bits(component, RT5645_LOUT1,
                        RT5645_L_MUTE | RT5645_R_MUTE,
                        RT5645_L_MUTE | RT5645_R_MUTE);
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                        RT5645_PWR_LM, 0);
-               hp_amp_power(codec, 0);
+               hp_amp_power(component, 0);
                break;
 
        default:
 static int rt5645_bst2_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_POST_PMU:
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG2,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG2,
                        RT5645_PWR_BST2_P, RT5645_PWR_BST2_P);
                break;
 
        case SND_SOC_DAPM_PRE_PMD:
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG2,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG2,
                        RT5645_PWR_BST2_P, 0);
                break;
 
 static int rt5650_hp_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *k, int  event)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
 static int rt5645_set_micbias1_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *k, 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_PMU:
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL2,
                        RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
                        RT5645_MICBIAS1_POW_CTRL_SEL_M);
                break;
 
        case SND_SOC_DAPM_POST_PMD:
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL2,
                        RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
                        RT5645_MICBIAS1_POW_CTRL_SEL_A);
                break;
 static int rt5645_set_micbias2_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *k, 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_PMU:
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL2,
                        RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
                        RT5645_MICBIAS2_POW_CTRL_SEL_M);
                break;
 
        case SND_SOC_DAPM_POST_PMD:
-               snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+               snd_soc_component_update_bits(component, RT5645_GEN_CTRL2,
                        RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
                        RT5645_MICBIAS2_POW_CTRL_SEL_A);
                break;
 static int rt5645_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        unsigned int val_len = 0, val_clk, mask_clk, dl_sft;
        int pre_div, bclk_ms, frame_size;
 
        rt5645->lrck[dai->id] = params_rate(params);
        pre_div = rl6231_get_clk_info(rt5645->sysclk, rt5645->lrck[dai->id]);
        if (pre_div < 0) {
-               dev_err(codec->dev, "Unsupported clock setting\n");
+               dev_err(component->dev, "Unsupported clock setting\n");
                return -EINVAL;
        }
        frame_size = snd_soc_params_to_frame_size(params);
        if (frame_size < 0) {
-               dev_err(codec->dev, "Unsupported frame size: %d\n", frame_size);
+               dev_err(component->dev, "Unsupported frame size: %d\n", frame_size);
                return -EINVAL;
        }
 
        case RT5645_AIF1:
                mask_clk = RT5645_I2S_PD1_MASK;
                val_clk = pre_div << RT5645_I2S_PD1_SFT;
-               snd_soc_update_bits(codec, RT5645_I2S1_SDP,
+               snd_soc_component_update_bits(component, RT5645_I2S1_SDP,
                        (0x3 << dl_sft), (val_len << dl_sft));
-               snd_soc_update_bits(codec, RT5645_ADDA_CLK1, mask_clk, val_clk);
+               snd_soc_component_update_bits(component, RT5645_ADDA_CLK1, mask_clk, val_clk);
                break;
        case  RT5645_AIF2:
                mask_clk = RT5645_I2S_BCLK_MS2_MASK | RT5645_I2S_PD2_MASK;
                val_clk = bclk_ms << RT5645_I2S_BCLK_MS2_SFT |
                        pre_div << RT5645_I2S_PD2_SFT;
-               snd_soc_update_bits(codec, RT5645_I2S2_SDP,
+               snd_soc_component_update_bits(component, RT5645_I2S2_SDP,
                        (0x3 << dl_sft), (val_len << dl_sft));
-               snd_soc_update_bits(codec, RT5645_ADDA_CLK1, mask_clk, val_clk);
+               snd_soc_component_update_bits(component, RT5645_ADDA_CLK1, mask_clk, val_clk);
                break;
        default:
-               dev_err(codec->dev, "Invalid dai->id: %d\n", dai->id);
+               dev_err(component->dev, "Invalid dai->id: %d\n", dai->id);
                return -EINVAL;
        }
 
 
 static int rt5645_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        unsigned int reg_val = 0, pol_sft;
 
        switch (rt5645->codec_type) {
        }
        switch (dai->id) {
        case RT5645_AIF1:
-               snd_soc_update_bits(codec, RT5645_I2S1_SDP,
+               snd_soc_component_update_bits(component, RT5645_I2S1_SDP,
                        RT5645_I2S_MS_MASK | (1 << pol_sft) |
                        RT5645_I2S_DF_MASK, reg_val);
                break;
        case RT5645_AIF2:
-               snd_soc_update_bits(codec, RT5645_I2S2_SDP,
+               snd_soc_component_update_bits(component, RT5645_I2S2_SDP,
                        RT5645_I2S_MS_MASK | (1 << pol_sft) |
                        RT5645_I2S_DF_MASK, reg_val);
                break;
        default:
-               dev_err(codec->dev, "Invalid dai->id: %d\n", dai->id);
+               dev_err(component->dev, "Invalid dai->id: %d\n", dai->id);
                return -EINVAL;
        }
        return 0;
 static int rt5645_set_dai_sysclk(struct snd_soc_dai *dai,
                int clk_id, unsigned int freq, int dir)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        unsigned int reg_val = 0;
 
        if (freq == rt5645->sysclk && clk_id == rt5645->sysclk_src)
                reg_val |= RT5645_SCLK_SRC_RCCLK;
                break;
        default:
-               dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id);
+               dev_err(component->dev, "Invalid clock id (%d)\n", clk_id);
                return -EINVAL;
        }
-       snd_soc_update_bits(codec, RT5645_GLB_CLK,
+       snd_soc_component_update_bits(component, RT5645_GLB_CLK,
                RT5645_SCLK_SRC_MASK, reg_val);
        rt5645->sysclk = freq;
        rt5645->sysclk_src = clk_id;
 static int rt5645_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
                        unsigned int freq_in, unsigned int freq_out)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        struct rl6231_pll_code pll_code;
        int ret;
 
                return 0;
 
        if (!freq_in || !freq_out) {
-               dev_dbg(codec->dev, "PLL disabled\n");
+               dev_dbg(component->dev, "PLL disabled\n");
 
                rt5645->pll_in = 0;
                rt5645->pll_out = 0;
-               snd_soc_update_bits(codec, RT5645_GLB_CLK,
+               snd_soc_component_update_bits(component, RT5645_GLB_CLK,
                        RT5645_SCLK_SRC_MASK, RT5645_SCLK_SRC_MCLK);
                return 0;
        }
 
        switch (source) {
        case RT5645_PLL1_S_MCLK:
-               snd_soc_update_bits(codec, RT5645_GLB_CLK,
+               snd_soc_component_update_bits(component, RT5645_GLB_CLK,
                        RT5645_PLL1_SRC_MASK, RT5645_PLL1_SRC_MCLK);
                break;
        case RT5645_PLL1_S_BCLK1:
        case RT5645_PLL1_S_BCLK2:
                switch (dai->id) {
                case RT5645_AIF1:
-                       snd_soc_update_bits(codec, RT5645_GLB_CLK,
+                       snd_soc_component_update_bits(component, RT5645_GLB_CLK,
                                RT5645_PLL1_SRC_MASK, RT5645_PLL1_SRC_BCLK1);
                        break;
                case  RT5645_AIF2:
-                       snd_soc_update_bits(codec, RT5645_GLB_CLK,
+                       snd_soc_component_update_bits(component, RT5645_GLB_CLK,
                                RT5645_PLL1_SRC_MASK, RT5645_PLL1_SRC_BCLK2);
                        break;
                default:
-                       dev_err(codec->dev, "Invalid dai->id: %d\n", dai->id);
+                       dev_err(component->dev, "Invalid dai->id: %d\n", dai->id);
                        return -EINVAL;
                }
                break;
        default:
-               dev_err(codec->dev, "Unknown PLL source %d\n", source);
+               dev_err(component->dev, "Unknown PLL source %d\n", source);
                return -EINVAL;
        }
 
        ret = rl6231_pll_calc(freq_in, freq_out, &pll_code);
        if (ret < 0) {
-               dev_err(codec->dev, "Unsupport input clock %d\n", freq_in);
+               dev_err(component->dev, "Unsupport input clock %d\n", freq_in);
                return ret;
        }
 
-       dev_dbg(codec->dev, "bypass=%d m=%d n=%d k=%d\n",
+       dev_dbg(component->dev, "bypass=%d m=%d n=%d k=%d\n",
                pll_code.m_bp, (pll_code.m_bp ? 0 : pll_code.m_code),
                pll_code.n_code, pll_code.k_code);
 
-       snd_soc_write(codec, RT5645_PLL_CTRL1,
+       snd_soc_component_write(component, RT5645_PLL_CTRL1,
                pll_code.n_code << RT5645_PLL_N_SFT | pll_code.k_code);
-       snd_soc_write(codec, RT5645_PLL_CTRL2,
+       snd_soc_component_write(component, RT5645_PLL_CTRL2,
                (pll_code.m_bp ? 0 : pll_code.m_code) << RT5645_PLL_M_SFT |
                pll_code.m_bp << RT5645_PLL_M_BP_SFT);
 
 static int rt5645_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
                        unsigned int rx_mask, int slots, int slot_width)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        unsigned int i_slot_sft, o_slot_sft, i_width_sht, o_width_sht, en_sft;
        unsigned int mask, val = 0;
 
        if (rx_mask || tx_mask) {
                val |= (1 << en_sft);
                if (rt5645->codec_type == CODEC_TYPE_RT5645)
-                       snd_soc_update_bits(codec, RT5645_BASS_BACK,
+                       snd_soc_component_update_bits(component, RT5645_BASS_BACK,
                                RT5645_G_BB_BST_MASK, RT5645_G_BB_BST_25DB);
        }
 
                break;
        }
 
-       snd_soc_update_bits(codec, RT5645_TDM_CTRL_1, mask, val);
+       snd_soc_component_update_bits(component, RT5645_TDM_CTRL_1, mask, val);
 
        return 0;
 }
 
-static int rt5645_set_bias_level(struct snd_soc_codec *codec,
+static int rt5645_set_bias_level(struct snd_soc_component *component,
                        enum snd_soc_bias_level level)
 {
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        switch (level) {
        case SND_SOC_BIAS_PREPARE:
-               if (SND_SOC_BIAS_STANDBY == snd_soc_codec_get_bias_level(codec)) {
-                       snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) {
+                       snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                RT5645_PWR_VREF1 | RT5645_PWR_MB |
                                RT5645_PWR_BG | RT5645_PWR_VREF2,
                                RT5645_PWR_VREF1 | RT5645_PWR_MB |
                                RT5645_PWR_BG | RT5645_PWR_VREF2);
                        mdelay(10);
-                       snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+                       snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                RT5645_PWR_FV1 | RT5645_PWR_FV2,
                                RT5645_PWR_FV1 | RT5645_PWR_FV2);
-                       snd_soc_update_bits(codec, RT5645_GEN_CTRL1,
+                       snd_soc_component_update_bits(component, RT5645_GEN_CTRL1,
                                RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL);
                }
                break;
 
        case SND_SOC_BIAS_STANDBY:
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                        RT5645_PWR_VREF1 | RT5645_PWR_MB |
                        RT5645_PWR_BG | RT5645_PWR_VREF2,
                        RT5645_PWR_VREF1 | RT5645_PWR_MB |
                        RT5645_PWR_BG | RT5645_PWR_VREF2);
                mdelay(10);
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                        RT5645_PWR_FV1 | RT5645_PWR_FV2,
                        RT5645_PWR_FV1 | RT5645_PWR_FV2);
-               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) {
-                       snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
+               if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
+                       snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140);
                        msleep(40);
                        if (rt5645->en_button_func)
                                queue_delayed_work(system_power_efficient_wq,
                break;
 
        case SND_SOC_BIAS_OFF:
-               snd_soc_write(codec, RT5645_DEPOP_M2, 0x1100);
+               snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1100);
                if (!rt5645->en_button_func)
-                       snd_soc_update_bits(codec, RT5645_GEN_CTRL1,
+                       snd_soc_component_update_bits(component, RT5645_GEN_CTRL1,
                                        RT5645_DIG_GATE_CTRL, 0);
-               snd_soc_update_bits(codec, RT5645_PWR_ANLG1,
+               snd_soc_component_update_bits(component, RT5645_PWR_ANLG1,
                                RT5645_PWR_VREF1 | RT5645_PWR_MB |
                                RT5645_PWR_BG | RT5645_PWR_VREF2 |
                                RT5645_PWR_FV1 | RT5645_PWR_FV2, 0x0);
        return 0;
 }
 
-static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec,
+static void rt5645_enable_push_button_irq(struct snd_soc_component *component,
        bool enable)
 {
-       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
 
        if (enable) {
                snd_soc_dapm_force_enable_pin(dapm, "ADC L power");
                snd_soc_dapm_force_enable_pin(dapm, "ADC R power");
                snd_soc_dapm_sync(dapm);
 
-               snd_soc_update_bits(codec, RT5650_4BTN_IL_CMD1, 0x3, 0x3);
-               snd_soc_update_bits(codec,
+               snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD1, 0x3, 0x3);
+               snd_soc_component_update_bits(component,
                                        RT5645_INT_IRQ_ST, 0x8, 0x8);
-               snd_soc_update_bits(codec,
+               snd_soc_component_update_bits(component,
                                        RT5650_4BTN_IL_CMD2, 0x8000, 0x8000);
-               snd_soc_read(codec, RT5650_4BTN_IL_CMD1);
+               snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1);
                pr_debug("%s read %x = %x\n", __func__, RT5650_4BTN_IL_CMD1,
-                       snd_soc_read(codec, RT5650_4BTN_IL_CMD1));
+                       snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1));
        } else {
-               snd_soc_update_bits(codec, RT5650_4BTN_IL_CMD2, 0x8000, 0x0);
-               snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x0);
+               snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD2, 0x8000, 0x0);
+               snd_soc_component_update_bits(component, RT5645_INT_IRQ_ST, 0x8, 0x0);
 
                snd_soc_dapm_disable_pin(dapm, "ADC L power");
                snd_soc_dapm_disable_pin(dapm, "ADC R power");
        }
 }
 
-static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
+static int rt5645_jack_detect(struct snd_soc_component *component, int jack_insert)
 {
-       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
        unsigned int val;
 
        if (jack_insert) {
                msleep(600);
                regmap_read(rt5645->regmap, RT5645_IN1_CTRL3, &val);
                val &= 0x7;
-               dev_dbg(codec->dev, "val = %d\n", val);
+               dev_dbg(component->dev, "val = %d\n", val);
 
                if (val == 1 || val == 2) {
                        rt5645->jack_type = SND_JACK_HEADSET;
                        if (rt5645->en_button_func) {
-                               rt5645_enable_push_button_irq(codec, true);
+                               rt5645_enable_push_button_irq(component, true);
                        }
                } else {
                        snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
                        RT5645_CBJ_BST1_EN, 0);
 
                if (rt5645->en_button_func)
-                       rt5645_enable_push_button_irq(codec, false);
+                       rt5645_enable_push_button_irq(component, false);
 
                if (rt5645->pdata.jd_mode == 0)
                        snd_soc_dapm_disable_pin(dapm, "LDO2");
        return rt5645->jack_type;
 }
 
-static int rt5645_button_detect(struct snd_soc_codec *codec)
+static int rt5645_button_detect(struct snd_soc_component *component)
 {
        int btn_type, val;
 
-       val = snd_soc_read(codec, RT5650_4BTN_IL_CMD1);
+       val = snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1);
        pr_debug("val=0x%x\n", val);
        btn_type = val & 0xfff0;
-       snd_soc_write(codec, RT5650_4BTN_IL_CMD1, val);
+       snd_soc_component_write(component, RT5650_4BTN_IL_CMD1, val);
 
        return btn_type;
 }
 
 static irqreturn_t rt5645_irq(int irq, void *data);
 
-int rt5645_set_jack_detect(struct snd_soc_codec *codec,
+int rt5645_set_jack_detect(struct snd_soc_component *component,
        struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack,
        struct snd_soc_jack *btn_jack)
 {
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        rt5645->hp_jack = hp_jack;
        rt5645->mic_jack = mic_jack;
                container_of(work, struct rt5645_priv, jack_detect_work.work);
        int val, btn_type, gpio_state = 0, report = 0;
 
-       if (!rt5645->codec)
+       if (!rt5645->component)
                return;
 
        switch (rt5645->pdata.jd_mode) {
        case 0: /* Not using rt5645 JD */
                if (rt5645->gpiod_hp_det) {
                        gpio_state = gpiod_get_value(rt5645->gpiod_hp_det);
-                       dev_dbg(rt5645->codec->dev, "gpio_state = %d\n",
+                       dev_dbg(rt5645->component->dev, "gpio_state = %d\n",
                                gpio_state);
-                       report = rt5645_jack_detect(rt5645->codec, gpio_state);
+                       report = rt5645_jack_detect(rt5645->component, gpio_state);
                }
                snd_soc_jack_report(rt5645->hp_jack,
                                    report, SND_JACK_HEADPHONE);
                                    report, SND_JACK_MICROPHONE);
                return;
        default: /* read rt5645 jd1_1 status */
-               val = snd_soc_read(rt5645->codec, RT5645_INT_IRQ_ST) & 0x1000;
+               val = snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000;
                break;
 
        }
 
        if (!val && (rt5645->jack_type == 0)) { /* jack in */
-               report = rt5645_jack_detect(rt5645->codec, 1);
+               report = rt5645_jack_detect(rt5645->component, 1);
        } else if (!val && rt5645->jack_type != 0) {
                /* for push button and jack out */
                btn_type = 0;
-               if (snd_soc_read(rt5645->codec, RT5645_INT_IRQ_ST) & 0x4) {
+               if (snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) {
                        /* button pressed */
                        report = SND_JACK_HEADSET;
-                       btn_type = rt5645_button_detect(rt5645->codec);
+                       btn_type = rt5645_button_detect(rt5645->component);
                        /* rt5650 can report three kinds of button behavior,
                           one click, double click and hold. However,
                           currently we will report button pressed/released
                        case 0x0000: /* unpressed */
                                break;
                        default:
-                               dev_err(rt5645->codec->dev,
+                               dev_err(rt5645->component->dev,
                                        "Unexpected button code 0x%04x\n",
                                        btn_type);
                                break;
        } else {
                /* jack out */
                report = 0;
-               snd_soc_update_bits(rt5645->codec,
+               snd_soc_component_update_bits(rt5645->component,
                                    RT5645_INT_IRQ_ST, 0x1, 0x0);
-               rt5645_jack_detect(rt5645->codec, 0);
+               rt5645_jack_detect(rt5645->component, 0);
        }
 
        snd_soc_jack_report(rt5645->hp_jack, report, SND_JACK_HEADPHONE);
                   &rt5645->jack_detect_work, msecs_to_jiffies(5));
 }
 
-static int rt5645_probe(struct snd_soc_codec *codec)
+static int rt5645_probe(struct snd_soc_component *component)
 {
-       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
-       rt5645->codec = codec;
+       rt5645->component = component;
 
        switch (rt5645->codec_type) {
        case CODEC_TYPE_RT5645:
                break;
        }
 
-       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
 
        /* for JD function */
        if (rt5645->pdata.jd_mode) {
        }
 
        if (rt5645->pdata.long_name)
-               codec->component.card->long_name = rt5645->pdata.long_name;
+               component->card->long_name = rt5645->pdata.long_name;
 
-       rt5645->eq_param = devm_kzalloc(codec->dev,
+       rt5645->eq_param = devm_kzalloc(component->dev,
                RT5645_HWEQ_NUM * sizeof(struct rt5645_eq_param_s), GFP_KERNEL);
 
        return 0;
 }
 
-static int rt5645_remove(struct snd_soc_codec *codec)
+static void rt5645_remove(struct snd_soc_component *component)
 {
-       rt5645_reset(codec);
-       return 0;
+       rt5645_reset(component);
 }
 
 #ifdef CONFIG_PM
-static int rt5645_suspend(struct snd_soc_codec *codec)
+static int rt5645_suspend(struct snd_soc_component *component)
 {
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        regcache_cache_only(rt5645->regmap, true);
        regcache_mark_dirty(rt5645->regmap);
        return 0;
 }
 
-static int rt5645_resume(struct snd_soc_codec *codec)
+static int rt5645_resume(struct snd_soc_component *component)
 {
-       struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
+       struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
 
        regcache_cache_only(rt5645->regmap, false);
        regcache_sync(rt5645->regmap);
        },
 };
 
-static const struct snd_soc_codec_driver soc_codec_dev_rt5645 = {
-       .probe = rt5645_probe,
-       .remove = rt5645_remove,
-       .suspend = rt5645_suspend,
-       .resume = rt5645_resume,
-       .set_bias_level = rt5645_set_bias_level,
-       .idle_bias_off = true,
-       .component_driver = {
-               .controls               = rt5645_snd_controls,
-               .num_controls           = ARRAY_SIZE(rt5645_snd_controls),
-               .dapm_widgets           = rt5645_dapm_widgets,
-               .num_dapm_widgets       = ARRAY_SIZE(rt5645_dapm_widgets),
-               .dapm_routes            = rt5645_dapm_routes,
-               .num_dapm_routes        = ARRAY_SIZE(rt5645_dapm_routes),
-       },
+static const struct snd_soc_component_driver soc_component_dev_rt5645 = {
+       .probe                  = rt5645_probe,
+       .remove                 = rt5645_remove,
+       .suspend                = rt5645_suspend,
+       .resume                 = rt5645_resume,
+       .set_bias_level         = rt5645_set_bias_level,
+       .controls               = rt5645_snd_controls,
+       .num_controls           = ARRAY_SIZE(rt5645_snd_controls),
+       .dapm_widgets           = rt5645_dapm_widgets,
+       .num_dapm_widgets       = ARRAY_SIZE(rt5645_dapm_widgets),
+       .dapm_routes            = rt5645_dapm_routes,
+       .num_dapm_routes        = ARRAY_SIZE(rt5645_dapm_routes),
+       .use_pmdown_time        = 1,
+       .endianness             = 1,
+       .non_legacy_dai_naming  = 1,
 };
 
 static const struct regmap_config rt5645_regmap = {
                }
        }
 
-       ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5645,
+       ret = devm_snd_soc_register_component(&i2c->dev, &soc_component_dev_rt5645,
                                     rt5645_dai, ARRAY_SIZE(rt5645_dai));
        if (ret)
                goto err_irq;
        cancel_delayed_work_sync(&rt5645->rcclock_work);
        del_timer_sync(&rt5645->btn_check_timer);
 
-       snd_soc_unregister_codec(&i2c->dev);
        regulator_bulk_disable(ARRAY_SIZE(rt5645->supplies), rt5645->supplies);
 
        return 0;
 
 static int rt5677_dsp_mode_i2c_write_addr(struct rt5677_priv *rt5677,
                unsigned int addr, unsigned int value, unsigned int opcode)
 {
-       struct snd_soc_codec *codec = rt5677->codec;
+       struct snd_soc_component *component = rt5677->component;
        int ret;
 
        mutex_lock(&rt5677->dsp_cmd_lock);
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_ADDR_MSB,
                addr >> 16);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set addr msb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set addr msb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_ADDR_LSB,
                addr & 0xffff);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set addr lsb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set addr lsb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_DATA_MSB,
                value >> 16);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set data msb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set data msb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_DATA_LSB,
                value & 0xffff);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set data lsb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set data lsb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_OP_CODE,
                opcode);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set op code value: %d\n", ret);
+               dev_err(component->dev, "Failed to set op code value: %d\n", ret);
                goto err;
        }
 
 static int rt5677_dsp_mode_i2c_read_addr(
        struct rt5677_priv *rt5677, unsigned int addr, unsigned int *value)
 {
-       struct snd_soc_codec *codec = rt5677->codec;
+       struct snd_soc_component *component = rt5677->component;
        int ret;
        unsigned int msb, lsb;
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_ADDR_MSB,
                addr >> 16);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set addr msb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set addr msb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_ADDR_LSB,
                addr & 0xffff);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set addr lsb value: %d\n", ret);
+               dev_err(component->dev, "Failed to set addr lsb value: %d\n", ret);
                goto err;
        }
 
        ret = regmap_write(rt5677->regmap_physical, RT5677_DSP_I2C_OP_CODE,
                0x0002);
        if (ret < 0) {
-               dev_err(codec->dev, "Failed to set op code value: %d\n", ret);
+               dev_err(component->dev, "Failed to set op code value: %d\n", ret);
                goto err;
        }
 
        return ret;
 }
 
-static void rt5677_set_dsp_mode(struct snd_soc_codec *codec, bool on)
+static void rt5677_set_dsp_mode(struct snd_soc_component *component, bool on)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        if (on) {
                regmap_update_bits(rt5677->regmap, RT5677_PWR_DSP1, 0x2, 0x2);
        }
 }
 
-static int rt5677_set_dsp_vad(struct snd_soc_codec *codec, bool on)
+static int rt5677_set_dsp_vad(struct snd_soc_component *component, bool on)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        static bool activity;
        int ret;
 
                }
                regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x07ff);
                regmap_write(rt5677->regmap, RT5677_PWR_DSP1, 0x07fd);
-               rt5677_set_dsp_mode(codec, true);
+               rt5677_set_dsp_mode(component, true);
 
                ret = request_firmware(&rt5677->fw1, RT5677_FIRMWARE1,
-                       codec->dev);
+                       component->dev);
                if (ret == 0) {
                        rt5677_spi_write_firmware(0x50000000, rt5677->fw1);
                        release_firmware(rt5677->fw1);
                }
 
                ret = request_firmware(&rt5677->fw2, RT5677_FIRMWARE2,
-                       codec->dev);
+                       component->dev);
                if (ret == 0) {
                        rt5677_spi_write_firmware(0x60000000, rt5677->fw2);
                        release_firmware(rt5677->fw2);
                regcache_cache_bypass(rt5677->regmap, true);
 
                regmap_update_bits(rt5677->regmap, RT5677_PWR_DSP1, 0x1, 0x1);
-               rt5677_set_dsp_mode(codec, false);
+               rt5677_set_dsp_mode(component, false);
                regmap_write(rt5677->regmap, RT5677_PWR_DSP1, 0x0001);
 
                regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec);
 {
        struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
        struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
-       struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 
        rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0];
 
-       if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF)
-               rt5677_set_dsp_vad(codec, rt5677->dsp_vad_en);
+       if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF)
+               rt5677_set_dsp_vad(component, rt5677->dsp_vad_en);
 
        return 0;
 }
 static int set_dmic_clk(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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        int idx, rate;
 
        rate = rt5677->sysclk / rl6231_get_pre_div(rt5677->regmap,
                RT5677_CLK_TREE_CTRL1, RT5677_I2S_PD1_SFT);
        idx = rl6231_calc_dmic_clk(rate);
        if (idx < 0)
-               dev_err(codec->dev, "Failed to set DMIC clock\n");
+               dev_err(component->dev, "Failed to set DMIC clock\n");
        else
                regmap_update_bits(rt5677->regmap, RT5677_DMIC_CTRL1,
                        RT5677_DMIC_CLK_MASK, idx << RT5677_DMIC_CLK_SFT);
 static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int val;
 
        regmap_read(rt5677->regmap, RT5677_GLB_CLK1, &val);
 static int is_using_asrc(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int reg, shift, val;
 
        if (source->reg == RT5677_ASRC_1) {
 static int can_use_asrc(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        if (rt5677->sysclk > rt5677->lrck[RT5677_AIF1] * 384)
                return 1;
 
 /**
  * rt5677_sel_asrc_clk_src - select ASRC clock source for a set of filters
- * @codec: SoC audio codec device.
+ * @component: SoC audio component device.
  * @filter_mask: mask of filters.
  * @clk_src: clock source
  *
  * set of filters specified by the mask. And the codec driver will turn on ASRC
  * for these filters if ASRC is selected as their clock source.
  */
-int rt5677_sel_asrc_clk_src(struct snd_soc_codec *codec,
+int rt5677_sel_asrc_clk_src(struct snd_soc_component *component,
                unsigned int filter_mask, unsigned int clk_src)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int asrc3_mask = 0, asrc3_value = 0;
        unsigned int asrc4_mask = 0, asrc4_value = 0;
        unsigned int asrc5_mask = 0, asrc5_value = 0;
 static int rt5677_dmic_use_asrc(struct snd_soc_dapm_widget *source,
                         struct snd_soc_dapm_widget *sink)
 {
-       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int asrc_setting;
 
        switch (source->shift) {
 static int rt5677_bst1_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
 static int rt5677_bst2_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
 static int rt5677_set_pll1_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMU:
 static int rt5677_set_pll2_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMU:
 static int rt5677_set_micbias1_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
 static int rt5677_if1_adc_tdm_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int value;
 
        switch (event) {
 static int rt5677_if2_adc_tdm_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int value;
 
        switch (event) {
 static int rt5677_vref_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 rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
-               if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_ON &&
+               if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON &&
                        !rt5677->is_vref_slow) {
                        mdelay(20);
                        regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
 static int rt5677_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int val_len = 0, val_clk, mask_clk;
        int pre_div, bclk_ms, frame_size;
 
        rt5677->lrck[dai->id] = params_rate(params);
        pre_div = rl6231_get_clk_info(rt5677->sysclk, rt5677->lrck[dai->id]);
        if (pre_div < 0) {
-               dev_err(codec->dev, "Unsupported clock setting: sysclk=%dHz lrck=%dHz\n",
+               dev_err(component->dev, "Unsupported clock setting: sysclk=%dHz lrck=%dHz\n",
                        rt5677->sysclk, rt5677->lrck[dai->id]);
                return -EINVAL;
        }
        frame_size = snd_soc_params_to_frame_size(params);
        if (frame_size < 0) {
-               dev_err(codec->dev, "Unsupported frame size: %d\n", frame_size);
+               dev_err(component->dev, "Unsupported frame size: %d\n", frame_size);
                return -EINVAL;
        }
        bclk_ms = frame_size > 32;
 
 static int rt5677_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int reg_val = 0;
 
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
 static int rt5677_set_dai_sysclk(struct snd_soc_dai *dai,
                int clk_id, unsigned int freq, int dir)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int reg_val = 0;
 
        if (freq == rt5677->sysclk && clk_id == rt5677->sysclk_src)
                reg_val |= RT5677_SCLK_SRC_RCCLK;
                break;
        default:
-               dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id);
+               dev_err(component->dev, "Invalid clock id (%d)\n", clk_id);
                return -EINVAL;
        }
        regmap_update_bits(rt5677->regmap, RT5677_GLB_CLK1,
 static int rt5677_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
                        unsigned int freq_in, unsigned int freq_out)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        struct rl6231_pll_code pll_code;
        int ret;
 
                return 0;
 
        if (!freq_in || !freq_out) {
-               dev_dbg(codec->dev, "PLL disabled\n");
+               dev_dbg(component->dev, "PLL disabled\n");
 
                rt5677->pll_in = 0;
                rt5677->pll_out = 0;
                }
                break;
        default:
-               dev_err(codec->dev, "Unknown PLL source %d\n", source);
+               dev_err(component->dev, "Unknown PLL source %d\n", source);
                return -EINVAL;
        }
 
        ret = rt5677_pll_calc(freq_in, freq_out, &pll_code);
        if (ret < 0) {
-               dev_err(codec->dev, "Unsupport input clock %d\n", freq_in);
+               dev_err(component->dev, "Unsupport input clock %d\n", freq_in);
                return ret;
        }
 
-       dev_dbg(codec->dev, "m_bypass=%d m=%d n=%d k=%d\n",
+       dev_dbg(component->dev, "m_bypass=%d m=%d n=%d k=%d\n",
                pll_code.m_bp, (pll_code.m_bp ? 0 : pll_code.m_code),
                pll_code.n_code, pll_code.k_code);
 
 static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
                        unsigned int rx_mask, int slots, int slot_width)
 {
-       struct snd_soc_codec *codec = dai->codec;
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_component *component = dai->component;
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        unsigned int val = 0, slot_width_25 = 0;
 
        if (rx_mask || tx_mask)
        return 0;
 }
 
-static int rt5677_set_bias_level(struct snd_soc_codec *codec,
+static int rt5677_set_bias_level(struct snd_soc_component *component,
                        enum snd_soc_bias_level level)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        switch (level) {
        case SND_SOC_BIAS_ON:
                break;
 
        case SND_SOC_BIAS_PREPARE:
-               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY) {
-                       rt5677_set_dsp_vad(codec, false);
+               if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) {
+                       rt5677_set_dsp_vad(component, false);
 
                        regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
                                RT5677_LDO1_SEL_MASK | RT5677_LDO2_SEL_MASK,
                        RT5677_PR_BASE + RT5677_BIAS_CUR4, 0x0f00, 0x0000);
 
                if (rt5677->dsp_vad_en)
-                       rt5677_set_dsp_vad(codec, true);
+                       rt5677_set_dsp_vad(component, true);
                break;
 
        default:
 }
 #endif
 
-static int rt5677_probe(struct snd_soc_codec *codec)
+static int rt5677_probe(struct snd_soc_component *component)
 {
-       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
        int i;
 
-       rt5677->codec = codec;
+       rt5677->component = component;
 
        if (rt5677->pdata.dmic2_clk_pin == RT5677_DMIC_CLK2) {
                snd_soc_dapm_add_routes(dapm,
                        ARRAY_SIZE(rt5677_dmic2_clk_1));
        }
 
-       snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
+       snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
 
        regmap_write(rt5677->regmap, RT5677_DIG_MISC, 0x0020);
        regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00);
        return 0;
 }
 
-static int rt5677_remove(struct snd_soc_codec *codec)
+static void rt5677_remove(struct snd_soc_component *component)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec);
        gpiod_set_value_cansleep(rt5677->pow_ldo2, 0);
        gpiod_set_value_cansleep(rt5677->reset_pin, 1);
-
-       return 0;
 }
 
 #ifdef CONFIG_PM
-static int rt5677_suspend(struct snd_soc_codec *codec)
+static int rt5677_suspend(struct snd_soc_component *component)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        if (!rt5677->dsp_vad_en) {
                regcache_cache_only(rt5677->regmap, true);
        return 0;
 }
 
-static int rt5677_resume(struct snd_soc_codec *codec)
+static int rt5677_resume(struct snd_soc_component *component)
 {
-       struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+       struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
        if (!rt5677->dsp_vad_en) {
                rt5677->pll_src = 0;
        },
 };
 
-static const struct snd_soc_codec_driver soc_codec_dev_rt5677 = {
-       .probe = rt5677_probe,
-       .remove = rt5677_remove,
-       .suspend = rt5677_suspend,
-       .resume = rt5677_resume,
-       .set_bias_level = rt5677_set_bias_level,
-       .idle_bias_off = true,
-       .component_driver = {
-               .controls               = rt5677_snd_controls,
-               .num_controls           = ARRAY_SIZE(rt5677_snd_controls),
-               .dapm_widgets           = rt5677_dapm_widgets,
-               .num_dapm_widgets       = ARRAY_SIZE(rt5677_dapm_widgets),
-               .dapm_routes            = rt5677_dapm_routes,
-               .num_dapm_routes        = ARRAY_SIZE(rt5677_dapm_routes),
-       },
+static const struct snd_soc_component_driver soc_component_dev_rt5677 = {
+       .probe                  = rt5677_probe,
+       .remove                 = rt5677_remove,
+       .suspend                = rt5677_suspend,
+       .resume                 = rt5677_resume,
+       .set_bias_level         = rt5677_set_bias_level,
+       .controls               = rt5677_snd_controls,
+       .num_controls           = ARRAY_SIZE(rt5677_snd_controls),
+       .dapm_widgets           = rt5677_dapm_widgets,
+       .num_dapm_widgets       = ARRAY_SIZE(rt5677_dapm_widgets),
+       .dapm_routes            = rt5677_dapm_routes,
+       .num_dapm_routes        = ARRAY_SIZE(rt5677_dapm_routes),
+       .use_pmdown_time        = 1,
+       .endianness             = 1,
+       .non_legacy_dai_naming  = 1,
 };
 
 static const struct regmap_config rt5677_regmap_physical = {
        rt5677_init_gpio(i2c);
        rt5677_init_irq(i2c);
 
-       return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5677,
+       return devm_snd_soc_register_component(&i2c->dev,
+                                     &soc_component_dev_rt5677,
                                      rt5677_dai, ARRAY_SIZE(rt5677_dai));
 }
 
 static int rt5677_i2c_remove(struct i2c_client *i2c)
 {
-       snd_soc_unregister_codec(&i2c->dev);
        rt5677_free_irq(i2c);
        rt5677_free_gpio(i2c);