11.1Sjmcneill/*	$NetBSD: qcom,pmic-gpio.h,v 1.1.1.3 2017/11/30 19:40:51 jmcneill Exp $	*/
21.1Sjmcneill
31.1.1.3Sjmcneill/* SPDX-License-Identifier: GPL-2.0 */
41.1Sjmcneill/*
51.1Sjmcneill * This header provides constants for the Qualcomm PMIC GPIO binding.
61.1Sjmcneill */
71.1Sjmcneill
81.1Sjmcneill#ifndef _DT_BINDINGS_PINCTRL_QCOM_PMIC_GPIO_H
91.1Sjmcneill#define _DT_BINDINGS_PINCTRL_QCOM_PMIC_GPIO_H
101.1Sjmcneill
111.1Sjmcneill#define PMIC_GPIO_PULL_UP_30		0
121.1Sjmcneill#define PMIC_GPIO_PULL_UP_1P5		1
131.1Sjmcneill#define PMIC_GPIO_PULL_UP_31P5		2
141.1Sjmcneill#define PMIC_GPIO_PULL_UP_1P5_30	3
151.1Sjmcneill
161.1Sjmcneill#define PMIC_GPIO_STRENGTH_NO		0
171.1Sjmcneill#define PMIC_GPIO_STRENGTH_HIGH		1
181.1Sjmcneill#define PMIC_GPIO_STRENGTH_MED		2
191.1Sjmcneill#define PMIC_GPIO_STRENGTH_LOW		3
201.1Sjmcneill
211.1Sjmcneill/*
221.1Sjmcneill * Note: PM8018 GPIO3 and GPIO4 are supporting
231.1Sjmcneill * only S3 and L2 options (1.8V)
241.1Sjmcneill */
251.1Sjmcneill#define PM8018_GPIO_L6			0
261.1Sjmcneill#define PM8018_GPIO_L5			1
271.1Sjmcneill#define PM8018_GPIO_S3			2
281.1Sjmcneill#define PM8018_GPIO_L14			3
291.1Sjmcneill#define PM8018_GPIO_L2			4
301.1Sjmcneill#define PM8018_GPIO_L4			5
311.1Sjmcneill#define PM8018_GPIO_VDD			6
321.1Sjmcneill
331.1Sjmcneill/*
341.1Sjmcneill * Note: PM8038 GPIO7 and GPIO8 are supporting
351.1Sjmcneill * only L11 and L4 options (1.8V)
361.1Sjmcneill */
371.1Sjmcneill#define PM8038_GPIO_VPH			0
381.1Sjmcneill#define PM8038_GPIO_BB			1
391.1Sjmcneill#define PM8038_GPIO_L11			2
401.1Sjmcneill#define PM8038_GPIO_L15			3
411.1Sjmcneill#define PM8038_GPIO_L4			4
421.1Sjmcneill#define PM8038_GPIO_L3			5
431.1Sjmcneill#define PM8038_GPIO_L17			6
441.1Sjmcneill
451.1Sjmcneill#define PM8058_GPIO_VPH			0
461.1Sjmcneill#define PM8058_GPIO_BB			1
471.1Sjmcneill#define PM8058_GPIO_S3			2
481.1Sjmcneill#define PM8058_GPIO_L3			3
491.1Sjmcneill#define PM8058_GPIO_L7			4
501.1Sjmcneill#define PM8058_GPIO_L6			5
511.1Sjmcneill#define PM8058_GPIO_L5			6
521.1Sjmcneill#define PM8058_GPIO_L2			7
531.1Sjmcneill
541.1Sjmcneill/*
551.1Sjmcneill * Note: PM8916 GPIO1 and GPIO2 are supporting
561.1Sjmcneill * only L2(1.15V) and L5(1.8V) options
571.1Sjmcneill */
581.1Sjmcneill#define PM8916_GPIO_VPH			0
591.1Sjmcneill#define PM8916_GPIO_L2			2
601.1Sjmcneill#define PM8916_GPIO_L5			3
611.1Sjmcneill
621.1Sjmcneill#define PM8917_GPIO_VPH			0
631.1Sjmcneill#define PM8917_GPIO_S4			2
641.1Sjmcneill#define PM8917_GPIO_L15			3
651.1Sjmcneill#define PM8917_GPIO_L4			4
661.1Sjmcneill#define PM8917_GPIO_L3			5
671.1Sjmcneill#define PM8917_GPIO_L17			6
681.1Sjmcneill
691.1Sjmcneill#define PM8921_GPIO_VPH			0
701.1Sjmcneill#define PM8921_GPIO_BB			1
711.1Sjmcneill#define PM8921_GPIO_S4			2
721.1Sjmcneill#define PM8921_GPIO_L15			3
731.1Sjmcneill#define PM8921_GPIO_L4			4
741.1Sjmcneill#define PM8921_GPIO_L3			5
751.1Sjmcneill#define PM8921_GPIO_L17			6
761.1Sjmcneill
771.1Sjmcneill/*
781.1Sjmcneill * Note: PM8941 gpios from 15 to 18 are supporting
791.1Sjmcneill * only S3 and L6 options (1.8V)
801.1Sjmcneill */
811.1Sjmcneill#define PM8941_GPIO_VPH			0
821.1Sjmcneill#define PM8941_GPIO_L1			1
831.1Sjmcneill#define PM8941_GPIO_S3			2
841.1Sjmcneill#define PM8941_GPIO_L6			3
851.1Sjmcneill
861.1Sjmcneill/*
871.1Sjmcneill * Note: PMA8084 gpios from 15 to 18 are supporting
881.1Sjmcneill * only S4 and L6 options (1.8V)
891.1Sjmcneill */
901.1Sjmcneill#define PMA8084_GPIO_VPH		0
911.1Sjmcneill#define PMA8084_GPIO_L1			1
921.1Sjmcneill#define PMA8084_GPIO_S4			2
931.1Sjmcneill#define PMA8084_GPIO_L6			3
941.1Sjmcneill
951.1Sjmcneill#define PM8994_GPIO_VPH			0
961.1Sjmcneill#define PM8994_GPIO_S4			2
971.1Sjmcneill#define PM8994_GPIO_L12			3
981.1Sjmcneill
991.1Sjmcneill/* To be used with "function" */
1001.1Sjmcneill#define PMIC_GPIO_FUNC_NORMAL		"normal"
1011.1Sjmcneill#define PMIC_GPIO_FUNC_PAIRED		"paired"
1021.1Sjmcneill#define PMIC_GPIO_FUNC_FUNC1		"func1"
1031.1Sjmcneill#define PMIC_GPIO_FUNC_FUNC2		"func2"
1041.1.1.2Sjmcneill#define PMIC_GPIO_FUNC_FUNC3		"func3"
1051.1.1.2Sjmcneill#define PMIC_GPIO_FUNC_FUNC4		"func4"
1061.1Sjmcneill#define PMIC_GPIO_FUNC_DTEST1		"dtest1"
1071.1Sjmcneill#define PMIC_GPIO_FUNC_DTEST2		"dtest2"
1081.1Sjmcneill#define PMIC_GPIO_FUNC_DTEST3		"dtest3"
1091.1Sjmcneill#define PMIC_GPIO_FUNC_DTEST4		"dtest4"
1101.1Sjmcneill
1111.1Sjmcneill#define PM8038_GPIO1_2_LPG_DRV		PMIC_GPIO_FUNC_FUNC1
1121.1Sjmcneill#define PM8038_GPIO3_5V_BOOST_EN	PMIC_GPIO_FUNC_FUNC1
1131.1Sjmcneill#define PM8038_GPIO4_SSBI_ALT_CLK	PMIC_GPIO_FUNC_FUNC1
1141.1Sjmcneill#define PM8038_GPIO5_6_EXT_REG_EN	PMIC_GPIO_FUNC_FUNC1
1151.1Sjmcneill#define PM8038_GPIO10_11_EXT_REG_EN	PMIC_GPIO_FUNC_FUNC1
1161.1Sjmcneill#define PM8038_GPIO6_7_CLK		PMIC_GPIO_FUNC_FUNC1
1171.1Sjmcneill#define PM8038_GPIO9_BAT_ALRM_OUT	PMIC_GPIO_FUNC_FUNC1
1181.1Sjmcneill#define PM8038_GPIO6_12_KYPD_DRV	PMIC_GPIO_FUNC_FUNC2
1191.1Sjmcneill
1201.1Sjmcneill#define PM8058_GPIO7_8_MP3_CLK		PMIC_GPIO_FUNC_FUNC1
1211.1Sjmcneill#define PM8058_GPIO7_8_BCLK_19P2MHZ	PMIC_GPIO_FUNC_FUNC2
1221.1Sjmcneill#define PM8058_GPIO9_26_KYPD_DRV	PMIC_GPIO_FUNC_FUNC1
1231.1Sjmcneill#define PM8058_GPIO21_23_UART_TX	PMIC_GPIO_FUNC_FUNC2
1241.1Sjmcneill#define PM8058_GPIO24_26_LPG_DRV	PMIC_GPIO_FUNC_FUNC2
1251.1Sjmcneill#define PM8058_GPIO33_BCLK_19P2MHZ	PMIC_GPIO_FUNC_FUNC1
1261.1Sjmcneill#define PM8058_GPIO34_35_MP3_CLK	PMIC_GPIO_FUNC_FUNC1
1271.1Sjmcneill#define PM8058_GPIO36_BCLK_19P2MHZ	PMIC_GPIO_FUNC_FUNC1
1281.1Sjmcneill#define PM8058_GPIO37_UPL_OUT		PMIC_GPIO_FUNC_FUNC1
1291.1Sjmcneill#define PM8058_GPIO37_UART_M_RX		PMIC_GPIO_FUNC_FUNC2
1301.1Sjmcneill#define PM8058_GPIO38_XO_SLEEP_CLK	PMIC_GPIO_FUNC_FUNC1
1311.1Sjmcneill#define PM8058_GPIO38_39_CLK_32KHZ	PMIC_GPIO_FUNC_FUNC2
1321.1Sjmcneill#define PM8058_GPIO39_MP3_CLK		PMIC_GPIO_FUNC_FUNC1
1331.1Sjmcneill#define PM8058_GPIO40_EXT_BB_EN		PMIC_GPIO_FUNC_FUNC1
1341.1Sjmcneill
1351.1Sjmcneill#define PM8916_GPIO1_BAT_ALRM_OUT	PMIC_GPIO_FUNC_FUNC1
1361.1Sjmcneill#define PM8916_GPIO1_KEYP_DRV		PMIC_GPIO_FUNC_FUNC2
1371.1Sjmcneill#define PM8916_GPIO2_DIV_CLK		PMIC_GPIO_FUNC_FUNC1
1381.1Sjmcneill#define PM8916_GPIO2_SLEEP_CLK		PMIC_GPIO_FUNC_FUNC2
1391.1Sjmcneill#define PM8916_GPIO3_KEYP_DRV		PMIC_GPIO_FUNC_FUNC1
1401.1Sjmcneill#define PM8916_GPIO4_KEYP_DRV		PMIC_GPIO_FUNC_FUNC2
1411.1Sjmcneill
1421.1Sjmcneill#define PM8917_GPIO9_18_KEYP_DRV	PMIC_GPIO_FUNC_FUNC1
1431.1Sjmcneill#define PM8917_GPIO20_BAT_ALRM_OUT	PMIC_GPIO_FUNC_FUNC1
1441.1Sjmcneill#define PM8917_GPIO21_23_UART_TX	PMIC_GPIO_FUNC_FUNC2
1451.1Sjmcneill#define PM8917_GPIO25_26_EXT_REG_EN	PMIC_GPIO_FUNC_FUNC1
1461.1Sjmcneill#define PM8917_GPIO37_38_XO_SLEEP_CLK	PMIC_GPIO_FUNC_FUNC1
1471.1Sjmcneill#define PM8917_GPIO37_38_MP3_CLK	PMIC_GPIO_FUNC_FUNC2
1481.1Sjmcneill
1491.1Sjmcneill#define PM8941_GPIO9_14_KYPD_DRV	PMIC_GPIO_FUNC_FUNC1
1501.1Sjmcneill#define PM8941_GPIO15_18_DIV_CLK	PMIC_GPIO_FUNC_FUNC1
1511.1Sjmcneill#define PM8941_GPIO15_18_SLEEP_CLK	PMIC_GPIO_FUNC_FUNC2
1521.1Sjmcneill#define PM8941_GPIO23_26_KYPD_DRV	PMIC_GPIO_FUNC_FUNC1
1531.1Sjmcneill#define PM8941_GPIO23_26_LPG_DRV_HI	PMIC_GPIO_FUNC_FUNC2
1541.1Sjmcneill#define PM8941_GPIO31_BAT_ALRM_OUT	PMIC_GPIO_FUNC_FUNC1
1551.1Sjmcneill#define PM8941_GPIO33_36_LPG_DRV_3D	PMIC_GPIO_FUNC_FUNC1
1561.1Sjmcneill#define PM8941_GPIO33_36_LPG_DRV_HI	PMIC_GPIO_FUNC_FUNC2
1571.1Sjmcneill
1581.1Sjmcneill#define PMA8084_GPIO4_5_LPG_DRV		PMIC_GPIO_FUNC_FUNC1
1591.1Sjmcneill#define PMA8084_GPIO7_10_LPG_DRV	PMIC_GPIO_FUNC_FUNC1
1601.1Sjmcneill#define PMA8084_GPIO5_14_KEYP_DRV	PMIC_GPIO_FUNC_FUNC2
1611.1Sjmcneill#define PMA8084_GPIO19_21_KEYP_DRV	PMIC_GPIO_FUNC_FUNC2
1621.1Sjmcneill#define PMA8084_GPIO15_18_DIV_CLK	PMIC_GPIO_FUNC_FUNC1
1631.1Sjmcneill#define PMA8084_GPIO15_18_SLEEP_CLK	PMIC_GPIO_FUNC_FUNC2
1641.1Sjmcneill#define PMA8084_GPIO22_BAT_ALRM_OUT	PMIC_GPIO_FUNC_FUNC1
1651.1Sjmcneill
1661.1Sjmcneill#endif
167