diff options
author | Jiri Kosina <jkosina@suse.cz> | 2018-01-31 16:23:47 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-01-31 16:23:47 +0100 |
commit | e56236b0b27fb7c0e044ba578713ea91ede0c237 (patch) | |
tree | 72e895a313cc034bffbd0e21fbe915b1ac193c0b /drivers | |
parent | 740c84eec79ad7c53e1fdb4cf54af9e7170dd825 (diff) | |
parent | 847989e548ee76f06fd51b61c1fb887d1e86a239 (diff) | |
download | linux-e56236b0b27fb7c0e044ba578713ea91ede0c237.tar.bz2 |
Merge branch 'for-4.16/i2c-hid' into for-linus
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index e054ee43c1e2..7230243b94d3 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -934,11 +934,6 @@ static int i2c_hid_of_probe(struct i2c_client *client, } pdata->hid_descriptor_address = val; - ret = of_property_read_u32(dev->of_node, "post-power-on-delay-ms", - &val); - if (!ret) - pdata->post_power_delay_ms = val; - return 0; } @@ -955,6 +950,16 @@ static inline int i2c_hid_of_probe(struct i2c_client *client, } #endif +static void i2c_hid_fwnode_probe(struct i2c_client *client, + struct i2c_hid_platform_data *pdata) +{ + u32 val; + + if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms", + &val)) + pdata->post_power_delay_ms = val; +} + static int i2c_hid_probe(struct i2c_client *client, const struct i2c_device_id *dev_id) { @@ -998,6 +1003,9 @@ static int i2c_hid_probe(struct i2c_client *client, ihid->pdata = *platform_data; } + /* Parse platform agnostic common properties from ACPI / device tree */ + i2c_hid_fwnode_probe(client, &ihid->pdata); + ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd"); if (IS_ERR(ihid->pdata.supply)) { ret = PTR_ERR(ihid->pdata.supply); |