fw/rffe: Add function to query RF wiring
authorSylvain Munaut <tnt@246tNt.com>
Sat, 23 Apr 2011 20:27:59 +0000 (22:27 +0200)
committerSylvain Munaut <tnt@246tNt.com>
Sun, 29 May 2011 17:51:54 +0000 (19:51 +0200)
Depending on the chipset and the HW, not all ports are connected
and we need to know what we can use when we have the choice ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
src/target/firmware/board/compal/rffe_dualband.c
src/target/firmware/board/gta0x/rffe_gta0x_triband.c
src/target/firmware/board/pirelli_dpl10/rffe_dpl10_triband.c
src/target/firmware/include/rffe.h

index a0e0337..d2d517d 100644 (file)
@@ -44,6 +44,18 @@ void rffe_mode(enum gsm_band band, int tx)
        tsp_act_update(tspact);
 }
 
+/* Returns RF wiring */
+uint32_t rffe_get_rx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_DCS1800);
+}
+
+uint32_t rffe_get_tx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_HI);
+}
+
+
 #define MCU_SW_TRACE   0xfffef00e
 #define ARM_CONF_REG   0xfffef006
 
index 7a37988..63f1513 100644 (file)
@@ -73,6 +73,18 @@ void rffe_mode(enum gsm_band band, int tx)
        tsp_act_update(tspact);
 }
 
+/* Returns RF wiring */
+uint32_t rffe_get_rx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_DCS1800) | (1 << PORT_PCS1900);
+}
+
+uint32_t rffe_get_tx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_HI);
+}
+
+
 #define MCU_SW_TRACE   0xfffef00e
 #define ARM_CONF_REG   0xfffef006
 
index 8d24928..00f1089 100644 (file)
@@ -72,6 +72,18 @@ void rffe_mode(enum gsm_band band, int tx)
        tsp_act_update(tspact);
 }
 
+/* Returns RF wiring */
+uint32_t rffe_get_rx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_DCS1800) | (1 << PORT_PCS1900);
+}
+
+uint32_t rffe_get_tx_ports(void)
+{
+       return (1 << PORT_LO) | (1 << PORT_HI);
+}
+
+
 #define MCU_SW_TRACE   0xfffef00e
 #define ARM_CONF_REG   0xfffef006
 #define ASIC_CONF_REG  0xfffef008
index a21d183..c28c696 100644 (file)
@@ -11,6 +11,20 @@ void rffe_init(void);
 /* switch RF Frontend Mode */
 void rffe_mode(enum gsm_band band, int tx);
 
+/* query RF wiring */
+enum rffe_port
+{
+       PORT_LO         = 0,    /* Combined 850/900 port */
+       PORT_HI         = 1,    /* Combined 1800/1900 port */
+       PORT_GSM850     = 2,
+       PORT_GSM900     = 3,
+       PORT_DCS1800    = 4,
+       PORT_PCS1900    = 5,
+};
+
+uint32_t rffe_get_rx_ports(void);
+uint32_t rffe_get_tx_ports(void);
+
 /* get current gain of RF frontend (anything between antenna and baseband in dBm */
 uint8_t rffe_get_gain(void);