Skip to contentSkip to conversation

ASoC: Add support for MAX98089 CODEC

PATCH Applied Jesse Marroquin 3 participants 3 messages Nov 17, 2010 – Nov 18, 2010

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

PATCH 1/1 ASoC: Add support for MAX98089 CODEC

This patch adds initial support for the MAX98089 CODEC.

---
 sound/soc/codecs/max98088.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
sound/soc/codecs/max98088.c +10 -1
index ef06007..9c32237 100644
@@ -28,6 +28,11 @@
 #include <sound/max98088.h>
 #include "max98088.h"
 
+enum max98088_type {
+       MAX98088,
+       MAX98089,
+};
+
 struct max98088_cdata {
        unsigned int rate;
        unsigned int fmt;
@@ -36,6 +41,7 @@ struct max98088_cdata {
 
 struct max98088_priv {
        u8 reg_cache[M98088_REG_CNT];
+       enum max98088_type devtype;
        void *control_data;
        struct max98088_pdata *pdata;
        unsigned int sysclk;
@@ -2042,6 +2048,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
        if (max98088 == NULL)
                return -ENOMEM;
 
+       max98088->devtype = id->driver_data;
+
        i2c_set_clientdata(i2c, max98088);
        max98088->control_data = i2c;
        max98088->pdata = i2c->dev.platform_data;
@@ -2061,7 +2069,8 @@ static int __devexit max98088_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id max98088_i2c_id[] = {
-       { "max98088", 0 },
+       { "max98088", MAX98088 },
+       { "max98089", MAX98089 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, max98088_i2c_id);
Signature · 1 line
1.5.6.5
Applied
#2 lore raw
In reply to Jesse Marroquin
Quoted 1 line · Jesse Marroquin

This patch adds initial support for the MAX98089 CODEC.

Applied, thanks. One thing:

Quoted 3 lines
 struct max98088_priv {
        u8 reg_cache[M98088_REG_CNT];

+ enum max98088_type devtype;

You currently never actually read the devtype anywhere - if the devices really are fully register compatible (eg, if the differences are in physical or electrical characteristics which aren't visible to software) then there's no need to bother doing this, though equally well it does no harm.