summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-03-25 19:54:35 +0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-04-22 02:37:27 +0400
commit12e9ade309db51e7ea26be3b4fd5bc6057ddc175 (patch)
treef9ce9c5fb33baf771ad4776e241fd1a08c5a0391
parenta0822a7e3b7333689b1c8cb92782e299791c2795 (diff)
downloadlinux-12e9ade309db51e7ea26be3b4fd5bc6057ddc175.tar.xz
NFC: trf7970a: Allow different Modulator and SYS_CLK Control register values
Currently the driver writes the same value to the 'Modulator and SYS_CLK Control' register no matter what RF technology is being used. That works for now but new RF technologies (e.g., ISO/IEC 14443-B) will require different values to be written to that register. To support this, add a member to the trf7970a structure which is set by the RF technology handling code and used by the framing code when it writes to that register. Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/nfc/trf7970a.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 90ec2ad35932..352aaab807b6 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -338,6 +338,7 @@ struct trf7970a {
void *cb_arg;
u8 iso_ctrl;
u8 iso_ctrl_tech;
+ u8 modulator_sys_clk_ctrl;
u8 special_fcn_reg1;
int technology;
int framing;
@@ -887,9 +888,11 @@ static int trf7970a_config_rf_tech(struct trf7970a *trf, int tech)
switch (tech) {
case NFC_DIGITAL_RF_TECH_106A:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443A_106;
+ trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
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;
break;
default:
dev_dbg(trf->dev, "Unsupported rf technology: %d\n", tech);
@@ -940,7 +943,7 @@ static int trf7970a_config_framing(struct trf7970a *trf, int framing)
trf->iso_ctrl = iso_ctrl;
ret = trf7970a_write(trf, TRF7970A_MODULATOR_SYS_CLK_CTRL,
- TRF7970A_MODULATOR_DEPTH_OOK);
+ trf->modulator_sys_clk_ctrl);
if (ret)
return ret;
}