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,
207 * struct ti_sci_pm_ops - Low Power Mode (LPM) control operations
209 * - source: The wake up source that woke soc from LPM.
210 * - timestamp: Timestamp at which soc woke.
211 * @set_device_constraint: Set LPM constraint on behalf of a device
212 * - id: Device Identifier
213 * - state: The desired state of device constraint: set or clear.
215 * - latency: maximum acceptable latency to wake up from low power mode
216 * - state: The desired state of latency constraint: set or clear.
219 int (*lpm_wake_reason)(const struct ti_sci_handle *handle,
221 int (*set_device_constraint)(const struct ti_sci_handle *handle,
223 int (*set_latency_constraint)(const struct ti_sci_handle *handle,
228 * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
244 * struct ti_sci_rm_core_ops - Resource management core operations
248 * - s_host: Host processing entity to which the
253 * - handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
254 * - dev_id: TISCI device ID.
255 * - subtype: Resource assignment subtype that is being requested
256 * from the given device.
257 * - desc: Pointer to ti_sci_resource_desc to be updated with the resource
261 int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
263 int (*get_range_from_shost)(const struct ti_sci_handle *handle,
283 int (*set_irq)(const struct ti_sci_handle *handle, u16 src_id,
285 int (*set_event_map)(const struct ti_sci_handle *handle, u16 src_id,
288 int (*free_irq)(const struct ti_sci_handle *handle, u16 src_id,
290 int (*free_event_map)(const struct ti_sci_handle *handle, u16 src_id,
321 * struct ti_sci_msg_rm_ring_cfg - Ring configuration
341 * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
345 int (*set_cfg)(const struct ti_sci_handle *handle,
350 * struct ti_sci_rm_psil_ops - PSI-L thread operations
351 * @pair: pair PSI-L source thread to a destination thread.
356 * @unpair: unpair PSI-L source thread from a destination thread.
363 int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
365 int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
516 * struct ti_sci_rm_udmap_ops - UDMA Management operations
522 int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
524 int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
526 int (*rx_flow_cfg)(const struct ti_sci_handle *handle,
531 * struct ti_sci_proc_ops - Processor Control operations
542 * -handle: Pointer to TI SCI handle as retrieved by *ti_sci_get_handle
543 * -pid: Processor ID
544 * -hid: Host ID
547 int (*request)(const struct ti_sci_handle *handle, u8 pid);
548 int (*release)(const struct ti_sci_handle *handle, u8 pid);
549 int (*handover)(const struct ti_sci_handle *handle, u8 pid, u8 hid);
550 int (*set_config)(const struct ti_sci_handle *handle, u8 pid,
552 int (*set_control)(const struct ti_sci_handle *handle, u8 pid,
554 int (*get_status)(const struct ti_sci_handle *handle, u8 pid,
560 * struct ti_sci_ops - Function support for TI SCI
561 * @dev_ops: Device specific operations
581 * struct ti_sci_handle - Handle returned to TI SCI clients for usage.
593 * struct ti_sci_resource - Structure representing a resource assigned
594 * to a device.
606 const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
607 int ti_sci_put_handle(const struct ti_sci_handle *handle);
608 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
611 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
617 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
618 struct device *dev, u32 dev_id, char *of_prop);
620 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
625 static inline const struct ti_sci_handle *ti_sci_get_handle(struct device *dev) in ti_sci_get_handle()
627 return ERR_PTR(-EINVAL); in ti_sci_get_handle()
630 static inline int ti_sci_put_handle(const struct ti_sci_handle *handle) in ti_sci_put_handle() argument
632 return -EINVAL; in ti_sci_put_handle()
636 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev) in devm_ti_sci_get_handle()
638 return ERR_PTR(-EINVAL); in devm_ti_sci_get_handle()
645 return ERR_PTR(-EINVAL); in ti_sci_get_by_phandle()
649 const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev, in devm_ti_sci_get_by_phandle()
652 return ERR_PTR(-EINVAL); in devm_ti_sci_get_by_phandle()
670 devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, in devm_ti_sci_get_of_resource() argument
671 struct device *dev, u32 dev_id, char *of_prop) in devm_ti_sci_get_of_resource()
673 return ERR_PTR(-EINVAL); in devm_ti_sci_get_of_resource()
677 devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, in devm_ti_sci_get_resource() argument
680 return ERR_PTR(-EINVAL); in devm_ti_sci_get_resource()