From 48229e592f95b4d0071f7711bd4c0e54104724e4 Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Thu, 21 May 2015 15:57:02 -0700 Subject: [PATCH] greybus: gb-audio: Activate TX connection Bundle CPort ID Currently, the audio driver activates & deactivates a predefined CPort ID but that can vary depending on the manifest data of the module. Instead, use the TX connection's Bundle CPort ID which contains the correct CPort ID. Signed-off-by: Mark A. Greer Acked-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio-pcm.c | 6 +++--- drivers/staging/greybus/audio.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/audio-pcm.c b/drivers/staging/greybus/audio-pcm.c index 8eb803a7a40a..30030f8d3c22 100644 --- a/drivers/staging/greybus/audio-pcm.c +++ b/drivers/staging/greybus/audio-pcm.c @@ -42,8 +42,8 @@ static void gb_pcm_work(struct work_struct *work) if (!atomic_read(&snd_dev->running)) { if (snd_dev->cport_active) { ret = gb_i2s_mgmt_deactivate_cport( - snd_dev->mgmt_connection, - CONFIG_I2S_REMOTE_DATA_CPORT); + snd_dev->mgmt_connection, + snd_dev->i2s_tx_connection->bundle_cport_id); if (ret) /* XXX Do what else with failure? */ pr_err("deactivate_cport failed: %d\n", ret); @@ -53,7 +53,7 @@ static void gb_pcm_work(struct work_struct *work) return; } else if (!snd_dev->cport_active) { ret = gb_i2s_mgmt_activate_cport(snd_dev->mgmt_connection, - CONFIG_I2S_REMOTE_DATA_CPORT); + snd_dev->i2s_tx_connection->bundle_cport_id); if (ret) pr_err("activate_cport failed: %d\n", ret); diff --git a/drivers/staging/greybus/audio.h b/drivers/staging/greybus/audio.h index 50a9ebb6612e..012c69a3ed83 100644 --- a/drivers/staging/greybus/audio.h +++ b/drivers/staging/greybus/audio.h @@ -22,7 +22,6 @@ #define CONFIG_PERIOD_NS 1000000 /* send msg every 1ms */ #define CONFIG_COUNT_MAX 20 -#define CONFIG_I2S_REMOTE_DATA_CPORT 7 /* XXX shouldn't be hardcoded...*/ /* Switch between dummy spdif and jetson rt5645 codec */ #define USE_RT5645 0 -- 2.39.5