Lines Matching +full:drv +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0
18 * i3c_device_do_priv_xfers() - do I3C SDR private transfers directed to a
30 * -EAGAIN: controller lost address arbitration. Target
33 * See I3C spec ver 1.1.1 09-Jun-2021. Section: 5.1.2.2.3.
46 return -EINVAL; in i3c_device_do_priv_xfers()
49 i3c_bus_normaluse_lock(dev->bus); in i3c_device_do_priv_xfers()
50 ret = i3c_dev_do_priv_xfers_locked(dev->desc, xfers, nxfers); in i3c_device_do_priv_xfers()
51 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_do_priv_xfers()
58 * i3c_device_do_setdasa() - do I3C dynamic address assignement with
69 i3c_bus_normaluse_lock(dev->bus); in i3c_device_do_setdasa()
70 ret = i3c_dev_setdasa_locked(dev->desc); in i3c_device_do_setdasa()
71 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_do_setdasa()
78 * i3c_device_get_info() - get I3C device information
91 i3c_bus_normaluse_lock(dev->bus); in i3c_device_get_info()
92 if (dev->desc) in i3c_device_get_info()
93 *info = dev->desc->info; in i3c_device_get_info()
94 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_get_info()
99 * i3c_device_disable_ibi() - Disable IBIs coming from a specific device
109 int ret = -ENOENT; in i3c_device_disable_ibi()
111 i3c_bus_normaluse_lock(dev->bus); in i3c_device_disable_ibi()
112 if (dev->desc) { in i3c_device_disable_ibi()
113 mutex_lock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
114 ret = i3c_dev_disable_ibi_locked(dev->desc); in i3c_device_disable_ibi()
115 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_disable_ibi()
117 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_disable_ibi()
124 * i3c_device_enable_ibi() - Enable IBIs coming from a specific device
138 int ret = -ENOENT; in i3c_device_enable_ibi()
140 i3c_bus_normaluse_lock(dev->bus); in i3c_device_enable_ibi()
141 if (dev->desc) { in i3c_device_enable_ibi()
142 mutex_lock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
143 ret = i3c_dev_enable_ibi_locked(dev->desc); in i3c_device_enable_ibi()
144 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_enable_ibi()
146 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_enable_ibi()
153 * i3c_device_request_ibi() - Request an IBI
157 * This function is responsible for pre-allocating all resources needed to
166 int ret = -ENOENT; in i3c_device_request_ibi()
168 if (!req->handler || !req->num_slots) in i3c_device_request_ibi()
169 return -EINVAL; in i3c_device_request_ibi()
171 i3c_bus_normaluse_lock(dev->bus); in i3c_device_request_ibi()
172 if (dev->desc) { in i3c_device_request_ibi()
173 mutex_lock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
174 ret = i3c_dev_request_ibi_locked(dev->desc, req); in i3c_device_request_ibi()
175 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_request_ibi()
177 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_request_ibi()
184 * i3c_device_free_ibi() - Free all resources needed for IBI handling
187 * This function is responsible for de-allocating resources previously
193 i3c_bus_normaluse_lock(dev->bus); in i3c_device_free_ibi()
194 if (dev->desc) { in i3c_device_free_ibi()
195 mutex_lock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
196 i3c_dev_free_ibi_locked(dev->desc); in i3c_device_free_ibi()
197 mutex_unlock(&dev->desc->ibi_lock); in i3c_device_free_ibi()
199 i3c_bus_normaluse_unlock(dev->bus); in i3c_device_free_ibi()
204 * i3cdev_to_dev() - Returns the device embedded in @i3cdev
211 return &i3cdev->dev; in i3cdev_to_dev()
216 * i3c_device_match_id() - Returns the i3c_device_id entry matching @i3cdev
227 const struct i3c_device_id *id; in i3c_device_match_id() local
238 for (id = id_table; id->match_flags != 0; id++) { in i3c_device_match_id()
239 if ((id->match_flags & I3C_MATCH_DCR) && in i3c_device_match_id()
240 id->dcr != devinfo.dcr) in i3c_device_match_id()
243 if ((id->match_flags & I3C_MATCH_MANUF) && in i3c_device_match_id()
244 id->manuf_id != manuf) in i3c_device_match_id()
247 if ((id->match_flags & I3C_MATCH_PART) && in i3c_device_match_id()
248 (rndpid || id->part_id != part)) in i3c_device_match_id()
251 if ((id->match_flags & I3C_MATCH_EXTRA_INFO) && in i3c_device_match_id()
252 (rndpid || id->extra_info != ext_info)) in i3c_device_match_id()
255 return id; in i3c_device_match_id()
263 * i3c_driver_register_with_owner() - register an I3C device driver
265 * @drv: driver to register
268 * Register @drv to the core.
272 int i3c_driver_register_with_owner(struct i3c_driver *drv, struct module *owner) in i3c_driver_register_with_owner() argument
274 drv->driver.owner = owner; in i3c_driver_register_with_owner()
275 drv->driver.bus = &i3c_bus_type; in i3c_driver_register_with_owner()
277 if (!drv->probe) { in i3c_driver_register_with_owner()
279 return -EINVAL; in i3c_driver_register_with_owner()
282 return driver_register(&drv->driver); in i3c_driver_register_with_owner()
287 * i3c_driver_unregister() - unregister an I3C device driver
289 * @drv: driver to unregister
291 * Unregister @drv.
293 void i3c_driver_unregister(struct i3c_driver *drv) in i3c_driver_unregister() argument
295 driver_unregister(&drv->driver); in i3c_driver_unregister()