summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPetr Kulhavy2016-03-29 09:39:35 +0200
committerMark Brown2016-03-31 02:01:47 +0200
commit630e413dc24da0c2373fd7592aeb0e08cea71cd1 (patch)
tree5a11d9388c76cd8b8a4db5d04733a97fcec8cb2a /sound
parentASoC: tas571x: implemented digital mute (diff)
downloadkernel-qcow2-linux-630e413dc24da0c2373fd7592aeb0e08cea71cd1.tar.gz
kernel-qcow2-linux-630e413dc24da0c2373fd7592aeb0e08cea71cd1.tar.xz
kernel-qcow2-linux-630e413dc24da0c2373fd7592aeb0e08cea71cd1.zip
ASoC: tas571x: chip type detection via I2C name
The chip selection was relying only on DT. It was not possible to use the driver without DT. This adds the chip type detection from the I2C name, which allows to use the driver from the platform driver without DT. Signed-off-by: Petr Kulhavy <petr@barix.com> Reviewed-by: Kevin Cernekee <cernekee@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/tas571x.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c
index d003c6ce0794..aafee9bbe01a 100644
--- a/sound/soc/codecs/tas571x.c
+++ b/sound/soc/codecs/tas571x.c
@@ -404,11 +404,10 @@ static int tas571x_i2c_probe(struct i2c_client *client,
i2c_set_clientdata(client, priv);
of_id = of_match_device(tas571x_of_match, dev);
- if (!of_id) {
- dev_err(dev, "Unknown device type\n");
- return -EINVAL;
- }
- priv->chip = of_id->data;
+ if (of_id)
+ priv->chip = of_id->data;
+ else
+ priv->chip = (void *) id->driver_data;
priv->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {
@@ -505,9 +504,9 @@ static const struct of_device_id tas571x_of_match[] = {
MODULE_DEVICE_TABLE(of, tas571x_of_match);
static const struct i2c_device_id tas571x_i2c_id[] = {
- { "tas5711", 0 },
- { "tas5717", 0 },
- { "tas5719", 0 },
+ { "tas5711", (kernel_ulong_t) &tas5711_chip },
+ { "tas5717", (kernel_ulong_t) &tas5717_chip },
+ { "tas5719", (kernel_ulong_t) &tas5717_chip },
{ }
};
MODULE_DEVICE_TABLE(i2c, tas571x_i2c_id);