Commit 34aa7e1c authored by Mark A. Greer's avatar Mark A. Greer Committed by Greg Kroah-Hartman
Browse files

greybus: gb-audio: Clean up codec name generation



Instead of using the fixed suffix, '6-001b', in the
codec name, generate it from the I2S adapter number
and I2C address of the codec.

Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
Acked-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 555a0645
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@
#define GB_AUDIO_DATA_DRIVER_NAME		"gb_audio_data"
#define GB_AUDIO_MGMT_DRIVER_NAME		"gb_audio_mgmt"

#define RT5647_I2C_ADAPTER_NR			6
#define RT5647_I2C_ADDR				0x1b

/*
 * gb_snd management functions
 */
@@ -111,7 +114,8 @@ static struct asoc_simple_card_info *setup_card_info(int device_count)
#endif
#if USE_RT5645
	obj->card_info.daifmt		= GB_FMTS;
	sprintf(obj->codec_name, "rt5645.%s", "6-001b"); /* XXX do i2c bus addr dynamically */
	sprintf(obj->codec_name, "rt5645.%d-%04x", RT5647_I2C_ADAPTER_NR,
		RT5647_I2C_ADDR);
	obj->card_info.codec_dai.name	= "rt5645-aif1";
	obj->card_info.codec_dai.fmt	= SND_SOC_DAIFMT_CBM_CFM;
	obj->card_info.codec_dai.sysclk	= 12288000;
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@

#define CONFIG_COUNT_MAX			20
#define CONFIG_I2S_REMOTE_DATA_CPORT		7 /* XXX shouldn't be hardcoded...*/
#define RT5647_SLAVE_ADDR			0x1b /* from toshiba/quanta code */

/* Switch between dummy spdif and jetson rt5645 codec */
#define USE_RT5645				0