mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 20:29:20 +00:00
NFC: digital: Add 'tg_listen_md' and 'tg_get_rf_tech' driver hooks
The digital layer of the NFC subsystem currently supports a 'tg_listen_mdaa' driver hook that supports devices that can do mode detection and automatic anticollision. However, there are some devices that can do mode detection but not automatic anitcollision so add the 'tg_listen_md' hook to support those devices. In order for the digital layer to get the RF technology detected by the device from the driver, add the 'tg_get_rf_tech' hook. It is only valid to call this hook immediately after a successful call to 'tg_listen_md'. CC: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
f63bac94bf
commit
bf30a67c94
4 changed files with 97 additions and 13 deletions
|
@ -201,6 +201,11 @@ static void digital_wq_cmd(struct work_struct *work)
|
|||
digital_send_cmd_complete, cmd);
|
||||
break;
|
||||
|
||||
case DIGITAL_CMD_TG_LISTEN_MD:
|
||||
rc = ddev->ops->tg_listen_md(ddev, cmd->timeout,
|
||||
digital_send_cmd_complete, cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
pr_err("Unknown cmd type %d\n", cmd->type);
|
||||
return;
|
||||
|
@ -293,6 +298,12 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech)
|
|||
500, digital_tg_recv_atr_req, NULL);
|
||||
}
|
||||
|
||||
static int digital_tg_listen_md(struct nfc_digital_dev *ddev, u8 rf_tech)
|
||||
{
|
||||
return digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MD, NULL, NULL, 500,
|
||||
digital_tg_recv_md_req, NULL);
|
||||
}
|
||||
|
||||
int digital_target_found(struct nfc_digital_dev *ddev,
|
||||
struct nfc_target *target, u8 protocol)
|
||||
{
|
||||
|
@ -510,6 +521,9 @@ static int digital_start_poll(struct nfc_dev *nfc_dev, __u32 im_protocols,
|
|||
if (ddev->ops->tg_listen_mdaa) {
|
||||
digital_add_poll_tech(ddev, 0,
|
||||
digital_tg_listen_mdaa);
|
||||
} else if (ddev->ops->tg_listen_md) {
|
||||
digital_add_poll_tech(ddev, 0,
|
||||
digital_tg_listen_md);
|
||||
} else {
|
||||
digital_add_poll_tech(ddev, NFC_DIGITAL_RF_TECH_106A,
|
||||
digital_tg_listen_nfca);
|
||||
|
@ -737,7 +751,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
|
|||
|
||||
if (!ops->in_configure_hw || !ops->in_send_cmd || !ops->tg_listen ||
|
||||
!ops->tg_configure_hw || !ops->tg_send_cmd || !ops->abort_cmd ||
|
||||
!ops->switch_rf)
|
||||
!ops->switch_rf || (ops->tg_listen_md && !ops->tg_get_rf_tech))
|
||||
return NULL;
|
||||
|
||||
ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue