|
@@ -51,6 +51,7 @@
|
|
|
#define HPH_IMPEDANCE_2VPK_MODE_OHMS 260
|
|
|
#define XTALK_L_CH_NUM 0
|
|
|
#define XTALK_R_CH_NUM 1
|
|
|
+#define GND_EXT_FET_MARGIN_MOHMS 200
|
|
|
|
|
|
#define NUM_ATTEMPTS 5
|
|
|
#define COMP_MAX_COEFF 25
|
|
@@ -1068,14 +1069,14 @@ static int wcd939x_config_xtalk(struct snd_soc_component *component,
|
|
|
/* Write scale and alpha based on channel */
|
|
|
if (xtalk_indx == XTALK_L_CH_NUM) {
|
|
|
snd_soc_component_update_bits(component, xtalk_sec1, 0xFF,
|
|
|
- pdata->usbcss_hs.alpha_l);
|
|
|
+ pdata->usbcss_hs.xtalk.alpha_l);
|
|
|
snd_soc_component_update_bits(component, xtalk_sec0, 0x1F,
|
|
|
- pdata->usbcss_hs.scale_l);
|
|
|
+ pdata->usbcss_hs.xtalk.scale_l);
|
|
|
} else if (xtalk_indx == XTALK_R_CH_NUM) {
|
|
|
snd_soc_component_update_bits(component, xtalk_sec1, 0xFF,
|
|
|
- pdata->usbcss_hs.alpha_r);
|
|
|
+ pdata->usbcss_hs.xtalk.alpha_r);
|
|
|
snd_soc_component_update_bits(component, xtalk_sec0, 0x1F,
|
|
|
- pdata->usbcss_hs.scale_r);
|
|
|
+ pdata->usbcss_hs.xtalk.scale_r);
|
|
|
} else {
|
|
|
snd_soc_component_update_bits(component, xtalk_sec1, 0xFF, MIN_XTALK_ALPHA);
|
|
|
snd_soc_component_update_bits(component, xtalk_sec0, 0x1F, MAX_XTALK_SCALE);
|
|
@@ -4768,41 +4769,69 @@ static void wcd939x_dt_parse_micbias_info(struct device *dev,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void fill_r_common_gnd_buffer(struct wcd939x_usbcss_hs_params *usbcss_hs, u32 val)
|
|
|
+{
|
|
|
+ size_t i;
|
|
|
+
|
|
|
+ for (i = 0; i < R_COMMON_GND_BUFFER_SIZE; i++)
|
|
|
+ usbcss_hs->gnd.r_cm_gnd_buffer.data[i] = val;
|
|
|
+}
|
|
|
+
|
|
|
static void init_usbcss_hs_params(struct wcd939x_usbcss_hs_params *usbcss_hs)
|
|
|
{
|
|
|
- usbcss_hs->r_gnd_sbu1_int_fet_mohms = 145;
|
|
|
- usbcss_hs->r_gnd_sbu2_int_fet_mohms = 185;
|
|
|
- usbcss_hs->r_gnd_ext_fet_customer_mohms = 0;
|
|
|
- usbcss_hs->r_gnd_ext_fet_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
- usbcss_hs->r_gnd_par_route1_mohms = 5;
|
|
|
- usbcss_hs->r_gnd_par_route2_mohms = 330;
|
|
|
- usbcss_hs->r_gnd_par_tot_mohms = 0;
|
|
|
- usbcss_hs->r_gnd_sbu1_res_tot_mohms = 0;
|
|
|
- usbcss_hs->r_gnd_sbu2_res_tot_mohms = 0;
|
|
|
- usbcss_hs->r_conn_par_load_pos_mohms = 7550;
|
|
|
- usbcss_hs->r_aud_int_fet_l_mohms = 303;
|
|
|
- usbcss_hs->r_aud_int_fet_r_mohms = 275;
|
|
|
- usbcss_hs->r_aud_ext_fet_l_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
- usbcss_hs->r_aud_ext_fet_r_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
- usbcss_hs->r_aud_res_tot_l_mohms = 0;
|
|
|
- usbcss_hs->r_aud_res_tot_r_mohms = 0;
|
|
|
- usbcss_hs->r_surge_mohms = 272;
|
|
|
- usbcss_hs->r_load_eff_l_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
- usbcss_hs->r_load_eff_r_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
- usbcss_hs->r3 = 1;
|
|
|
- usbcss_hs->r4 = 330;
|
|
|
- usbcss_hs->r5 = 5;
|
|
|
- usbcss_hs->r6 = 1;
|
|
|
- usbcss_hs->r7 = 5;
|
|
|
- usbcss_hs->k_aud_times_100 = 13;
|
|
|
- usbcss_hs->k_gnd_times_100 = 13;
|
|
|
- usbcss_hs->aud_tap_offset = 0;
|
|
|
- usbcss_hs->gnd_tap_offset = 0;
|
|
|
- usbcss_hs->scale_l = MAX_XTALK_SCALE;
|
|
|
- usbcss_hs->alpha_l = MIN_XTALK_ALPHA;
|
|
|
- usbcss_hs->scale_r = MAX_XTALK_SCALE;
|
|
|
- usbcss_hs->alpha_r = MIN_XTALK_ALPHA;
|
|
|
- usbcss_hs->xtalk_config = XTALK_NONE;
|
|
|
+ fill_r_common_gnd_buffer(usbcss_hs, 0);
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_int_fet_mohms = 183;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_int_fet_mohms = 127;
|
|
|
+ usbcss_hs->gnd.r_cm_gnd_buffer.write_index = 0;
|
|
|
+ usbcss_hs->gnd.rdson_mohms = 500;
|
|
|
+ usbcss_hs->gnd.rdson_3p6v_mohms = 545;
|
|
|
+ usbcss_hs->gnd.r_gnd_ext_fet_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->gnd.r_common_gnd_mohms = 0;
|
|
|
+ usbcss_hs->gnd.r_common_gnd_offset = 0;
|
|
|
+ usbcss_hs->gnd.r_common_gnd_margin = 500;
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_delta_mohms = 45;
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_min_mohms = 0;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route1_mohms = 5;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route1_mohms = 5;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route2_mohms = 330;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route2_mohms = 330;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_tot_mohms = 0;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_tot_mohms = 0;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_res_tot_mohms = 0;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_res_tot_mohms = 0;
|
|
|
+ usbcss_hs->aud.l.r_aud_int_fet_mohms = 290;
|
|
|
+ usbcss_hs->aud.r.r_aud_int_fet_mohms = 290;
|
|
|
+ usbcss_hs->aud.l.r_aud_ext_fet_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->aud.r.r_aud_ext_fet_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->aud.l.r_aud_res_tot_mohms = 0;
|
|
|
+ usbcss_hs->aud.r.r_aud_res_tot_mohms = 0;
|
|
|
+ usbcss_hs->aud.r_surge_mohms = 229;
|
|
|
+ usbcss_hs->aud.l.r_load_eff_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->aud.r.r_load_eff_mohms = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->aud.l.zval = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->aud.r.zval = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->zdiffval = 0; /* to be computed during MBHC zdet */
|
|
|
+ usbcss_hs->diff_slope_factor_times_1000 = 9898;
|
|
|
+ usbcss_hs->se_slope_factor_times_1000 = 9906;
|
|
|
+ usbcss_hs->aud.l.r1 = 310;
|
|
|
+ usbcss_hs->aud.r.r1 = 310;
|
|
|
+ usbcss_hs->aud.l.r3 = 1;
|
|
|
+ usbcss_hs->aud.r.r3 = 1;
|
|
|
+ usbcss_hs->gnd.sbu1.r4 = 530;
|
|
|
+ usbcss_hs->gnd.sbu2.r4 = 530;
|
|
|
+ usbcss_hs->gnd.sbu1.r5 = 5;
|
|
|
+ usbcss_hs->gnd.sbu2.r5 = 5;
|
|
|
+ usbcss_hs->gnd.sbu1.r6 = 1;
|
|
|
+ usbcss_hs->gnd.sbu2.r6 = 1;
|
|
|
+ usbcss_hs->gnd.sbu1.r7 = 5;
|
|
|
+ usbcss_hs->gnd.sbu2.r7 = 5;
|
|
|
+ usbcss_hs->aud.k_aud_times_100 = 13;
|
|
|
+ usbcss_hs->aud.aud_tap_offset = 0;
|
|
|
+ usbcss_hs->xtalk.scale_l = MAX_XTALK_SCALE;
|
|
|
+ usbcss_hs->xtalk.alpha_l = MIN_XTALK_ALPHA;
|
|
|
+ usbcss_hs->xtalk.scale_r = MAX_XTALK_SCALE;
|
|
|
+ usbcss_hs->xtalk.alpha_r = MIN_XTALK_ALPHA;
|
|
|
+ usbcss_hs->xtalk.xtalk_config = XTALK_NONE;
|
|
|
}
|
|
|
|
|
|
static void parse_xtalk_param(struct device *dev, u32 default_val, u32 *prop_val_p,
|
|
@@ -4827,7 +4856,7 @@ static void parse_xtalk_param(struct device *dev, u32 default_val, u32 *prop_val
|
|
|
static void wcd939x_dt_parse_usbcss_hs_info(struct device *dev,
|
|
|
struct wcd939x_usbcss_hs_params *usbcss_hs)
|
|
|
{
|
|
|
- u32 prop_val = 0;
|
|
|
+ u32 prop_val = 0, r_common_gnd_mohms = 0;
|
|
|
s32 prop_val_signed = 0;
|
|
|
int rc = 0;
|
|
|
|
|
@@ -4839,7 +4868,7 @@ static void wcd939x_dt_parse_usbcss_hs_info(struct device *dev,
|
|
|
rc = wcd939x_read_of_property_u32(dev, "qcom,usbcss-hs-xtalk-config", &prop_val);
|
|
|
if ((!rc) && (prop_val == XTALK_NONE || prop_val == XTALK_DIGITAL
|
|
|
|| prop_val == XTALK_ANALOG)) {
|
|
|
- usbcss_hs->xtalk_config = (enum xtalk_mode) prop_val;
|
|
|
+ usbcss_hs->xtalk.xtalk_config = (enum xtalk_mode) prop_val;
|
|
|
} else
|
|
|
dev_dbg(dev, "%s: %s OOB. Default value of %s used.\n",
|
|
|
__func__, "qcom,usbcss-hs-xtalk-config", "XTALK_NONE");
|
|
@@ -4850,83 +4879,142 @@ static void wcd939x_dt_parse_usbcss_hs_info(struct device *dev,
|
|
|
/* k values for linearizer */
|
|
|
if (of_find_property(dev->of_node, "qcom,usbcss-hs-lin-k-aud", NULL)) {
|
|
|
rc = wcd939x_read_of_property_s32(dev, "qcom,usbcss-hs-lin-k-aud",
|
|
|
- &prop_val);
|
|
|
- if ((!rc) && (prop_val <= MAX_K_TIMES_100) && (prop_val >= MIN_K_TIMES_100))
|
|
|
- usbcss_hs->k_aud_times_100 = prop_val;
|
|
|
- dev_dbg(dev, "%s: %s OOB. Default value of %d will be used.\n",
|
|
|
- __func__, "qcom,usbcss-hs-lin-k-aud",
|
|
|
- usbcss_hs->k_aud_times_100);
|
|
|
+ &prop_val_signed);
|
|
|
+ if ((!rc) && (prop_val_signed <= MAX_K_TIMES_100) &&
|
|
|
+ (prop_val_signed >= MIN_K_TIMES_100))
|
|
|
+ usbcss_hs->aud.k_aud_times_100 = prop_val_signed;
|
|
|
+ else
|
|
|
+ dev_dbg(dev, "%s: %s OOB. Default value of %d will be used.\n",
|
|
|
+ __func__, "qcom,usbcss-hs-lin-k-aud",
|
|
|
+ usbcss_hs->aud.k_aud_times_100);
|
|
|
} else {
|
|
|
dev_dbg(dev, "%s: %s property not found. Default value of %d will be used.\n",
|
|
|
__func__, "qcom,usbcss-hs-lin-k-aud",
|
|
|
- usbcss_hs->k_aud_times_100);
|
|
|
+ usbcss_hs->aud.k_aud_times_100);
|
|
|
}
|
|
|
- if (of_find_property(dev->of_node, "qcom,usbcss-hs-lin-k-gnd", NULL)) {
|
|
|
- rc = wcd939x_read_of_property_s32(dev, "qcom,usbcss-hs-lin-k-gnd",
|
|
|
- &prop_val_signed);
|
|
|
- if ((!rc) && (prop_val_signed <= MAX_K_TIMES_100) &&
|
|
|
- (prop_val_signed >= MIN_K_TIMES_100))
|
|
|
- usbcss_hs->k_gnd_times_100 = prop_val_signed;
|
|
|
- dev_dbg(dev, "%s: %s OOB. Default value of %d will be used.\n",
|
|
|
- __func__, "qcom,usbcss-hs-lin-k-gnd",
|
|
|
- usbcss_hs->k_gnd_times_100);
|
|
|
+
|
|
|
+ /* Differential slope factor */
|
|
|
+ if (of_find_property(dev->of_node, "qcom,usbcss-hs-diff-slope", NULL)) {
|
|
|
+ rc = wcd939x_read_of_property_u32(dev, "qcom,usbcss-hs-diff-slope", &prop_val);
|
|
|
+ if ((!rc) && (prop_val <= MAX_DIFF_SLOPE_FACTOR) &&
|
|
|
+ (prop_val >= MIN_DIFF_SLOPE_FACTOR))
|
|
|
+ usbcss_hs->diff_slope_factor_times_1000 = prop_val;
|
|
|
+ else
|
|
|
+ dev_dbg(dev, "%s: %s OOB. Default value of %d will be used.\n",
|
|
|
+ __func__, "qcom,usbcss-hs-diff-slope",
|
|
|
+ usbcss_hs->diff_slope_factor_times_1000);
|
|
|
} else {
|
|
|
dev_dbg(dev, "%s: %s property not found. Default value of %d will be used.\n",
|
|
|
- __func__, "qcom,usbcss-hs-lin-k-gnd",
|
|
|
- usbcss_hs->k_gnd_times_100);
|
|
|
- }
|
|
|
-
|
|
|
- /* r_gnd_ext_fet_customer_mohms */
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r_gnd_ext_fet_customer_mohms, &prop_val,
|
|
|
- "qcom,usbcss-hs-rdson");
|
|
|
- usbcss_hs->r_gnd_ext_fet_customer_mohms = prop_val;
|
|
|
- /* r_conn_par_load_pos_mohm */
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r_conn_par_load_pos_mohms, &prop_val,
|
|
|
- "qcom,usbcss-hs-r2");
|
|
|
- usbcss_hs->r_conn_par_load_pos_mohms = prop_val;
|
|
|
+ __func__, "qcom,usbcss-hs-diff-slope",
|
|
|
+ usbcss_hs->diff_slope_factor_times_1000);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* R_ds(on) */
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.rdson_mohms, &prop_val, "qcom,usbcss-hs-rdson-6v");
|
|
|
+ usbcss_hs->gnd.rdson_mohms = prop_val;
|
|
|
+ /* R_ds(on) Vgs=3.6V */
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.rdson_3p6v_mohms, &prop_val,
|
|
|
+ "qcom,usbcss-hs-rdson-3p6v");
|
|
|
+ usbcss_hs->gnd.rdson_3p6v_mohms = prop_val;
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_delta_mohms = (s32) (usbcss_hs->gnd.rdson_3p6v_mohms -
|
|
|
+ usbcss_hs->gnd.rdson_mohms);
|
|
|
+ /* r_common_gnd_margin */
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.r_common_gnd_margin, &prop_val,
|
|
|
+ "qcom,usbcss-hs-rcom-margin");
|
|
|
+ usbcss_hs->gnd.r_common_gnd_margin = prop_val;
|
|
|
+ /* r1 */
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->aud.l.r1, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r1-l");
|
|
|
+ usbcss_hs->aud.l.r1 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->aud.r.r1, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r1-r");
|
|
|
+ usbcss_hs->aud.r.r1 = prop_val;
|
|
|
/* r3 */
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r3, &prop_val,
|
|
|
- "qcom,usbcss-hs-r3");
|
|
|
- usbcss_hs->r3 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->aud.l.r3, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r3-l");
|
|
|
+ usbcss_hs->aud.l.r3 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->aud.r.r3, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r3-r");
|
|
|
+ usbcss_hs->aud.r.r3 = prop_val;
|
|
|
/* r4 */
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r4, &prop_val,
|
|
|
- "qcom,usbcss-hs-r4");
|
|
|
- usbcss_hs->r4 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu1.r4, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r4-sbu1");
|
|
|
+ usbcss_hs->gnd.sbu1.r4 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu2.r4, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r4-sbu2");
|
|
|
+ usbcss_hs->gnd.sbu2.r4 = prop_val;
|
|
|
/* r_gnd_par_route1_mohms and r_gnd_par_route2_mohms */
|
|
|
- if (usbcss_hs->xtalk_config == XTALK_ANALOG) {
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r5, &prop_val,
|
|
|
- "qcom,usbcss-hs-r5");
|
|
|
- usbcss_hs->r5 = prop_val;
|
|
|
- usbcss_hs->r_gnd_par_route1_mohms = usbcss_hs->r5 + usbcss_hs->r4;
|
|
|
- usbcss_hs->r_gnd_par_route2_mohms = 125;
|
|
|
- } else if (usbcss_hs->xtalk_config == XTALK_DIGITAL) {
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r6, &prop_val,
|
|
|
- "qcom,usbcss-hs-r6");
|
|
|
- usbcss_hs->r6 = prop_val;
|
|
|
- usbcss_hs->r_gnd_par_route2_mohms = usbcss_hs->r6 + usbcss_hs->r4;
|
|
|
- parse_xtalk_param(dev, usbcss_hs->r_gnd_par_route1_mohms, &prop_val,
|
|
|
- "qcom,usbcss-hs-r7");
|
|
|
- usbcss_hs->r7 = prop_val;
|
|
|
- usbcss_hs->r_gnd_par_route1_mohms = prop_val;
|
|
|
+ if (usbcss_hs->xtalk.xtalk_config == XTALK_ANALOG) {
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu1.r5, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r5-sbu1");
|
|
|
+ usbcss_hs->gnd.sbu1.r5 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu2.r5, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r5-sbu2");
|
|
|
+ usbcss_hs->gnd.sbu2.r5 = prop_val;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route1_mohms = usbcss_hs->gnd.sbu1.r5 +
|
|
|
+ usbcss_hs->gnd.sbu1.r4;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route1_mohms = usbcss_hs->gnd.sbu2.r5 +
|
|
|
+ usbcss_hs->gnd.sbu2.r4;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route2_mohms = 125;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route2_mohms = 125;
|
|
|
+ } else if (usbcss_hs->xtalk.xtalk_config == XTALK_DIGITAL) {
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu1.r6, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r6-sbu1");
|
|
|
+ usbcss_hs->gnd.sbu1.r6 = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu2.r6, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r6-sbu2");
|
|
|
+ usbcss_hs->gnd.sbu2.r6 = prop_val;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route2_mohms = usbcss_hs->gnd.sbu1.r6 +
|
|
|
+ usbcss_hs->gnd.sbu1.r4;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route2_mohms = usbcss_hs->gnd.sbu2.r6 +
|
|
|
+ usbcss_hs->gnd.sbu2.r4;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu1.r7, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r7-sbu1");
|
|
|
+ usbcss_hs->gnd.sbu1.r7 = prop_val;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route1_mohms = prop_val;
|
|
|
+ parse_xtalk_param(dev, usbcss_hs->gnd.sbu2.r7, &prop_val,
|
|
|
+ "qcom,usbcss-hs-r7-sbu2");
|
|
|
+ usbcss_hs->gnd.sbu2.r7 = prop_val;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route1_mohms = prop_val;
|
|
|
}
|
|
|
|
|
|
/* Compute total resistances */
|
|
|
- usbcss_hs->r_gnd_par_tot_mohms = usbcss_hs->r_gnd_par_route1_mohms +
|
|
|
- usbcss_hs->r_gnd_par_route2_mohms;
|
|
|
- usbcss_hs->r_gnd_sbu1_res_tot_mohms = get_r_gnd_res_tot_mohms(
|
|
|
- usbcss_hs->r_gnd_sbu1_int_fet_mohms,
|
|
|
- usbcss_hs->r_gnd_ext_fet_mohms,
|
|
|
- usbcss_hs->r_gnd_par_tot_mohms);
|
|
|
- usbcss_hs->r_gnd_sbu2_res_tot_mohms = get_r_gnd_res_tot_mohms(
|
|
|
- usbcss_hs->r_gnd_sbu2_int_fet_mohms,
|
|
|
- usbcss_hs->r_gnd_ext_fet_mohms,
|
|
|
- usbcss_hs->r_gnd_par_tot_mohms);
|
|
|
- usbcss_hs->r_aud_res_tot_l_mohms = get_r_aud_res_tot_mohms(
|
|
|
- usbcss_hs->r_aud_int_fet_l_mohms,
|
|
|
- usbcss_hs->r_aud_ext_fet_l_mohms);
|
|
|
- usbcss_hs->r_aud_res_tot_r_mohms = get_r_aud_res_tot_mohms(
|
|
|
- usbcss_hs->r_aud_int_fet_r_mohms,
|
|
|
- usbcss_hs->r_aud_ext_fet_r_mohms);
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_tot_mohms = usbcss_hs->gnd.sbu1.r_gnd_par_route1_mohms +
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_route2_mohms;
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_tot_mohms = usbcss_hs->gnd.sbu2.r_gnd_par_route1_mohms +
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route2_mohms;
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_res_tot_mohms = get_r_gnd_res_tot_mohms(
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_int_fet_mohms,
|
|
|
+ usbcss_hs->gnd.r_gnd_ext_fet_mohms,
|
|
|
+ usbcss_hs->gnd.sbu1.r_gnd_par_tot_mohms);
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_res_tot_mohms = get_r_gnd_res_tot_mohms(
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_int_fet_mohms,
|
|
|
+ usbcss_hs->gnd.r_gnd_ext_fet_mohms,
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_tot_mohms);
|
|
|
+ usbcss_hs->aud.l.r_aud_res_tot_mohms = get_r_aud_res_tot_mohms(
|
|
|
+ usbcss_hs->aud.l.r_aud_int_fet_mohms,
|
|
|
+ usbcss_hs->aud.l.r_aud_ext_fet_mohms,
|
|
|
+ usbcss_hs->aud.l.r3);
|
|
|
+ usbcss_hs->aud.r.r_aud_res_tot_mohms = get_r_aud_res_tot_mohms(
|
|
|
+ usbcss_hs->aud.r.r_aud_int_fet_mohms,
|
|
|
+ usbcss_hs->aud.r.r_aud_ext_fet_mohms,
|
|
|
+ usbcss_hs->aud.r.r3);
|
|
|
+
|
|
|
+ /* Fill r_common_gnd buffer */
|
|
|
+ r_common_gnd_mohms = usbcss_hs->gnd.rdson_mohms +
|
|
|
+ (usbcss_hs->gnd.sbu1.r_gnd_par_route2_mohms +
|
|
|
+ usbcss_hs->gnd.sbu2.r_gnd_par_route2_mohms) / 2;
|
|
|
+ fill_r_common_gnd_buffer(usbcss_hs, r_common_gnd_mohms);
|
|
|
+
|
|
|
+ /* Determine min val used for linearizer audio tap calculations */
|
|
|
+ if (usbcss_hs->gnd.rdson_3p6v_mohms < GND_EXT_FET_MARGIN_MOHMS)
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_min_mohms = 0;
|
|
|
+ else if ((usbcss_hs->gnd.rdson_3p6v_mohms - GND_EXT_FET_MARGIN_MOHMS)
|
|
|
+ < GND_EXT_FET_MARGIN_MOHMS)
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_min_mohms = usbcss_hs->gnd.rdson_3p6v_mohms -
|
|
|
+ GND_EXT_FET_MARGIN_MOHMS;
|
|
|
+ else
|
|
|
+ usbcss_hs->gnd.gnd_ext_fet_min_mohms = GND_EXT_FET_MARGIN_MOHMS;
|
|
|
|
|
|
/* Set linearizer calibration codes to be sourced from SW */
|
|
|
wcd_usbss_linearizer_rdac_cal_code_select(LINEARIZER_SOURCE_SW);
|