asoc: codecs: Add support for class ab low power modes

Add codec enable and disable sequences for class ab
low power modes.

Change-Id: If5b54075985c2d4d1a24423c03e78bee119862bc
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
This commit is contained in:
Karthikeyan Mani 2019-05-17 16:59:53 -07:00 committed by Gerrit - the friendly Code Review server
parent c63ec8cd8f
commit 7f609a3ca0
2 changed files with 12 additions and 4 deletions

View File

@ -34,6 +34,10 @@ static const char *mode_to_str(int mode)
return WCD_CLSH_STRINGIFY(CLS_AB);
case CLS_AB_HIFI:
return WCD_CLSH_STRINGIFY(CLS_AB_HIFI);
case CLS_AB_LP:
return WCD_CLSH_STRINGIFY(CLS_AB_LP);
case CLS_AB_LOHIFI:
return WCD_CLSH_STRINGIFY(CLS_AB_LOHIFI);
default:
return WCD_CLSH_STRINGIFY(CLS_H_INVALID);
};
@ -107,7 +111,7 @@ static inline void wcd_clsh_set_buck_mode(struct snd_soc_component *component,
int mode)
{
if (mode == CLS_H_HIFI || mode == CLS_H_LOHIFI ||
mode == CLS_AB_HIFI)
mode == CLS_AB_HIFI || mode == CLS_AB_LOHIFI)
snd_soc_component_update_bits(component,
WCD9XXX_ANA_RX_SUPPLIES,
0x08, 0x08); /* set to HIFI */
@ -122,7 +126,7 @@ static inline void wcd_clsh_set_flyback_mode(
int mode)
{
if (mode == CLS_H_HIFI || mode == CLS_H_LOHIFI ||
mode == CLS_AB_HIFI) {
mode == CLS_AB_HIFI || mode == CLS_AB_LOHIFI) {
snd_soc_component_update_bits(component,
WCD9XXX_ANA_RX_SUPPLIES,
0x04, 0x04);
@ -154,7 +158,7 @@ static inline void wcd_clsh_force_iq_ctl(struct snd_soc_component *component,
snd_soc_component_update_bits(component,
WCD9XXX_CLASSH_MODE_2,
0xFF, 0x1C);
if (mode == CLS_H_LOHIFI) {
if (mode == CLS_H_LOHIFI || mode == CLS_AB_LOHIFI) {
snd_soc_component_update_bits(component,
WCD9XXX_HPH_NEW_INT_PA_MISC2,
0x20, 0x20);
@ -258,6 +262,8 @@ static void wcd_clsh_set_hph_mode(struct snd_soc_component *component,
break;
case CLS_H_LP:
case CLS_H_LOHIFI:
case CLS_AB_LP:
case CLS_AB_LOHIFI:
val = 0x04;
break;
default:

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
*/
#ifndef _WCD_CLSH
@ -62,6 +62,8 @@ enum {
CLS_H_LOHIFI, /* LoHIFI */
CLS_H_ULP, /* Ultra Low power */
CLS_AB_HIFI, /* Class-AB */
CLS_AB_LP, /* Class-AB Low Power */
CLS_AB_LOHIFI, /* Class-AB Low HIFI */
CLS_NONE, /* None of the above modes */
};