2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DAL_AUX_ENGINE_H__
27 #define __DAL_AUX_ENGINE_H__
29 #include "dc_ddc_types.h"
33 struct aux_engine_funcs {
35 struct aux_engine **ptr);
36 bool (*acquire_engine)(
37 struct aux_engine *engine);
39 struct aux_engine *engine,
40 union aux_config cfg);
41 void (*submit_channel_request)(
42 struct aux_engine *engine,
43 struct aux_request_transaction_data *request);
44 void (*process_channel_reply)(
45 struct aux_engine *engine,
46 struct aux_reply_transaction_data *reply);
47 int (*read_channel_reply)(
48 struct aux_engine *engine,
51 uint8_t *reply_result,
53 enum aux_channel_operation_result (*get_channel_status)(
54 struct aux_engine *engine,
55 uint8_t *returned_bytes);
56 bool (*is_engine_available) (
57 struct aux_engine *engine);
62 const struct aux_engine_funcs *funcs;
63 /* following values are expressed in milliseconds */
65 uint32_t max_defer_write_retry;
70 void dal_aux_engine_construct(
71 struct aux_engine *engine,
72 struct dc_context *ctx);
74 void dal_aux_engine_destruct(
75 struct aux_engine *engine);
76 bool dal_aux_engine_submit_request(
78 struct i2caux_transaction_request *request,
79 bool middle_of_transaction);
80 bool dal_aux_engine_acquire(
83 enum i2caux_engine_type dal_aux_engine_get_engine_type(
84 const struct engine *engine);