Lines Matching +full:bus +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0
18 * i3c_device_do_priv_xfers() - do I3C SDR private transfers directed to a
19 * specific device
42 return -EINVAL; in i3c_device_do_priv_xfers()
45 i3c_bus_normaluse_lock(dev->bus); in i3c_device_do_priv_xfers()
46 ret = i3c_dev_do_priv_xfers_locked(dev->desc, xfers, nxfers); in i3c_device_do_priv_xfers()
47 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_do_priv_xfers()
54 * i3c_device_get_info() - get I3C device information
67 i3c_bus_normaluse_lock(dev->bus); in i3c_device_get_info()
68 if (dev->desc) in i3c_device_get_info()
69 *info = dev->desc->info; in i3c_device_get_info()
70 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_get_info()
75 * i3c_device_disable_ibi() - Disable IBIs coming from a specific device
78 * This function disable IBIs coming from a specific device and wait for
85 int ret = -ENOENT; in i3c_device_disable_ibi()
87 i3c_bus_normaluse_lock(dev->bus); in i3c_device_disable_ibi()
88 if (dev->desc) { in i3c_device_disable_ibi()
89 mutex_lock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
90 ret = i3c_dev_disable_ibi_locked(dev->desc); in i3c_device_disable_ibi()
91 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
93 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_disable_ibi()
100 * i3c_device_enable_ibi() - Enable IBIs coming from a specific device
103 * This function enable IBIs coming from a specific device and wait for
114 int ret = -ENOENT; in i3c_device_enable_ibi()
116 i3c_bus_normaluse_lock(dev->bus); in i3c_device_enable_ibi()
117 if (dev->desc) { in i3c_device_enable_ibi()
118 mutex_lock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
119 ret = i3c_dev_enable_ibi_locked(dev->desc); in i3c_device_enable_ibi()
120 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
122 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_enable_ibi()
129 * i3c_device_request_ibi() - Request an IBI
133 * This function is responsible for pre-allocating all resources needed to
142 int ret = -ENOENT; in i3c_device_request_ibi()
144 if (!req->handler || !req->num_slots) in i3c_device_request_ibi()
145 return -EINVAL; in i3c_device_request_ibi()
147 i3c_bus_normaluse_lock(dev->bus); in i3c_device_request_ibi()
148 if (dev->desc) { in i3c_device_request_ibi()
149 mutex_lock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
150 ret = i3c_dev_request_ibi_locked(dev->desc, req); in i3c_device_request_ibi()
151 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
153 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_request_ibi()
160 * i3c_device_free_ibi() - Free all resources needed for IBI handling
163 * This function is responsible for de-allocating resources previously
169 i3c_bus_normaluse_lock(dev->bus); in i3c_device_free_ibi()
170 if (dev->desc) { in i3c_device_free_ibi()
171 mutex_lock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
172 i3c_dev_free_ibi_locked(dev->desc); in i3c_device_free_ibi()
173 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
175 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_free_ibi()
180 * i3cdev_to_dev() - Returns the device embedded in @i3cdev
187 return &i3cdev->dev; in i3cdev_to_dev()
192 * dev_to_i3cdev() - Returns the I3C device containing @dev
204 * i3c_device_match_id() - Returns the i3c_device_id entry matching @i3cdev
226 for (id = id_table; id->match_flags != 0; id++) { in i3c_device_match_id()
227 if ((id->match_flags & I3C_MATCH_DCR) && in i3c_device_match_id()
228 id->dcr != devinfo.dcr) in i3c_device_match_id()
231 if ((id->match_flags & I3C_MATCH_MANUF) && in i3c_device_match_id()
232 id->manuf_id != manuf) in i3c_device_match_id()
235 if ((id->match_flags & I3C_MATCH_PART) && in i3c_device_match_id()
236 (rndpid || id->part_id != part)) in i3c_device_match_id()
239 if ((id->match_flags & I3C_MATCH_EXTRA_INFO) && in i3c_device_match_id()
240 (rndpid || id->extra_info != ext_info)) in i3c_device_match_id()
251 * i3c_driver_register_with_owner() - register an I3C device driver
262 drv->driver.owner = owner; in i3c_driver_register_with_owner()
263 drv->driver.bus = &i3c_bus_type; in i3c_driver_register_with_owner()
265 if (!drv->probe) { in i3c_driver_register_with_owner()
267 return -EINVAL; in i3c_driver_register_with_owner()
270 return driver_register(&drv->driver); in i3c_driver_register_with_owner()
275 * i3c_driver_unregister() - unregister an I3C device driver
283 driver_unregister(&drv->driver); in i3c_driver_unregister()