Lines Matching +full:power +full:- +full:supplies
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
32 #include "i2c-hid.h"
38 struct regulator_bulk_data supplies[2]; member
45 struct device *dev = &ihid_of->client->dev; in i2c_hid_of_power_up()
48 ret = regulator_bulk_enable(ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_power_up()
49 ihid_of->supplies); in i2c_hid_of_power_up()
51 dev_warn(dev, "Failed to enable supplies: %d\n", ret); in i2c_hid_of_power_up()
55 if (ihid_of->post_power_delay_ms) in i2c_hid_of_power_up()
56 msleep(ihid_of->post_power_delay_ms); in i2c_hid_of_power_up()
65 regulator_bulk_disable(ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_power_down()
66 ihid_of->supplies); in i2c_hid_of_power_down()
72 struct device *dev = &client->dev; in i2c_hid_of_probe()
79 ihid_of = devm_kzalloc(&client->dev, sizeof(*ihid_of), GFP_KERNEL); in i2c_hid_of_probe()
81 return -ENOMEM; in i2c_hid_of_probe()
83 ihid_of->ops.power_up = i2c_hid_of_power_up; in i2c_hid_of_probe()
84 ihid_of->ops.power_down = i2c_hid_of_power_down; in i2c_hid_of_probe()
86 ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val); in i2c_hid_of_probe()
88 dev_err(&client->dev, "HID register address not provided\n"); in i2c_hid_of_probe()
89 return -ENODEV; in i2c_hid_of_probe()
92 dev_err(&client->dev, "Bad HID register address: 0x%08x\n", in i2c_hid_of_probe()
94 return -EINVAL; in i2c_hid_of_probe()
98 if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms", in i2c_hid_of_probe()
100 ihid_of->post_power_delay_ms = val; in i2c_hid_of_probe()
102 ihid_of->supplies[0].supply = "vdd"; in i2c_hid_of_probe()
103 ihid_of->supplies[1].supply = "vddl"; in i2c_hid_of_probe()
104 ret = devm_regulator_bulk_get(&client->dev, in i2c_hid_of_probe()
105 ARRAY_SIZE(ihid_of->supplies), in i2c_hid_of_probe()
106 ihid_of->supplies); in i2c_hid_of_probe()
110 if (device_property_read_bool(dev, "touchscreen-inverted-x")) in i2c_hid_of_probe()
113 if (device_property_read_bool(dev, "touchscreen-inverted-y")) in i2c_hid_of_probe()
116 return i2c_hid_core_probe(client, &ihid_of->ops, in i2c_hid_of_probe()
121 { .compatible = "hid-over-i2c" },
128 { "hid-over-i2c", 0 },