]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/rt298.c
Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', 'asoc/topic...
[karo-tx-linux.git] / sound / soc / codecs / rt298.c
index 603e9334b971349ea6e98ee6e1115167abb45358..b3f795c60749b8f8473184f0872329d4578b8e48 100644 (file)
@@ -48,7 +48,7 @@ struct rt298_priv {
        int is_hp_in;
 };
 
-static struct reg_default rt298_index_def[] = {
+static const struct reg_default rt298_index_def[] = {
        { 0x01, 0xa5a8 },
        { 0x02, 0x8e95 },
        { 0x03, 0x0002 },
@@ -128,7 +128,7 @@ static bool rt298_volatile_register(struct device *dev, unsigned int reg)
        case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0):
                return true;
        default:
-               return true;
+               return false;
        }
 
 
@@ -1164,7 +1164,11 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
                return -ENODEV;
        }
 
-       rt298->index_cache = rt298_index_def;
+       rt298->index_cache = devm_kmemdup(&i2c->dev, rt298_index_def,
+                                         sizeof(rt298_index_def), GFP_KERNEL);
+       if (!rt298->index_cache)
+               return -ENOMEM;
+
        rt298->index_cache_size = INDEX_CACHE_SIZE;
        rt298->i2c = i2c;
        i2c_set_clientdata(i2c, rt298);