NFC: trf7970a: Allow different Modulator and SYS_CLK Control register values
authorMark A. Greer <mgreer@animalcreek.com>
Tue, 25 Mar 2014 15:54:35 +0000 (08:54 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Apr 2014 22:37:27 +0000 (00:37 +0200)
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>
drivers/nfc/trf7970a.c

index 90ec2ad359324e71cb29143b92f18c8fc16d27e3..352aaab807b60140708fd302c6968ad5dc109819 100644 (file)
@@ -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;
        }