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_do_setdasa() - do I3C dynamic address assignement with
65 i3c_bus_normaluse_lock(dev->bus); in i3c_device_do_setdasa()
66 ret = i3c_dev_setdasa_locked(dev->desc); in i3c_device_do_setdasa()
67 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_do_setdasa()
74 * i3c_device_get_info() - get I3C device information
87 i3c_bus_normaluse_lock(dev->bus); in i3c_device_get_info()
88 if (dev->desc) in i3c_device_get_info()
89 *info = dev->desc->info; in i3c_device_get_info()
90 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_get_info()
95 * i3c_device_disable_ibi() - Disable IBIs coming from a specific device
98 * This function disable IBIs coming from a specific device and wait for
105 int ret = -ENOENT; in i3c_device_disable_ibi()
107 i3c_bus_normaluse_lock(dev->bus); in i3c_device_disable_ibi()
108 if (dev->desc) { in i3c_device_disable_ibi()
109 mutex_lock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
110 ret = i3c_dev_disable_ibi_locked(dev->desc); in i3c_device_disable_ibi()
111 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
113 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_disable_ibi()
120 * i3c_device_enable_ibi() - Enable IBIs coming from a specific device
123 * This function enable IBIs coming from a specific device and wait for
134 int ret = -ENOENT; in i3c_device_enable_ibi()
136 i3c_bus_normaluse_lock(dev->bus); in i3c_device_enable_ibi()
137 if (dev->desc) { in i3c_device_enable_ibi()
138 mutex_lock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
139 ret = i3c_dev_enable_ibi_locked(dev->desc); in i3c_device_enable_ibi()
140 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
142 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_enable_ibi()
149 * i3c_device_request_ibi() - Request an IBI
153 * This function is responsible for pre-allocating all resources needed to
162 int ret = -ENOENT; in i3c_device_request_ibi()
164 if (!req->handler || !req->num_slots) in i3c_device_request_ibi()
165 return -EINVAL; in i3c_device_request_ibi()
167 i3c_bus_normaluse_lock(dev->bus); in i3c_device_request_ibi()
168 if (dev->desc) { in i3c_device_request_ibi()
169 mutex_lock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
170 ret = i3c_dev_request_ibi_locked(dev->desc, req); in i3c_device_request_ibi()
171 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
173 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_request_ibi()
180 * i3c_device_free_ibi() - Free all resources needed for IBI handling
183 * This function is responsible for de-allocating resources previously
189 i3c_bus_normaluse_lock(dev->bus); in i3c_device_free_ibi()
190 if (dev->desc) { in i3c_device_free_ibi()
191 mutex_lock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
192 i3c_dev_free_ibi_locked(dev->desc); in i3c_device_free_ibi()
193 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
195 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_free_ibi()
200 * i3cdev_to_dev() - Returns the device embedded in @i3cdev
207 return &i3cdev->dev; in i3cdev_to_dev()
212 * i3c_device_match_id() - Returns the i3c_device_id entry matching @i3cdev
234 for (id = id_table; id->match_flags != 0; id++) { in i3c_device_match_id()
235 if ((id->match_flags & I3C_MATCH_DCR) && in i3c_device_match_id()
236 id->dcr != devinfo.dcr) in i3c_device_match_id()
239 if ((id->match_flags & I3C_MATCH_MANUF) && in i3c_device_match_id()
240 id->manuf_id != manuf) in i3c_device_match_id()
243 if ((id->match_flags & I3C_MATCH_PART) && in i3c_device_match_id()
244 (rndpid || id->part_id != part)) in i3c_device_match_id()
247 if ((id->match_flags & I3C_MATCH_EXTRA_INFO) && in i3c_device_match_id()
248 (rndpid || id->extra_info != ext_info)) in i3c_device_match_id()
259 * i3c_driver_register_with_owner() - register an I3C device driver
270 drv->driver.owner = owner; in i3c_driver_register_with_owner()
271 drv->driver.bus = &i3c_bus_type; in i3c_driver_register_with_owner()
273 if (!drv->probe) { in i3c_driver_register_with_owner()
275 return -EINVAL; in i3c_driver_register_with_owner()
278 return driver_register(&drv->driver); in i3c_driver_register_with_owner()
283 * i3c_driver_unregister() - unregister an I3C device driver
291 driver_unregister(&drv->driver); in i3c_driver_unregister()