xref: /linux/drivers/nfc/s3fwrn5/phy_common.h (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  *
3  * Link Layer for Samsung S3FWRN5 NCI based Driver
4  *
5  * Copyright (C) 2015 Samsung Electrnoics
6  * Robert Baldyga <r.baldyga@samsung.com>
7  * Copyright (C) 2020 Samsung Electrnoics
8  * Bongsu Jeon <bongsu.jeon@samsung.com>
9  */
10 
11 #ifndef __NFC_S3FWRN5_PHY_COMMON_H
12 #define __NFC_S3FWRN5_PHY_COMMON_H
13 
14 #include <linux/mutex.h>
15 #include <net/nfc/nci_core.h>
16 
17 #include "s3fwrn5.h"
18 
19 #define S3FWRN5_EN_WAIT_TIME 20
20 
21 struct phy_common {
22 	struct nci_dev *ndev;
23 
24 	int gpio_en;
25 	int gpio_fw_wake;
26 
27 	struct mutex mutex;
28 
29 	enum s3fwrn5_mode mode;
30 };
31 
32 void s3fwrn5_phy_set_wake(void *phy_id, bool wake);
33 bool s3fwrn5_phy_power_ctrl(struct phy_common *phy, enum s3fwrn5_mode mode);
34 void s3fwrn5_phy_set_mode(void *phy_id, enum s3fwrn5_mode mode);
35 enum s3fwrn5_mode s3fwrn5_phy_get_mode(void *phy_id);
36 
37 #endif /* __NFC_S3FWRN5_PHY_COMMON_H */
38