mirror of
https://github.com/smaeul/u-boot.git
synced 2025-11-09 08:20:17 +00:00
The pinctrl and GPIO drivers are currently heavily incompatible with upstream. Most Qualcomm pinctrl blocks feature "tiles" of pins, each at it's own address. Introduce support for these by allowing the soc driver to specify per-pin register offsets similarly to the Linux driver. Adjust the GPIO driver to handle these too, and finally enable support for all pins with the same numbering as used in Linux. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
29 lines
491 B
C
29 lines
491 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Qualcomm common pin control data.
|
|
*
|
|
* Copyright (C) 2023 Linaro Ltd.
|
|
*/
|
|
#ifndef _QCOM_GPIO_H_
|
|
#define _QCOM_GPIO_H_
|
|
|
|
#include <asm/types.h>
|
|
#include <stdbool.h>
|
|
|
|
struct msm_pin_data {
|
|
int pin_count;
|
|
const unsigned int *pin_offsets;
|
|
};
|
|
|
|
static inline u32 qcom_pin_offset(const unsigned int *offs, unsigned int selector)
|
|
{
|
|
u32 out = (selector * 0x1000);
|
|
|
|
if (offs)
|
|
return out + offs[selector];
|
|
|
|
return out;
|
|
}
|
|
|
|
#endif /* _QCOM_GPIO_H_ */
|