Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6272602d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "pinctrl: qcom: spmi-gpio: add support to enable/disable output"

parents c9e80c50 3f96cb1a
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
 */

#include <linux/gpio/driver.h>
@@ -423,6 +423,9 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev,
			return -EINVAL;
		arg = 1;
		break;
	case PIN_CONFIG_OUTPUT_ENABLE:
		arg = pad->output_enabled;
		break;
	case PIN_CONFIG_OUTPUT:
		arg = pad->out_value;
		break;
@@ -502,6 +505,9 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
		case PIN_CONFIG_INPUT_ENABLE:
			pad->input_enabled = arg ? true : false;
			break;
		case PIN_CONFIG_OUTPUT_ENABLE:
			pad->output_enabled = arg ? true : false;
			break;
		case PIN_CONFIG_OUTPUT:
			pad->output_enabled = true;
			pad->out_value = arg;