Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: Update pn544 documentation

The pn544 driver no longer has a /dev/pn544 interface nor a sysfs one.

Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

+1 -83
+1 -83
Documentation/nfc/nfc-pn544.txt
··· 1 1 Kernel driver for the NXP Semiconductors PN544 Near Field 2 2 Communication chip 3 3 4 - Author: Jari Vanhala 5 - Contact: Matti Aaltonen (matti.j.aaltonen at nokia.com) 6 - 7 4 General 8 5 ------- 9 6 10 7 The PN544 is an integrated transmission module for contactless 11 8 communication. The driver goes under drives/nfc/ and is compiled as a 12 - module named "pn544". It registers a misc device and creates a device 13 - file named "/dev/pn544". 9 + module named "pn544". 14 10 15 11 Host Interfaces: I2C, SPI and HSU, this driver supports currently only I2C. 16 - 17 - The Interface 18 - ------------- 19 - 20 - The driver offers a sysfs interface for a hardware test and an IOCTL 21 - interface for selecting between two operating modes. There are read, 22 - write and poll functions for transferring messages. The two operating 23 - modes are the normal (HCI) mode and the firmware update mode. 24 - 25 - PN544 is controlled by sending messages from the userspace to the 26 - chip. The main function of the driver is just to pass those messages 27 - without caring about the message content. 28 - 29 12 30 13 Protocols 31 14 --------- ··· 30 47 31 48 For the ETSI HCI specification see 32 49 http://www.etsi.org/WebSite/Technologies/ProtocolSpecification.aspx 33 - 34 - The Hardware Test 35 - ----------------- 36 - 37 - The idea of the test is that it can performed by reading from the 38 - corresponding sysfs file. The test is implemented in the board file 39 - and it should test that PN544 can be put into the firmware update 40 - mode. If the test is not implemented the sysfs file does not get 41 - created. 42 - 43 - Example: 44 - > cat /sys/module/pn544/drivers/i2c\:pn544/3-002b/nfc_test 45 - 1 46 - 47 - Normal Operation 48 - ---------------- 49 - 50 - PN544 is powered up when the device file is opened, otherwise it's 51 - turned off. Only one instance can use the device at a time. 52 - 53 - Userspace applications control PN544 with HCI messages. The hardware 54 - sends an interrupt when data is available for reading. Data is 55 - physically read when the read function is called by a userspace 56 - application. Poll() checks the read interrupt state. Configuration and 57 - self testing are also done from the userspace using read and write. 58 - 59 - Example platform data: 60 - 61 - static int rx71_pn544_nfc_request_resources(struct i2c_client *client) 62 - { 63 - /* Get and setup the HW resources for the device */ 64 - } 65 - 66 - static void rx71_pn544_nfc_free_resources(void) 67 - { 68 - /* Release the HW resources */ 69 - } 70 - 71 - static void rx71_pn544_nfc_enable(int fw) 72 - { 73 - /* Turn the device on */ 74 - } 75 - 76 - static int rx71_pn544_nfc_test(void) 77 - { 78 - /* 79 - * Put the device into the FW update mode 80 - * and then back to the normal mode. 81 - * Check the behavior and return one on success, 82 - * zero on failure. 83 - */ 84 - } 85 - 86 - static void rx71_pn544_nfc_disable(void) 87 - { 88 - /* turn the power off */ 89 - } 90 - 91 - static struct pn544_nfc_platform_data rx71_nfc_data = { 92 - .request_resources = rx71_pn544_nfc_request_resources, 93 - .free_resources = rx71_pn544_nfc_free_resources, 94 - .enable = rx71_pn544_nfc_enable, 95 - .test = rx71_pn544_nfc_test, 96 - .disable = rx71_pn544_nfc_disable, 97 - };