Commit 9f0c4542 authored by Thierry Escande's avatar Thierry Escande Committed by Samuel Ortiz

NFC: port100: Abort current command before switching RF off

If a command is still being processed by the device, the switch RF off
command will be rejected. With this patch, the port100 driver calls
port100_abort_cmd() before sending the switch RF off command.
Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent a52bd7d2
...@@ -1050,6 +1050,10 @@ static int port100_switch_rf(struct nfc_digital_dev *ddev, bool on) ...@@ -1050,6 +1050,10 @@ static int port100_switch_rf(struct nfc_digital_dev *ddev, bool on)
*skb_put(skb, 1) = on ? 1 : 0; *skb_put(skb, 1) = on ? 1 : 0;
/* Cancel the last command if the device is being switched off */
if (!on)
port100_abort_cmd(ddev);
resp = port100_send_cmd_sync(dev, PORT100_CMD_SWITCH_RF, skb); resp = port100_send_cmd_sync(dev, PORT100_CMD_SWITCH_RF, skb);
if (IS_ERR(resp)) if (IS_ERR(resp))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment