WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / amd / display / include / gpio_service_interface.h
blob9c55d247227ea5fb5098679da77a74f55a041e05
1 /*
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.
22 * Authors: AMD
26 #ifndef __DAL_GPIO_SERVICE_INTERFACE_H__
27 #define __DAL_GPIO_SERVICE_INTERFACE_H__
29 #include "gpio_types.h"
30 #include "gpio_interface.h"
31 #include "hw/gpio.h"
33 struct gpio_service;
35 struct gpio *dal_gpio_create(
36 struct gpio_service *service,
37 enum gpio_id id,
38 uint32_t en,
39 enum gpio_pin_output_state output_state);
41 void dal_gpio_destroy(
42 struct gpio **ptr);
44 struct gpio_service *dal_gpio_service_create(
45 enum dce_version dce_version_major,
46 enum dce_version dce_version_minor,
47 struct dc_context *ctx);
49 struct gpio *dal_gpio_service_create_irq(
50 struct gpio_service *service,
51 uint32_t offset,
52 uint32_t mask);
54 struct gpio *dal_gpio_service_create_generic_mux(
55 struct gpio_service *service,
56 uint32_t offset,
57 uint32_t mask);
59 void dal_gpio_destroy_generic_mux(
60 struct gpio **mux);
62 enum gpio_result dal_mux_setup_config(
63 struct gpio *mux,
64 struct gpio_generic_mux_config *config);
66 struct gpio_pin_info dal_gpio_get_generic_pin_info(
67 struct gpio_service *service,
68 enum gpio_id id,
69 uint32_t en);
71 struct ddc *dal_gpio_create_ddc(
72 struct gpio_service *service,
73 uint32_t offset,
74 uint32_t mask,
75 struct gpio_ddc_hw_info *info);
77 void dal_gpio_destroy_ddc(
78 struct ddc **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(
90 struct gpio *irq,
91 struct gpio_hpd_config *config);
93 struct gpio *dal_gpio_create_irq(
94 struct gpio_service *service,
95 enum gpio_id id,
96 uint32_t en);
98 void dal_gpio_destroy_irq(
99 struct gpio **ptr);
102 enum gpio_result dal_ddc_open(
103 struct ddc *ddc,
104 enum gpio_mode mode,
105 enum gpio_ddc_config_type config_type);
107 enum gpio_result dal_ddc_change_mode(
108 struct ddc *ddc,
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(
115 struct ddc *ddc,
116 enum gpio_ddc_config_type config_type);
118 void dal_ddc_close(
119 struct ddc *ddc);
121 #endif