Skip to content

Commit 4af95d0

Browse files
David Collinslinusw
authored andcommitted
pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes
Add support for SPMI PMIC GPIO subtypes GPIO_LV_VIN2 and GPIO_MV_VIN3. GPIO_LV_VIN2 GPIOs support two input reference voltages: VIN0 and VIN1. These are typically connected to 1.8 V and 1.2 V supplies respectively. GPIO_MV_VIN3 GPIOs support three input reference voltages: VIN0, VIN1, and VIN2. These are typically connected to Vph, 1.8 V, and 1.2 V supplies respectively. Signed-off-by: David Collins <[email protected]> Signed-off-by: Anjelique Melendez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 1c2eb18 commit 4af95d0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/pinctrl/qcom/pinctrl-spmi-gpio.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Copyright (c) 2012-2014, 2016-2021 The Linux Foundation. All rights reserved.
4+
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
45
*/
56

67
#include <linux/gpio/driver.h>
@@ -36,6 +37,8 @@
3637
#define PMIC_GPIO_SUBTYPE_GPIOC_8CH 0xd
3738
#define PMIC_GPIO_SUBTYPE_GPIO_LV 0x10
3839
#define PMIC_GPIO_SUBTYPE_GPIO_MV 0x11
40+
#define PMIC_GPIO_SUBTYPE_GPIO_LV_VIN2 0x12
41+
#define PMIC_GPIO_SUBTYPE_GPIO_MV_VIN3 0x13
3942

4043
#define PMIC_MPP_REG_RT_STS 0x10
4144
#define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1
@@ -822,6 +825,16 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
822825
pad->have_buffer = true;
823826
pad->lv_mv_type = true;
824827
break;
828+
case PMIC_GPIO_SUBTYPE_GPIO_LV_VIN2:
829+
pad->num_sources = 2;
830+
pad->have_buffer = true;
831+
pad->lv_mv_type = true;
832+
break;
833+
case PMIC_GPIO_SUBTYPE_GPIO_MV_VIN3:
834+
pad->num_sources = 3;
835+
pad->have_buffer = true;
836+
pad->lv_mv_type = true;
837+
break;
825838
default:
826839
dev_err(state->dev, "unknown GPIO type 0x%x\n", subtype);
827840
return -ENODEV;

0 commit comments

Comments
 (0)