From 4c21f53aa93a97fe1b31752bce1c2b3253b556dc Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Wed, 16 Jan 2019 16:35:16 -0800 Subject: [PATCH] qcacmn: move over to new explicit reset API Move over to new explicit reset API as the old calls are removed in kernel msm-4.19. CRs-Fixed: 2386317 Change-Id: I4d550fc19970baa8e1c90ed170beb995cb850706 --- qal/linux/src/qal_vbus_dev.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/qal/linux/src/qal_vbus_dev.c b/qal/linux/src/qal_vbus_dev.c index 23ff343ea853..2f332611bdaa 100644 --- a/qal/linux/src/qal_vbus_dev.c +++ b/qal/linux/src/qal_vbus_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -88,6 +88,7 @@ qal_vbus_disable_devclk(struct qdf_dev_clk *clk) qdf_export_symbol(qal_vbus_disable_devclk); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) QDF_STATUS qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state, struct qdf_vbus_rstctl **rstctl) @@ -97,7 +98,8 @@ qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state, if (!pfhndl || !state) return QDF_STATUS_E_INVAL; - rsctl = reset_control_get_optional((struct device *)pfhndl, state); + rsctl = reset_control_get_optional_exclusive((struct device *)pfhndl, + state); if (!rsctl) return QDF_STATUS_E_FAILURE; @@ -108,6 +110,27 @@ qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state, } #else QDF_STATUS +qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state, + struct qdf_vbus_rstctl **rstctl) +{ + struct reset_control *rsctl; + + if (!pfhndl || !state) + return QDF_STATUS_E_INVAL; + + rsctl = reset_control_get_optional((struct device *)pfhndl, + state); + + if (!rsctl) + return QDF_STATUS_E_FAILURE; + + *rstctl = (struct qdf_vbus_rstctl *)rsctl; + + return QDF_STATUS_SUCCESS; +} +#endif +#else +QDF_STATUS qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state, struct qdf_vbus_rstctl **rstctl) {