Lines Matching +full:post +full:- +full:delay
12 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
13 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
14 * Copyright (c) 2007-2008 Oliver Neukum
15 * Copyright (c) 2006-2010 Jiri Kosina
22 #include <linux/delay.h>
33 #include "i2c-hid.h"
48 struct device *dev = &ihid_of->client->dev; in i2c_hid_of_power_up()
51 ret = regulator_bulk_enable(ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_power_up()
52 ihid_of->supplies); in i2c_hid_of_power_up()
58 if (ihid_of->post_power_delay_ms) in i2c_hid_of_power_up()
59 msleep(ihid_of->post_power_delay_ms); in i2c_hid_of_power_up()
61 gpiod_set_value_cansleep(ihid_of->reset_gpio, 0); in i2c_hid_of_power_up()
62 if (ihid_of->post_reset_delay_ms) in i2c_hid_of_power_up()
63 msleep(ihid_of->post_reset_delay_ms); in i2c_hid_of_power_up()
72 gpiod_set_value_cansleep(ihid_of->reset_gpio, 1); in i2c_hid_of_power_down()
73 regulator_bulk_disable(ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_power_down()
74 ihid_of->supplies); in i2c_hid_of_power_down()
79 struct device *dev = &client->dev; in i2c_hid_of_probe()
88 return -ENOMEM; in i2c_hid_of_probe()
90 ihid_of->client = client; in i2c_hid_of_probe()
91 ihid_of->ops.power_up = i2c_hid_of_power_up; in i2c_hid_of_probe()
92 ihid_of->ops.power_down = i2c_hid_of_power_down; in i2c_hid_of_probe()
94 ret = device_property_read_u32(dev, "hid-descr-addr", &val); in i2c_hid_of_probe()
97 return -ENODEV; in i2c_hid_of_probe()
101 return -EINVAL; in i2c_hid_of_probe()
105 if (!device_property_read_u32(dev, "post-power-on-delay-ms", &val)) in i2c_hid_of_probe()
106 ihid_of->post_power_delay_ms = val; in i2c_hid_of_probe()
109 * Note this is a kernel internal device-property set by x86 platform code, in i2c_hid_of_probe()
113 if (!device_property_read_u32(dev, "post-reset-deassert-delay-ms", &val)) in i2c_hid_of_probe()
114 ihid_of->post_reset_delay_ms = val; in i2c_hid_of_probe()
117 ihid_of->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); in i2c_hid_of_probe()
118 if (IS_ERR(ihid_of->reset_gpio)) in i2c_hid_of_probe()
119 return PTR_ERR(ihid_of->reset_gpio); in i2c_hid_of_probe()
121 ihid_of->supplies[0].supply = "vdd"; in i2c_hid_of_probe()
122 ihid_of->supplies[1].supply = "vddl"; in i2c_hid_of_probe()
123 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_probe()
124 ihid_of->supplies); in i2c_hid_of_probe()
128 if (device_property_read_bool(dev, "touchscreen-inverted-x")) in i2c_hid_of_probe()
131 if (device_property_read_bool(dev, "touchscreen-inverted-y")) in i2c_hid_of_probe()
134 return i2c_hid_core_probe(client, &ihid_of->ops, in i2c_hid_of_probe()
140 { .compatible = "hid-over-i2c" },
148 { "hid-over-i2c", 0 },