Lines Matching +full:vendor +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0
3 * ulpi.c - USB ULPI PHY bus
18 #include <linux/clk/clk-conf.h>
20 /* -------------------------------------------------------------------------- */
24 return ulpi->ops->read(ulpi->dev.parent, addr); in ulpi_read()
30 return ulpi->ops->write(ulpi->dev.parent, addr, val); in ulpi_write()
34 /* -------------------------------------------------------------------------- */
40 const struct ulpi_device_id *id; in ulpi_match() local
42 /* Some ULPI devices don't have a vendor id so rely on OF match */ in ulpi_match()
43 if (ulpi->id.vendor == 0) in ulpi_match()
46 for (id = drv->id_table; id->vendor; id++) in ulpi_match()
47 if (id->vendor == ulpi->id.vendor && in ulpi_match()
48 id->product == ulpi->id.product) in ulpi_match()
60 if (ret != -ENODEV) in ulpi_uevent()
64 ulpi->id.vendor, ulpi->id.product)) in ulpi_uevent()
65 return -ENOMEM; in ulpi_uevent()
71 struct ulpi_driver *drv = to_ulpi_driver(dev->driver); in ulpi_probe()
74 ret = of_clk_set_defaults(dev->of_node, false); in ulpi_probe()
78 return drv->probe(to_ulpi_dev(dev)); in ulpi_probe()
83 struct ulpi_driver *drv = to_ulpi_driver(dev->driver); in ulpi_remove()
85 if (drv->remove) in ulpi_remove()
86 drv->remove(to_ulpi_dev(dev)); in ulpi_remove()
99 /* -------------------------------------------------------------------------- */
108 if (len != -ENODEV) in modalias_show()
112 ulpi->id.vendor, ulpi->id.product); in modalias_show()
141 /* -------------------------------------------------------------------------- */
144 * ulpi_register_driver - register a driver with the ULPI bus
152 if (!drv->probe) in __ulpi_register_driver()
153 return -EINVAL; in __ulpi_register_driver()
155 drv->driver.owner = module; in __ulpi_register_driver()
156 drv->driver.bus = &ulpi_bus; in __ulpi_register_driver()
158 return driver_register(&drv->driver); in __ulpi_register_driver()
163 * ulpi_unregister_driver - unregister a driver with the ULPI bus
170 driver_unregister(&drv->driver); in ulpi_unregister_driver()
174 /* -------------------------------------------------------------------------- */
182 parent = ulpi->dev.parent; in ulpi_of_register()
183 if (parent->of_node) in ulpi_of_register()
184 np = of_get_child_by_name(parent->of_node, "ulpi"); in ulpi_of_register()
185 else if (parent->parent && parent->parent->of_node) in ulpi_of_register()
186 np = of_get_child_by_name(parent->parent->of_node, "ulpi"); in ulpi_of_register()
193 return -EINVAL; in ulpi_of_register()
195 ulpi->dev.of_node = child; in ulpi_of_register()
216 ulpi->id.vendor = ulpi_read(ulpi, ULPI_VENDOR_ID_LOW); in ulpi_read_id()
217 ulpi->id.vendor |= ulpi_read(ulpi, ULPI_VENDOR_ID_HIGH) << 8; in ulpi_read_id()
219 ulpi->id.product = ulpi_read(ulpi, ULPI_PRODUCT_ID_LOW); in ulpi_read_id()
220 ulpi->id.product |= ulpi_read(ulpi, ULPI_PRODUCT_ID_HIGH) << 8; in ulpi_read_id()
222 /* Some ULPI devices don't have a vendor id so rely on OF match */ in ulpi_read_id()
223 if (ulpi->id.vendor == 0) in ulpi_read_id()
226 request_module("ulpi:v%04xp%04x", ulpi->id.vendor, ulpi->id.product); in ulpi_read_id()
229 of_device_request_module(&ulpi->dev); in ulpi_read_id()
237 ulpi->dev.parent = dev; /* needed early for ops */ in ulpi_register()
238 ulpi->dev.bus = &ulpi_bus; in ulpi_register()
239 ulpi->dev.type = &ulpi_dev_type; in ulpi_register()
240 dev_set_name(&ulpi->dev, "%s.ulpi", dev_name(dev)); in ulpi_register()
242 ACPI_COMPANION_SET(&ulpi->dev, ACPI_COMPANION(dev)); in ulpi_register()
252 ret = device_register(&ulpi->dev); in ulpi_register()
256 dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n", in ulpi_register()
257 ulpi->id.vendor, ulpi->id.product); in ulpi_register()
263 * ulpi_register_interface - instantiate new ULPI device
278 return ERR_PTR(-ENOMEM); in ulpi_register_interface()
280 ulpi->ops = ops; in ulpi_register_interface()
293 * ulpi_unregister_interface - unregister ULPI interface
301 of_node_put(ulpi->dev.of_node); in ulpi_unregister_interface()
302 device_unregister(&ulpi->dev); in ulpi_unregister_interface()
306 /* -------------------------------------------------------------------------- */