Path: blob/master/drivers/gpu/drm/amd/display/include/gpio_interface.h
26535 views
/*1* Copyright 2012-15 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21* Authors: AMD22*23*/2425#ifndef __DAL_GPIO_INTERFACE_H__26#define __DAL_GPIO_INTERFACE_H__2728#include "gpio_types.h"29#include "grph_object_defs.h"3031struct gpio;3233/* Open the handle for future use */34enum gpio_result dal_gpio_open(35struct gpio *gpio,36enum gpio_mode mode);3738enum gpio_result dal_gpio_open_ex(39struct gpio *gpio,40enum gpio_mode mode);4142/* Get high or low from the pin */43enum gpio_result dal_gpio_get_value(44const struct gpio *gpio,45uint32_t *value);4647/* Set pin high or low */48enum gpio_result dal_gpio_set_value(49const struct gpio *gpio,50uint32_t value);5152/* Get current mode */53enum gpio_mode dal_gpio_get_mode(54const struct gpio *gpio);5556/* Change mode of the handle */57enum gpio_result dal_gpio_change_mode(58struct gpio *gpio,59enum gpio_mode mode);6061/* Lock Pin */62enum gpio_result dal_gpio_lock_pin(63struct gpio *gpio);6465/* Unlock Pin */66enum gpio_result dal_gpio_unlock_pin(67struct gpio *gpio);6869/* Get the GPIO id */70enum gpio_id dal_gpio_get_id(71const struct gpio *gpio);7273/* Get the GPIO enum */74uint32_t dal_gpio_get_enum(75const struct gpio *gpio);7677/* Set the GPIO pin configuration */78enum gpio_result dal_gpio_set_config(79struct gpio *gpio,80const struct gpio_config_data *config_data);8182/* Obtain GPIO pin info */83enum gpio_result dal_gpio_get_pin_info(84const struct gpio *gpio,85struct gpio_pin_info *pin_info);8687/* Obtain GPIO sync source */88enum sync_source dal_gpio_get_sync_source(89const struct gpio *gpio);9091/* Obtain GPIO pin output state (active low or active high) */92enum gpio_pin_output_state dal_gpio_get_output_state(93const struct gpio *gpio);9495struct hw_ddc *dal_gpio_get_ddc(struct gpio *gpio);9697struct hw_hpd *dal_gpio_get_hpd(struct gpio *gpio);9899struct hw_generic *dal_gpio_get_generic(struct gpio *gpio);100101/* Close the handle */102void dal_gpio_close(103struct gpio *gpio);104105106107108#endif109110111