From fa9df61628124ef909052713fe1a3b487255633f Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Wed, 19 Oct 2022 12:36:17 -0700 Subject: [PATCH 1/3] abi_gki_aarch64_qcom: Add symbols for wcd usbss i2c driver Add i2c_transfer and regulator_bulk_enable to the ABI list to be used in the wcd usbss i2c driver. Change-Id: I045618c55e63b91d3a316967a9ab942f7e658f45 Signed-off-by: Phani Kumar Uppalapati --- android/abi_gki_aarch64_qcom | 1 + 1 file changed, 1 insertion(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index d6e5a4e3bfa9..bba27648556a 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -1727,6 +1727,7 @@ regmap_write regulator_allow_bypass regulator_bulk_disable + regulator_bulk_enable regulator_count_voltages regulator_disable regulator_disable_regmap From 3de6b115648e79752517b0d881d78ec506cd84c7 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Fri, 14 Oct 2022 09:28:40 -0700 Subject: [PATCH 2/3] defconfig: Enable wcd usbss related configs for pineapple Enable wcd usb subsystem related configs for pineapple target. Change-Id: Ic477b329a6ca564a6bab515c0a159d72ee13e18c Signed-off-by: Phani Kumar Uppalapati --- arch/arm64/configs/vendor/pineapple_GKI.config | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/vendor/pineapple_GKI.config b/arch/arm64/configs/vendor/pineapple_GKI.config index c5903404597e..25922c0b5f0a 100644 --- a/arch/arm64/configs/vendor/pineapple_GKI.config +++ b/arch/arm64/configs/vendor/pineapple_GKI.config @@ -153,6 +153,7 @@ CONFIG_QCOM_SPSS=m CONFIG_QCOM_STATS=m CONFIG_QCOM_TSENS=m CONFIG_QCOM_VADC_COMMON=m +CONFIG_QCOM_WCD_USBSS_I2C=m # CONFIG_QCOM_WCNSS_PIL is not set CONFIG_QRTR=m CONFIG_QRTR_SMD=m From 1b5b41d6678fa8f631159d5e756c3028c803be49 Mon Sep 17 00:00:00 2001 From: Sam Rainey Date: Mon, 17 Oct 2022 14:15:18 -0700 Subject: [PATCH 3/3] wcd939x-usbss: Add support for WCD_USBSS_HSJ_CONNECT in the wcd939x i2c driver Add a case in the wcd939x i2c driver for connecting a headset microphone via the USB subsystem. Update corresponding header file. Change-Id: Ia01804a8ffde36d055a65c11692cef20297e30ca Signed-off-by: Sam Rainey --- drivers/soc/qcom/wcd939x-i2c.c | 8 ++++++++ include/linux/soc/qcom/wcd939x-i2c.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/soc/qcom/wcd939x-i2c.c b/drivers/soc/qcom/wcd939x-i2c.c index 1cdd6e76f89b..d17337ac98a9 100644 --- a/drivers/soc/qcom/wcd939x-i2c.c +++ b/drivers/soc/qcom/wcd939x-i2c.c @@ -341,6 +341,14 @@ int wcd_usbss_switch_update(enum wcd_usbss_cable_types ctype, regmap_update_bits_base(wcd_usbss_ctxt_->regmap, WCD_USBSS_AUDIO_FSM_START, 0x01, 0x01, NULL, false, true); break; + case WCD_USBSS_HSJ_CONNECT: + /* Select MG2, GSBU1 */ + regmap_update_bits(wcd_usbss_ctxt_->regmap, + WCD_USBSS_SWITCH_SELECT0, 0x03, 0x1); + /* Enable SENSE, MIC, AGND switches */ + regmap_update_bits(wcd_usbss_ctxt_->regmap, + WCD_USBSS_SWITCH_SETTINGS_ENABLE, 0x07, 0x07); + break; case WCD_USBSS_DP_AUX_CC1: fallthrough; case WCD_USBSS_DP_AUX_CC2: diff --git a/include/linux/soc/qcom/wcd939x-i2c.h b/include/linux/soc/qcom/wcd939x-i2c.h index 7d9fb4edb711..36320ce34c77 100644 --- a/include/linux/soc/qcom/wcd939x-i2c.h +++ b/include/linux/soc/qcom/wcd939x-i2c.h @@ -15,6 +15,7 @@ enum wcd_usbss_cable_types { WCD_USBSS_DP_AUX_CC2, WCD_USBSS_AATC, WCD_USBSS_GND_MIC_SWAP_AATC, + WCD_USBSS_HSJ_CONNECT, }; enum wcd_usbss_cable_status {