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_SERVICE_INTERFACE_H__
27 #define __DAL_GPIO_SERVICE_INTERFACE_H__
29 #include "gpio_types.h"
30 #include "gpio_interface.h"
35 struct gpio *dal_gpio_create(
36 struct gpio_service *service,
39 enum gpio_pin_output_state output_state);
41 void dal_gpio_destroy(
44 struct gpio_service *dal_gpio_service_create(
45 enum dce_version dce_version,
46 enum dce_environment dce_environment,
47 struct dc_context *ctx);
49 struct gpio *dal_gpio_service_create_irq(
50 struct gpio_service *service,
54 struct gpio *dal_gpio_service_create_generic_mux(
55 struct gpio_service *service,
59 void dal_gpio_destroy_generic_mux(
62 enum gpio_result dal_mux_setup_config(
64 struct gpio_generic_mux_config *config);
66 struct gpio_pin_info dal_gpio_get_generic_pin_info(
67 struct gpio_service *service,
71 struct ddc *dal_gpio_create_ddc(
72 struct gpio_service *service,
75 struct gpio_ddc_hw_info *info);
77 void dal_gpio_destroy_ddc(
80 void dal_gpio_service_destroy(
81 struct gpio_service **ptr);
83 enum dc_irq_source dal_irq_get_source(
84 const struct gpio *irq);
86 enum dc_irq_source dal_irq_get_rx_source(
87 const struct gpio *irq);
89 enum gpio_result dal_irq_setup_hpd_filter(
91 struct gpio_hpd_config *config);
93 struct gpio *dal_gpio_create_irq(
94 struct gpio_service *service,
98 void dal_gpio_destroy_irq(
102 enum gpio_result dal_ddc_open(
105 enum gpio_ddc_config_type config_type);
107 enum gpio_result dal_ddc_change_mode(
109 enum gpio_mode mode);
111 enum gpio_ddc_line dal_ddc_get_line(
112 const struct ddc *ddc);
114 enum gpio_result dal_ddc_set_config(
116 enum gpio_ddc_config_type config_type);