Skip to contentSkip to conversation

ASoC: Support TI Isabelle Audio driver

PATCH RESEND Superseded [email protected] 2 participants 6 messages May 29, 2012 – Jun 1, 2012

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH RESEND 1/1 ASoC: Support TI Isabelle Audio driver

From: M R Swami Reddy <[email protected]>

ASoC: Support TI ISABELLE Audio driver

The Isabelle Audio IC is a complete low power high fidelity CODEC with integrated ADCs, DACs, decimation and interpolation filters, PLL, and power providers. This device supports 2 analog and 2 digital microphone channels, a mono earpiece driver, stereo class G headphone drivers with ultra low power and best SNR in the industry, stereo Class D speaker drivers, and 2 high performance Line drivers.

The below patch is a basic driver code for TI Isabelle audio codec. The functionalities like headset detection, etc., will be included incrementally in the up-coming patches.

---
 sound/soc/codecs/Kconfig    |    4 +
 sound/soc/codecs/Makefile   |    2 +
 sound/soc/codecs/isabelle.c | 1262 ++++++++++++++++++++++++++++++++++
 sound/soc/codecs/isabelle.h |  143 ++++
 4 files changed, 1411 insertions(+), 0 deletions(-)
sound/soc/codecs/Kconfig +4 -0
index ed5f66c..4ebf9e8 100644
@@ -30,6 +30,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CX20442
 	select SND_SOC_DA7210 if I2C
 	select SND_SOC_DFBMCS320
+	select SND_SOC_ISABELLE if I2C
 	select SND_SOC_JZ4740_CODEC if SOC_JZ4740
 	select SND_SOC_LM4857 if I2C
 	select SND_SOC_LM49453 if I2C
@@ -185,6 +186,9 @@ config SND_SOC_DFBMCS320
 config SND_SOC_DMIC
 	tristate
 
+config SND_SOC_ISABELLE
+        tristate
+
 config SND_SOC_LM49453
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 7bbfdb2..fdc1ff6 100644
@@ -17,6 +17,7 @@ snd-soc-cx20442-objs := cx20442.o
 snd-soc-da7210-objs := da7210.o
 snd-soc-dfbmcs320-objs := dfbmcs320.o
 snd-soc-dmic-objs := dmic.o
+snd-soc-isabelle-objs := isabelle.o
 snd-soc-l3-objs := l3.o
 snd-soc-lm49453-objs := lm49453.o
 snd-soc-max98088-objs := max98088.o
@@ -106,6 +107,7 @@ obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
 obj-$(CONFIG_SND_SOC_DFBMCS320)	+= snd-soc-dfbmcs320.o
 obj-$(CONFIG_SND_SOC_DMIC)	+= snd-soc-dmic.o
+obj-$(CONFIG_SND_SOC_ISABELLE)	+= snd-soc-isabelle.o
 obj-$(CONFIG_SND_SOC_L3)	+= snd-soc-l3.o
 obj-$(CONFIG_SND_SOC_LM49453)   += snd-soc-lm49453.o
 obj-$(CONFIG_SND_SOC_JZ4740_CODEC)	+= snd-soc-jz4740-codec.o
sound/soc/codecs/isabelle.c new file +1262 -0

1,262 lines not on this page · raw message

sound/soc/codecs/isabelle.h new file +143 -0

143 lines not on this page · raw message

#1 lore raw
Quoted 3 lines · On Tue, May 29, 2012 at 04:39:46PM +0530, [email protected] wrote:

he below patch is a basic driver code for TI Isabelle audio codec. The functionalities like headset detection, etc., will be included incrementally in the up-coming patches.

Overall this is very good, there's a few issues below but they're pretty minor and ought to be easy to fix.

Quoted 1 line

You should include signoffs from both of you - it's especailly important that whoever sends the mail signs it off from a legal point of view.

sound/soc/codecs/isabelle.c line 143

Quoted 4 lines
sound/soc/codecs/isabelle.c new file +4 -0
+/* codec private data */
+struct isabelle_priv {
+	struct regmap *regmap;
+};

If this is all you need then you should be able to use the newly introduced dev_get_regmap() to get the regmap back (other drivers should be being updated for this soon).

sound/soc/codecs/isabelle.c line 349

Quoted 5 lines
sound/soc/codecs/isabelle.c new file +5 -0
+/*
+ * MICGAIN volume control:
+ * from 0 to 30 dB in 1 dB steps
+ */
+static const DECLARE_TLV_DB_SCALE(mic_amp_tlv, 0, 100, 0);

These comments are a bit on the verbose side...

sound/soc/codecs/isabelle.c line 938

Quoted 3 lines
sound/soc/codecs/isabelle.c new file +3 -0
+       case SND_SOC_BIAS_STANDBY:
+               if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
+                       regcache_sync(isabelle->regmap);

Nothing ever marks the cache as dirty so this'll never actually do anything.

sound/soc/codecs/isabelle.c line 1141

