diff options
author | Clément Viel <clement.viel@qorvo.com> | 2022-04-20 11:12:53 +0200 |
---|---|---|
committer | Victor Liu <victorliu@google.com> | 2022-04-26 18:14:54 +0000 |
commit | 407b433e06df2afe3eda9541a202095f7b7e78af (patch) | |
tree | 58443a7230bad374593d591512c8bdf1aab1040d | |
parent | 8886306a0534900c9860f9beaa196c6a17a5fe72 (diff) | |
download | uwb-407b433e06df2afe3eda9541a202095f7b7e78af.tar.gz |
dw3000: use antenna selection to trigger TX on RF2 behavior
Bug: 221242261
Change-Id: I6e17aa50b2e177955edd153ab593d1900355c326
Signed-off-by: Mikael Sourmey <mikael.sourmey@qorvo.com>
-rw-r--r-- | kernel/drivers/net/ieee802154/dw3000_calib.c | 6 | ||||
-rw-r--r-- | kernel/drivers/net/ieee802154/dw3000_chip_e0.h | 1 | ||||
-rw-r--r-- | kernel/drivers/net/ieee802154/dw3000_core.c | 21 |
3 files changed, 6 insertions, 22 deletions
diff --git a/kernel/drivers/net/ieee802154/dw3000_calib.c b/kernel/drivers/net/ieee802154/dw3000_calib.c index 208b3b4..31fc047 100644 --- a/kernel/drivers/net/ieee802154/dw3000_calib.c +++ b/kernel/drivers/net/ieee802154/dw3000_calib.c @@ -29,12 +29,12 @@ #define ANT_OTHER_PARAMS (3) /* port, selector_gpio... */ #define ANTPAIR_CHAN_PARAMS (2 * DW3000_CALIBRATION_CHANNEL_MAX + 1) -#define OTHER_PARAMS (14) /* xtal_trim, temperature_reference, +#define OTHER_PARAMS (13) /* xtal_trim, temperature_reference, smart_tx_power, spi_pid, dw3000_pid, auto_sleep_margin, restricted_channels phrMode, alternate_pulse_shape, wificoex_gpio, wificoex_delay_us, - wificoex_interval_us, wificoex_margin_us, rf_tx2 */ + wificoex_interval_us, wificoex_margin_us */ #define MAX_CALIB_KEYS ((ANTMAX * (ANT_CHAN_PARAMS + ANT_OTHER_PARAMS)) + \ (ANTPAIR_MAX * ANTPAIR_CHAN_PARAMS) + \ @@ -97,7 +97,6 @@ static const struct { DW_INFO(spi_pid), DW_INFO(dw3000_pid), DW_INFO(restricted_channels), - DW_INFO(tx_rf2), DW_INFO(config.phrMode), DW_INFO(coex_gpio), DW_INFO(coex_delay_us), @@ -158,7 +157,6 @@ static const char *const dw3000_calib_keys[MAX_CALIB_KEYS + 1] = { "spi_pid", "dw3000_pid", "restricted_channels", - "tx_rf2", "phr_mode", "coex_gpio", "coex_delay_us", diff --git a/kernel/drivers/net/ieee802154/dw3000_chip_e0.h b/kernel/drivers/net/ieee802154/dw3000_chip_e0.h index 1230bbd..c4a97ee 100644 --- a/kernel/drivers/net/ieee802154/dw3000_chip_e0.h +++ b/kernel/drivers/net/ieee802154/dw3000_chip_e0.h @@ -99,7 +99,6 @@ struct dw3000_timer_cfg { /* Hardware timer functions */ int dw3000_timers_enable(struct dw3000 *dw); int dw3000_timers_reset(struct dw3000 *dw); -int dw3000_timer_get_counters(struct dw3000 *dw); int dw3000_timers_read_and_clear_events(struct dw3000 *dw, u8 *evt0, u8 *evt1); int dw3000_timer_configure(struct dw3000 *dw, enum dw3000_timer timer, diff --git a/kernel/drivers/net/ieee802154/dw3000_core.c b/kernel/drivers/net/ieee802154/dw3000_core.c index 71d27f2..fb4afef 100644 --- a/kernel/drivers/net/ieee802154/dw3000_core.c +++ b/kernel/drivers/net/ieee802154/dw3000_core.c @@ -1390,11 +1390,6 @@ int dw3000_change_tx_rf1_to_rf2(struct dw3000 *dw, bool tx) return rc; } -int dw3000_change_tx_to_default(struct dw3000 *dw) -{ - return dw3000_reg_write32(dw, DW3000_RF_SWITCH_CTRL_ID, 0, 0x1C000000); -} - /** * dw3000_read_rdb_status() - Fast read of RDB_STATUS register * @dw: the DW device on which the SPI transfer will occurs @@ -6256,21 +6251,13 @@ int dw3000_set_tx_antenna(struct dw3000 *dw, int ant_set_id) return 0; /* Retrieve antenna GPIO configuration from calibration data */ ant_calib = &dw->calib_data.ant[ant_idx1]; - if (ant_calib->port != 0) { - /* TX always use RF1 port */ - dev_warn( - dw->dev, - "Bad antenna selected or bad configuration ant=%d, port=%d\n", - ant_idx1, ant_calib->port); - return -EINVAL; - } - /* Set GPIO state according config to select this antenna */ - if (dw->tx_rf2) { - /* force antenna switch to AoA 1*/ + /* switching to RF2 port for TX if necessary */ + if (ant_calib->port == 1) { dw3000_change_tx_rf1_to_rf2(dw, true); - ant_calib = &dw->calib_data.ant[3]; + dw->tx_rf2 = 1; } + /* Set GPIO state according config to select this antenna */ rc = dw3000_set_antenna_gpio(dw, ant_calib); if (rc) |