Skip to contentSkip to conversation

ASoC: rt5640: Add minimal support for RT5642

PATCH In review Jarkko Nikula 2 participants 2 messages Apr 16, 2014 – Apr 17, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rt5640: Add minimal support for RT5642

We have been using rt5640.c codec driver with RT5642 codec chip before commit 022d21f004c1 ("ASoC: rt5640: add rt5639 support"). That commits starts using device ID reading in reset register for adding device specific controls and routes runtime.

Now since device ID appears to be different between RT5640 and RT5642 the driver doesn't add those controls and routes that are valid also on RT5642.

Fix this by adding a device ID found by debugging and minimal code for supporting RT5642.

---
 sound/soc/codecs/rt5640.c | 2 ++
 sound/soc/codecs/rt5640.h | 1 +
 2 files changed, 3 insertions(+)
sound/soc/codecs/rt5640.c +2 -0
index b947c820697d..ffde5bf11789 100644
@@ -2000,6 +2000,7 @@ static int rt5640_probe(struct snd_soc_codec *codec)
 
 	switch (snd_soc_read(codec, RT5640_RESET)) {
 	case RT5640_RESET_ID:
+	case RT5642_RESET_ID:
 		snd_soc_add_codec_controls(codec,
 			rt5640_specific_snd_controls,
 			ARRAY_SIZE(rt5640_specific_snd_controls));
@@ -2150,6 +2151,7 @@ static const struct regmap_config rt5640_regmap = {
 static const struct i2c_device_id rt5640_i2c_id[] = {
 	{ "rt5640", 0 },
 	{ "rt5639", 0 },
+	{ "rt5642", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id);
sound/soc/codecs/rt5640.h +1 -0
index 3b50459a83b4..d31faeaa637e 100644
@@ -16,6 +16,7 @@
 
 #define RT5639_RESET_ID				0x0008
 #define RT5640_RESET_ID				0x000c
+#define RT5642_RESET_ID				0x0006
 
 /* Info */
 #define RT5640_RESET				0x00
Signature · 1 line
1.9.1
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: Jarkko Nikula [mailto:[email protected]]
Sent: Wednesday, April 16, 2014 9:16 PM
To: [email protected]
Cc: Mark Brown; Oder Chiou; Bard Liao; Liam Girdwood; Jarkko Nikula
Subject: [PATCH] ASoC: rt5640: Add minimal support for RT5642

We have been using rt5640.c codec driver with RT5642 codec chip before commit 022d21f004c1 ("ASoC: rt5640: add rt5639 support"). That commits starts using device ID reading in reset register for adding device specific controls and routes runtime.

Now since device ID appears to be different between RT5640 and RT5642 the driver doesn't add those controls and routes that are valid also on RT5642.

Quoted 8 lines

Fix this by adding a device ID found by debugging and minimal code for supporting RT5642.

#define RT5639_RESET_ID 0x0008
#define RT5640_RESET_ID 0x000c
+#define RT5642_RESET_ID 0x0006

Actually, the device is store in bit 1 and 2. So we need a mask when reading the device ID. I will send another patch for doing it.

Quoted 1 line

------Please consider the environment before printing this e-mail.