#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/workqueue.h>
-#include <linux/i2c.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
struct gb_snd *snd_dev;
struct platform_device *codec, *dai;
struct asoc_simple_card_info *simple_card;
+#if USE_RT5645
+ struct i2c_board_info rt5647_info;
+#endif
unsigned long flags;
int ret;
goto out_get_ver;
}
+#if USE_RT5645
+ rt5647_info.addr = RT5647_I2C_ADDR;
+ strlcpy(rt5647_info.type, "rt5647", I2C_NAME_SIZE);
+
+ snd_dev->rt5647 = i2c_new_device(i2c_get_adapter(RT5647_I2C_ADAPTER_NR),
+ &rt5647_info);
+ if (!snd_dev->rt5647) {
+ pr_err("can't create rt5647 i2c device\n");
+ goto out_get_ver;
+ }
+#endif
+
return 0;
out_get_ver:
snd_dev = (struct gb_snd *)connection->private;
+#if USE_RT5645
+ i2c_unregister_device(snd_dev->rt5647);
+#endif
+
platform_device_unregister(&snd_dev->card);
platform_device_unregister(&snd_dev->cpu_dai);
platform_device_unregister(snd_dev->codec);
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <sound/soc.h>
#include "greybus.h"
struct platform_device cpu_dai;
struct platform_device *codec;
struct asoc_simple_card_info *simple_card_info;
+ struct i2c_client *rt5647;
struct gb_connection *mgmt_connection;
struct gb_connection *i2s_tx_connection;
struct gb_connection *i2s_rx_connection;