/** * DOC: Xe I2C devices * * Register a platform device for the I2C host controller (Synpsys DesignWare * I2C) if the registers of that controller are mapped to the MMIO, and also the * I2C client device for the Add-In Management Controller (the MCU) attached to * the host controller. * * See drivers/i2c/busses/i2c-designware-* for more information on the I2C host * controller.
*/
fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL); if (IS_ERR(fwnode)) return PTR_ERR(fwnode);
/* * Not using platform_device_register_full() here because we don't have * a handle to the platform_device before it returns. xe_i2c_notifier() * uses that handle, but it may be called before * platform_device_register_full() is done.
*/
pdev = platform_device_alloc(adapter_name, pci_dev_id(pci)); if (!pdev) {
ret = -ENOMEM; goto err_fwnode_remove;
}
if (i2c->adapter_irq) { struct resource res;
res = DEFINE_RES_IRQ_NAMED(i2c->adapter_irq, "xe_i2c");
ret = platform_device_add_resources(pdev, &res, 1); if (ret) goto err_pdev_put;
}
/** * xe_i2c_probe: Probe the I2C host adapter and the I2C clients attached to it * @xe: xe device instance * * Register all the I2C devices described in the I2C Endpoint data structure. * * Return: 0 on success, error code on failure
*/ int xe_i2c_probe(struct xe_device *xe)
{ struct device *drm_dev = xe->drm.dev; struct xe_i2c_endpoint ep; struct regmap *regmap; struct xe_i2c *i2c; int ret;
if (xe->info.platform != XE_BATTLEMAGE) return 0;
if (IS_SRIOV_VF(xe)) return 0;
xe_i2c_read_endpoint(xe_root_tile_mmio(xe), &ep); if (ep.cookie != XE_I2C_EP_COOKIE_DEVICE) return 0;
i2c = devm_kzalloc(drm_dev, sizeof(*i2c), GFP_KERNEL); if (!i2c) return -ENOMEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.