Lines Matching +full:master +full:- +full:mode
1 /* SPDX-License-Identifier: GPL-2.0 */
39 * struct i3c_i2c_dev_desc - Common part of the I3C/I2C device descriptor
42 * @master: I3C master that instantiated this device. Will be used to do
44 * @master_priv: master private data assigned to the device. Can be used to
45 * add master specific information
51 struct i3c_master_controller *master; member
62 * struct i2c_dev_boardinfo - I2C device board information
68 * This structure is used to attach board-level information to an I2C device.
78 * struct i2c_dev_desc - I2C device descriptor
87 * using &struct_i3c_master_controller->ops->attach_i2c_dev().
101 * struct i3c_ibi_slot - I3C IBI (In-Band Interrupt) slot
108 * An IBI slot is an object pre-allocated by the controller and used when an
110 * Every time an IBI comes in, the I3C master driver should find a free IBI
114 * How IBI slots are allocated is left to the I3C master driver, though, for
115 * simple kmalloc-based allocation, the generic IBI slot pool can be used.
125 * struct i3c_device_ibi_info - IBI information attached to a specific device
135 * rejected by the master
151 * infrastructure. I3C master drivers may have their own internal
153 * controller-private data.
167 * struct i3c_dev_boardinfo - I3C device board information
174 * assigned a dynamic address by the master. Will be used during
182 * This structure is used to attach board-level information to an I3C device.
196 * struct i3c_dev_desc - I3C device descriptor
200 * @ibi_lock: lock used to protect the &struct_i3c_device->ibi
204 * should never be accessed from I3C master controller drivers. Only core
205 * code should manipulate it in when updating the dev <-> desc link or
210 * core and passed to I3C master controller drivers when they're requested to
225 * struct i3c_device - I3C device object
247 * I3C master can also have limitations, so this number is just here as a
248 * reference and should be adjusted on a per-controller/per-board basis.
259 * enum i3c_bus_mode - I3C bus mode
263 * the bus. The only impact in this mode is that the
281 * enum i3c_open_drain_speed - I3C open-drain speed
282 * @I3C_OPEN_DRAIN_SLOW_SPEED: Slow open-drain speed for sending the first
285 * working in I2C mode will turn off their spike filter when
286 * switching into I3C mode.
287 * @I3C_OPEN_DRAIN_NORMAL_SPEED: Normal open-drain speed in I3C bus mode.
295 * enum i3c_addr_slot_status - I3C address slot status
303 * such as the "assigned-address" property in a device tree source.
323 * struct i3c_bus - I3C bus object
324 * @cur_master: I3C master currently driving the bus. Since I3C is multi-master
325 * this can change over the time. Will be used to let a master
329 * @addrslots: a bitmap with 2-bits per-slot to encode the address status and
332 * @mode: bus mode (see &enum i3c_bus_mode)
336 * @scl_rate: SCL signal rate for I3C and I2C mode
339 * I3C master
342 * I3C master
351 * the same master in parallel. This is the responsibility of the
352 * master to guarantee that frames are actually sent sequentially and
356 * by the I3C master to cope with the multi-master functionality, where one bus
364 enum i3c_bus_mode mode; member
377 * struct i3c_master_controller_ops - I3C master methods
379 * least call master_set_info() from there and set the bus mode.
383 * &i3c_master_controller_ops->bus_init().
391 * This is a good place to attach master controller specific
401 * happens when the master device is unregistered.
407 * attached or re-attached to the controller.
418 * This is a good place to attach master controller specific
422 * happens when the master device is unregistered.
426 * the transfers are DMA-safe. If drivers want to have DMA-safe
433 * length and number of pre-allocated slots).
434 * Some controllers support less IBI-capable devices than regular
435 * devices, so this method might return -%EBUSY if there's no
438 * @free_ibi: free an IBI previously requested with ->request_ibi(). The IBI
439 * should have been disabled with ->disable_irq() prior to that
440 * This method is mandatory only if ->request_ibi is not NULL.
441 * @enable_ibi: enable the IBI. Only valid if ->request_ibi() has been called
442 * prior to ->enable_ibi(). The controller should first enable
446 * This method is mandatory only if ->request_ibi is not NULL.
450 * This method is mandatory only if ->request_ibi is not NULL.
453 * in the IBI slot pool so that the controller can re-use it
455 * This method is mandatory only if ->request_ibi is not
459 * @set_speed: adjust I3C open drain mode timing.
462 int (*bus_init)(struct i3c_master_controller *master);
463 void (*bus_cleanup)(struct i3c_master_controller *master);
467 int (*do_daa)(struct i3c_master_controller *master);
468 bool (*supports_ccc_cmd)(struct i3c_master_controller *master,
470 int (*send_ccc_cmd)(struct i3c_master_controller *master,
486 int (*enable_hotjoin)(struct i3c_master_controller *master);
487 int (*disable_hotjoin)(struct i3c_master_controller *master);
488 int (*set_speed)(struct i3c_master_controller *master, enum i3c_open_drain_speed speed);
492 * struct i3c_master_controller - I3C master controller object
493 * @dev: device to be registered to the device-model
494 * @this: an I3C device object representing this master. This device will be
499 * @ops: master operations. See &struct i3c_master_controller_ops
500 * @secondary: true if the master is a secondary master
502 * @hotjoin: true if the master support hotjoin
505 * @boardinfo: board-level information attached to devices connected on the bus
506 * @bus: I3C bus exposed by this master
507 * @wq: workqueue which can be used by master
511 * be done from a sleep-able context
535 * i3c_bus_for_each_i2cdev() - iterate over all I2C devices present on the bus
543 list_for_each_entry(dev, &(bus)->devs.i2c, common.node)
546 * i3c_bus_for_each_i3cdev() - iterate over all I3C devices present on the bus
554 list_for_each_entry(dev, &(bus)->devs.i3c, common.node)
556 int i3c_master_do_i2c_xfers(struct i3c_master_controller *master,
560 int i3c_master_disec_locked(struct i3c_master_controller *master, u8 addr,
562 int i3c_master_enec_locked(struct i3c_master_controller *master, u8 addr,
564 int i3c_master_entdaa_locked(struct i3c_master_controller *master);
565 int i3c_master_defslvs_locked(struct i3c_master_controller *master);
567 int i3c_master_get_free_addr(struct i3c_master_controller *master,
570 int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
572 int i3c_master_do_daa(struct i3c_master_controller *master);
574 int i3c_master_set_info(struct i3c_master_controller *master,
577 int i3c_master_register(struct i3c_master_controller *master,
581 void i3c_master_unregister(struct i3c_master_controller *master);
582 int i3c_master_enable_hotjoin(struct i3c_master_controller *master);
583 int i3c_master_disable_hotjoin(struct i3c_master_controller *master);
586 * i3c_dev_get_master_data() - get master private data attached to an I3C
595 return dev->common.master_priv; in i3c_dev_get_master_data()
599 * i3c_dev_set_master_data() - attach master private data to an I3C device
604 * This functions allows a master controller to attach per-device private data
610 dev->common.master_priv = data; in i3c_dev_set_master_data()
614 * i2c_dev_get_master_data() - get master private data attached to an I2C
623 return dev->common.master_priv; in i2c_dev_get_master_data()
627 * i2c_dev_set_master_data() - attach master private data to an I2C device
632 * This functions allows a master controller to attach per-device private data
638 dev->common.master_priv = data; in i2c_dev_set_master_data()
642 * i3c_dev_get_master() - get master used to communicate with a device
645 * Return: the master controller driving @dev
650 return dev->common.master; in i3c_dev_get_master()
654 * i2c_dev_get_master() - get master used to communicate with a device
657 * Return: the master controller driving @dev
662 return dev->common.master; in i2c_dev_get_master()
666 * i3c_master_get_bus() - get the bus attached to a master
667 * @master: master object
669 * Return: the I3C bus @master is connected to
672 i3c_master_get_bus(struct i3c_master_controller *master) in i3c_master_get_bus() argument
674 return &master->bus; in i3c_master_get_bus()