Lines Matching full:ibi
411 * typically specified by the DT-'s assigned-address property. Lower addresses having higher IBI
1187 * When the device does not have IBI payload GETMRL only returns 2 in i3c_master_getmrl_locked()
2081 * We need to restore the IBI state too, so let's save the in i3c_master_add_i3c_dev_locked()
2082 * IBI information and try to restore them after olddev has in i3c_master_add_i3c_dev_locked()
2083 * been detached+released and its IBI has been stopped and in i3c_master_add_i3c_dev_locked()
2087 if (olddev->ibi) { in i3c_master_add_i3c_dev_locked()
2088 ibireq.handler = olddev->ibi->handler; in i3c_master_add_i3c_dev_locked()
2089 ibireq.max_payload_len = olddev->ibi->max_payload_len; in i3c_master_add_i3c_dev_locked()
2090 ibireq.num_slots = olddev->ibi->num_slots; in i3c_master_add_i3c_dev_locked()
2092 if (olddev->ibi->enabled) in i3c_master_add_i3c_dev_locked()
2098 * So, update the olddev->ibi->enabled flag to false in i3c_master_add_i3c_dev_locked()
2101 olddev->ibi->enabled = false; in i3c_master_add_i3c_dev_locked()
2150 * Now is time to try to restore the IBI setup. If we're lucky, in i3c_master_add_i3c_dev_locked()
2153 * should request the IBI again instead of trying to hide that from in i3c_master_add_i3c_dev_locked()
2161 "Failed to request IBI on device %d-%llx", in i3c_master_add_i3c_dev_locked()
2167 "Failed to re-enable IBI on device %d-%llx", in i3c_master_add_i3c_dev_locked()
2551 * i3c_master_queue_ibi() - Queue an IBI
2552 * @dev: the device this IBI is coming from
2553 * @slot: the IBI slot used to store the payload
2555 * Queue an IBI to the controller workqueue. The IBI handler attached to
2560 if (!dev->ibi || !slot) in i3c_master_queue_ibi()
2563 atomic_inc(&dev->ibi->pending_ibis); in i3c_master_queue_ibi()
2564 queue_work(dev->ibi->wq, &slot->work); in i3c_master_queue_ibi()
2580 dev->ibi->handler(dev->dev, &payload); in i3c_master_handle_ibi()
2583 if (atomic_dec_and_test(&dev->ibi->pending_ibis)) in i3c_master_handle_ibi()
2584 complete(&dev->ibi->all_ibis_handled); in i3c_master_handle_ibi()
2609 * i3c_generic_ibi_free_pool() - Free a generic IBI pool
2610 * @pool: the IBI pool to free
2612 * Free all IBI slots allated by a generic IBI pool.
2639 * i3c_generic_ibi_alloc_pool() - Create a generic IBI pool
2641 * @req: IBI setup request describing what the device driver expects
2643 * Create a generic IBI pool based on the information provided in @req.
2645 * Return: a valid IBI pool in case of success, an ERR_PTR() otherwise.
2700 * i3c_generic_ibi_get_free_slot() - Get a free slot from a generic IBI pool
2701 * @pool: the pool to query an IBI slot on
2703 * Search for a free slot in a generic IBI pool.
2727 * i3c_generic_ibi_recycle_slot() - Return a slot to a generic IBI pool
2728 * @pool: the pool to return the IBI slot to
2729 * @s: IBI slot to recycle
2731 * Add an IBI slot back to its generic IBI pool. Should be called from the
2969 if (!dev->ibi) in i3c_dev_disable_ibi_locked()
2977 reinit_completion(&dev->ibi->all_ibis_handled); in i3c_dev_disable_ibi_locked()
2978 if (atomic_read(&dev->ibi->pending_ibis)) in i3c_dev_disable_ibi_locked()
2979 wait_for_completion(&dev->ibi->all_ibis_handled); in i3c_dev_disable_ibi_locked()
2981 dev->ibi->enabled = false; in i3c_dev_disable_ibi_locked()
2991 if (!dev->ibi) in i3c_dev_enable_ibi_locked()
2996 dev->ibi->enabled = true; in i3c_dev_enable_ibi_locked()
3005 struct i3c_device_ibi_info *ibi; in i3c_dev_request_ibi_locked() local
3011 if (dev->ibi) in i3c_dev_request_ibi_locked()
3014 ibi = kzalloc(sizeof(*ibi), GFP_KERNEL); in i3c_dev_request_ibi_locked()
3015 if (!ibi) in i3c_dev_request_ibi_locked()
3018 ibi->wq = alloc_ordered_workqueue(dev_name(i3cdev_to_dev(dev->dev)), WQ_MEM_RECLAIM); in i3c_dev_request_ibi_locked()
3019 if (!ibi->wq) { in i3c_dev_request_ibi_locked()
3020 kfree(ibi); in i3c_dev_request_ibi_locked()
3024 atomic_set(&ibi->pending_ibis, 0); in i3c_dev_request_ibi_locked()
3025 init_completion(&ibi->all_ibis_handled); in i3c_dev_request_ibi_locked()
3026 ibi->handler = req->handler; in i3c_dev_request_ibi_locked()
3027 ibi->max_payload_len = req->max_payload_len; in i3c_dev_request_ibi_locked()
3028 ibi->num_slots = req->num_slots; in i3c_dev_request_ibi_locked()
3030 dev->ibi = ibi; in i3c_dev_request_ibi_locked()
3033 kfree(ibi); in i3c_dev_request_ibi_locked()
3034 dev->ibi = NULL; in i3c_dev_request_ibi_locked()
3044 if (!dev->ibi) in i3c_dev_free_ibi_locked()
3047 if (WARN_ON(dev->ibi->enabled)) in i3c_dev_free_ibi_locked()
3052 if (dev->ibi->wq) { in i3c_dev_free_ibi_locked()
3053 destroy_workqueue(dev->ibi->wq); in i3c_dev_free_ibi_locked()
3054 dev->ibi->wq = NULL; in i3c_dev_free_ibi_locked()
3057 kfree(dev->ibi); in i3c_dev_free_ibi_locked()
3058 dev->ibi = NULL; in i3c_dev_free_ibi_locked()