summaryrefslogtreecommitdiff
path: root/drivers/sound/max98095.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sound/max98095.c')
-rw-r--r--drivers/sound/max98095.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/drivers/sound/max98095.c b/drivers/sound/max98095.c
index e9bf64f82f..93be50c34a 100644
--- a/drivers/sound/max98095.c
+++ b/drivers/sound/max98095.c
@@ -432,84 +432,6 @@ static int max98095_do_init(struct maxim_priv *priv,
return ret;
}
-#ifndef CONFIG_DM_SOUND
-static int get_max98095_codec_values(struct sound_codec_info *pcodec_info,
- const void *blob)
-{
- int error = 0;
- enum fdt_compat_id compat;
- int node;
- int parent;
-
- /* Get the node from FDT for codec */
- node = fdtdec_next_compatible(blob, 0, COMPAT_MAXIM_98095_CODEC);
- if (node <= 0) {
- debug("EXYNOS_SOUND: No node for codec in device tree\n");
- debug("node = %d\n", node);
- return -1;
- }
-
- parent = fdt_parent_offset(blob, node);
- if (parent < 0) {
- debug("%s: Cannot find node parent\n", __func__);
- return -1;
- }
-
- compat = fdtdec_lookup(blob, parent);
- switch (compat) {
- case COMPAT_SAMSUNG_S3C2440_I2C:
- pcodec_info->i2c_bus = i2c_get_bus_num_fdt(parent);
- error |= pcodec_info->i2c_bus;
- debug("i2c bus = %d\n", pcodec_info->i2c_bus);
- pcodec_info->i2c_dev_addr = fdtdec_get_int(blob, node,
- "reg", 0);
- error |= pcodec_info->i2c_dev_addr;
- debug("i2c dev addr = %x\n", pcodec_info->i2c_dev_addr);
- break;
- default:
- debug("%s: Unknown compat id %d\n", __func__, compat);
- return -1;
- }
- if (error == -1) {
- debug("fail to get max98095 codec node properties\n");
- return -1;
- }
-
- return 0;
-}
-
-/* max98095 Device Initialisation */
-int max98095_init(const void *blob, enum en_max_audio_interface aif_id,
- int sampling_rate, int mclk_freq,
- int bits_per_sample)
-{
- int ret;
- int old_bus = i2c_get_bus_num();
- struct sound_codec_info pcodec_info;
- struct max98095_priv max98095_info;
-
- if (get_max98095_codec_values(&pcodec_info, blob) < 0) {
- debug("FDT Codec values failed\n");
- return -1;
- }
-
- i2c_set_bus_num(pcodec_info.i2c_bus);
-
- max98095_info.i2c_addr = pcodec_info.i2c_dev_addr;
- ret = max98095_device_init(&max98095_info);
- if (ret < 0) {
- debug("%s: max98095 codec chip init failed\n", __func__);
- return ret;
- }
-
- ret = max98095_do_init(&max98095_info, aif_id, sampling_rate, mclk_freq,
- bits_per_sample);
- i2c_set_bus_num(old_bus);
-
- return ret;
-}
-#endif
-
static int max98095_set_params(struct udevice *dev, int interface, int rate,
int mclk_freq, int bits_per_sample,
uint channels)