• Home
  • Raw
  • Download

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
43 * Some ULPI devices don't have a vendor id in ulpi_match()
46 if (ulpi->id.vendor == 0 || !drv->id_table) in ulpi_match()
49 for (id = drv->id_table; id->vendor; id++) in ulpi_match()
50 if (id->vendor == ulpi->id.vendor && in ulpi_match()
51 id->product == ulpi->id.product) in ulpi_match()
63 if (ret != -ENODEV) in ulpi_uevent()
67 ulpi->id.vendor, ulpi->id.product)) in ulpi_uevent()
68 return -ENOMEM; in ulpi_uevent()
74 struct ulpi_driver *drv = to_ulpi_driver(dev->driver); in ulpi_probe()
77 ret = of_clk_set_defaults(dev->of_node, false); in ulpi_probe()
81 return drv->probe(to_ulpi_dev(dev)); in ulpi_probe()
86 struct ulpi_driver *drv = to_ulpi_driver(dev->driver); in ulpi_remove()
88 if (drv->remove) in ulpi_remove()
89 drv->remove(to_ulpi_dev(dev)); in ulpi_remove()
102 /* -------------------------------------------------------------------------- */
111 if (len != -ENODEV) in modalias_show()
115 ulpi->id.vendor, ulpi->id.product); in modalias_show()
135 of_node_put(dev->of_node); in ulpi_dev_release()
145 /* -------------------------------------------------------------------------- */
148 * ulpi_register_driver - register a driver with the ULPI bus
156 if (!drv->probe) in __ulpi_register_driver()
157 return -EINVAL; in __ulpi_register_driver()
159 drv->driver.owner = module; in __ulpi_register_driver()
160 drv->driver.bus = &ulpi_bus; in __ulpi_register_driver()
162 return driver_register(&drv->driver); in __ulpi_register_driver()
167 * ulpi_unregister_driver - unregister a driver with the ULPI bus
174 driver_unregister(&drv->driver); in ulpi_unregister_driver()
178 /* -------------------------------------------------------------------------- */
186 parent = ulpi->dev.parent; in ulpi_of_register()
187 if (parent->of_node) in ulpi_of_register()
188 np = of_get_child_by_name(parent->of_node, "ulpi"); in ulpi_of_register()
189 else if (parent->parent && parent->parent->of_node) in ulpi_of_register()
190 np = of_get_child_by_name(parent->parent->of_node, "ulpi"); in ulpi_of_register()
197 return -EINVAL; in ulpi_of_register()
199 ulpi->dev.of_node = child; in ulpi_of_register()
220 ulpi->id.vendor = ulpi_read(ulpi, ULPI_VENDOR_ID_LOW); in ulpi_read_id()
221 ulpi->id.vendor |= ulpi_read(ulpi, ULPI_VENDOR_ID_HIGH) << 8; in ulpi_read_id()
223 ulpi->id.product = ulpi_read(ulpi, ULPI_PRODUCT_ID_LOW); in ulpi_read_id()
224 ulpi->id.product |= ulpi_read(ulpi, ULPI_PRODUCT_ID_HIGH) << 8; in ulpi_read_id()
226 /* Some ULPI devices don't have a vendor id so rely on OF match */ in ulpi_read_id()
227 if (ulpi->id.vendor == 0) in ulpi_read_id()
230 request_module("ulpi:v%04xp%04x", ulpi->id.vendor, ulpi->id.product); in ulpi_read_id()
233 of_device_request_module(&ulpi->dev); in ulpi_read_id()
241 ulpi->dev.parent = dev; /* needed early for ops */ in ulpi_register()
242 ulpi->dev.bus = &ulpi_bus; in ulpi_register()
243 ulpi->dev.type = &ulpi_dev_type; in ulpi_register()
244 dev_set_name(&ulpi->dev, "%s.ulpi", dev_name(dev)); in ulpi_register()
246 ACPI_COMPANION_SET(&ulpi->dev, ACPI_COMPANION(dev)); in ulpi_register()
254 of_node_put(ulpi->dev.of_node); in ulpi_register()
258 ret = device_register(&ulpi->dev); in ulpi_register()
260 put_device(&ulpi->dev); in ulpi_register()
264 dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n", in ulpi_register()
265 ulpi->id.vendor, ulpi->id.product); in ulpi_register()
271 * ulpi_register_interface - instantiate new ULPI device
286 return ERR_PTR(-ENOMEM); in ulpi_register_interface()
288 ulpi->ops = ops; in ulpi_register_interface()
301 * ulpi_unregister_interface - unregister ULPI interface
309 device_unregister(&ulpi->dev); in ulpi_unregister_interface()
313 /* -------------------------------------------------------------------------- */