Skip to content

Commit e56236b

Browse files
author
Jiri Kosina
committed
Merge branch 'for-4.16/i2c-hid' into for-linus
2 parents 740c84e + 847989e commit e56236b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

Documentation/devicetree/bindings/input/hid-over-i2c.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ device-specific compatible properties, which should be used in addition to the
3131

3232
- vdd-supply: phandle of the regulator that provides the supply voltage.
3333
- post-power-on-delay-ms: time required by the device after enabling its regulators
34-
before it is ready for communication. Must be used with 'vdd-supply'.
34+
or powering it on, before it is ready for communication.
3535

3636
Example:
3737

drivers/hid/i2c-hid/i2c-hid.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,6 @@ static int i2c_hid_of_probe(struct i2c_client *client,
934934
}
935935
pdata->hid_descriptor_address = val;
936936

937-
ret = of_property_read_u32(dev->of_node, "post-power-on-delay-ms",
938-
&val);
939-
if (!ret)
940-
pdata->post_power_delay_ms = val;
941-
942937
return 0;
943938
}
944939

@@ -955,6 +950,16 @@ static inline int i2c_hid_of_probe(struct i2c_client *client,
955950
}
956951
#endif
957952

953+
static void i2c_hid_fwnode_probe(struct i2c_client *client,
954+
struct i2c_hid_platform_data *pdata)
955+
{
956+
u32 val;
957+
958+
if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms",
959+
&val))
960+
pdata->post_power_delay_ms = val;
961+
}
962+
958963
static int i2c_hid_probe(struct i2c_client *client,
959964
const struct i2c_device_id *dev_id)
960965
{
@@ -998,6 +1003,9 @@ static int i2c_hid_probe(struct i2c_client *client,
9981003
ihid->pdata = *platform_data;
9991004
}
10001005

1006+
/* Parse platform agnostic common properties from ACPI / device tree */
1007+
i2c_hid_fwnode_probe(client, &ihid->pdata);
1008+
10011009
ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
10021010
if (IS_ERR(ihid->pdata.supply)) {
10031011
ret = PTR_ERR(ihid->pdata.supply);

0 commit comments

Comments
 (0)