diff options
author | More Kuo <morekuo@google.com> | 2023-01-17 17:58:48 +0800 |
---|---|---|
committer | More Kuo <morekuo@google.com> | 2023-02-09 17:35:13 +0800 |
commit | 1402dbbf6f5168f966853990ccd3a6833c9fa085 (patch) | |
tree | b34025ca9964c516bb3aeeadb0b1e62efa35bb7f | |
parent | 1827510d9c30713206d42435ef509ffa605c70cb (diff) | |
download | broadcom-android-gs-shusky-5.15-android14-qpr1-beta.tar.gz |
Nitrous: Set BT_BLE_DBO_LE as default inputandroid-u-qpr2-beta-3_r0.8android-u-qpr2-beta-3.1_r0.8android-u-qpr2-beta-2_r0.8android-u-qpr2-beta-1_r0.7android-u-qpr1-beta-2_r0.8android-u-qpr1-beta-2.2_r0.7android-u-qpr1-beta-2.1_r0.8android-14.0.0_r0.81android-14.0.0_r0.80android-14.0.0_r0.8android-14.0.0_r0.77android-14.0.0_r0.67android-14.0.0_r0.57android-14.0.0_r0.45android-14.0.0_r0.38android-14.0.0_r0.18main-16k-gs-shusky-5.15android-gs-shusky-udc-d1android-gs-shusky-5.15-u-qpr1-beta2android-gs-shusky-5.15-android14-qpr2-betaandroid-gs-shusky-5.15-android14-qpr2android-gs-shusky-5.15-android14-qpr1-betaandroid-gs-shusky-5.15-android14-qpr1android-gs-shusky-5.15-android14-d1android-gs-akita-5.15-android14-d2
Set BT_BLE_DBO_LE as default input, and set it as output only if the BT_REG_ON
is set from APM.
Bug: 268450112
Signed-off-by: More Kuo <morekuo@google.com>
Change-Id: Ibc3edc298a1eb949d589e7ba69472eebde8d06c6
-rw-r--r-- | nitrous.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -33,6 +33,8 @@ #define TIMESYNC_ENABLED 2 #define DBO_NOT_SUPPORTED 0 #define DBO_SUPPORTED 1 +#define DBO_NOT_CONFIGURED 0 +#define DBO_CONFIGURED 1 struct nitrous_lpm_proc; @@ -55,6 +57,7 @@ struct nitrous_bt_lpm { struct kfifo timestamp_queue; int dbo_state; + int dbo_config; bool off_mode_latch; struct device *dev; @@ -554,6 +557,7 @@ static int nitrous_rfkill_set_power(void *data, bool blocked) { struct nitrous_bt_lpm *lpm = data; struct timespec64 ts; + int ret; if (!lpm) { return -EINVAL; @@ -574,6 +578,16 @@ static int nitrous_rfkill_set_power(void *data, bool blocked) /* Reset to make sure LPM is disabled */ nitrous_lpm_runtime_disable(lpm); ktime_get_real_ts64(&ts); + + if (!lpm->dbo_config) { + ret = gpiod_direction_output(lpm->gpio_ble_dbo, 1); + if (ret) { + dev_info(lpm->dev, "DBO: ret = %d", ret); + } else { + lpm->dbo_config = DBO_CONFIGURED; + } + } + if (!blocked) { /* Power up the BT chip. delay between consecutive toggles. */ logbuffer_log(lpm->log, "Power up BT chip %ptTt", &ts); @@ -703,7 +717,7 @@ static int nitrous_probe(struct platform_device *pdev) } dev_dbg(lpm->dev, "Timesync support: %x", lpm->timesync_state); - lpm->gpio_ble_dbo = devm_gpiod_get_optional(dev, "bt-ble-dbo-le", GPIOD_OUT_HIGH); + lpm->gpio_ble_dbo = devm_gpiod_get_optional(dev, "bt-ble-dbo-le", GPIOD_IN); lpm->dbo_state = DBO_NOT_SUPPORTED; if (IS_ERR(lpm->gpio_ble_dbo)) { dev_warn(lpm->dev, "Can't get dbo GPIO descriptor\n"); @@ -743,6 +757,8 @@ static int nitrous_probe(struct platform_device *pdev) lpm->idle_bt_rx_ip_index = exynos_get_idle_ip_index("bluetooth-rx"); exynos_update_ip_idle_status(lpm->idle_bt_rx_ip_index, STATUS_IDLE); + lpm->dbo_config = DBO_NOT_CONFIGURED; + logbuffer_log(lpm->log, "probe: successful"); return rc; |