Lines Matching refs:cdx

98 	struct cdx_controller *cdx = cdx_dev->cdx;  in cdx_dev_reset()  local
109 ret = cdx->ops->dev_configure(cdx, cdx_dev->bus_num, in cdx_dev_reset()
150 struct cdx_controller *cdx = cdx_dev->cdx; in cdx_unregister_device() local
154 if (cdx_dev->enabled && cdx->ops->bus_disable) in cdx_unregister_device()
155 cdx->ops->bus_disable(cdx, cdx_dev->bus_num); in cdx_unregister_device()
227 struct cdx_controller *cdx = cdx_dev->cdx; in cdx_set_master() local
233 if (cdx->ops->dev_configure) in cdx_set_master()
234 ret = cdx->ops->dev_configure(cdx, cdx_dev->bus_num, in cdx_set_master()
243 struct cdx_controller *cdx = cdx_dev->cdx; in cdx_clear_master() local
249 if (cdx->ops->dev_configure) in cdx_clear_master()
250 ret = cdx->ops->dev_configure(cdx, cdx_dev->bus_num, in cdx_clear_master()
306 struct cdx_controller *cdx = cdx_dev->cdx; in cdx_probe() local
313 if (cdx->msi_domain) { in cdx_probe()
350 struct cdx_controller *cdx = cdx_dev->cdx; in cdx_dma_configure() local
354 ret = of_dma_configure_id(dev, cdx->dev->of_node, 0, &input_id); in cdx_dma_configure()
482 struct cdx_controller *cdx = cdx_dev->cdx; in enable_store() local
492 if (enable && cdx->ops->bus_enable) in enable_store()
493 ret = cdx->ops->bus_enable(cdx, cdx_dev->bus_num); in enable_store()
494 else if (!enable && cdx->ops->bus_disable) in enable_store()
495 ret = cdx->ops->bus_disable(cdx, cdx_dev->bus_num); in enable_store()
601 struct cdx_controller *cdx; in rescan_store() local
626 cdx = platform_get_drvdata(pd); in rescan_store()
627 if (cdx && cdx->controller_registered && cdx->ops->scan) in rescan_store()
628 cdx->ops->scan(cdx); in rescan_store()
787 struct cdx_controller *cdx = dev_params->cdx; in cdx_device_add() local
811 cdx_dev->cdx = dev_params->cdx; in cdx_device_add()
825 ((cdx->id << CDX_CONTROLLER_ID_SHIFT) | (cdx_dev->bus_num & CDX_BUS_NUM_MASK)), in cdx_device_add()
828 if (cdx->msi_domain) { in cdx_device_add()
830 dev_set_msi_domain(&cdx_dev->dev, cdx->msi_domain); in cdx_device_add()
873 struct device *cdx_bus_add(struct cdx_controller *cdx, u8 bus_num) in cdx_bus_add() argument
883 cdx_dev->cdx = cdx; in cdx_bus_add()
885 cdx_dev->dev.parent = cdx->dev; in cdx_bus_add()
892 ((cdx->id << CDX_CONTROLLER_ID_SHIFT) | (bus_num & CDX_BUS_NUM_MASK))); in cdx_bus_add()
900 if (cdx->ops->bus_enable) { in cdx_bus_add()
901 ret = cdx->ops->bus_enable(cdx, bus_num); in cdx_bus_add()
903 dev_err(cdx->dev, "cdx bus enable failed: %d\n", ret); in cdx_bus_add()
920 int cdx_register_controller(struct cdx_controller *cdx) in cdx_register_controller() argument
926 dev_err(cdx->dev, in cdx_register_controller()
928 cdx->id = (u8)MAX_CDX_CONTROLLERS; in cdx_register_controller()
933 cdx->id = ret; in cdx_register_controller()
936 if (cdx->ops->scan) in cdx_register_controller()
937 cdx->ops->scan(cdx); in cdx_register_controller()
938 cdx->controller_registered = true; in cdx_register_controller()
945 void cdx_unregister_controller(struct cdx_controller *cdx) in cdx_unregister_controller() argument
947 if (cdx->id >= MAX_CDX_CONTROLLERS) in cdx_unregister_controller()
952 cdx->controller_registered = false; in cdx_unregister_controller()
953 device_for_each_child(cdx->dev, NULL, cdx_unregister_device); in cdx_unregister_controller()
954 ida_free(&cdx_controller_ida, cdx->id); in cdx_unregister_controller()