mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
NFC: trf7970a: Ignore antenna noise when checking for RF field
[ Upstream commita9bc28aa4e] The main channel Received Signal Strength Indicator (RSSI) measurement is used to determine whether an RF field is present or not. RSSI != 0 is interpreted as an RF Field is present. This does not take RF noise and measurement inaccuracy into account, and results in false positives in the field. Define a noise level and make sure the RF field is only interpreted as present when the RSSI is above the noise level. Fixes:851ee3cbf8("NFC: trf7970a: Don't turn on RF if there is already an RF field") Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Mark Greer <mgreer@animalcreek.com> Link: https://patch.msgid.link/20260422100930.581237-1-paul.geurts@prodrive-technologies.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
17e23e8150
commit
0d0dd383ac
@@ -311,6 +311,7 @@
|
||||
#define TRF7970A_RSSI_OSC_STATUS_RSSI_MASK (BIT(2) | BIT(1) | BIT(0))
|
||||
#define TRF7970A_RSSI_OSC_STATUS_RSSI_X_MASK (BIT(5) | BIT(4) | BIT(3))
|
||||
#define TRF7970A_RSSI_OSC_STATUS_RSSI_OSC_OK BIT(6)
|
||||
#define TRF7970A_RSSI_OSC_STATUS_RSSI_NOISE_LEVEL 1
|
||||
|
||||
#define TRF7970A_SPECIAL_FCN_REG1_COL_7_6 BIT(0)
|
||||
#define TRF7970A_SPECIAL_FCN_REG1_14_ANTICOLL BIT(1)
|
||||
@@ -1253,7 +1254,7 @@ static int trf7970a_is_rf_field(struct trf7970a *trf, bool *is_rf_field)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (rssi & TRF7970A_RSSI_OSC_STATUS_RSSI_MASK)
|
||||
if ((rssi & TRF7970A_RSSI_OSC_STATUS_RSSI_MASK) > TRF7970A_RSSI_OSC_STATUS_RSSI_NOISE_LEVEL)
|
||||
*is_rf_field = true;
|
||||
else
|
||||
*is_rf_field = false;
|
||||
|
||||
Reference in New Issue
Block a user