提交 a1cbf338 编写于 作者: P Peter Rosin

i2c: pca9541: add device tree binding

No longer rely on the implicit matching with the i2c device name, use
an explicit compatible string instead.
Reviewed-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NPeter Rosin <peda@axentia.se>
上级 40839590
...@@ -85,6 +85,13 @@ static const struct i2c_device_id pca9541_id[] = { ...@@ -85,6 +85,13 @@ static const struct i2c_device_id pca9541_id[] = {
MODULE_DEVICE_TABLE(i2c, pca9541_id); MODULE_DEVICE_TABLE(i2c, pca9541_id);
#ifdef CONFIG_OF
static const struct of_device_id pca9541_of_match[] = {
{ .compatible = "nxp,pca9541" },
{}
};
#endif
/* /*
* Write to chip register. Don't use i2c_transfer()/i2c_smbus_xfer() * Write to chip register. Don't use i2c_transfer()/i2c_smbus_xfer()
* as they will try to lock the adapter a second time. * as they will try to lock the adapter a second time.
...@@ -383,6 +390,7 @@ static int pca9541_remove(struct i2c_client *client) ...@@ -383,6 +390,7 @@ static int pca9541_remove(struct i2c_client *client)
static struct i2c_driver pca9541_driver = { static struct i2c_driver pca9541_driver = {
.driver = { .driver = {
.name = "pca9541", .name = "pca9541",
.of_match_table = of_match_ptr(pca9541_of_match),
}, },
.probe = pca9541_probe, .probe = pca9541_probe,
.remove = pca9541_remove, .remove = pca9541_remove,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册