projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', 'asoc/topic...
[firefly-linux-kernel-4.4.55.git]
/
sound
/
soc
/
codecs
/
rt298.c
diff --git
a/sound/soc/codecs/rt298.c
b/sound/soc/codecs/rt298.c
index 603e9334b971349ea6e98ee6e1115167abb45358..b3f795c60749b8f8473184f0872329d4578b8e48 100644
(file)
--- a/
sound/soc/codecs/rt298.c
+++ b/
sound/soc/codecs/rt298.c
@@
-48,7
+48,7
@@
struct rt298_priv {
int is_hp_in;
};
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 },
{ 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:
case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0):
return true;
default:
- return
tru
e;
+ return
fals
e;
}
}
@@
-1164,7
+1164,11
@@
static int rt298_i2c_probe(struct i2c_client *i2c,
return -ENODEV;
}
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);
rt298->index_cache_size = INDEX_CACHE_SIZE;
rt298->i2c = i2c;
i2c_set_clientdata(i2c, rt298);