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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTh7q/AAoJEIqAPN1PVmxKKAMP/1mJP88CXQv6SZUpmWMXP/K2
 7LqdG6nSnuPwm8k43qbNTdCbZRxfRVTdmyBjdAsxHYVOj2S3hGMkYXcCW6phD+AJ
 I4OPi3quC+y+4Tjl34fWIpEPTgvmAqMxuyLXiKwMTwuzdwNkDF3JzYiRyxm2QvqM
 qFevVEUdWqj0YywJGfokQLFfWNJbu7ghpBei4eIK53QX63dIQVPi63Lih5jBI4ig
 gJg7CHfPzaduYuCysU7rRss93p4CJ45Mc8b9CZn59KWW2nRw98wp867083Rbr9F7
 zwaH0hc/L1kwFLLEXMYPx2a/1CoEya54amu8oKaBEg90OUvYPxjPQlPKvmy1hKXB
 cNwW7snuAH+10IBmD3dcoEqZ50pTXkMZw5czdNmgnUUxrOyS4wzR/n1X10+FqH3O
 1E6G8MWVZuIU9l/FBSRvhX0jFK2upHgGrD93nu1qAg7giAZvqDHUSKdGVmMfI32D
 Tm+j6cS0/AouePssWChQtPwbAJus2kgeBO/w8gu2HaFN8C13E/nPSg77tONlRWQ6
 rEkXum1P2jE9QTGQfzGwbCITxhEiMpHxtXV80lD5THkfHVVtQV6zkL2Lj9QDzoxQ
 d80Xk2DOScKnDcVCOiHX1NrnST3sFH1TsRS9XCKvmDX02VMl+KbYZzzJJaQ8gDLj
 NCVNv3BvuclwsG3VVqFn
 =t52d
 -----END PGP SIGNATURE-----

Merge tag 'nfc-next-3.16-2' of git://git.kernel.org/pub/scm/linux/kernel/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>
This commit is contained in:
John W. Linville 2014-05-30 13:41:40 -04:00
commit 57afc62e94
7 changed files with 57 additions and 11 deletions

View File

@ -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

View File

@ -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)
@ -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] = {
@ -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 },
};
@ -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 },

View File

@ -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 */
@ -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;
@ -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;

View File

@ -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);
@ -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);

View File

@ -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,

View File

@ -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)
{

View File

@ -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);