Thank you for your repply Jimmy.
I was refer to AN11690 document, and i did this step:
- Adding nxp-pn5xx driver into driver/misc using git clone https://github.com/NXPNFCLinux/nxp-pn5xx.git.
- Include driver compilation into drivers/misc/Makefile. obj-y += nxp-pn5xx/.
- Include the driver config into drivers/misc/Kconfig, source "drivers/misc/nxp-pn5xx/Kconfig".
- Register PN7150 via platform data, because not support device tree.
#if defined(CONFIG_NFC_NXP_PN5XX) || defined(CONFIG_NFC_NXP_PN5XX_MODULE)
#include <linux/i2c.h>
#include <linux/pn5xx_i2c.h>
#define NFC_PN5XX_I2C_BUS (2)
static struct pn544_i2c_platform_data nfc_pdata = {
.irq_gpio = PAD_GPIO_A + 28,
.ven_gpio = PAD_GPIO_B + 9,
.firm_gpio = GPIO_UNUSED,
.clkreq_gpio = GPIO_UNUSED,
};
static struct i2c_board_info __initdata nfc_board_info = {
.type = "pn547",
.addr = (0x28),
.platform_data = &nfc_pdata,
};
#endif
and register :
#if defined(CONFIG_NFC_NXP_PN5XX) || defined(CONFIG_NFC_NXP_PN5XX_MODULE)
printk("plat: add nfc(pn5xx) device\n");
i2c_register_board_info(NFC_PN5XX_I2C_BUS, &nfc_board_info, 1);
#endif
6. Adding N5XX into build config file, CONFIG_NFC_NXP_PN5XX=y.
7. Change driver/misc/nxp-pn5xx/Makefile, to obj-$(CONFIG_NFC_NXP_PN5XX) += pn5xx_i2c.o.
8. Replace pakages/apps/Nfc, external/libnfc-nci, framework/base with the file from NXPNFC project AR0F.3.5.0_L_OpnSrc version.
9. Retrieve and install NXP-NCI.
$ wget
https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_lollipop/ma
ster/nxpnfc_manifest.xml
./NxpNfcAndroid/install.sh PN7150
10. Adding NFC into device.mk
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
libnfc_nci_jni \
nfc_nci_pn54x.default\
NfcNci \
Tag \
com.android.nfc_extras
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/android.hardware.nfc.hce.xml \
NxpNfcAndroid/conf/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
NxpNfcAndroid/conf/libnfc-nxp.conf:system/etc/libnfc-nxp.conf
11. Edit init.rc file
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
i am able to build and can see nfc_nci.pn54x.default.so file from /system/lib/hw.
i do the following test using adb:
# ls /sys/bus/i2c/devices/i2c-2/
2-001d
2-0028 ------> PN7150
delete_device
device
i2c-dev
name
new_device
power
subsystem
uevent
# ls /sys/bus/i2c/drivers
Goodix-TS
HM5065
SP2518
alc562x-codec
axp_mfd
dummy
ir-kbd-i2c
mma8653
nxp_edid
pn544 ----> the driver is apear
# ls -als /dev/pn544
crw-rw---- nfc nfc 10, 61 2015-01-01 00:00 pn544
But, the NFC on Setting menu is blocked (can't enable or disable).
there is contain error on logcat:
D/NxpTml ( 692): PN54X - Posting read message.....
D/NxpHal ( 692): read successful status = 0x0
D/NxpHal ( 692): phNxpNciHal_print_res_status: response status =STATUS_SYNTAX_ERROR
W/NxpHal ( 692): Invalid Data from config file . Aborting..