-#if defined(CONFIG_SPI_MASTER)
-static int es8316_spi_probe(struct spi_device *spi)
-{
- struct es8316_priv *es8316;
- int ret;
-
- es8316 = kzalloc(sizeof(*es8316), GFP_KERNEL);
- if (es8316 == NULL)
- return -ENOMEM;
-
- spi_set_drvdata(spi, es8316);
- ret = snd_soc_register_codec(&spi->dev,
- &soc_codec_dev_es8316,
- &es8316_dai, 1);
- if (ret < 0)
- kfree(es8316);
- return ret;
-}
-
-static int es8316_spi_remove(struct spi_device *spi)
-{
- snd_soc_unregister_codec(&spi->dev);
- kfree(spi_get_drvdata(spi));
- return 0;
-}
-
-static struct spi_driver es8316_spi_driver = {
- .driver = {
- .name = "es8316",
- .owner = THIS_MODULE,
- },
- .probe = es8316_spi_probe,
- .remove = es8316_spi_remove,
-};
-#endif /* CONFIG_SPI_MASTER */
-
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-
-static void es8316_i2c_shutdown(struct i2c_client *i2c)
-{
- struct snd_soc_codec *codec;
- struct es8316_priv *es8316 = es8316_private;
-
- if (!es8316_codec)
- goto err;
-
- es8316_set_gpio(ES8316_CODEC_SET_SPK, !es8316->spk_gpio_level);
- mdelay(150);
-
-
- codec = es8316_codec;
- snd_soc_write(codec, ES8316_CPHP_ICAL_VOL_REG18, 0x33);
- snd_soc_write(codec, ES8316_CPHP_OUTEN_REG17, 0x00);
- snd_soc_write(codec, ES8316_CPHP_LDOCTL_REG1B, 0x03);
- snd_soc_write(codec, ES8316_CPHP_PDN2_REG1A, 0x22);
- snd_soc_write(codec, ES8316_CPHP_PDN1_REG19, 0x06);
- snd_soc_write(codec, ES8316_HPMIX_SWITCH_REG14, 0x00);
- snd_soc_write(codec, ES8316_HPMIX_PDN_REG15, 0x33);
- snd_soc_write(codec, ES8316_HPMIX_VOL_REG16, 0x00);
- snd_soc_write(codec, ES8316_ADC_PDN_LINSEL_REG22, 0xC0);
- snd_soc_write(codec, ES8316_DAC_PDN_REG2F, 0x11);
- snd_soc_write(codec, ES8316_SYS_PDN_REG0D, 0x3F);
- snd_soc_write(codec, ES8316_CLKMGR_CLKSW_REG01, 0x03);
- snd_soc_write(codec, ES8316_RESET_REG00, 0x7F);
-err:
- return;
-}
-
-static int es8316_i2c_probe(struct i2c_client *i2c_client,