nfc driver: Enable nfc clk request gpio and RF_CLK3 configuration
Enabled nfc clk request gpio and RF_CLK3 configuration for pitti. Change-Id: I540a09798777b05f2a1b82e6d89c0641e3fe1da3 Signed-off-by: Khageswararao Rao B <quic_kraob@quicinc.com>
This commit is contained in:
37
nfc/common.c
37
nfc/common.c
@@ -69,17 +69,20 @@ int nfc_parse_dt(struct device *dev, struct platform_configs *nfc_configs,
|
|||||||
pr_warn("NxpDrv: %s: dwl_req gpio invalid %d\n", __func__,
|
pr_warn("NxpDrv: %s: dwl_req gpio invalid %d\n", __func__,
|
||||||
nfc_gpio->dwl_req);
|
nfc_gpio->dwl_req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read clock request gpio configuration if MGPIO configurations are not preasent */
|
/* Read clock request gpio configuration if MGPIO configurations are not preasent */
|
||||||
if (of_property_read_string(np, DTS_CLKSRC_GPIO_STR, &nfc_configs->clk_src_name)) {
|
if (of_property_read_string(np, DTS_CLKSRC_GPIO_STR, &nfc_configs->clk_src_name)) {
|
||||||
nfc_configs->clk_pin_voting = false;
|
nfc_configs->clk_pin_voting = false;
|
||||||
nfc_gpio->clkreq = of_get_named_gpio(np, DTS_CLKREQ_GPIO_STR, 0);
|
|
||||||
if (!gpio_is_valid(nfc_gpio->clkreq)) {
|
|
||||||
dev_err(dev, "NxpDrv: clkreq gpio invalid %d\n", nfc_gpio->clkreq);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
nfc_configs->clk_pin_voting = true;
|
nfc_configs->clk_pin_voting = true;
|
||||||
|
|
||||||
|
/* Read clkreq GPIO pin number from DTSI */
|
||||||
|
nfc_gpio->clkreq = of_get_named_gpio(np, DTS_CLKREQ_GPIO_STR, 0);
|
||||||
|
if (!gpio_is_valid(nfc_gpio->clkreq)) {
|
||||||
|
dev_err(dev, "NxpDrv: clkreq gpio invalid %d\n", nfc_gpio->clkreq);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef NFC_SECURE_PERIPHERAL_ENABLED
|
#ifdef NFC_SECURE_PERIPHERAL_ENABLED
|
||||||
/* Read DTS_SZONE_STR to check secure zone support */
|
/* Read DTS_SZONE_STR to check secure zone support */
|
||||||
if (of_property_read_string(np, DTS_SZONE_STR, &nfc_configs->szone)) {
|
if (of_property_read_string(np, DTS_SZONE_STR, &nfc_configs->szone)) {
|
||||||
@@ -494,22 +497,20 @@ int nfc_post_init(struct nfc_dev *nfc_dev)
|
|||||||
__func__, nfc_gpio->dwl_req);
|
__func__, nfc_gpio->dwl_req);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(nfc_configs.clk_pin_voting)) {
|
/* Read clkreq GPIO number from device tree*/
|
||||||
/* Read clkreq GPIO number from device tree*/
|
ret = of_property_read_u32_index(nfc_dev->i2c_dev.client->dev.of_node,
|
||||||
ret = of_property_read_u32_index(nfc_dev->i2c_dev.client->dev.of_node,
|
|
||||||
DTS_CLKREQ_GPIO_STR, 1, &clkreq_gpio);
|
DTS_CLKREQ_GPIO_STR, 1, &clkreq_gpio);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("NxpDrv: %s Failed to read clkreq gipo number, ret: %d\n",
|
pr_err("NxpDrv: %s Failed to read clkreq gipo number, ret: %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
/* configure clkreq GPIO as wakeup capable */
|
/* configure clkreq GPIO as wakeup capable */
|
||||||
ret = msm_gpio_mpm_wake_set(clkreq_gpio, true);
|
ret = msm_gpio_mpm_wake_set(clkreq_gpio, true);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("NxpDrv: %s clkreq gpio %d as wakeup capable failed, ret: %d\n",
|
pr_err("NxpDrv: %s clkreq gpio %d as wakeup capable failed, ret: %d\n",
|
||||||
__func__, clkreq_gpio, ret);
|
__func__, clkreq_gpio, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nfcc_hw_check(nfc_dev);
|
ret = nfcc_hw_check(nfc_dev);
|
||||||
|
Reference in New Issue
Block a user