Skip to content

Commit

Permalink
usb: phy: isp1301: Add OF device ID table
Browse files Browse the repository at this point in the history
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Javier Martinez Canillas authored and Greg Kroah-Hartman committed Mar 9, 2017
1 parent 85550f9 commit fd56765
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/phy/phy-isp1301.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ static const struct i2c_device_id isp1301_id[] = {
};
MODULE_DEVICE_TABLE(i2c, isp1301_id);

static const struct of_device_id isp1301_of_match[] = {
{.compatible = "nxp,isp1301" },
{ },
};
MODULE_DEVICE_TABLE(of, isp1301_of_match);

static struct i2c_client *isp1301_i2c_client;

static int __isp1301_write(struct isp1301 *isp, u8 reg, u8 value, u8 clear)
Expand Down Expand Up @@ -130,6 +136,7 @@ static int isp1301_remove(struct i2c_client *client)
static struct i2c_driver isp1301_driver = {
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(isp1301_of_match),
},
.probe = isp1301_probe,
.remove = isp1301_remove,
Expand Down

0 comments on commit fd56765

Please sign in to comment.