Merge branch 'for-4.16/i2c-hid' into for-linus
This commit is contained in:
commit
e56236b0b2
|
@ -31,7 +31,7 @@ device-specific compatible properties, which should be used in addition to the
|
||||||
|
|
||||||
- vdd-supply: phandle of the regulator that provides the supply voltage.
|
- vdd-supply: phandle of the regulator that provides the supply voltage.
|
||||||
- post-power-on-delay-ms: time required by the device after enabling its regulators
|
- post-power-on-delay-ms: time required by the device after enabling its regulators
|
||||||
before it is ready for communication. Must be used with 'vdd-supply'.
|
or powering it on, before it is ready for communication.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
|
@ -934,11 +934,6 @@ static int i2c_hid_of_probe(struct i2c_client *client,
|
||||||
}
|
}
|
||||||
pdata->hid_descriptor_address = val;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -955,6 +950,16 @@ static inline int i2c_hid_of_probe(struct i2c_client *client,
|
||||||
}
|
}
|
||||||
#endif
|
#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,
|
static int i2c_hid_probe(struct i2c_client *client,
|
||||||
const struct i2c_device_id *dev_id)
|
const struct i2c_device_id *dev_id)
|
||||||
{
|
{
|
||||||
|
@ -998,6 +1003,9 @@ static int i2c_hid_probe(struct i2c_client *client,
|
||||||
ihid->pdata = *platform_data;
|
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");
|
ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
|
||||||
if (IS_ERR(ihid->pdata.supply)) {
|
if (IS_ERR(ihid->pdata.supply)) {
|
||||||
ret = PTR_ERR(ihid->pdata.supply);
|
ret = PTR_ERR(ihid->pdata.supply);
|
||||||
|
|
Loading…
Reference in New Issue