OSDN Git Service

nfc: import xiaomi sagit-p-oss changes
authorwloot <wlootlxt123@gmail.com>
Fri, 12 Jul 2019 17:08:43 +0000 (01:08 +0800)
committerArian <arian.kulmer@web.de>
Tue, 19 Nov 2019 15:24:31 +0000 (16:24 +0100)
Change-Id: Ib320f9d088e7be28ef0986d88071256dd80fd2e4

drivers/nfc/nq-nci.c

index aa5e02e..d2d74e1 100644 (file)
@@ -1,4 +1,5 @@
 /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2019 XiaoMi, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -637,6 +638,12 @@ static const struct file_operations nfc_dev_fops = {
 #endif
 };
 
+/**
+ * Do not need check availability of NFCC.
+ * This function will block NFCC to enter FW download mode.
+ */
+
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
 /* Check for availability of NQ_ NFC controller hardware */
 static int nfcc_hw_check(struct i2c_client *client, struct nqx_dev *nqx_dev)
 {
@@ -761,6 +768,7 @@ err_nfcc_hw_check:
 done:
        return ret;
 }
+#endif
 
 /*
        * Routine to enable clock.
@@ -1064,6 +1072,8 @@ static int nqx_probe(struct i2c_client *client,
        }
        nqx_disable_irq(nqx_dev);
 
+/* Do not perform nfcc_hw_check, make sure that nfcc is present */
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
        /*
         * To be efficient we need to test whether nfcc hardware is physically
         * present before attempting further hardware initialisation.
@@ -1077,6 +1087,7 @@ static int nqx_probe(struct i2c_client *client,
                goto err_request_hw_check_failed;
        }
 
+#endif
        /* Register reboot notifier here */
        r = register_reboot_notifier(&nfcc_notifier);
        if (r) {