Skip to content

Commit

Permalink
ASoC: ssm2518: Add explicit device tree support
Browse files Browse the repository at this point in the history
Add OF match table to SSM2518 to allow direct matching without going
through I2C subsystem.

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Ricard Wanderlof authored and Mark Brown committed Aug 15, 2015
1 parent 1c07a4d commit 601e457
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/soc/codecs/ssm2518.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,14 @@ static int ssm2518_i2c_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id ssm2518_dt_ids[] = {
{ .compatible = "adi,ssm2518", },
{ }
};
MODULE_DEVICE_TABLE(of, ssm2518_dt_ids);
#endif

static const struct i2c_device_id ssm2518_i2c_ids[] = {
{ "ssm2518", 0 },
{ }
Expand All @@ -815,6 +823,7 @@ MODULE_DEVICE_TABLE(i2c, ssm2518_i2c_ids);
static struct i2c_driver ssm2518_driver = {
.driver = {
.name = "ssm2518",
.of_match_table = of_match_ptr(ssm2518_dt_ids),
},
.probe = ssm2518_i2c_probe,
.remove = ssm2518_i2c_remove,
Expand Down

0 comments on commit 601e457

Please sign in to comment.