coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio_common.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _SOC_QUALCOMM_COMMON_GPIO_H_
4 #define _SOC_QUALCOMM_COMMON_GPIO_H_
5 
6 #include <soc/gpio.h>
7 #include <soc/addressmap.h>
8 
9 #define GPIO_FUNC_GPIO 0
10 #define TLMM_GPIO_OFF_DELTA 0x1000
11 
12 /* GPIO TLMM INTR: Mask */
16 };
17 
18 /* GPIO TLMM: Mask */
20  GPIO_BMSK = 0x1,
25 };
26 
27 /* GPIO TLMM INTR: Shift */
31 };
32 
33 /* GPIO TLMM: Shift */
40 };
41 
42 /* GPIO IO: Shift */
46 };
47 
48 /* GPIO INTR STATUS */
52 };
53 
54 /* GPIO TLMM: Direction */
58 };
59 
60 /* GPIO TLMM: Pullup/Pulldown */
61 enum gpio_pull {
66 };
67 
68 /* GPIO TLMM: Drive Strength */
78 };
79 
85 };
86 
87 typedef struct {
89 } gpio_t;
90 
91 struct tlmm_gpio {
96 };
97 
98 #define GPIO(num) ((gpio_t){.addr = GPIO##num##_ADDR})
99 
101  uint32_t drive_str, uint32_t enable);
104 
105 #endif /* _SOC_QUALCOMM_COMMON_GPIO_H_ */
#define pull
Definition: asmlib.h:26
unsigned int type
Definition: edid.c:57
gpio_irq_type
Definition: gpio_common.h:54
@ GPIO_PULL_DOWN
Definition: gpio_common.h:17
@ GPIO_PULL_UP
Definition: gpio_common.h:18
gpio_drv_str
Definition: gpio_common.h:69
@ GPIO_8MA
Definition: gpio_common.h:73
@ GPIO_12MA
Definition: gpio_common.h:75
@ GPIO_14MA
Definition: gpio_common.h:76
@ GPIO_6MA
Definition: gpio_common.h:72
@ GPIO_2MA
Definition: gpio_common.h:70
@ GPIO_16MA
Definition: gpio_common.h:77
@ GPIO_4MA
Definition: gpio_common.h:71
@ GPIO_10MA
Definition: gpio_common.h:74
void gpio_input_irq(gpio_t gpio, enum gpio_irq_type type, uint32_t pull)
Definition: gpio.c:65
@ IRQ_TYPE_DUAL_EDGE
Definition: gpio_common.h:84
@ IRQ_TYPE_RISING_EDGE
Definition: gpio_common.h:82
@ IRQ_TYPE_FALLING_EDGE
Definition: gpio_common.h:83
@ IRQ_TYPE_LEVEL
Definition: gpio_common.h:81
gpio_irq_status
Definition: gpio_common.h:49
@ GPIO_INTR_STATUS_DISABLE
Definition: gpio_common.h:50
@ GPIO_INTR_STATUS_ENABLE
Definition: gpio_common.h:51
gpio_tlmm_intr_bmsk
Definition: gpio_common.h:13
@ GPIO_INTR_DECT_CTL_MASK
Definition: gpio_common.h:15
@ GPIO_INTR_STATUS_MASK
Definition: gpio_common.h:14
gpio_io_shft
Definition: gpio_common.h:43
@ GPIO_IO_OUT_SHFT
Definition: gpio_common.h:45
@ GPIO_IO_IN_SHFT
Definition: gpio_common.h:44
gpio_tlmm_intr_shft
Definition: gpio_common.h:28
@ GPIO_INTR_DECT_CTL_SHFT
Definition: gpio_common.h:29
@ GPIO_INTR_RAW_STATUS_EN_SHFT
Definition: gpio_common.h:30
gpio_direction
Definition: gpio_common.h:55
@ GPIO_INPUT
Definition: gpio_common.h:56
@ GPIO_OUTPUT
Definition: gpio_common.h:57
void gpio_configure(gpio_t gpio, uint32_t func, uint32_t pull, uint32_t drive_str, uint32_t enable)
Definition: gpio.c:7
gpio_pull
Definition: gpio_common.h:61
@ GPIO_KEEPER
Definition: gpio_common.h:64
@ GPIO_NO_PULL
Definition: gpio_common.h:62
gpio_tlmm_shft
Definition: gpio_common.h:34
@ GPIO_CFG_EGPIO_SHFT
Definition: gpio_common.h:39
@ GPIO_CFG_FUNC_SHFT
Definition: gpio_common.h:36
@ GPIO_CFG_DRV_SHFT
Definition: gpio_common.h:37
@ GPIO_CFG_PULL_SHFT
Definition: gpio_common.h:35
@ GPIO_CFG_OE_SHFT
Definition: gpio_common.h:38
gpio_tlmm_bmsk
Definition: gpio_common.h:19
@ GPIO_CFG_PULL_BMSK
Definition: gpio_common.h:21
@ GPIO_CFG_DRV_BMSK
Definition: gpio_common.h:23
@ GPIO_CFG_EGPIO_BMSK
Definition: gpio_common.h:24
@ GPIO_BMSK
Definition: gpio_common.h:20
@ GPIO_CFG_FUNC_BMSK
Definition: gpio_common.h:22
uint32_t gpio_t
Definition: gpio.h:9
unsigned int uint32_t
Definition: stdint.h:14
uint32_t u32
Definition: stdint.h:51
u32 addr
Definition: gpio_common.h:88
Definition: pinmux.c:36
uint32_t intr_cfg
Definition: gpio_common.h:94
uint32_t intr_status
Definition: gpio_common.h:95
uint32_t cfg
Definition: gpio_common.h:92
uint32_t in_out
Definition: gpio_common.h:93