Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b3e5232 authored by Vatsal Bucha's avatar Vatsal Bucha
Browse files

ASoC: rouleur: Update hph registers based on foundry id



Rouleur has different hph settings for different foundry
id. Read foundry id and update hph settings so as to
provide same settings to end user.

Change-Id: I114047226462ab95e0c93271c3d6099f15af2343
Signed-off-by: default avatarVatsal Bucha <vbucha@codeaurora.org>
parent 8203a06e
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -238,6 +238,18 @@ static int bolero_cdc_update_wcd_event(void *handle, u16 event, u32 data)
				priv->component,
				priv->component,
				BOLERO_MACRO_EVT_RX_PA_GAIN_UPDATE, data);
				BOLERO_MACRO_EVT_RX_PA_GAIN_UPDATE, data);
		break;
		break;
	case WCD_BOLERO_EVT_HPHL_HD2_ENABLE:
		if (priv->macro_params[RX_MACRO].event_handler)
			priv->macro_params[RX_MACRO].event_handler(
				priv->component,
				BOLERO_MACRO_EVT_HPHL_HD2_ENABLE, data);
		break;
	case WCD_BOLERO_EVT_HPHR_HD2_ENABLE:
		if (priv->macro_params[RX_MACRO].event_handler)
			priv->macro_params[RX_MACRO].event_handler(
				priv->component,
				BOLERO_MACRO_EVT_HPHR_HD2_ENABLE, data);
		break;
	default:
	default:
		dev_err(priv->dev, "%s: Invalid event %d trigger from wcd\n",
		dev_err(priv->dev, "%s: Invalid event %d trigger from wcd\n",
			__func__, event);
			__func__, event);
+2 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,8 @@ enum {
	BOLERO_MACRO_EVT_SSR_GFMUX_UP,
	BOLERO_MACRO_EVT_SSR_GFMUX_UP,
	BOLERO_MACRO_EVT_PRE_SSR_UP,
	BOLERO_MACRO_EVT_PRE_SSR_UP,
	BOLERO_MACRO_EVT_RX_PA_GAIN_UPDATE,
	BOLERO_MACRO_EVT_RX_PA_GAIN_UPDATE,
	BOLERO_MACRO_EVT_HPHL_HD2_ENABLE, /* Enable HD2 cfg for HPHL */
	BOLERO_MACRO_EVT_HPHR_HD2_ENABLE, /* Enable HD2 cfg for HPHR */
};
};


enum {
enum {
+2 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,8 @@ enum {
	WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
	WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
	WCD_BOLERO_EVT_BCS_CLK_OFF,
	WCD_BOLERO_EVT_BCS_CLK_OFF,
	WCD_BOLERO_EVT_RX_PA_GAIN_UPDATE,
	WCD_BOLERO_EVT_RX_PA_GAIN_UPDATE,
	WCD_BOLERO_EVT_HPHL_HD2_ENABLE, /* to enable hd2 config for hphl */
	WCD_BOLERO_EVT_HPHR_HD2_ENABLE, /* to enable hd2 config for hphr */
};
};


struct wcd_ctrl_platform_data {
struct wcd_ctrl_platform_data {
+10 −0
Original line number Original line Diff line number Diff line
@@ -1463,6 +1463,16 @@ static int rx_macro_event_handler(struct snd_soc_component *component,
					 RX_MACRO_MOD_GAIN));
					 RX_MACRO_MOD_GAIN));
		}
		}
		break;
		break;
	case BOLERO_MACRO_EVT_HPHL_HD2_ENABLE:
		/* Enable hd2 config for hphl*/
		snd_soc_component_update_bits(component,
				BOLERO_CDC_RX_RX0_RX_PATH_CFG0, 0x04, data);
		break;
	case BOLERO_MACRO_EVT_HPHR_HD2_ENABLE:
		/* Enable hd2 config for hphr*/
		snd_soc_component_update_bits(component,
				BOLERO_CDC_RX_RX1_RX_PATH_CFG0, 0x04, data);
		break;
	}
	}
done:
done:
	return ret;
	return ret;
+5 −0
Original line number Original line Diff line number Diff line
@@ -88,6 +88,8 @@ struct rouleur_priv {
	struct notifier_block psy_nb;
	struct notifier_block psy_nb;
	struct work_struct soc_eval_work;
	struct work_struct soc_eval_work;
	bool low_soc;
	bool low_soc;
	int foundry_id_reg;
	int foundry_id;
};
};


struct rouleur_micbias_setting {
struct rouleur_micbias_setting {
@@ -105,6 +107,7 @@ struct rouleur_pdata {
	struct cdc_regulator *regulator;
	struct cdc_regulator *regulator;
	int num_supplies;
	int num_supplies;
	int reset_reg;
	int reset_reg;
	int foundry_id_reg;
};
};


struct wcd_ctrl_platform_data {
struct wcd_ctrl_platform_data {
@@ -135,6 +138,8 @@ enum {
	WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
	WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
	WCD_BOLERO_EVT_BCS_CLK_OFF,
	WCD_BOLERO_EVT_BCS_CLK_OFF,
	WCD_BOLERO_EVT_RX_PA_GAIN_UPDATE, /* To reduce PA gain for low SoC */
	WCD_BOLERO_EVT_RX_PA_GAIN_UPDATE, /* To reduce PA gain for low SoC */
	WCD_BOLERO_EVT_HPHL_HD2_ENABLE, /* to enable hd2 config for hphl */
	WCD_BOLERO_EVT_HPHR_HD2_ENABLE, /* to enable hd2 config for hphr */
};
};


enum {
enum {
Loading