diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-12-18 10:26:23 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-09 18:51:52 -0500 |
commit | aa74103071312fede1f4953fe3c027941add1256 (patch) | |
tree | ef18da500a359869f6bbff17fd372e704693eb2b /drivers/nfc | |
parent | bf71ab8ba53081c28b960d48e0c4cd1c17588aa6 (diff) |
NFC: pn544: Separate the core code and the i2c one into different modules
As we may need to support other physical layers, we can avoid linking the
core part into each and every pn544 module.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r-- | drivers/nfc/Kconfig | 15 | ||||
-rw-r--r-- | drivers/nfc/Makefile | 2 | ||||
-rw-r--r-- | drivers/nfc/pn544/Kconfig | 23 | ||||
-rw-r--r-- | drivers/nfc/pn544/Makefile | 5 | ||||
-rw-r--r-- | drivers/nfc/pn544/pn544.c | 6 |
5 files changed, 35 insertions, 16 deletions
diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index ec857676c39f..80c728b28828 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig | |||
@@ -5,19 +5,6 @@ | |||
5 | menu "Near Field Communication (NFC) devices" | 5 | menu "Near Field Communication (NFC) devices" |
6 | depends on NFC | 6 | depends on NFC |
7 | 7 | ||
8 | config PN544_HCI_NFC | ||
9 | tristate "HCI PN544 NFC driver" | ||
10 | depends on I2C && NFC_HCI && NFC_SHDLC | ||
11 | select CRC_CCITT | ||
12 | default n | ||
13 | ---help--- | ||
14 | NXP PN544 i2c driver. | ||
15 | This is a driver based on the SHDLC and HCI NFC kernel layers and | ||
16 | will thus not work with NXP libnfc library. | ||
17 | |||
18 | To compile this driver as a module, choose m here. The module will | ||
19 | be called pn544_hci. | ||
20 | |||
21 | config NFC_PN533 | 8 | config NFC_PN533 |
22 | tristate "NXP PN533 USB driver" | 9 | tristate "NXP PN533 USB driver" |
23 | depends on USB | 10 | depends on USB |
@@ -39,4 +26,6 @@ config NFC_WILINK | |||
39 | Say Y here to compile support for Texas Instrument's NFC WiLink driver | 26 | Say Y here to compile support for Texas Instrument's NFC WiLink driver |
40 | into the kernel or say M to compile it as module. | 27 | into the kernel or say M to compile it as module. |
41 | 28 | ||
29 | source "drivers/nfc/pn544/Kconfig" | ||
30 | |||
42 | endmenu | 31 | endmenu |
diff --git a/drivers/nfc/Makefile b/drivers/nfc/Makefile index 36c359043f54..574bbc04d97a 100644 --- a/drivers/nfc/Makefile +++ b/drivers/nfc/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for nfc devices | 2 | # Makefile for nfc devices |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_PN544_HCI_NFC) += pn544/ | 5 | obj-$(CONFIG_NFC_PN544) += pn544/ |
6 | obj-$(CONFIG_NFC_PN533) += pn533.o | 6 | obj-$(CONFIG_NFC_PN533) += pn533.o |
7 | obj-$(CONFIG_NFC_WILINK) += nfcwilink.o | 7 | obj-$(CONFIG_NFC_WILINK) += nfcwilink.o |
8 | 8 | ||
diff --git a/drivers/nfc/pn544/Kconfig b/drivers/nfc/pn544/Kconfig new file mode 100644 index 000000000000..c277790ac71c --- /dev/null +++ b/drivers/nfc/pn544/Kconfig | |||
@@ -0,0 +1,23 @@ | |||
1 | config NFC_PN544 | ||
2 | tristate "NXP PN544 NFC driver" | ||
3 | depends on NFC_HCI | ||
4 | select CRC_CCITT | ||
5 | default n | ||
6 | ---help--- | ||
7 | NXP PN544 core driver. | ||
8 | This is a driver based on the HCI NFC kernel layers and | ||
9 | will thus not work with NXP libnfc library. | ||
10 | |||
11 | To compile this driver as a module, choose m here. The module will | ||
12 | be called pn544. | ||
13 | Say N if unsure. | ||
14 | |||
15 | config NFC_PN544_I2C | ||
16 | tristate "NFC PN544 i2c support" | ||
17 | depends on NFC_PN544 && I2C && NFC_SHDLC | ||
18 | ---help--- | ||
19 | This module adds support for the NXP pn544 i2c interface. | ||
20 | Select this if your platform is using the i2c bus. | ||
21 | |||
22 | If you choose to build a module, it'll be called pn544_i2c. | ||
23 | Say N if unsure. \ No newline at end of file | ||
diff --git a/drivers/nfc/pn544/Makefile b/drivers/nfc/pn544/Makefile index 725733881eb3..ac076793687d 100644 --- a/drivers/nfc/pn544/Makefile +++ b/drivers/nfc/pn544/Makefile | |||
@@ -2,6 +2,7 @@ | |||
2 | # Makefile for PN544 HCI based NFC driver | 2 | # Makefile for PN544 HCI based NFC driver |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_PN544_HCI_NFC) += pn544_i2c.o | 5 | pn544_i2c-objs = i2c.o |
6 | 6 | ||
7 | pn544_i2c-y := pn544.o i2c.o | 7 | obj-$(CONFIG_NFC_PN544) += pn544.o |
8 | obj-$(CONFIG_NFC_PN544_I2C) += pn544_i2c.o | ||
diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index ece834239852..d108c794008d 100644 --- a/drivers/nfc/pn544/pn544.c +++ b/drivers/nfc/pn544/pn544.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/module.h> | ||
23 | 24 | ||
24 | #include <linux/nfc.h> | 25 | #include <linux/nfc.h> |
25 | #include <net/nfc/hci.h> | 26 | #include <net/nfc/hci.h> |
@@ -862,6 +863,7 @@ err_alloc_hdev: | |||
862 | err_info_alloc: | 863 | err_info_alloc: |
863 | return r; | 864 | return r; |
864 | } | 865 | } |
866 | EXPORT_SYMBOL(pn544_hci_probe); | ||
865 | 867 | ||
866 | void pn544_hci_remove(struct nfc_hci_dev *hdev) | 868 | void pn544_hci_remove(struct nfc_hci_dev *hdev) |
867 | { | 869 | { |
@@ -871,3 +873,7 @@ void pn544_hci_remove(struct nfc_hci_dev *hdev) | |||
871 | nfc_hci_free_device(hdev); | 873 | nfc_hci_free_device(hdev); |
872 | kfree(info); | 874 | kfree(info); |
873 | } | 875 | } |
876 | EXPORT_SYMBOL(pn544_hci_remove); | ||
877 | |||
878 | MODULE_LICENSE("GPL"); | ||
879 | MODULE_DESCRIPTION(DRIVER_DESC); | ||