config SND_SOC_ES705_EXTCLK_OVER_GPIO
bool "Enable External Clock Control Over GPIO"
---help---
- This will enable external clock ON/OFF over
- GPIO
+ This will enable support of external clock ON/OFF
+ over GPIO
# Options for escore infrastructure
-//***********************************************************************************
-// SCRIPT GENERATED FILE - DO NOT EDIT
-//
-// es-a300-reg.h
-//
-// This file contains the addresses for the codec hardware fields. Addresses
-// are automatically extracted by script from the codec register spreadsheets.
-//
-// This file generated on 5/22/2015 at 10:58:03 AM
-//
-//***********************************************************************************
+/*
+ * SCRIPT GENERATED FILE - DO NOT EDIT
+ *
+ * es-a300-reg.h
+ *
+ * This file contains the addresses for the codec hardware fields. Addresses
+ * are automatically extracted by script from the codec register spreadsheets.
+ *
+ * This file generated on 5/22/2015 at 10:58:03 AM
+ */
#ifndef __ES_A300_REG_H__
#define __ES_A300_REG_H__
};
static const struct soc_enum mic1_pga_mux_enum =
- SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mic1_pga_mux_names),
- mic1_pga_mux_names);
+ SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mic1_pga_mux_names),
+ mic1_pga_mux_names);
static const struct snd_kcontrol_new mic1_pga_mux_controls =
SOC_DAPM_ENUM_VIRT("Switch", mic1_pga_mux_enum);
SND_SOC_DAPM_VIRT_MUX("MIC0 PGA Mux", SND_SOC_NOPM, 0, 0,
&mic0_pga_mux_controls),
- SND_SOC_DAPM_VIRT_MUX("MIC1 PGA Mux", SND_SOC_NOPM, 0, 0,
- &mic1_pga_mux_controls),
+ SND_SOC_DAPM_VIRT_MUX("MIC1 PGA Mux", SND_SOC_NOPM, 0, 0,
+ &mic1_pga_mux_controls),
/* ADC */
SND_SOC_DAPM_ADC("ADC0", NULL, ES_ADC0_ON, ES_ADC0_ON_SHIFT, 0),
SND_SOC_DAPM_MUX("ADC1 MUX", SND_SOC_NOPM, 0, 0, &adc1_mux),
{"MIC0 PGA Mux", "MIC-HS", "MICHS"},
{"MIC0 PGA", NULL, "MIC0 PGA Mux"},
- {"MIC1 PGA Mux", "MIC-1", "MIC1"},
- {"MIC1 PGA Mux", "MIC-HS", "MICHS"},
- {"MIC1 PGA", NULL, "MIC1 PGA Mux"},
+ {"MIC1 PGA Mux", "MIC-1", "MIC1"},
+ {"MIC1 PGA Mux", "MIC-HS", "MICHS"},
+ {"MIC1 PGA", NULL, "MIC1 PGA Mux"},
{"MIC2 PGA", NULL, "MIC2"},
switch_value = es_d300_switch[id].value;
cmd = es_d300_switch[id].value_cmd[switch_value];
- cmd = cmd | (1 << ES_SC_BIT);
/*
* The delay is required to make sure the route is active.
escore->algo_type_off = PASSTHRU_VP;
}
-
- pr_debug("%s **** Stop route Algo type %d for stream type %d ******* \n", __func__,escore->algo_type_off, stream_type);
-
-
/* Stop the route first, except when stopping DHWPT use cases */
if (escore->algo_type_off != DHWPT) {
if (escore->algo_type_off == PASSTHRU_VP &&
return ret;
}
- /* Require 1ms delay between stop route and DHWPT to avoid noise */
+ /* Require 1ms delay between stop route
+ and DHWPT to avoid noise */
usleep_range(5000, 5005);
}
if (escore->base_route_setup) {
ret = escore_cmd(escore, stop_route_cmd, &resp);
if (ret) {
- pr_err("%s: Route stop failed, ret = %d\n", __func__,
- ret);
+ pr_err("%s: Route stop failed, ret = %d\n",
+ __func__, ret);
return ret;
}
/* When stopping capture route and DHWPT playback is running,
* restore chip to MP_Sleep mode */
- if (escore->algo_type_off == PASSTHRU_VP && escore->dhwpt_capture_on)
+ if (escore->algo_type_off == PASSTHRU_VP &&
+ escore->dhwpt_capture_on)
escore->dhwpt_capture_on = 0;
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
- pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+ if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+ !escore->dhwpt_capture_on) {
+ pr_debug("%s(): Put chip back into mp_sleep\n",
+ __func__);
ret = es755_enter_mp_sleep();
if (ret) {
pr_err("%s: es755_enter_mp_sleep failed = %d\n",
if (!escore->dhwpt_capture_on) {
- /* Disable DHWPT if enabled, or when stopping DHWPT use cases */
+ /* Disable DHWPT if enabled or
+ when stopping DHWPT use cases
+ */
u32 cmd = escore->dhwpt_cmd & 0xFFFF0000;
- /* Bring the chip from MP Sleep mode to Normal mode before
- * sending any commands */
+ /* Bring the chip from MP Sleep mode to Normal
+ mode before sending any commands
+ */
ret = es755_exit_mp_sleep();
if (ret) {
pr_err("%s(): es755_exit_mp_sleep() fail %d\n",
return ret;
}
} else {
-
- pr_debug("%s(): Seems DHWPT capture is on. Skip disabling DHWPT\n", __func__);
+ pr_debug("%s(): %s\n",
+ "DHWPT capture is on.Skip disabling DHWPT",
+ __func__);
}
escore->dhwpt_mode = 0;
}
}
-
-
escore->current_preset = 0;
- /* Reset algo_preset so that it is not accidently set for a
- * diffeent route, UCM is responsible to set this algo preset
- * for every use case
- */
- escore->algo_preset_one = 0;
- escore->algo_preset_two = 0;
- //escore->algo_type_off = ALGO_NONE;
return ret;
}
static int setup_dhwpt_msg(u32 *msg, int mux)
{
- pr_debug("****** %s() *********:\n", __func__);
switch (mux) {
case ES_PASSIN1_MUX:
msg[0] = 0xB05A3FF3;
escore->current_preset = msg & 0xFFFF;
rc = escore_queue_msg_to_list(escore, (char *)&msg, sizeof(msg));
-/*
- if (!rc && escore->dhwpt_enabled) {
- msg = escore->dhwpt_cmd;
- rc = escore_queue_msg_to_list(escore,
- (char *)&msg, sizeof(msg));
- }
-*/
-
/* Configure command completion mode */
if (escore->cmd_compl_mode == ES_CMD_COMP_INTR) {
cmd |= escore->pdata->gpio_a_irq_type;
}
/* Set digital output gain */
- cmd = (ES_SET_DIGITAL_GAIN<<16) | escore->digital_gain[i];
+ cmd = (ES_SET_DIGITAL_GAIN<<16) |
+ escore->digital_gain[i];
rc = escore_cmd(escore, cmd, &resp);
if (rc) {
dev_err(escore_priv.dev,
/* DHWPT playback case */
if (escore->algo_type == DHWPT) {
if (escore->dhwpt_capture_on)
- pr_debug("%s(): ****** Seem capture is present. DHWPT is already sent **********\n",__func__);
+ pr_debug("%s():Capture is present. DHWPT is already sent.\n",
+ __func__);
else {
- /* Before setting DHWPT configurations, ensure that normal route setup is inactive. */
+ /* Before setting DHWPT configurations,
+ ensure that normal route setup is inactive.
+ */
if (atomic_read(&escore->active_streams)) {
- pr_debug("%s(): ** Stop route before sending DHWPT ****\n",__func__);
+ pr_debug("%s():Stop route before sending DHWPT\n",
+ __func__);
_es_stop_route(escore, ES_TYPE_NONE);
- /* Require 1ms delay between stop route and DHWPT to avoid noise */
+
+ /* Require 1ms delay between stop route
+ and DHWPT to avoid noise
+ */
usleep_range(5000, 5005);
}
rc = escore_cmd(escore, escore->dhwpt_cmd, &resp);
if (rc < 0) {
- pr_err("%s(): Error %d in sending DHWPT command\n",__func__, rc);
+ pr_err("%s(): Error %d in sending DHWPT command\n",
+ __func__, rc);
return rc;
}
}
rc = es_change_power_state_normal(escore);
if (rc) {
pr_err("%s(): Power state transition failed %d\n",
- __func__, rc);
+ __func__, rc);
return rc;
}
* firmware after stopping the current route. The stream count will
* anyway be decremented when the HAL layer stops the PCM stream
* of previous use-case. */
- else if (unlikely(atomic_read(&escore->active_streams)) && !escore->dhwpt_mode)
+ else if (unlikely(atomic_read(&escore->active_streams)) &&
+ !escore->dhwpt_mode)
_es_stop_route(escore, ES_TYPE_NONE);
- if (escore->algo_type == PASSTHRU_VP && !escore->dhwpt_enabled && escore->dhwpt_mode) {
- dev_err(escore_priv.dev, "%s(): **** WARNING: PT_VP route called even DHWPT playback is ON ****\n",__func__);
- dev_err(escore_priv.dev, "%s(): **** Forcibly stopping DHWPT playback ****\n",__func__);
+ if (escore->algo_type == PASSTHRU_VP && !escore->dhwpt_enabled &&
+ escore->dhwpt_mode) {
+ dev_err(escore_priv.dev, "%s(): %s\n", __func__,
+ "WARNING: PT_VP route called even DHWPT playback is ON");
+ dev_err(escore_priv.dev, "%s(): %s\n", __func__,
+ "Forcibly stopping DHWPT playback");
/* Disable DHWPT if enabled, or when stopping DHWPT use cases */
msg = escore->dhwpt_cmd & 0xFFFF0000;
rc = escore_cmd(escore, msg, &resp);
}
/* Setup AEC if enabled */
- if (escore->algo_type == PASSTHRU_VP && escore->vp_aec && !escore->dhwpt_enabled) {
+ if (escore->algo_type == PASSTHRU_VP && escore->vp_aec &&
+ !escore->dhwpt_enabled) {
escore_queue_msg_to_list(escore, (char *)pt_vp_aec_msgblk,
sizeof(pt_vp_aec_msgblk));
}
&resp);
if (rc)
- pr_warn("%s(): Error %d setting Power Saving Level" \
- " resp = 0x%x\n", __func__, rc, resp);
+ pr_warn("%s(): Error %d %s resp = 0x%x\n",
+ __func__, rc, "setting Power Saving Level", resp);
}
/* add umbrella base route */
&resp);
if (rc) {
- pr_warn("%s(): Error %d selecting HPF mode" \
- " resp = 0x%x\n", __func__, rc, resp);
+ pr_warn("%s(): Error %d %s resp = 0x%x\n", __func__,
+ rc, "selecting HPF mode", resp);
goto exit;
}
}
}
}
- pr_debug("%s: START RX PMU Active channels Act %d Total %d\n", __func__,
- escore->i2s_dai_data[dai_id].rx_ch_act, escore->i2s_dai_data[dai_id].rx_ch_tot);
+ pr_debug("%s: START RX PMU Active channels Act %d Total %d\n",
+ __func__,
+ escore->i2s_dai_data[dai_id].rx_ch_act,
+ escore->i2s_dai_data[dai_id].rx_ch_tot);
if (escore->i2s_dai_data[dai_id].rx_ch_act ==
escore->i2s_dai_data[dai_id].rx_ch_tot) {
atomic_inc(&escore->active_streams);
}
- pr_debug("%s: END RX PMU Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
+ pr_debug("%s: END RX PMU Active channels %d Active streams %d\n",
+ __func__,
+ escore->i2s_dai_data[dai_id].rx_ch_act,
+ escore->active_streams);
break;
case SND_SOC_DAPM_POST_PMD:
for (j = 0; j < escore->dai_nr; j++) {
}
}
- pr_debug("%s: BEGIN RX PMD Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
+ pr_debug("%s: BEGIN RX PMD Active channels %d Active streams %d\n",
+ __func__,
+ escore->i2s_dai_data[dai_id].rx_ch_act,
+ escore->active_streams);
if (!escore->i2s_dai_data[dai_id].rx_ch_act) {
-/*
- if (atomic_read(&escore->active_streams) &&
- atomic_dec_and_test(&escore->active_streams)) {
- mutex_lock(&escore->access_lock);
- ret = _es_stop_route(escore,ES_TYPE_PB);
- mutex_unlock(&escore->access_lock);
- }
-*/
/* Decrease active streams count if non-zero */
if (atomic_read(&escore->active_streams)) {
atomic_dec(&escore->active_streams);
(atomic_read(&escore->active_streams) == 1
&& escore->dhwpt_mode)) {
mutex_lock(&escore->access_lock);
- ret = _es_stop_route(escore,ES_TYPE_PB);
+ ret = _es_stop_route(escore,
+ ES_TYPE_PB);
mutex_unlock(&escore->access_lock);
}
}
}
- pr_debug("%s: END RX PMD Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
+ pr_debug("%s: END RX PMD Active channels %d Streams %d\n",
+ __func__, escore->i2s_dai_data[dai_id].rx_ch_act,
+ escore->active_streams);
break;
}
mutex_unlock(&codec->mutex);
}
}
- pr_debug("%s: BEGIN TX PMU Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
+ pr_debug("%s: BEGIN TX PMU Active channels %d Streams %d\n",
+ __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+ escore->active_streams);
if (escore->i2s_dai_data[dai_id].tx_ch_act ==
escore->i2s_dai_data[dai_id].tx_ch_tot) {
atomic_inc(&escore->active_streams);
}
- pr_debug("%s: END TX PMU Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
+ pr_debug("%s: END TX PMU Active channels %d Streams %d\n",
+ __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+ escore->active_streams);
break;
case SND_SOC_DAPM_POST_PMD:
for (j = 0; j < escore->dai_nr; j++) {
}
}
- pr_debug("%s: BEGIN TX PMD Active channels %d Active streams %d DHWPT mode %d\n", __func__,
- escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams,escore->dhwpt_mode);
+ pr_debug("%s: BEGIN TX PMD Active channels %d Streams %d\n",
+ __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+ escore->active_streams, escore->dhwpt_mode);
if (!escore->i2s_dai_data[dai_id].tx_ch_act) {
/* Decrease active streams count if non-zero */
(atomic_read(&escore->active_streams) == 1
&& escore->dhwpt_mode)) {
mutex_lock(&escore->access_lock);
- ret = _es_stop_route(escore,ES_TYPE_CAP);
+ ret = _es_stop_route(escore,
+ ES_TYPE_CAP);
mutex_unlock(&escore->access_lock);
}
}
}
- pr_debug("%s: END TX PMD Active channels %d Active streams %d\n", __func__,
- escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
+ pr_debug("%s: END TX PMD Active channels %d Streams %d\n",
+ __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+ escore->active_streams);
break;
}
mutex_unlock(&codec->mutex);
algo_type = DHWPT;
break;
default:
- pr_err("%s(): Algo type not implemented: %s\n", __func__, kcontrol->id.name);
+ pr_err("%s(): Algo type not implemented: %s\n", __func__,
+ kcontrol->id.name);
ret = -EINVAL;
break;
}
#endif
exit:
- pr_debug("put input control %s (%d) val %s\n", kcontrol->id.name,reg,
+ pr_debug("put input control %s (%d) val %s\n", kcontrol->id.name, reg,
proc_block_input_texts[mux]);
mutex_unlock(&codec->mutex);
/* TBD: translation */
/* value = escore_read(NULL, reg); */
ucontrol->value.enumerated.item[0] = value;
- pr_debug("get input control %s (%d) val %s\n", kcontrol->id.name,reg,
+ pr_debug("get input control %s (%d) val %s\n", kcontrol->id.name, reg,
proc_block_input_texts[value]);
return 0;
#endif
exit:
- pr_debug("put output control %s (%d) val %s\n", kcontrol->id.name,reg,
+ pr_debug("put output control %s (%d) val %s\n", kcontrol->id.name, reg,
proc_block_output_texts[mux]);
mutex_unlock(&codec->mutex);
return rc;
/* TBD: translation */
/* value = escore_read(NULL, reg); */
ucontrol->value.enumerated.item[0] = value;
- pr_debug("get output control %s (%d) val %s\n", kcontrol->id.name,reg,
+ pr_debug("get output control %s (%d) val %s\n", kcontrol->id.name, reg,
proc_block_output_texts[value]);
return 0;
/* Ignore Preset ID 0 and don't send command to device,
* but reset algo_preset value so that next preset value
* can be set properly. */
- if(!escore->algo_preset_one) {
+ if (!escore->algo_preset_one) {
dev_dbg(escore_priv.dev,
"%s(): Preset ID %d is not supported\n",
__func__, value);
return rc;
}
- if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
+ if (escore->base_route_setup) {
/* Set the preset immediately */
usleep_range(5000, 5005);
pr_debug("%s:add algo preset one: %d", __func__,
escore->algo_preset_one);
- rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_one);
+ rc = escore_write_locked(NULL, ES_PRESET,
+ escore->algo_preset_one);
if (rc)
dev_err(escore_priv.dev, "%s(): Set Preset one failed:%d\n",
__func__, rc);
/* Ignore Preset ID 0 and don't send command to device,
* but reset algo_preset value so that next preset value
* can be set properly. */
- if(!escore->algo_preset_two) {
+ if (!escore->algo_preset_two) {
dev_dbg(escore_priv.dev,
"%s(): Preset ID %d is not supported\n",
__func__, value);
return rc;
}
- if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
+ if (escore->base_route_setup) {
/* Set the preset immediately */
usleep_range(5000, 5005);
pr_debug("%s:add algo preset two: %d", __func__,
escore->algo_preset_two);
- rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_two);
+ rc = escore_write_locked(NULL, ES_PRESET,
+ escore->algo_preset_two);
if (rc)
dev_err(escore_priv.dev, "%s(): Set Preset two failed:%d\n",
__func__, rc);
}
static int get_hpf_mode(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
}
static int put_hpf_mode(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
int ret = 0;
bool clk_en;
- clk_en = enable? true: false;
+ clk_en = enable ? true : false;
if (clk_en == escore_priv.codec_clk_en)
return 0;
clk_disable(codec_clk);
#endif
- if ( -EINVAL != ret)
- {
+ if (-EINVAL != ret) {
escore_priv.codec_clk_en = clk_en;
ret = 0;
}
return -EINVAL;
}
}
- rc = escore_write_locked(codec, ES_CODEC_OUTPUT_RATE, codec_output_rate);
+ rc = escore_write_locked(codec, ES_CODEC_OUTPUT_RATE,
+ codec_output_rate);
if (rc) {
pr_err("%s(): Preparing write message failed %d\n",
__func__, rc);
*/
escore->can_mpsleep = (rate >= 48) && (bps >= 0x1F) && (channels >= 2);
- dev_dbg(codec->dev, "%s(): ############# Rate %d BPS %d channels %d #############n", __func__,
+ dev_dbg(codec->dev, "%s(): # Rate %d BPS %d channels %d #\n", __func__,
rate, bps, channels);
switch (dai->id) {
if (escore->algo_type == DHWPT || escore->dhwpt_enabled)
escore->dhwpt_cmd = (ES_DHWPT_CMD << 16) | port_map;
-
/* BAS-3205, if frame size is 64 bits and word length is 16 bits, set
* TDM Timeslots Per Frame of PortA to 3 */
-
-
if (escore->algo_type != DHWPT && !escore->dhwpt_enabled) {
if (64 == (bps + 1)*channels && 0x1F == bps) {
- api_access = &escore->api_access[ES_PORT_TDM_SLOTS_PER_FRAME];
- api_access->write_msg[0] |= ES_API_WORD(ES_SET_DEV_PARAM_ID,
- (ES755_PCM_PORT_A << 8));
+ api_access =
+ &escore->api_access[ES_PORT_TDM_SLOTS_PER_FRAME];
+ api_access->write_msg[0] |=
+ ES_API_WORD(ES_SET_DEV_PARAM_ID,
+ (ES755_PCM_PORT_A << 8));
rc = escore_write_locked(escore,
ES_PORT_TDM_SLOTS_PER_FRAME,
return rc;
}
- api_access->write_msg[0] &= ES_API_WORD(ES_SET_DEV_PARAM_ID,
- 0x00ff);
+ api_access->write_msg[0] &=
+ ES_API_WORD(ES_SET_DEV_PARAM_ID, 0x00ff);
}
}
}
static int es755_get_power_saving_mode(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = escore_priv.codec;
- struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+ struct snd_soc_codec *codec = escore_priv.codec;
+ struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
- ucontrol->value.enumerated.item[0] = escore->power_saving_mode;
+ ucontrol->value.enumerated.item[0] = escore->power_saving_mode;
return 0;
}
static int es755_set_power_saving_mode(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = escore_priv.codec;
struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
unsigned int set_power_state_cmd)
{
int rc = 0;
- dev_dbg(escore_priv.dev,
- "%s(): **** Current state = %d, Next state = %d\n",
- __func__, escore_priv.escore_power_state,
- next_power_state);
+
+ dev_info(escore_priv.dev, "%s()\n", __func__);
/* Power state transition */
while (next_power_state != escore_priv.escore_power_state) {
rc = -EINVAL;
goto es755_power_transition_exit;
}
-/*
dev_dbg(escore_priv.dev,
"%s(): Current state = %d, val=%d\n",
__func__, escore_priv.escore_power_state,
next_power_state);
-*/
}
- dev_dbg(escore_priv.dev, "%s(): Power state changed to %d\n", __func__,escore_priv.escore_power_state);
+ dev_dbg(escore_priv.dev, "%s(): Power state change successful\n",
+ __func__);
es755_power_transition_exit:
return rc;
}
struct escore_priv *escore = &escore_priv;
value = ucontrol->value.enumerated.item[0];
- dev_dbg(escore_priv.dev, "%s(): ***** Put Power state call %d *** \n", __func__,value);
/* Not supported */
if (!value) {
escore->mp_sleep_requested = 1;
- dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
- __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
+ if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+ !escore->dhwpt_capture_on) {
rc = es755_enter_mp_sleep();
if (rc) {
dev_dbg(escore_priv.dev,
- "%s() es755_enter_mp_sleep fail :%d\n",
- __func__, rc);
+ "%s() es755_enter_mp_sleep fail :%d\n",
+ __func__, rc);
}
} else {
- dev_dbg(escore_priv.dev, "%s(): ***** Seem capture is present or no playback started yet, Skip putting in MP_sleep *****\n", __func__);
+ dev_dbg(escore_priv.dev, "%s(): %s, %s\n", __func__,
+ "Seem capture is present or no playback started yet",
+ "Skip putting in MP_sleep");
}
} else {
pr_debug("%s: Set digital gain 0x%x.\n", __func__, val);
- if ( ucontrol->value.enumerated.item[0] > (e->max - 1) ) {
+ if (ucontrol->value.enumerated.item[0] > (e->max - 1)) {
dev_err(escore_priv.dev, "%s(): Enum exceed the maximum!\n",
__func__);
return -EINVAL;
static const char * const es755_path_id_texts[] = {
- [ES300_PRI] = "PRI", "SEC", "TER", "FEIN", "AECREF", "AUDIN1", "AUDIN2",
- "RESERVED", "RESERVED",
+ [ES300_PRI] = "PRI", "SEC", "TER", "FEIN", "AECREF", "AUDIN1",
+ "AUDIN2", "RESERVED", "RESERVED",
[ES300_UITONE1] = "UITONE1", "UITONE2", "UITONE3", "UITONE4", "PASSIN1",
- "PASSIN2", "PASSIN3", "PASSIN4", "FEIN2", "RESERVED", "RESERVED", "RESERVED",
+ "PASSIN2", "PASSIN3", "PASSIN4", "FEIN2", "RESERVED", "RESERVED",
+ "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
"RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
- "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
- [ES300_CSOUT1] = "CSOUT1", "CSOUT2", "FEOUT1", "FEOUT2", "AUDOUT1", "AUDOUT2",
- "RESERVED", "RESERVED",
- [ES300_MONOUT1] = "MONOUT1", "MONOUT2", "MONOUT3", "MONOUT4", "PASSOUT1",
- "PASSOUT2", "PASSOUT3", "PASSOUT4",
+ [ES300_CSOUT1] = "CSOUT1", "CSOUT2", "FEOUT1", "FEOUT2", "AUDOUT1",
+ "AUDOUT2", "RESERVED", "RESERVED",
+ [ES300_MONOUT1] = "MONOUT1", "MONOUT2", "MONOUT3", "MONOUT4",
+ "PASSOUT1", "PASSOUT2", "PASSOUT3", "PASSOUT4",
};
static const struct soc_enum es755_path_id_enum =
int rc;
int ret = 0;
- pr_debug("%s()\n", __func__);
if (reg > ES_MAX_REGISTER) {
/*dev_err(codec->dev, "read out of range reg %d", reg);*/
return 0;
}
escore->reg_cache[reg].value = value;
- dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
- __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
+ if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+ !escore->dhwpt_capture_on
+ && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
es755_enter_mp_sleep();
}
unsigned int value)
{
struct escore_priv *escore = &escore_priv;
- u32 resp;
int ret = 0;
- pr_debug("%s()\n", __func__);
if (reg > ES_MAX_REGISTER) {
/*dev_err(codec->dev, "write out of range reg %d", reg);*/
}
if (atomic_read(&escore->active_streams) > 0)
- {
usleep_range(1000, 1005);
- }
ret = escore_write(codec, ES_CODEC_ADDR, reg);
if (ret < 0) {
}
escore->reg_cache[reg].value = value;
- dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
- __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
+ if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+ !escore->dhwpt_capture_on &&
+ escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
es755_enter_mp_sleep();
}
rc = escore_pm_get_sync();
if (rc < 0) {
pr_err("%s(): pm_get_sync failed :%d\n",
- __func__, rc);
+ __func__, rc);
goto err_exit;
}
escore->acc_det_status = ES_ACC_BUTTON_PRESSED;
*/
if (escore->acc_det_status == ES_ACC_BUTTON_PRESSED) {
escore_pm_put_autosuspend();
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
- pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+ if (escore->mp_sleep_requested && escore->dhwpt_mode
+ && !escore->dhwpt_capture_on) {
+ pr_debug("%s(): Put chip back into mp_sleep\n",
+ __func__);
es755_enter_mp_sleep();
}
}
pr_debug("%s(): Event: 0x%04x\n", __func__, (u32)action);
if (escore->dhwpt_mode) {
- /* Cancel delayed work of MP Sleep, and bring chip to Normal mode
- * if it is in MP Sleep mode */
+ /* Cancel delayed work of MP Sleep and bring chip to Normal
+ mode if it is in MP Sleep mode */
pr_debug("%s(): Bring chip from MP Sleep to Normal mode\n",
__func__);
rc = es755_exit_mp_sleep();
}
impd_level = accdet_status_reg.fields.impd_level;
- pr_info("%s(): ******* Impd level ****** %d\n",__func__,impd_level);
mg_select = accdet_status_reg.fields.mg_select;
mg_sel_force = accdet_cfg.mic_det_enabled & (0x1);
msleep(escore_priv.hs_delay);
pr_debug("%s(): ***Redetect HS MIC with Delay %d\n",
__func__,escore_priv.hs_delay);
- // redetect_HS
+ /* redetect_HS */
rc = es755_mic_config(escore);
if (rc < 0) {
pr_err("%s(): MIC config fail %d\n",
* Put the chip back to autosuspend when user unplugs.
*/
if (escore->acc_det_status == ES_ACC_BUTTON_PRESSED) {
-
escore_pm_put_autosuspend();
-
- if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
- pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+ if (escore->mp_sleep_requested
+ && escore->dhwpt_mode
+ && !escore->dhwpt_capture_on) {
+ pr_debug("%s(): %s\n",
+ "Put chip back into mp_sleep",
+ __func__);
es755_enter_mp_sleep();
}
}
int rc, ret;
u32 cmd = 0;
u32 event_type = 0;
- pr_info("%s(): @@@@@@ Entry #####\n", __func__);
+
pr_debug("%s() Interrupt received\n", __func__);
if (!escore) {
pr_err("%s(): Invalid IRQ data\n", __func__);
msleep(ES_PM_CLOCK_STABILIZATION);
}
-
if (escore->dhwpt_mode) {
- /* Cancel delayed work of MP Sleep, and bring chip to Normal mode
- * if it is in MP Sleep mode */
+ /* Cancel delayed work of MP Sleep, and bring chip to
+ Normal mode if it is in MP Sleep mode */
pr_debug("%s(): Bring chip from MP Sleep to Normal mode\n",
__func__);
rc = es755_exit_mp_sleep();
escore_pm_put_autosuspend();
err_pm_get_sync:
escore->intr_recvd = 0;
- pr_info("%s(): @@@@@@ Exit #####\n", __func__);
return IRQ_HANDLED;
}
escore_priv.fw_af_filename = fw_af_filename;
escore_priv.selected_endpoint = -1;
- memset( escore_priv.digital_gain, 0, sizeof(escore_priv.digital_gain) );
+ memset(escore_priv.digital_gain, 0, sizeof(escore_priv.digital_gain));
escore_priv.power_transition_wq =
create_singlethread_workqueue("escore_power_transition_wq");
dev_dbg(escore->dev, "%s()\n", __func__);
- if(escore->pm_enable) {
+ if (escore->pm_enable) {
pr_err("%s(): Already Enabled\n", __func__);
return;
}
pm_runtime_use_autosuspend(escore->dev);
pm_runtime_enable(escore->dev);
device_init_wakeup(escore->dev, true);
- if(pm_runtime_get_sync(escore->dev) >= 0) {
+ if (pm_runtime_get_sync(escore->dev) >= 0) {
ret = pm_runtime_put_sync_autosuspend(escore->dev);
- if (ret < 0){
+ if (ret < 0) {
dev_err(escore->dev,
"%s() escore PM put failed ret = %d\n",
__func__, ret);
pr_debug("%s(): write ES_SYNC_CMD = 0x%08x\n",
__func__, sync_cmd);
rc = escore_spi_cmd(escore, sync_cmd, &sync_ack);
- pr_debug("%s(): rc=%d, sync_ack = 0x%08x\n", __func__, rc, \
+ pr_debug("%s(): rc=%d, sync_ack = 0x%08x\n", __func__, rc,
sync_ack);
if (rc < 0) {
pr_err("%s(): firmware load failed sync write %d\n",
skip_vs_seq = 1;
skip_vs_load = 1;
goto vs_set_low_power;
- } else if (escore->escore_power_state == ES_SET_POWER_STATE_VS_OVERLAY) {
+ } else if (escore->escore_power_state ==
+ ES_SET_POWER_STATE_VS_OVERLAY) {
skip_vs_load = 1;
dev_dbg(escore->dev, "%s() already in VS overlay mode\n",
__func__);
pr_debug("%s() VS firmware is already downloaded", __func__);
/* Setup the Event response */
- cmd = (ES_SET_EVENT_RESP << 16) | \
+ cmd = (ES_SET_EVENT_RESP << 16) |
escore->pdata->gpio_b_irq_type;
rc = escore_cmd_nopm(escore, cmd, &rsp);
if (rc < 0) {
if (!skip_vs_load) {
vs_load_time = (timespec_sub(vs_load_end, vs_load_start));
dev_info(escore->dev, "VS firmware load time = %lu.%03lu sec\n",
- vs_load_time.tv_sec, (vs_load_time.tv_nsec)/1000000);
+ vs_load_time.tv_sec, (vs_load_time.tv_nsec)/1000000);
}
if (!skip_vs_seq) {
wdb_time = (timespec_sub(wdb_end, wdb_start));
}
} else {
/* Setup the Event response */
- cmd = (ES_SET_EVENT_RESP << 16) | \
+ cmd = (ES_SET_EVENT_RESP << 16) |
escore->pdata->gpio_b_irq_type;
rc = escore_cmd_nopm(escore, cmd, &resp);
if (rc < 0) {
msleep(ES_PM_CLOCK_STABILIZATION);
}
- //if (escore->pri_intf == ES_SPI_INTF)
- // msleep(ES_WAKEUP_TIME);
-
do {
/* Set flag to Wait for API Interrupt */
escore_set_api_intr_wait(escore);
else
msleep(escore->delay.wakeup_to_normal);
-/*
- if (escore->pri_intf == ES_SPI_INTF) {
- if (escore->pdata->gpioa_gpio == -1)
- msleep(ES_WAKEUP_TIME);
- rc = escore_cmd_nopm(escore, p_cmd, &rsp);
- if (rc < 0) {
- pr_err("%s(): get power state failed" \
- " rc = %d\n", __func__, rc);
- continue;
- }
- if ((rsp != ES_PS_NORMAL) &&
- (rsp != ES_PS_OVERLAY)) {
- rc = -1;
- continue;
- }
- }
-*/
-
/* Send sync command to verify device is active */
rc = escore_cmd_nopm(escore, cmd, &rsp);
if (rc < 0) {
}
} while (rc && --retry);
- /* Hack to avoid flase interrupts coming after deep sleep */
- //msleep(350);
-
/* Set the Smooth Mute rate to Zero */
cmd = ES_SET_SMOOTH_MUTE << 16 | ES_SMOOTH_MUTE_ZERO;
rc = escore_cmd_nopm(escore, cmd, &rsp);
__func__, rc);
goto escore_wakeup_exit;
}
-
escore_wakeup_exit:
return rc;
}
#define ES_PS_NORMAL (ES_GET_POWER_STATE << 16 | ES_SET_POWER_STATE_NORMAL)
#define ES_PS_OVERLAY (ES_GET_POWER_STATE << 16 | ES_SET_POWER_STATE_VS_OVERLAY)
-#define ES_DIGITAL_GAIN_MAX_NUM 48 /* Maximum number of digital gain allowed, equal to ES300_PASSOUT4+1 */
+/* Maximum number of digital gain allowed, equal to ES300_PASSOUT4+1 */
+#define ES_DIGITAL_GAIN_MAX_NUM 48
enum {
SBL,
u16 algo_preset_two;
/* endif 705 */
- int selected_endpoint; /* Selected endpoint(pathID) for following digital gain setting */
+ /* Selected endpoint(pathID) for following digital gain setting */
+ int selected_endpoint;
u32 digital_gain[ES_DIGITAL_GAIN_MAX_NUM];
struct mutex pm_mutex;