Skip to content

Commit

Permalink
ASoC: cs42l51: re-hook of_match_table pointer
Browse files Browse the repository at this point in the history
In commit a1253ef ("ASoC: cs42l51: split i2c from codec driver"),
the I2C part of the CS42L51 was moved to a separate file, but the
definition of the of_device_id array was left in the driver file
itself, no longer connected to the platform_driver structure using the
.of_match_table pointer.

This commit exports the of_device_id array in cs42l51, and uses it as
.of_match_able in cs42l51-i2c.c. This solution was suggested by Brian
Austin.

Fixes: a1253ef ("ASoC: cs42l51: split i2c from codec driver")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
  • Loading branch information
Thomas Petazzoni authored and Mark Brown committed Nov 12, 2014
1 parent f114040 commit 2cb1e02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions sound/soc/codecs/cs42l51-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static struct i2c_driver cs42l51_i2c_driver = {
.driver = {
.name = "cs42l51",
.owner = THIS_MODULE,
.of_match_table = cs42l51_of_match,
},
.probe = cs42l51_i2c_probe,
.remove = cs42l51_i2c_remove,
Expand Down
4 changes: 3 additions & 1 deletion sound/soc/codecs/cs42l51.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,13 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
}
EXPORT_SYMBOL_GPL(cs42l51_probe);

static const struct of_device_id cs42l51_of_match[] = {
const struct of_device_id cs42l51_of_match[] = {
{ .compatible = "cirrus,cs42l51", },
{ }
};
MODULE_DEVICE_TABLE(of, cs42l51_of_match);
EXPORT_SYMBOL_GPL(cs42l51_of_match);

MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("Cirrus Logic CS42L51 ALSA SoC Codec Driver");
MODULE_LICENSE("GPL");
1 change: 1 addition & 0 deletions sound/soc/codecs/cs42l51.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct device;

extern const struct regmap_config cs42l51_regmap;
int cs42l51_probe(struct device *dev, struct regmap *regmap);
extern const struct of_device_id cs42l51_of_match[];

#define CS42L51_CHIP_ID 0x1B
#define CS42L51_CHIP_REV_A 0x00
Expand Down

0 comments on commit 2cb1e02

Please sign in to comment.