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_GPIO_INTERFACE_H__
27 #define __DAL_GPIO_INTERFACE_H__
29 #include "gpio_types.h"
30 #include "grph_object_defs.h"
34 /* Open the handle for future use */
35 enum gpio_result
dal_gpio_open(
39 enum gpio_result
dal_gpio_open_ex(
43 /* Get high or low from the pin */
44 enum gpio_result
dal_gpio_get_value(
45 const struct gpio
*gpio
,
48 /* Set pin high or low */
49 enum gpio_result
dal_gpio_set_value(
50 const struct gpio
*gpio
,
53 /* Get current mode */
54 enum gpio_mode
dal_gpio_get_mode(
55 const struct gpio
*gpio
);
57 /* Change mode of the handle */
58 enum gpio_result
dal_gpio_change_mode(
63 enum gpio_result
dal_gpio_lock_pin(
67 enum gpio_result
dal_gpio_unlock_pin(
71 enum gpio_id
dal_gpio_get_id(
72 const struct gpio
*gpio
);
74 /* Get the GPIO enum */
75 uint32_t dal_gpio_get_enum(
76 const struct gpio
*gpio
);
78 /* Set the GPIO pin configuration */
79 enum gpio_result
dal_gpio_set_config(
81 const struct gpio_config_data
*config_data
);
83 /* Obtain GPIO pin info */
84 enum gpio_result
dal_gpio_get_pin_info(
85 const struct gpio
*gpio
,
86 struct gpio_pin_info
*pin_info
);
88 /* Obtain GPIO sync source */
89 enum sync_source
dal_gpio_get_sync_source(
90 const struct gpio
*gpio
);
92 /* Obtain GPIO pin output state (active low or active high) */
93 enum gpio_pin_output_state
dal_gpio_get_output_state(
94 const struct gpio
*gpio
);
96 struct hw_ddc
*dal_gpio_get_ddc(struct gpio
*gpio
);
98 struct hw_hpd
*dal_gpio_get_hpd(struct gpio
*gpio
);
100 struct hw_generic
*dal_gpio_get_generic(struct gpio
*gpio
);
102 /* Close the handle */