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

Commit fe702b2f authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wsa883x: Update sequence for temperature



Update sequence to enable temperature sensor in wsa883x to
read proper temperature measurement.

Change-Id: I7db16344a92b82539929511bd0de322ed086beb7
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 47aa5011
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -831,7 +831,7 @@ static const struct snd_kcontrol_new wsa883x_snd_controls[] = {
	SOC_SINGLE_EXT("WSA PA Mute", SND_SOC_NOPM, 0, 1, 0,
		wsa883x_get_mute, wsa883x_set_mute),

	SOC_SINGLE_EXT("WSA Temp", SND_SOC_NOPM, 0, 1, 0,
	SOC_SINGLE_EXT("WSA Temp", SND_SOC_NOPM, 0, UINT_MAX, 0,
			wsa_get_temp, NULL),

	SOC_ENUM_EXT("WSA MODE", wsa_dev_mode_enum,
@@ -1055,7 +1055,19 @@ static int32_t wsa883x_temp_reg_read(struct snd_soc_component *component,

	mutex_lock(&wsa883x->res_lock);

	/* TODO Vote for global PA */
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x01, 0x01);
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x04, 0x04);
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x02, 0x02);
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x80, 0x80);
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x20, 0x20);
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0x40, 0x40);

	snd_soc_component_update_bits(component, WSA883X_TADC_VALUE_CTL,
				0x01, 0x00);
	wsa_temp_reg->dmeas_msb = snd_soc_component_read32(
@@ -1073,7 +1085,8 @@ static int32_t wsa883x_temp_reg_read(struct snd_soc_component *component,
	wsa_temp_reg->d2_lsb = snd_soc_component_read32(
					component, WSA883X_OTP_REG_4);

	/* TODO Unvote for global PA */
	snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP,
				0xE7, 0x00);
	mutex_unlock(&wsa883x->res_lock);

	return 0;