diff options
author | Bongsu Jeon <bongsu.jeon@samsung.com> | 2020-12-02 12:47:40 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-03 02:55:25 +0100 |
commit | b3799d592f26faaafdfe82fef3f5f91f9764da5f (patch) | |
tree | 2c75f9a2a82ac74306b7f8db2daf590fb22f3637 /drivers/nfc/s3fwrn5/phy_common.h | |
parent | nfc: s3fwrn5: reduce the EN_WAIT_TIME (diff) | |
download | linux-b3799d592f26faaafdfe82fef3f5f91f9764da5f.tar.xz linux-b3799d592f26faaafdfe82fef3f5f91f9764da5f.zip |
nfc: s3fwrn5: extract the common phy blocks
Extract the common phy blocks to reuse it.
The UART module will use the common blocks.
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/nfc/s3fwrn5/phy_common.h')
-rw-r--r-- | drivers/nfc/s3fwrn5/phy_common.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/nfc/s3fwrn5/phy_common.h b/drivers/nfc/s3fwrn5/phy_common.h new file mode 100644 index 000000000000..b98531decbbc --- /dev/null +++ b/drivers/nfc/s3fwrn5/phy_common.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * + * Link Layer for Samsung S3FWRN5 NCI based Driver + * + * Copyright (C) 2015 Samsung Electrnoics + * Robert Baldyga <r.baldyga@samsung.com> + * Copyright (C) 2020 Samsung Electrnoics + * Bongsu Jeon <bongsu.jeon@samsung.com> + */ + +#ifndef __NFC_S3FWRN5_PHY_COMMON_H +#define __NFC_S3FWRN5_PHY_COMMON_H + +#include <linux/mutex.h> +#include <net/nfc/nci_core.h> + +#include "s3fwrn5.h" + +#define S3FWRN5_EN_WAIT_TIME 20 + +struct phy_common { + struct nci_dev *ndev; + + int gpio_en; + int gpio_fw_wake; + + struct mutex mutex; + + enum s3fwrn5_mode mode; +}; + +void s3fwrn5_phy_set_wake(void *phy_id, bool wake); +bool s3fwrn5_phy_power_ctrl(struct phy_common *phy, enum s3fwrn5_mode mode); +enum s3fwrn5_mode s3fwrn5_phy_get_mode(void *phy_id); + +#endif /* __NFC_S3FWRN5_PHY_COMMON_H */ |