Quoted 4 lines
sound/soc/codecs/isabelle.c new file +4 -0
+static int isabelle_resume(struct snd_soc_codec *codec)
+{
+	isabelle_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+	isabelle_set_bias_level(codec, codec->dapm.suspend_bias_level);

As with your previous driver there's no need to use suspend_bias_level the framework will ensure that you're in your idle state before it suspends. Indeed, since your driver sets idle_bias_off there's no need for these suspend and resume functions at all except possibly to invalidate the cache in the suspend.

sound/soc/codecs/isabelle.c line 1171

Quoted 5 lines
sound/soc/codecs/isabelle.c new file +5 -0
+static int isabelle_remove(struct snd_soc_codec *codec)
+{
+	isabelle_set_bias_level(codec, SND_SOC_BIAS_OFF);
+	return 0;
+}

No need for this, your driver sets idle_bias_off so it'll be powered down before the driver is removed.

sound/soc/codecs/isabelle.c line 1213

Quoted 2 lines
sound/soc/codecs/isabelle.c new file +2 -0
+	isabelle->regmap = regmap_init_i2c(i2c, &isabelle_regmap_config);
+	if (IS_ERR(isabelle->regmap)) {

devm_regmap_init_i2c().

sound/soc/codecs/isabelle.c line 1245

Quoted 5 lines
sound/soc/codecs/isabelle.c new file +5 -0
+static const struct i2c_device_id isabelle_i2c_id[] = {
+	{ "isabelle", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id);

This should really include a list of part numbers - the general expecation people have is that they can just register the part number.

author maintainer
#2 lore raw

Hi Mark,

Quoted 7 lines · Mark Brown
Quoted 3 lines · On Tue, May 29, 2012 at 04:39:46PM +0530, [email protected] wrote:

he below patch is a basic driver code for TI Isabelle audio codec. The functionalities like headset detection, etc., will be included incrementally in the up-coming patches.

Overall this is very good, there's a few issues below but they're pretty minor and ought to be easy to fix.

Thanks for quick review. I will fix these minor issues and update the patch.

Quoted 8 lines

sound/soc/codecs/isabelle.c line 143

Quoted 4 lines
sound/soc/codecs/isabelle.c new file +4 -0
+/* codec private data */
+struct isabelle_priv {
+	struct regmap *regmap;
+};

If this is all you need then you should be able to use the newly introduced dev_get_regmap() to get the regmap back (other drivers should be being updated for this soon).

The dev_get_regmap() is not found in the 'for-next' or '3.5' branch. So this api can't be used with 'for-next' source base. Please advice.

Quoted 7 lines

sound/soc/codecs/isabelle.c line 1245

Quoted 5 lines
sound/soc/codecs/isabelle.c new file +5 -0
+static const struct i2c_device_id isabelle_i2c_id[] = {
+	{ "isabelle", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id);

This should really include a list of part numbers - the general expecation people have is that they can just register the part number.

This audio codec has been referred as 'isabelle' in datasheet and no specific part number.

Thanks
Swami

#3 lore raw
Quoted 8 lines · MR Swami Reddy
Quoted 3 lines · Mark Brown

If this is all you need then you should be able to use the newly introduced dev_get_regmap() to get the regmap back (other drivers should be being updated for this soon).

The dev_get_regmap() is not found in the 'for-next' or '3.5' branch. So this api can't be used with 'for-next' source base. Please advice.

It's in Linus' tree so it'll be in for-3.6 just as soon as the merge window is open. While the merge window is still open we don't update anything in for-next except for bug fixes but once the merge window closes I'll rebase for-3.6 onto -rc1 and add that into for-next.

Quoted 5 lines
Quoted 2 lines

This should really include a list of part numbers - the general expecation people have is that they can just register the part number.

This audio codec has been referred as 'isabelle' in datasheet and no specific part number.

OK, no problem - that's just a bit unusual.

author maintainer
#4 lore raw
Quoted 5 lines · Mark Brown
Quoted 4 lines · MR Swami Reddy
Quoted 3 lines · Mark Brown

If this is all you need then you should be able to use the newly introduced dev_get_regmap() to get the regmap back (other drivers should be being updated for this soon).

Quoted 7 lines
Quoted 2 lines

The dev_get_regmap() is not found in the 'for-next' or '3.5' branch. So this api can't be used with 'for-next' source base. Please advice.

It's in Linus' tree so it'll be in for-3.6 just as soon as the merge window is open. While the merge window is still open we don't update anything in for-next except for bug fixes but once the merge window closes I'll rebase for-3.6 onto -rc1 and add that into for-next.

Is it OK, if Ithe 'dev_get_regmap()' api will be included in the patch, after its merged into 'for-next' branch?

Thanks
Swami

#5 lore raw
Quoted 2 lines · MR Swami Reddy

Is it OK, if Ithe 'dev_get_regmap()' api will be included in the patch, after its merged into 'for-next' branch?

If you send it now then by the time it appears in for-next the dependency will be there, for test you can always grab the commit from Linus' tree.