NFC: Driver: configure NFC_CLK_REQ GPIO to wakeup capable

Configure NFC_CLK_REQ GPIO (GPIO_35) to wakeup capable
by calling msm_gpio_mpm_wake_set().

Change-Id: Ic3f5a7caffc4de376dbcc00123fddeb6fd4fefa8
This commit is contained in:
Khageswararao Rao B
2022-12-01 20:47:32 +05:30
parent 6de117e3c9
commit 5343706ca7

View File

@@ -24,7 +24,7 @@
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/delay.h>
#include <linux/pinctrl/qcom-pinctrl.h>
#include "common.h"
@@ -413,6 +413,7 @@ long nfc_dev_compat_ioctl(struct file *pfile, unsigned int cmd,
int nfc_post_init(struct nfc_dev *nfc_dev)
{
int ret=0;
unsigned int clkreq_gpio = 0;
static int post_init_success;
struct platform_configs nfc_configs;
struct platform_gpio *nfc_gpio;
@@ -445,6 +446,22 @@ int nfc_post_init(struct nfc_dev *nfc_dev)
__func__, nfc_gpio->clkreq);
return ret;
}
/* Read clkreq GPIO number from device tree*/
ret = of_property_read_u32_index(nfc_dev->i2c_dev.client->dev.of_node, DTS_CLKREQ_GPIO_STR, 1, &clkreq_gpio);
if (ret < 0) {
pr_err("%s Failed to read clkreq gipo number, ret: %d\n", __func__, ret);
return ret;
}
/* configure clkreq GPIO as wakeup capable */
ret = msm_gpio_mpm_wake_set(clkreq_gpio, true);
if (ret < 0) {
pr_err("%s Failed to setup clkreq gpio %d as wakeup capable, ret: %d\n", __func__, clkreq_gpio , ret);
return ret;
} else {
pr_info("%s clkreq gpio %d successfully setup for wakeup capable\n", __func__, clkreq_gpio);
}
}
ret = nfcc_hw_check(nfc_dev);