Skip to content

Commit

Permalink
Merge tag 'nfc-next-3.16-2' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"NFC: 3.16: Second pull request

This is the 2nd NFC pull request for 3.16. We have:

- Felica (Type3) tags support for trf7970a
- Type 4b tags support for port100
- st21nfca DTS typo fix
- A few sparse warning check fixes"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
John W. Linville committed May 30, 2014
2 parents a3b9d55 + 6857bb9 commit 57afc62
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/net/nfc/st21nfca.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* STMicroelectronics SAS. ST21NFCA NFC Controller

Required properties:
- compatible: Should be "st,st21nfca-i2c".
- compatible: Should be "st,st21nfca_i2c".
- clock-frequency: I²C work frequency.
- reg: address on the bus
- interrupt-parent: phandle for the interrupt gpio controller
Expand Down
36 changes: 35 additions & 1 deletion drivers/nfc/port100.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
NFC_PROTO_MIFARE_MASK | \
NFC_PROTO_FELICA_MASK | \
NFC_PROTO_NFC_DEP_MASK | \
NFC_PROTO_ISO14443_MASK)
NFC_PROTO_ISO14443_MASK | \
NFC_PROTO_ISO14443_B_MASK)

#define PORT100_CAPABILITIES (NFC_DIGITAL_DRV_CAPS_IN_CRC | \
NFC_DIGITAL_DRV_CAPS_TG_CRC)
Expand Down Expand Up @@ -120,6 +121,7 @@ struct port100_in_rf_setting {
#define PORT100_COMM_TYPE_IN_212F 0x01
#define PORT100_COMM_TYPE_IN_424F 0x02
#define PORT100_COMM_TYPE_IN_106A 0x03
#define PORT100_COMM_TYPE_IN_106B 0x07

static const struct port100_in_rf_setting in_rf_settings[] = {
[NFC_DIGITAL_RF_TECH_212F] = {
Expand All @@ -140,6 +142,12 @@ static const struct port100_in_rf_setting in_rf_settings[] = {
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_106A,
},
[NFC_DIGITAL_RF_TECH_106B] = {
.in_send_set_number = 3,
.in_send_comm_type = PORT100_COMM_TYPE_IN_106B,
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_106B,
},
/* Ensures the array has NFC_DIGITAL_RF_TECH_LAST elements */
[NFC_DIGITAL_RF_TECH_LAST] = { 0 },
};
Expand Down Expand Up @@ -340,6 +348,32 @@ in_protocols[][PORT100_IN_MAX_NUM_PROTOCOLS + 1] = {
[NFC_DIGITAL_FRAMING_NFC_DEP_ACTIVATED] = {
{ PORT100_IN_PROT_END, 0 },
},
[NFC_DIGITAL_FRAMING_NFCB] = {
{ PORT100_IN_PROT_INITIAL_GUARD_TIME, 20 },
{ PORT100_IN_PROT_ADD_CRC, 1 },
{ PORT100_IN_PROT_CHECK_CRC, 1 },
{ PORT100_IN_PROT_MULTI_CARD, 0 },
{ PORT100_IN_PROT_ADD_PARITY, 0 },
{ PORT100_IN_PROT_CHECK_PARITY, 0 },
{ PORT100_IN_PROT_BITWISE_AC_RECV_MODE, 0 },
{ PORT100_IN_PROT_VALID_BIT_NUMBER, 8 },
{ PORT100_IN_PROT_CRYPTO1, 0 },
{ PORT100_IN_PROT_ADD_SOF, 1 },
{ PORT100_IN_PROT_CHECK_SOF, 1 },
{ PORT100_IN_PROT_ADD_EOF, 1 },
{ PORT100_IN_PROT_CHECK_EOF, 1 },
{ PORT100_IN_PROT_DEAF_TIME, 4 },
{ PORT100_IN_PROT_CRM, 0 },
{ PORT100_IN_PROT_CRM_MIN_LEN, 0 },
{ PORT100_IN_PROT_T1_TAG_FRAME, 0 },
{ PORT100_IN_PROT_RFCA, 0 },
{ PORT100_IN_PROT_GUARD_TIME_AT_INITIATOR, 6 },
{ PORT100_IN_PROT_END, 0 },
},
[NFC_DIGITAL_FRAMING_NFCB_T4T] = {
/* nfc_digital_framing_nfcb */
{ PORT100_IN_PROT_END, 0 },
},
/* Ensures the array has NFC_DIGITAL_FRAMING_LAST elements */
[NFC_DIGITAL_FRAMING_LAST] = {
{ PORT100_IN_PROT_END, 0 },
Expand Down
13 changes: 12 additions & 1 deletion drivers/nfc/trf7970a.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@

#define TRF7970A_SUPPORTED_PROTOCOLS \
(NFC_PROTO_MIFARE_MASK | NFC_PROTO_ISO14443_MASK | \
NFC_PROTO_ISO14443_B_MASK | NFC_PROTO_ISO15693_MASK)
NFC_PROTO_ISO14443_B_MASK | NFC_PROTO_FELICA_MASK | \
NFC_PROTO_ISO15693_MASK)

#define TRF7970A_AUTOSUSPEND_DELAY 30000 /* 30 seconds */

Expand Down Expand Up @@ -867,6 +868,14 @@ static int trf7970a_config_rf_tech(struct trf7970a *trf, int tech)
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443B_106;
trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
break;
case NFC_DIGITAL_RF_TECH_212F:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_212;
trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
break;
case NFC_DIGITAL_RF_TECH_424F:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_424;
trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
break;
case NFC_DIGITAL_RF_TECH_ISO15693:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_15693_SGL_1OF4_2648;
trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
Expand Down Expand Up @@ -898,6 +907,8 @@ static int trf7970a_config_framing(struct trf7970a *trf, int framing)
case NFC_DIGITAL_FRAMING_NFCA_T4T:
case NFC_DIGITAL_FRAMING_NFCB:
case NFC_DIGITAL_FRAMING_NFCB_T4T:
case NFC_DIGITAL_FRAMING_NFCF:
case NFC_DIGITAL_FRAMING_NFCF_T3T:
case NFC_DIGITAL_FRAMING_ISO15693_INVENTORY:
case NFC_DIGITAL_FRAMING_ISO15693_T5T:
trf->tx_cmd = TRF7970A_CMD_TRANSMIT;
Expand Down
6 changes: 4 additions & 2 deletions net/nfc/digital_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ int digital_target_found(struct nfc_digital_dev *ddev,

void digital_poll_next_tech(struct nfc_digital_dev *ddev)
{
u8 rand_mod;

digital_switch_rf(ddev, 0);

mutex_lock(&ddev->poll_lock);
Expand All @@ -395,8 +397,8 @@ void digital_poll_next_tech(struct nfc_digital_dev *ddev)
return;
}

ddev->poll_tech_index = (ddev->poll_tech_index + 1) %
ddev->poll_tech_count;
get_random_bytes(&rand_mod, sizeof(rand_mod));
ddev->poll_tech_index = rand_mod % ddev->poll_tech_count;

mutex_unlock(&ddev->poll_lock);

Expand Down
5 changes: 2 additions & 3 deletions net/nfc/digital_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ int digital_in_send_atr_req(struct nfc_digital_dev *ddev,

ddev->skb_add_crc(skb);

digital_in_send_cmd(ddev, skb, 500, digital_in_recv_atr_res, target);

return 0;
return digital_in_send_cmd(ddev, skb, 500, digital_in_recv_atr_res,
target);
}

static int digital_in_send_rtox(struct nfc_digital_dev *ddev,
Expand Down
2 changes: 1 addition & 1 deletion net/nfc/digital_technology.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ static void digital_in_recv_attrib_res(struct nfc_digital_dev *ddev, void *arg,
digital_poll_next_tech(ddev);
}

int digital_in_send_attrib_req(struct nfc_digital_dev *ddev,
static int digital_in_send_attrib_req(struct nfc_digital_dev *ddev,
struct nfc_target *target,
struct digital_sensb_res *sensb_res)
{
Expand Down
4 changes: 2 additions & 2 deletions net/nfc/rawsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ static struct nfc_sock_list raw_sk_list = {
.lock = __RW_LOCK_UNLOCKED(raw_sk_list.lock)
};

void nfc_sock_link(struct nfc_sock_list *l, struct sock *sk)
static void nfc_sock_link(struct nfc_sock_list *l, struct sock *sk)
{
write_lock(&l->lock);
sk_add_node(sk, &l->head);
write_unlock(&l->lock);
}

void nfc_sock_unlink(struct nfc_sock_list *l, struct sock *sk)
static void nfc_sock_unlink(struct nfc_sock_list *l, struct sock *sk)
{
write_lock(&l->lock);
sk_del_node_init(sk);
Expand Down

0 comments on commit 57afc62

Please sign in to comment.