mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
serial: msm_geni_serial: Vote for shutdown pinctrl during BT off
Currently driver is voting for active/sleep state configuration during BT disconnect. Since this state contains UART functionality, GPIO pins remains high which consumes power. This change is added to vote for the shutdown pinctrl state during BT disconnect and configure GPIO's in gpio functionality. This is a requirement from BT SOC team. Change-Id: I09f7a4a1dbc197c2bfd443a0b546a1ff283134ed Signed-off-by: Paras Sharma <parashar@codeaurora.org>
This commit is contained in:
parent
aa860b5b17
commit
0df046ba49
2 changed files with 24 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/bitmap.h>
|
||||
|
|
@ -2187,6 +2187,14 @@ static void msm_geni_serial_shutdown(struct uart_port *uport)
|
|||
disable_irq(msm_port->wakeup_irq);
|
||||
free_irq(msm_port->wakeup_irq, uport);
|
||||
}
|
||||
|
||||
if (!IS_ERR_OR_NULL(msm_port->serial_rsc.geni_gpio_shutdown)) {
|
||||
ret = pinctrl_select_state(msm_port->serial_rsc.geni_pinctrl,
|
||||
msm_port->serial_rsc.geni_gpio_shutdown);
|
||||
if (ret)
|
||||
IPC_LOG_MSG(msm_port->ipc_log_misc,
|
||||
"%s: Error %d pinctrl_select_state\n", __func__, ret);
|
||||
}
|
||||
}
|
||||
IPC_LOG_MSG(msm_port->ipc_log_misc, "%s: End\n", __func__);
|
||||
}
|
||||
|
|
@ -2905,6 +2913,18 @@ static int msm_geni_serial_get_irq_pinctrl(struct platform_device *pdev,
|
|||
dev_err(&pdev->dev, "No pinctrl config specified!\n");
|
||||
return PTR_ERR(dev_port->serial_rsc.geni_pinctrl);
|
||||
}
|
||||
|
||||
if (!dev_port->is_console) {
|
||||
if (IS_ERR_OR_NULL(pinctrl_lookup_state(dev_port->serial_rsc.geni_pinctrl,
|
||||
PINCTRL_SHUTDOWN))) {
|
||||
dev_info(&pdev->dev, "No Shutdown config specified\n");
|
||||
} else {
|
||||
dev_port->serial_rsc.geni_gpio_shutdown =
|
||||
pinctrl_lookup_state(dev_port->serial_rsc.geni_pinctrl,
|
||||
PINCTRL_SHUTDOWN);
|
||||
}
|
||||
}
|
||||
|
||||
dev_port->serial_rsc.geni_gpio_active =
|
||||
pinctrl_lookup_state(dev_port->serial_rsc.geni_pinctrl,
|
||||
PINCTRL_ACTIVE);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_MSM_GENI_SE
|
||||
|
|
@ -66,6 +66,7 @@ struct se_geni_rsc {
|
|||
unsigned long ib;
|
||||
unsigned long ib_noc;
|
||||
struct pinctrl *geni_pinctrl;
|
||||
struct pinctrl_state *geni_gpio_shutdown;
|
||||
struct pinctrl_state *geni_gpio_active;
|
||||
struct pinctrl_state *geni_gpio_sleep;
|
||||
int clk_freq_out;
|
||||
|
|
@ -76,6 +77,7 @@ struct se_geni_rsc {
|
|||
#define PINCTRL_DEFAULT "default"
|
||||
#define PINCTRL_ACTIVE "active"
|
||||
#define PINCTRL_SLEEP "sleep"
|
||||
#define PINCTRL_SHUTDOWN "shutdown"
|
||||
|
||||
#define KHz(freq) (1000 * (freq))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue