diff options
-rw-r--r-- | drivers/nfc/pn544/i2c.c | 14 | ||||
-rw-r--r-- | drivers/nfc/pn544/pn544.c | 2 | ||||
-rw-r--r-- | drivers/nfc/pn544/pn544.h | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index d6185ff2f87b..c7e277cddb48 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c | |||
@@ -58,6 +58,14 @@ MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); | |||
58 | 58 | ||
59 | #define PN544_HCI_I2C_DRIVER_NAME "pn544_hci_i2c" | 59 | #define PN544_HCI_I2C_DRIVER_NAME "pn544_hci_i2c" |
60 | 60 | ||
61 | /* | ||
62 | * Exposed through the 4 most significant bytes | ||
63 | * from the HCI SW_VERSION first byte, a.k.a. | ||
64 | * SW RomLib. | ||
65 | */ | ||
66 | #define PN544_HW_VARIANT_C2 0xa | ||
67 | #define PN544_HW_VARIANT_C3 0xb | ||
68 | |||
61 | #define PN544_FW_CMD_WRITE 0x08 | 69 | #define PN544_FW_CMD_WRITE 0x08 |
62 | #define PN544_FW_CMD_CHECK 0x06 | 70 | #define PN544_FW_CMD_CHECK 0x06 |
63 | 71 | ||
@@ -119,6 +127,8 @@ struct pn544_i2c_phy { | |||
119 | unsigned int gpio_fw; | 127 | unsigned int gpio_fw; |
120 | unsigned int en_polarity; | 128 | unsigned int en_polarity; |
121 | 129 | ||
130 | u8 hw_variant; | ||
131 | |||
122 | struct work_struct fw_work; | 132 | struct work_struct fw_work; |
123 | int fw_work_state; | 133 | int fw_work_state; |
124 | char firmware_name[NFC_FIRMWARE_NAME_MAXSIZE + 1]; | 134 | char firmware_name[NFC_FIRMWARE_NAME_MAXSIZE + 1]; |
@@ -469,7 +479,8 @@ static struct nfc_phy_ops i2c_phy_ops = { | |||
469 | .disable = pn544_hci_i2c_disable, | 479 | .disable = pn544_hci_i2c_disable, |
470 | }; | 480 | }; |
471 | 481 | ||
472 | static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name) | 482 | static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name, |
483 | u8 hw_variant) | ||
473 | { | 484 | { |
474 | struct pn544_i2c_phy *phy = phy_id; | 485 | struct pn544_i2c_phy *phy = phy_id; |
475 | 486 | ||
@@ -477,6 +488,7 @@ static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name) | |||
477 | 488 | ||
478 | strcpy(phy->firmware_name, firmware_name); | 489 | strcpy(phy->firmware_name, firmware_name); |
479 | 490 | ||
491 | phy->hw_variant = hw_variant; | ||
480 | phy->fw_work_state = FW_WORK_STATE_START; | 492 | phy->fw_work_state = FW_WORK_STATE_START; |
481 | 493 | ||
482 | schedule_work(&phy->fw_work); | 494 | schedule_work(&phy->fw_work); |
diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index 3df4a109cfad..9c8051d20cea 100644 --- a/drivers/nfc/pn544/pn544.c +++ b/drivers/nfc/pn544/pn544.c | |||
@@ -786,7 +786,7 @@ static int pn544_hci_fw_download(struct nfc_hci_dev *hdev, | |||
786 | if (info->fw_download == NULL) | 786 | if (info->fw_download == NULL) |
787 | return -ENOTSUPP; | 787 | return -ENOTSUPP; |
788 | 788 | ||
789 | return info->fw_download(info->phy_id, firmware_name); | 789 | return info->fw_download(info->phy_id, firmware_name, hdev->sw_romlib); |
790 | } | 790 | } |
791 | 791 | ||
792 | static int pn544_hci_discover_se(struct nfc_hci_dev *hdev) | 792 | static int pn544_hci_discover_se(struct nfc_hci_dev *hdev) |
diff --git a/drivers/nfc/pn544/pn544.h b/drivers/nfc/pn544/pn544.h index 491bf45da358..2aa9233e8086 100644 --- a/drivers/nfc/pn544/pn544.h +++ b/drivers/nfc/pn544/pn544.h | |||
@@ -25,7 +25,8 @@ | |||
25 | #define PN544_HCI_MODE 0 | 25 | #define PN544_HCI_MODE 0 |
26 | #define PN544_FW_MODE 1 | 26 | #define PN544_FW_MODE 1 |
27 | 27 | ||
28 | typedef int (*fw_download_t)(void *context, const char *firmware_name); | 28 | typedef int (*fw_download_t)(void *context, const char *firmware_name, |
29 | u8 hw_variant); | ||
29 | 30 | ||
30 | int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name, | 31 | int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name, |
31 | int phy_headroom, int phy_tailroom, int phy_payload, | 32 | int phy_headroom, int phy_tailroom, int phy_payload, |