Lines Matching +full:device +full:- +full:handle
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
13 * struct ti_sci_version_info - version information structure
31 * struct ti_sci_core_ops - SoC Core Operations
37 int (*reboot_device)(const struct ti_sci_handle *handle);
41 * struct ti_sci_dev_ops - Device control operations
42 * @get_device: Command to request for device managed by TISCI
45 * @idle_device: Command to idle a device managed by TISCI
48 * @put_device: Command to release a device managed by TISCI
51 * @is_valid: Check if the device ID is a valid ID.
53 * @get_context_loss_count: Command to retrieve context loss counter - this
54 * increments every time the device looses context. Overflow
56 * - count: pointer to u32 which will retrieve counter
59 * @is_idle: Reports back about device idle state
60 * - req_state: Returns requested idle state
64 * @is_stop: Reports back about device stop state
65 * - req_state: Returns requested stop state
66 * - current_state: Returns current stop state
70 * @is_on: Reports back about device ON(or active) state
71 * - req_state: Returns requested ON state
72 * - current_state: Returns current ON state
76 * @is_transitioning: Reports back if the device is in the middle of transition
78 * -current_state: Returns 'true' if currently transitioning.
79 * @set_device_resets: Command to configure resets for device managed by TISCI.
80 * -reset_state: Device specific reset bit field
83 * @get_device_resets: Command to read state of resets for device managed
85 * -reset_state: pointer to u32 which will retrieve resets
91 * -handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
92 * -id: Device Identifier
94 * Request for the device - NOTE: the client MUST maintain integrity of
99 int (*get_device)(const struct ti_sci_handle *handle, u32 id);
100 int (*get_device_exclusive)(const struct ti_sci_handle *handle, u32 id);
101 int (*idle_device)(const struct ti_sci_handle *handle, u32 id);
102 int (*idle_device_exclusive)(const struct ti_sci_handle *handle,
104 int (*put_device)(const struct ti_sci_handle *handle, u32 id);
105 int (*is_valid)(const struct ti_sci_handle *handle, u32 id);
106 int (*get_context_loss_count)(const struct ti_sci_handle *handle,
108 int (*is_idle)(const struct ti_sci_handle *handle, u32 id,
110 int (*is_stop)(const struct ti_sci_handle *handle, u32 id,
112 int (*is_on)(const struct ti_sci_handle *handle, u32 id,
114 int (*is_transitioning)(const struct ti_sci_handle *handle, u32 id,
116 int (*set_device_resets)(const struct ti_sci_handle *handle, u32 id,
118 int (*get_device_resets)(const struct ti_sci_handle *handle, u32 id,
123 * struct ti_sci_clk_ops - Clock control operations
125 * - needs_ssc: 'true' if Spread Spectrum clock is desired.
126 * - can_change_freq: 'true' if frequency change is desired.
127 * - enable_input_term: 'true' if input termination is desired.
131 * - req_state: state indicating if the clock is auto managed
133 * - req_state: if the clock is requested to be forced ON
134 * - current_state: if the clock is currently ON
136 * - req_state: if the clock is requested to be forced OFF
137 * - current_state: if the clock is currently Gated
138 * @set_parent: Set the clock source of a specific device clock
139 * - parent_id: Parent clock identifier to set.
140 * @get_parent: Get the current clock source of a specific device clock
141 * - parent_id: Parent clock identifier which is the parent.
143 * - num_parents: returns the number of parent clocks.
146 * - match_freq: Best matching frequency in Hz.
149 * - current_freq: Frequency in Hz that the clock is at.
153 * -handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
154 * -did: Device identifier this request is for
155 * -cid: Clock identifier for the device for this request.
156 * Each device has it's own set of clock inputs. This indexes
158 * -min_freq: The minimum allowable frequency in Hz. This is the minimum
161 * -target_freq: The target clock frequency in Hz. A frequency will be
163 * -max_freq: The maximum allowable frequency in Hz. This is the maximum
167 * Request for the clock - NOTE: the client MUST maintain integrity of
172 int (*get_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid,
175 int (*idle_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
176 int (*put_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
177 int (*is_auto)(const struct ti_sci_handle *handle, u32 did, u32 cid,
179 int (*is_on)(const struct ti_sci_handle *handle, u32 did, u32 cid,
181 int (*is_off)(const struct ti_sci_handle *handle, u32 did, u32 cid,
183 int (*set_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid,
185 int (*get_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid,
187 int (*get_num_parents)(const struct ti_sci_handle *handle, u32 did,
189 int (*get_best_match_freq)(const struct ti_sci_handle *handle, u32 did,
192 int (*set_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid,
194 int (*get_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid,
199 * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
215 * struct ti_sci_rm_core_ops - Resource management core operations
219 * - s_host: Host processing entity to which the
224 * - handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
225 * - dev_id: TISCI device ID.
226 * - subtype: Resource assignment subtype that is being requested
227 * from the given device.
228 * - desc: Pointer to ti_sci_resource_desc to be updated with the resource
232 int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
234 int (*get_range_from_shost)(const struct ti_sci_handle *handle,
254 int (*set_irq)(const struct ti_sci_handle *handle, u16 src_id,
256 int (*set_event_map)(const struct ti_sci_handle *handle, u16 src_id,
259 int (*free_irq)(const struct ti_sci_handle *handle, u16 src_id,
261 int (*free_event_map)(const struct ti_sci_handle *handle, u16 src_id,
292 * struct ti_sci_msg_rm_ring_cfg - Ring configuration
312 * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
316 int (*set_cfg)(const struct ti_sci_handle *handle,
321 * struct ti_sci_rm_psil_ops - PSI-L thread operations
322 * @pair: pair PSI-L source thread to a destination thread.
327 * @unpair: unpair PSI-L source thread from a destination thread.
334 int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
336 int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
487 * struct ti_sci_rm_udmap_ops - UDMA Management operations
493 int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
495 int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
497 int (*rx_flow_cfg)(const struct ti_sci_handle *handle,
502 * struct ti_sci_proc_ops - Processor Control operations
513 * -handle: Pointer to TI SCI handle as retrieved by *ti_sci_get_handle
514 * -pid: Processor ID
515 * -hid: Host ID
518 int (*request)(const struct ti_sci_handle *handle, u8 pid);
519 int (*release)(const struct ti_sci_handle *handle, u8 pid);
520 int (*handover)(const struct ti_sci_handle *handle, u8 pid, u8 hid);
521 int (*set_config)(const struct ti_sci_handle *handle, u8 pid,
523 int (*set_control)(const struct ti_sci_handle *handle, u8 pid,
525 int (*get_status)(const struct ti_sci_handle *handle, u8 pid,
531 * struct ti_sci_ops - Function support for TI SCI
532 * @dev_ops: Device specific operations
551 * struct ti_sci_handle - Handle returned to TI SCI clients for usage.
563 * struct ti_sci_resource - Structure representing a resource assigned
564 * to a device.
576 const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
577 int ti_sci_put_handle(const struct ti_sci_handle *handle);
578 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
581 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
587 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
588 struct device *dev, u32 dev_id, char *of_prop);
590 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
595 static inline const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) in ti_sci_get_handle()
597 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
600 static inline int ti_sci_put_handle(const struct ti_sci_handle *handle) in ti_sci_put_handle() argument
602 return -EINVAL; in ti_sci_put_handle()
606 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev) in devm_ti_sci_get_handle()
608 return ERR_PTR(-EINVAL); in devm_ti_sci_get_handle()
615 return ERR_PTR(-EINVAL); in ti_sci_get_by_phandle()
619 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev, in devm_ti_sci_get_by_phandle()
622 return ERR_PTR(-EINVAL); in devm_ti_sci_get_by_phandle()
640 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, in devm_ti_sci_get_of_resource() argument
641 struct device *dev, u32 dev_id, char *of_prop) in devm_ti_sci_get_of_resource()
643 return ERR_PTR(-EINVAL); in devm_ti_sci_get_of_resource()
647 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
650 return ERR_PTR(-EINVAL);