mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
NFC: Allow HCI driver to pre-open pipes to some gates
Some NFC chips will statically create and open pipes for both standard and proprietary gates. The driver can now pass this information to HCI such that HCI will not attempt to create and open them, but will instead directly use the passed pipe ids. Signed-off-by: Eric Lapuyade <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
eae202aa20
commit
a10d595b10
5 changed files with 47 additions and 37 deletions
|
|
@ -108,16 +108,22 @@ enum pn544_state {
|
|||
|
||||
#define PN544_NFC_WI_MGMT_GATE 0xA1
|
||||
|
||||
static u8 pn544_custom_gates[] = {
|
||||
PN544_SYS_MGMT_GATE,
|
||||
PN544_SWP_MGMT_GATE,
|
||||
PN544_POLLING_LOOP_MGMT_GATE,
|
||||
PN544_NFC_WI_MGMT_GATE,
|
||||
PN544_RF_READER_F_GATE,
|
||||
PN544_RF_READER_JEWEL_GATE,
|
||||
PN544_RF_READER_ISO15693_GATE,
|
||||
PN544_RF_READER_NFCIP1_INITIATOR_GATE,
|
||||
PN544_RF_READER_NFCIP1_TARGET_GATE
|
||||
static struct nfc_hci_gate pn544_gates[] = {
|
||||
{NFC_HCI_ADMIN_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{NFC_HCI_LOOPBACK_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{NFC_HCI_ID_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{NFC_HCI_LINK_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{NFC_HCI_RF_READER_B_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{NFC_HCI_RF_READER_A_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_SYS_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_SWP_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_POLLING_LOOP_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_NFC_WI_MGMT_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_RF_READER_F_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_RF_READER_JEWEL_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_RF_READER_ISO15693_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_RF_READER_NFCIP1_INITIATOR_GATE, NFC_HCI_INVALID_PIPE},
|
||||
{PN544_RF_READER_NFCIP1_TARGET_GATE, NFC_HCI_INVALID_PIPE}
|
||||
};
|
||||
|
||||
/* Largest headroom needed for outgoing custom commands */
|
||||
|
|
@ -849,10 +855,9 @@ static int __devinit pn544_hci_probe(struct i2c_client *client,
|
|||
goto err_rti;
|
||||
}
|
||||
|
||||
init_data.gate_count = ARRAY_SIZE(pn544_custom_gates);
|
||||
init_data.gate_count = ARRAY_SIZE(pn544_gates);
|
||||
|
||||
memcpy(init_data.gates, pn544_custom_gates,
|
||||
ARRAY_SIZE(pn544_custom_gates));
|
||||
memcpy(init_data.gates, pn544_gates, sizeof(pn544_gates));
|
||||
|
||||
/*
|
||||
* TODO: Session id must include the driver name + some bus addr
|
||||
|
|
|
|||
Loading…
Reference in a new issue