From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 046E82BE03C; Wed, 4 Feb 2026 15:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217350; cv=none; b=Ue9M6ecdREvHlU5UI14SP8DIpvx3zN4iSCFaYoDUQe3VNrzGO0Dpk0Z44GBzkYiTLZPbRAj/dgN2BxvDQvUbi7ugD6j3dL+10pSm7LkXGWRssG1V0c9YgOjtaM82Hms0uni1bWFqt1CijLHB8AiaA2wKis4Y03hqprJ2EEHvFN8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217350; c=relaxed/simple; bh=uuKpyF77GyDERDuIIuaeWYB959SaWgDt751+wITbuY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rT6hdW6meaPiCJq0EM9/aizwzPaB32NBefep2ouwr+KfDDstZE5hxFjhB4SMde5sGN8DeGOXlGxSEOuOohyi1amxj9Nq37re72o6takrtTJa2+o3HCk5iBnX/jn/EScXkiKxUAkDXD6tkd4EgQ+0rpPOIg3cM8//18VlQY2WD0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oB7305LG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oB7305LG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DFE2C19423; Wed, 4 Feb 2026 15:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770217349; bh=uuKpyF77GyDERDuIIuaeWYB959SaWgDt751+wITbuY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oB7305LG+f5cHnCkfAPNhwdnDfTcX4LChevslIxVEmJrEq5iEKnty0ac+ElsHiYT7 SdtxCT8iovSzqOCK7t/s/imYLpdg46l6o2tBNavLKhi6GdO1Ao8TeposliBnlYueec MNrJJFG5gSnEQMPKnfBDzDu2J2gCdAqI+onXfg04= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abel Vesa , Bartosz Golaszewski , Konrad Dybcio , Abel Vesa , Linus Walleij , Sasha Levin Subject: [PATCH 5.15 196/206] pinctrl: lpass-lpi: implement .get_direction() for the GPIO driver Date: Wed, 4 Feb 2026 15:40:27 +0100 Message-ID: <20260204143905.284742319@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143858.193781818@linuxfoundation.org> References: <20260204143858.193781818@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski [ Upstream commit 4f0d22ec60cee420125f4055af76caa0f373a3fe ] GPIO controller driver should typically implement the .get_direction() callback as GPIOLIB internals may try to use it to determine the state of a pin. Add it for the LPASS LPI driver. Reported-by: Abel Vesa Cc: stable@vger.kernel.org Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver") Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio # X1E CRD Tested-by: Abel Vesa Signed-off-by: Linus Walleij [ PIN_CONFIG_LEVEL => PIN_CONFIG_OUTPUT ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c @@ -484,6 +484,22 @@ static const struct pinconf_ops lpi_gpio .pin_config_group_set = lpi_config_set, }; +static int lpi_gpio_get_direction(struct gpio_chip *chip, unsigned int pin) +{ + unsigned long config = pinconf_to_config_packed(PIN_CONFIG_OUTPUT, 0); + struct lpi_pinctrl *state = gpiochip_get_data(chip); + unsigned long arg; + int ret; + + ret = lpi_config_get(state->ctrl, pin, &config); + if (ret) + return ret; + + arg = pinconf_to_config_argument(config); + + return arg ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; +} + static int lpi_gpio_direction_input(struct gpio_chip *chip, unsigned int pin) { struct lpi_pinctrl *state = gpiochip_get_data(chip); @@ -582,6 +598,7 @@ static void lpi_gpio_dbg_show(struct seq #endif static const struct gpio_chip lpi_gpio_template = { + .get_direction = lpi_gpio_get_direction, .direction_input = lpi_gpio_direction_input, .direction_output = lpi_gpio_direction_output, .get = lpi_gpio_get,