#include "greybus.h"
#include "audio.h"
-#define GB_I2S_MGMT_VERSION_MAJOR 0x00
-#define GB_I2S_MGMT_VERSION_MINOR 0x01
-
-#define GB_I2S_DATA_VERSION_MAJOR 0x00
-#define GB_I2S_DATA_VERSION_MINOR 0x01
-
/***********************************
* GB I2S helper functions
***********************************/
-int gb_i2s_mgmt_get_version(struct gb_connection *connection)
-{
- struct gb_protocol_version_response response;
-
- memset(&response, 0, sizeof(response));
- return gb_protocol_get_version(connection,
- GB_I2S_MGMT_TYPE_PROTOCOL_VERSION,
- NULL, 0, &response,
- GB_I2S_MGMT_VERSION_MAJOR);
-}
-
-int gb_i2s_data_get_version(struct gb_connection *connection)
-{
- struct gb_protocol_version_response response;
-
- memset(&response, 0, sizeof(response));
- return gb_protocol_get_version(connection,
- GB_I2S_DATA_TYPE_PROTOCOL_VERSION,
- NULL, 0, &response,
- GB_I2S_DATA_VERSION_MAJOR);
-}
-
int gb_i2s_mgmt_activate_cport(struct gb_connection *connection,
uint16_t cport)
{
goto out_card;
}
- ret = gb_i2s_data_get_version(connection);
- if (ret) {
- pr_err("i2s data get_version() failed: %d\n", ret);
- goto out_get_ver;
- }
-
#if USE_RT5645
rt5647_info.addr = RT5647_I2C_ADDR;
strlcpy(rt5647_info.type, "rt5647", I2C_NAME_SIZE);
return 0;
+#if USE_RT5645
out_get_ver:
platform_device_unregister(&snd_dev->card);
+#endif
out_card:
platform_device_unregister(&snd_dev->cpu_dai);
out_dai:
connection->private = snd_dev;
spin_unlock_irqrestore(&snd_dev->lock, flags);
- ret = gb_i2s_mgmt_get_version(connection);
- if (ret) {
- pr_err("i2s mgmt get_version() failed: %d\n", ret);
- goto err_free_snd_dev;
- }
-
ret = gb_i2s_mgmt_get_cfgs(snd_dev, connection);
if (ret) {
pr_err("can't get i2s configurations: %d\n", ret);
/*
* GB I2S cmd functions
*/
-int gb_i2s_mgmt_get_version(struct gb_connection *connection);
-int gb_i2s_data_get_version(struct gb_connection *connection);
int gb_i2s_mgmt_activate_cport(struct gb_connection *connection,
uint16_t cport);
int gb_i2s_mgmt_deactivate_cport(struct gb_connection *connection,