Skip to content

Commit

Permalink
ASoC: sgtl5000: add device tree probe support
Browse files Browse the repository at this point in the history
It adds device tree probe support for sgtl5000 driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Shawn Guo authored and Mark Brown committed Jul 29, 2011
1 parent a7f96e4 commit 58e4942
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* Freescale SGTL5000 Stereo Codec

Required properties:
- compatible : "fsl,sgtl5000".

Example:

codec: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
};
8 changes: 8 additions & 0 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/consumer.h>
#include <linux/of_device.h>
#include <sound/core.h>
#include <sound/tlv.h>
#include <sound/pcm.h>
Expand Down Expand Up @@ -1494,10 +1495,17 @@ static const struct i2c_device_id sgtl5000_id[] = {

MODULE_DEVICE_TABLE(i2c, sgtl5000_id);

static const struct of_device_id sgtl5000_dt_ids[] = {
{ .compatible = "fsl,sgtl5000", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, sgtl5000_dt_ids);

static struct i2c_driver sgtl5000_i2c_driver = {
.driver = {
.name = "sgtl5000",
.owner = THIS_MODULE,
.of_match_table = sgtl5000_dt_ids,
},
.probe = sgtl5000_i2c_probe,
.remove = __devexit_p(sgtl5000_i2c_remove),
Expand Down

0 comments on commit 58e4942

Please sign in to comment.