Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Mateusz Kulikowski | 2507d82 | 2016-03-31 23:12:32 +0200 | [diff] [blame] | 2 | /* |
Caleb Connolly | fabb897 | 2023-11-14 12:55:42 +0000 | [diff] [blame] | 3 | * Qualcomm common pin control data. |
Mateusz Kulikowski | 2507d82 | 2016-03-31 23:12:32 +0200 | [diff] [blame] | 4 | * |
Caleb Connolly | fabb897 | 2023-11-14 12:55:42 +0000 | [diff] [blame] | 5 | * Copyright (C) 2023 Linaro Ltd. |
Mateusz Kulikowski | 2507d82 | 2016-03-31 23:12:32 +0200 | [diff] [blame] | 6 | */ |
Caleb Connolly | fabb897 | 2023-11-14 12:55:42 +0000 | [diff] [blame] | 7 | #ifndef _QCOM_GPIO_H_ |
| 8 | #define _QCOM_GPIO_H_ |
| 9 | |
| 10 | #include <asm/types.h> |
| 11 | #include <stdbool.h> |
| 12 | |
| 13 | struct msm_pin_data { |
| 14 | int pin_count; |
| 15 | const unsigned int *pin_offsets; |
| 16 | }; |
| 17 | |
| 18 | static inline u32 qcom_pin_offset(const unsigned int *offs, unsigned int selector) |
| 19 | { |
| 20 | u32 out = (selector * 0x1000); |
| 21 | |
| 22 | if (offs) |
| 23 | return out + offs[selector]; |
| 24 | |
| 25 | return out; |
| 26 | } |
| 27 | |
| 28 | #endif /* _QCOM_GPIO_H_ */ |