diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-08 12:02:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:30:49 -0500 |
commit | 8a5ac6ecd56756ee72588627aa23ab6cf9b790db (patch) | |
tree | de3fea105315782161688cd7a9c22634422e1fd6 | |
parent | adf5ace5d8161b962afe90e77922728a425b6933 (diff) |
ssb: extract FEM info from SPROM
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/ssb/pci.c | 23 | ||||
-rw-r--r-- | include/linux/ssb/ssb.h | 9 | ||||
-rw-r--r-- | include/linux/ssb/ssb_regs.h | 17 |
3 files changed, 49 insertions, 0 deletions
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c index 34c3bab90b9a..973223f5de8e 100644 --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c | |||
@@ -607,6 +607,29 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in) | |||
607 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, | 607 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, |
608 | sizeof(out->antenna_gain.ghz5)); | 608 | sizeof(out->antenna_gain.ghz5)); |
609 | 609 | ||
610 | /* Extract FEM info */ | ||
611 | SPEX(fem.ghz2.tssipos, SSB_SPROM8_FEM2G, | ||
612 | SSB_SROM8_FEM_TSSIPOS, SSB_SROM8_FEM_TSSIPOS_SHIFT); | ||
613 | SPEX(fem.ghz2.extpa_gain, SSB_SPROM8_FEM2G, | ||
614 | SSB_SROM8_FEM_EXTPA_GAIN, SSB_SROM8_FEM_EXTPA_GAIN_SHIFT); | ||
615 | SPEX(fem.ghz2.pdet_range, SSB_SPROM8_FEM2G, | ||
616 | SSB_SROM8_FEM_PDET_RANGE, SSB_SROM8_FEM_PDET_RANGE_SHIFT); | ||
617 | SPEX(fem.ghz2.tr_iso, SSB_SPROM8_FEM2G, | ||
618 | SSB_SROM8_FEM_TR_ISO, SSB_SROM8_FEM_TR_ISO_SHIFT); | ||
619 | SPEX(fem.ghz2.antswlut, SSB_SPROM8_FEM2G, | ||
620 | SSB_SROM8_FEM_ANTSWLUT, SSB_SROM8_FEM_ANTSWLUT_SHIFT); | ||
621 | |||
622 | SPEX(fem.ghz5.tssipos, SSB_SPROM8_FEM5G, | ||
623 | SSB_SROM8_FEM_TSSIPOS, SSB_SROM8_FEM_TSSIPOS_SHIFT); | ||
624 | SPEX(fem.ghz5.extpa_gain, SSB_SPROM8_FEM5G, | ||
625 | SSB_SROM8_FEM_EXTPA_GAIN, SSB_SROM8_FEM_EXTPA_GAIN_SHIFT); | ||
626 | SPEX(fem.ghz5.pdet_range, SSB_SPROM8_FEM5G, | ||
627 | SSB_SROM8_FEM_PDET_RANGE, SSB_SROM8_FEM_PDET_RANGE_SHIFT); | ||
628 | SPEX(fem.ghz5.tr_iso, SSB_SPROM8_FEM5G, | ||
629 | SSB_SROM8_FEM_TR_ISO, SSB_SROM8_FEM_TR_ISO_SHIFT); | ||
630 | SPEX(fem.ghz5.antswlut, SSB_SPROM8_FEM5G, | ||
631 | SSB_SROM8_FEM_ANTSWLUT, SSB_SROM8_FEM_ANTSWLUT_SHIFT); | ||
632 | |||
610 | sprom_extract_r458(out, in); | 633 | sprom_extract_r458(out, in); |
611 | 634 | ||
612 | /* TODO - get remaining rev 8 stuff needed */ | 635 | /* TODO - get remaining rev 8 stuff needed */ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 061e560251b4..dcf35b0f303a 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -94,6 +94,15 @@ struct ssb_sprom { | |||
94 | } ghz5; /* 5GHz band */ | 94 | } ghz5; /* 5GHz band */ |
95 | } antenna_gain; | 95 | } antenna_gain; |
96 | 96 | ||
97 | struct { | ||
98 | struct { | ||
99 | u8 tssipos, extpa_gain, pdet_range, tr_iso, antswlut; | ||
100 | } ghz2; | ||
101 | struct { | ||
102 | u8 tssipos, extpa_gain, pdet_range, tr_iso, antswlut; | ||
103 | } ghz5; | ||
104 | } fem; | ||
105 | |||
97 | /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ | 106 | /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ |
98 | }; | 107 | }; |
99 | 108 | ||
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 98941203a27f..c814ae6eeb22 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -432,6 +432,23 @@ | |||
432 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ | 432 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ |
433 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ | 433 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ |
434 | #define SSB_SPROM8_RXPO5G_SHIFT 8 | 434 | #define SSB_SPROM8_RXPO5G_SHIFT 8 |
435 | #define SSB_SPROM8_FEM2G 0x00AE | ||
436 | #define SSB_SPROM8_FEM5G 0x00B0 | ||
437 | #define SSB_SROM8_FEM_TSSIPOS 0x0001 | ||
438 | #define SSB_SROM8_FEM_TSSIPOS_SHIFT 0 | ||
439 | #define SSB_SROM8_FEM_EXTPA_GAIN 0x0006 | ||
440 | #define SSB_SROM8_FEM_EXTPA_GAIN_SHIFT 1 | ||
441 | #define SSB_SROM8_FEM_PDET_RANGE 0x00F8 | ||
442 | #define SSB_SROM8_FEM_PDET_RANGE_SHIFT 3 | ||
443 | #define SSB_SROM8_FEM_TR_ISO 0x0700 | ||
444 | #define SSB_SROM8_FEM_TR_ISO_SHIFT 8 | ||
445 | #define SSB_SROM8_FEM_ANTSWLUT 0xF800 | ||
446 | #define SSB_SROM8_FEM_ANTSWLUT_SHIFT 11 | ||
447 | #define SSB_SPROM8_THERMAL 0x00B2 | ||
448 | #define SSB_SPROM8_MPWR_RAWTS 0x00B4 | ||
449 | #define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6 | ||
450 | #define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8 | ||
451 | #define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA | ||
435 | #define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ | 452 | #define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ |
436 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ | 453 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ |
437 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 454 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |