Merge "ASoC: codecs: Fix override of codec driver private data"
This commit is contained in:
commit
d1a412e9b1
4 changed files with 102 additions and 135 deletions
|
@ -48,18 +48,11 @@
|
||||||
#define BUS_DOWN 1
|
#define BUS_DOWN 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*50 Milliseconds sufficient for DSP bring up in the modem
|
* 50 Milliseconds sufficient for DSP bring up in the lpass
|
||||||
* after Sub System Restart
|
* after Sub System Restart
|
||||||
*/
|
*/
|
||||||
#define ADSP_STATE_READY_TIMEOUT_MS 50
|
#define ADSP_STATE_READY_TIMEOUT_MS 50
|
||||||
|
|
||||||
enum {
|
|
||||||
BOOST_SWITCH = 0,
|
|
||||||
BOOST_ALWAYS,
|
|
||||||
BYPASS_ALWAYS,
|
|
||||||
BOOST_ON_FOREVER,
|
|
||||||
};
|
|
||||||
|
|
||||||
#define EAR_PMD 0
|
#define EAR_PMD 0
|
||||||
#define EAR_PMU 1
|
#define EAR_PMU 1
|
||||||
#define SPK_PMD 2
|
#define SPK_PMD 2
|
||||||
|
@ -81,12 +74,10 @@ enum {
|
||||||
((value - min_value)/step_size)
|
((value - min_value)/step_size)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
RX_MIX1_INP_SEL_ZERO = 0,
|
BOOST_SWITCH = 0,
|
||||||
RX_MIX1_INP_SEL_IIR1,
|
BOOST_ALWAYS,
|
||||||
RX_MIX1_INP_SEL_IIR2,
|
BYPASS_ALWAYS,
|
||||||
RX_MIX1_INP_SEL_RX1,
|
BOOST_ON_FOREVER,
|
||||||
RX_MIX1_INP_SEL_RX2,
|
|
||||||
RX_MIX1_INP_SEL_RX3,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
|
static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
|
||||||
|
@ -874,11 +865,12 @@ static int msm_anlg_cdc_dig_register_notifier(void *handle,
|
||||||
struct notifier_block *nblock,
|
struct notifier_block *nblock,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *handle_cdc = handle;
|
struct sdm660_cdc_priv *handle_cdc = handle;
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
return blocking_notifier_chain_register(&handle_cdc->notifier,
|
return blocking_notifier_chain_register(&handle_cdc->notifier,
|
||||||
nblock);
|
nblock);
|
||||||
|
|
||||||
return blocking_notifier_chain_unregister(&handle_cdc->notifier,
|
return blocking_notifier_chain_unregister(&handle_cdc->notifier,
|
||||||
nblock);
|
nblock);
|
||||||
}
|
}
|
||||||
|
@ -893,10 +885,10 @@ static int msm_anlg_cdc_mbhc_register_notifier(struct wcd_mbhc *wcd_mbhc,
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
return blocking_notifier_chain_register(
|
return blocking_notifier_chain_register(
|
||||||
&sdm660_cdc->notifier,
|
&sdm660_cdc->notifier_mbhc,
|
||||||
nblock);
|
nblock);
|
||||||
|
|
||||||
return blocking_notifier_chain_unregister(&sdm660_cdc->notifier,
|
return blocking_notifier_chain_unregister(&sdm660_cdc->notifier_mbhc,
|
||||||
nblock);
|
nblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -944,7 +936,7 @@ static const uint32_t wcd_imped_val[] = {4, 8, 12, 13, 16,
|
||||||
static void msm_anlg_cdc_dig_notifier_call(struct snd_soc_codec *codec,
|
static void msm_anlg_cdc_dig_notifier_call(struct snd_soc_codec *codec,
|
||||||
const enum dig_cdc_notify_event event)
|
const enum dig_cdc_notify_event event)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *sdm660_cdc = codec->control_data;
|
struct sdm660_cdc_priv *sdm660_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
|
|
||||||
pr_debug("%s: notifier call event %d\n", __func__, event);
|
pr_debug("%s: notifier call event %d\n", __func__, event);
|
||||||
blocking_notifier_call_chain(&sdm660_cdc->notifier,
|
blocking_notifier_call_chain(&sdm660_cdc->notifier,
|
||||||
|
@ -958,7 +950,7 @@ static void msm_anlg_cdc_notifier_call(struct snd_soc_codec *codec,
|
||||||
snd_soc_codec_get_drvdata(codec);
|
snd_soc_codec_get_drvdata(codec);
|
||||||
|
|
||||||
dev_dbg(codec->dev, "%s: notifier call event %d\n", __func__, event);
|
dev_dbg(codec->dev, "%s: notifier call event %d\n", __func__, event);
|
||||||
blocking_notifier_call_chain(&sdm660_cdc->notifier, event,
|
blocking_notifier_call_chain(&sdm660_cdc->notifier_mbhc, event,
|
||||||
&sdm660_cdc->mbhc);
|
&sdm660_cdc->mbhc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2045,12 +2037,6 @@ static const char * const wsa_spk_text[] = {
|
||||||
"ZERO", "WSA"
|
"ZERO", "WSA"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const char * const iir_inp1_text[] = {
|
|
||||||
"ZERO", "DEC1", "DEC2", "RX1", "RX2", "RX3"
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct soc_enum adc2_enum =
|
static const struct soc_enum adc2_enum =
|
||||||
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0,
|
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0,
|
||||||
ARRAY_SIZE(adc2_mux_text), adc2_mux_text);
|
ARRAY_SIZE(adc2_mux_text), adc2_mux_text);
|
||||||
|
@ -2598,7 +2584,7 @@ static int msm_anlg_cdc_codec_enable_micbias(struct snd_soc_dapm_widget *w,
|
||||||
|
|
||||||
static void update_clkdiv(void *handle, int val)
|
static void update_clkdiv(void *handle, int val)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *handle_cdc = handle;
|
struct sdm660_cdc_priv *handle_cdc = handle;
|
||||||
struct snd_soc_codec *codec = handle_cdc->codec;
|
struct snd_soc_codec *codec = handle_cdc->codec;
|
||||||
|
|
||||||
snd_soc_update_bits(codec,
|
snd_soc_update_bits(codec,
|
||||||
|
@ -2608,10 +2594,7 @@ static void update_clkdiv(void *handle, int val)
|
||||||
|
|
||||||
static int get_cdc_version(void *handle)
|
static int get_cdc_version(void *handle)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *handle_cdc = handle;
|
struct sdm660_cdc_priv *sdm660_cdc = handle;
|
||||||
struct snd_soc_codec *codec = handle_cdc->codec;
|
|
||||||
struct sdm660_cdc_priv *sdm660_cdc =
|
|
||||||
snd_soc_codec_get_drvdata(codec);
|
|
||||||
|
|
||||||
return get_codec_version(sdm660_cdc);
|
return get_codec_version(sdm660_cdc);
|
||||||
}
|
}
|
||||||
|
@ -3680,11 +3663,12 @@ static int msm_anlg_cdc_bringup(struct snd_soc_codec *codec)
|
||||||
MSM89XX_PMIC_ANALOG_SEC_ACCESS,
|
MSM89XX_PMIC_ANALOG_SEC_ACCESS,
|
||||||
0xA5);
|
0xA5);
|
||||||
snd_soc_write(codec, MSM89XX_PMIC_ANALOG_PERPH_RESET_CTL4, 0x00);
|
snd_soc_write(codec, MSM89XX_PMIC_ANALOG_PERPH_RESET_CTL4, 0x00);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct regulator *msm_anlg_cdc_find_regulator(
|
static struct regulator *msm_anlg_cdc_find_regulator(
|
||||||
const struct sdm660_cdc *sdm660_cdc,
|
const struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -3779,6 +3763,7 @@ static int msm_anlg_cdc_device_down(struct snd_soc_codec *codec)
|
||||||
msm_anlg_cdc_dig_notifier_call(codec, DIG_CDC_EVENT_SSR_DOWN);
|
msm_anlg_cdc_dig_notifier_call(codec, DIG_CDC_EVENT_SSR_DOWN);
|
||||||
set_bit(BUS_DOWN, &sdm660_cdc_priv->status_mask);
|
set_bit(BUS_DOWN, &sdm660_cdc_priv->status_mask);
|
||||||
snd_soc_card_change_online_state(codec->component.card, 0);
|
snd_soc_card_change_online_state(codec->component.card, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3906,7 +3891,7 @@ EXPORT_SYMBOL(msm_anlg_cdc_update_int_spk_boost);
|
||||||
static void msm_anlg_cdc_set_micb_v(struct snd_soc_codec *codec)
|
static void msm_anlg_cdc_set_micb_v(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct sdm660_cdc *sdm660_cdc = codec->control_data;
|
struct sdm660_cdc_priv *sdm660_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
struct sdm660_cdc_pdata *pdata = sdm660_cdc->dev->platform_data;
|
struct sdm660_cdc_pdata *pdata = sdm660_cdc->dev->platform_data;
|
||||||
u8 reg_val;
|
u8 reg_val;
|
||||||
|
|
||||||
|
@ -4060,63 +4045,53 @@ EXPORT_SYMBOL(msm_anlg_codec_info_create_codec_entry);
|
||||||
|
|
||||||
static int msm_anlg_cdc_soc_probe(struct snd_soc_codec *codec)
|
static int msm_anlg_cdc_soc_probe(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc_priv *sdm660_cdc_priv;
|
struct sdm660_cdc_priv *sdm660_cdc;
|
||||||
struct sdm660_cdc *handle_cdc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
sdm660_cdc_priv = devm_kzalloc(codec->dev,
|
sdm660_cdc = dev_get_drvdata(codec->dev);
|
||||||
sizeof(struct sdm660_cdc_priv),
|
sdm660_cdc->codec = codec;
|
||||||
GFP_KERNEL);
|
|
||||||
if (!sdm660_cdc_priv)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
codec->control_data = dev_get_drvdata(codec->dev);
|
|
||||||
snd_soc_codec_set_drvdata(codec, sdm660_cdc_priv);
|
|
||||||
sdm660_cdc_priv->codec = codec;
|
|
||||||
handle_cdc = codec->control_data;
|
|
||||||
handle_cdc->codec = codec;
|
|
||||||
|
|
||||||
/* codec resmgr module init */
|
/* codec resmgr module init */
|
||||||
sdm660_cdc_priv->spkdrv_reg =
|
sdm660_cdc->spkdrv_reg =
|
||||||
msm_anlg_cdc_find_regulator(codec->control_data,
|
msm_anlg_cdc_find_regulator(sdm660_cdc,
|
||||||
MSM89XX_VDD_SPKDRV_NAME);
|
MSM89XX_VDD_SPKDRV_NAME);
|
||||||
sdm660_cdc_priv->pmic_rev =
|
sdm660_cdc->pmic_rev =
|
||||||
snd_soc_read(codec,
|
snd_soc_read(codec,
|
||||||
MSM89XX_PMIC_DIGITAL_REVISION1);
|
MSM89XX_PMIC_DIGITAL_REVISION1);
|
||||||
sdm660_cdc_priv->codec_version =
|
sdm660_cdc->codec_version =
|
||||||
snd_soc_read(codec,
|
snd_soc_read(codec,
|
||||||
MSM89XX_PMIC_DIGITAL_PERPH_SUBTYPE);
|
MSM89XX_PMIC_DIGITAL_PERPH_SUBTYPE);
|
||||||
sdm660_cdc_priv->analog_major_rev =
|
sdm660_cdc->analog_major_rev =
|
||||||
snd_soc_read(codec,
|
snd_soc_read(codec,
|
||||||
MSM89XX_PMIC_ANALOG_REVISION4);
|
MSM89XX_PMIC_ANALOG_REVISION4);
|
||||||
|
|
||||||
if (sdm660_cdc_priv->codec_version == CONGA) {
|
if (sdm660_cdc->codec_version == CONGA) {
|
||||||
dev_dbg(codec->dev, "%s :Conga REV: %d\n", __func__,
|
dev_dbg(codec->dev, "%s :Conga REV: %d\n", __func__,
|
||||||
sdm660_cdc_priv->codec_version);
|
sdm660_cdc->codec_version);
|
||||||
sdm660_cdc_priv->ext_spk_boost_set = true;
|
sdm660_cdc->ext_spk_boost_set = true;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(codec->dev, "%s :PMIC REV: %d\n", __func__,
|
dev_dbg(codec->dev, "%s :PMIC REV: %d\n", __func__,
|
||||||
sdm660_cdc_priv->pmic_rev);
|
sdm660_cdc->pmic_rev);
|
||||||
if (sdm660_cdc_priv->pmic_rev == TOMBAK_1_0 &&
|
if (sdm660_cdc->pmic_rev == TOMBAK_1_0 &&
|
||||||
sdm660_cdc_priv->codec_version == CAJON_2_0) {
|
sdm660_cdc->codec_version == CAJON_2_0) {
|
||||||
if (sdm660_cdc_priv->analog_major_rev == 0x02) {
|
if (sdm660_cdc->analog_major_rev == 0x02) {
|
||||||
sdm660_cdc_priv->codec_version = DRAX_CDC;
|
sdm660_cdc->codec_version = DRAX_CDC;
|
||||||
dev_dbg(codec->dev,
|
dev_dbg(codec->dev,
|
||||||
"%s : Drax codec detected\n", __func__);
|
"%s : Drax codec detected\n", __func__);
|
||||||
} else {
|
} else {
|
||||||
sdm660_cdc_priv->codec_version = DIANGU;
|
sdm660_cdc->codec_version = DIANGU;
|
||||||
dev_dbg(codec->dev, "%s : Diangu detected\n",
|
dev_dbg(codec->dev, "%s : Diangu detected\n",
|
||||||
__func__);
|
__func__);
|
||||||
}
|
}
|
||||||
} else if (sdm660_cdc_priv->pmic_rev == TOMBAK_1_0 &&
|
} else if (sdm660_cdc->pmic_rev == TOMBAK_1_0 &&
|
||||||
(snd_soc_read(codec, MSM89XX_PMIC_ANALOG_NCP_FBCTRL)
|
(snd_soc_read(codec, MSM89XX_PMIC_ANALOG_NCP_FBCTRL)
|
||||||
& 0x80)) {
|
& 0x80)) {
|
||||||
sdm660_cdc_priv->codec_version = CAJON;
|
sdm660_cdc->codec_version = CAJON;
|
||||||
dev_dbg(codec->dev, "%s : Cajon detected\n", __func__);
|
dev_dbg(codec->dev, "%s : Cajon detected\n", __func__);
|
||||||
} else if (sdm660_cdc_priv->pmic_rev == TOMBAK_2_0 &&
|
} else if (sdm660_cdc->pmic_rev == TOMBAK_2_0 &&
|
||||||
(snd_soc_read(codec, MSM89XX_PMIC_ANALOG_NCP_FBCTRL)
|
(snd_soc_read(codec, MSM89XX_PMIC_ANALOG_NCP_FBCTRL)
|
||||||
& 0x80)) {
|
& 0x80)) {
|
||||||
sdm660_cdc_priv->codec_version = CAJON_2_0;
|
sdm660_cdc->codec_version = CAJON_2_0;
|
||||||
dev_dbg(codec->dev, "%s : Cajon 2.0 detected\n",
|
dev_dbg(codec->dev, "%s : Cajon 2.0 detected\n",
|
||||||
__func__);
|
__func__);
|
||||||
}
|
}
|
||||||
|
@ -4125,8 +4100,8 @@ static int msm_anlg_cdc_soc_probe(struct snd_soc_codec *codec)
|
||||||
* set to default boost option BOOST_SWITCH, user mixer path can change
|
* set to default boost option BOOST_SWITCH, user mixer path can change
|
||||||
* it to BOOST_ALWAYS or BOOST_BYPASS based on solution chosen.
|
* it to BOOST_ALWAYS or BOOST_BYPASS based on solution chosen.
|
||||||
*/
|
*/
|
||||||
sdm660_cdc_priv->boost_option = BOOST_SWITCH;
|
sdm660_cdc->boost_option = BOOST_SWITCH;
|
||||||
sdm660_cdc_priv->hph_mode = NORMAL_MODE;
|
sdm660_cdc->hph_mode = NORMAL_MODE;
|
||||||
|
|
||||||
msm_anlg_cdc_dt_parse_boost_info(codec);
|
msm_anlg_cdc_dt_parse_boost_info(codec);
|
||||||
msm_anlg_cdc_set_boost_v(codec);
|
msm_anlg_cdc_set_boost_v(codec);
|
||||||
|
@ -4143,50 +4118,49 @@ static int msm_anlg_cdc_soc_probe(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
wcd9xxx_spmi_set_codec(codec);
|
wcd9xxx_spmi_set_codec(codec);
|
||||||
|
|
||||||
sdm660_cdc_priv->on_demand_list[ON_DEMAND_MICBIAS].supply =
|
sdm660_cdc->on_demand_list[ON_DEMAND_MICBIAS].supply =
|
||||||
msm_anlg_cdc_find_regulator(
|
msm_anlg_cdc_find_regulator(
|
||||||
codec->control_data,
|
sdm660_cdc,
|
||||||
on_demand_supply_name[ON_DEMAND_MICBIAS]);
|
on_demand_supply_name[ON_DEMAND_MICBIAS]);
|
||||||
atomic_set(&sdm660_cdc_priv->on_demand_list[ON_DEMAND_MICBIAS].ref,
|
atomic_set(&sdm660_cdc->on_demand_list[ON_DEMAND_MICBIAS].ref,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
BLOCKING_INIT_NOTIFIER_HEAD(&sdm660_cdc_priv->notifier);
|
sdm660_cdc->fw_data = devm_kzalloc(codec->dev,
|
||||||
|
sizeof(*(sdm660_cdc->fw_data)),
|
||||||
sdm660_cdc_priv->fw_data = devm_kzalloc(codec->dev,
|
|
||||||
sizeof(*(sdm660_cdc_priv->fw_data)),
|
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!sdm660_cdc_priv->fw_data)
|
if (!sdm660_cdc->fw_data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
set_bit(WCD9XXX_MBHC_CAL, sdm660_cdc_priv->fw_data->cal_bit);
|
set_bit(WCD9XXX_MBHC_CAL, sdm660_cdc->fw_data->cal_bit);
|
||||||
ret = wcd_cal_create_hwdep(sdm660_cdc_priv->fw_data,
|
ret = wcd_cal_create_hwdep(sdm660_cdc->fw_data,
|
||||||
WCD9XXX_CODEC_HWDEP_NODE, codec);
|
WCD9XXX_CODEC_HWDEP_NODE, codec);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(codec->dev, "%s hwdep failed %d\n", __func__, ret);
|
dev_err(codec->dev, "%s hwdep failed %d\n", __func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wcd_mbhc_init(&sdm660_cdc_priv->mbhc, codec, &mbhc_cb, &intr_ids,
|
wcd_mbhc_init(&sdm660_cdc->mbhc, codec, &mbhc_cb, &intr_ids,
|
||||||
wcd_mbhc_registers, true);
|
wcd_mbhc_registers, true);
|
||||||
|
|
||||||
sdm660_cdc_priv->int_mclk0_enabled = false;
|
sdm660_cdc->int_mclk0_enabled = false;
|
||||||
/*Update speaker boost configuration*/
|
/*Update speaker boost configuration*/
|
||||||
sdm660_cdc_priv->spk_boost_set = spkr_boost_en;
|
sdm660_cdc->spk_boost_set = spkr_boost_en;
|
||||||
pr_debug("%s: speaker boost configured = %d\n",
|
pr_debug("%s: speaker boost configured = %d\n",
|
||||||
__func__, sdm660_cdc_priv->spk_boost_set);
|
__func__, sdm660_cdc->spk_boost_set);
|
||||||
|
|
||||||
/* Set initial MICBIAS voltage level */
|
/* Set initial MICBIAS voltage level */
|
||||||
msm_anlg_cdc_set_micb_v(codec);
|
msm_anlg_cdc_set_micb_v(codec);
|
||||||
|
|
||||||
/* Set initial cap mode */
|
/* Set initial cap mode */
|
||||||
msm_anlg_cdc_configure_cap(codec, false, false);
|
msm_anlg_cdc_configure_cap(codec, false, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_anlg_cdc_soc_remove(struct snd_soc_codec *codec)
|
static int msm_anlg_cdc_soc_remove(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc_priv *sdm660_cdc_priv =
|
struct sdm660_cdc_priv *sdm660_cdc_priv =
|
||||||
snd_soc_codec_get_drvdata(codec);
|
dev_get_drvdata(codec->dev);
|
||||||
|
|
||||||
sdm660_cdc_priv->spkdrv_reg = NULL;
|
sdm660_cdc_priv->spkdrv_reg = NULL;
|
||||||
sdm660_cdc_priv->on_demand_list[ON_DEMAND_MICBIAS].supply = NULL;
|
sdm660_cdc_priv->on_demand_list[ON_DEMAND_MICBIAS].supply = NULL;
|
||||||
|
@ -4198,7 +4172,7 @@ static int msm_anlg_cdc_soc_remove(struct snd_soc_codec *codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_anlg_cdc_enable_static_supplies_to_optimum(
|
static int msm_anlg_cdc_enable_static_supplies_to_optimum(
|
||||||
struct sdm660_cdc *sdm660_cdc,
|
struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
struct sdm660_cdc_pdata *pdata)
|
struct sdm660_cdc_pdata *pdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -4231,7 +4205,7 @@ static int msm_anlg_cdc_enable_static_supplies_to_optimum(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_anlg_cdc_disable_static_supplies_to_optimum(
|
static int msm_anlg_cdc_disable_static_supplies_to_optimum(
|
||||||
struct sdm660_cdc *sdm660_cdc,
|
struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
struct sdm660_cdc_pdata *pdata)
|
struct sdm660_cdc_pdata *pdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -4256,7 +4230,7 @@ static int msm_anlg_cdc_disable_static_supplies_to_optimum(
|
||||||
static int msm_anlg_cdc_suspend(struct snd_soc_codec *codec)
|
static int msm_anlg_cdc_suspend(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct msm_asoc_mach_data *pdata = NULL;
|
struct msm_asoc_mach_data *pdata = NULL;
|
||||||
struct sdm660_cdc *sdm660_cdc = codec->control_data;
|
struct sdm660_cdc_priv *sdm660_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
struct sdm660_cdc_pdata *sdm660_cdc_pdata =
|
struct sdm660_cdc_pdata *sdm660_cdc_pdata =
|
||||||
sdm660_cdc->dev->platform_data;
|
sdm660_cdc->dev->platform_data;
|
||||||
|
|
||||||
|
@ -4281,7 +4255,7 @@ static int msm_anlg_cdc_suspend(struct snd_soc_codec *codec)
|
||||||
static int msm_anlg_cdc_resume(struct snd_soc_codec *codec)
|
static int msm_anlg_cdc_resume(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct msm_asoc_mach_data *pdata = NULL;
|
struct msm_asoc_mach_data *pdata = NULL;
|
||||||
struct sdm660_cdc *sdm660_cdc = codec->control_data;
|
struct sdm660_cdc_priv *sdm660_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
struct sdm660_cdc_pdata *sdm660_cdc_pdata =
|
struct sdm660_cdc_pdata *sdm660_cdc_pdata =
|
||||||
sdm660_cdc->dev->platform_data;
|
sdm660_cdc->dev->platform_data;
|
||||||
|
|
||||||
|
@ -4311,7 +4285,7 @@ static struct snd_soc_codec_driver soc_codec_dev_sdm660_cdc = {
|
||||||
.get_regmap = msm_anlg_get_regmap,
|
.get_regmap = msm_anlg_get_regmap,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int msm_anlg_cdc_init_supplies(struct sdm660_cdc *sdm660_cdc,
|
static int msm_anlg_cdc_init_supplies(struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
struct sdm660_cdc_pdata *pdata)
|
struct sdm660_cdc_pdata *pdata)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -4386,7 +4360,7 @@ err:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_anlg_cdc_enable_static_supplies(
|
static int msm_anlg_cdc_enable_static_supplies(
|
||||||
struct sdm660_cdc *sdm660_cdc,
|
struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
struct sdm660_cdc_pdata *pdata)
|
struct sdm660_cdc_pdata *pdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -4411,7 +4385,7 @@ static int msm_anlg_cdc_enable_static_supplies(
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msm_anlg_cdc_disable_supplies(struct sdm660_cdc *sdm660_cdc,
|
static void msm_anlg_cdc_disable_supplies(struct sdm660_cdc_priv *sdm660_cdc,
|
||||||
struct sdm660_cdc_pdata *pdata)
|
struct sdm660_cdc_pdata *pdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -4438,7 +4412,7 @@ static const struct of_device_id sdm660_codec_of_match[] = {
|
||||||
|
|
||||||
static void msm_anlg_add_child_devices(struct work_struct *work)
|
static void msm_anlg_add_child_devices(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *pdata;
|
struct sdm660_cdc_priv *pdata;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
struct msm_dig_ctrl_data *dig_ctrl_data = NULL, *temp;
|
struct msm_dig_ctrl_data *dig_ctrl_data = NULL, *temp;
|
||||||
|
@ -4446,7 +4420,7 @@ static void msm_anlg_add_child_devices(struct work_struct *work)
|
||||||
struct msm_dig_ctrl_platform_data *platdata;
|
struct msm_dig_ctrl_platform_data *platdata;
|
||||||
char plat_dev_name[MSM_DIG_CDC_STRING_LEN];
|
char plat_dev_name[MSM_DIG_CDC_STRING_LEN];
|
||||||
|
|
||||||
pdata = container_of(work, struct sdm660_cdc,
|
pdata = container_of(work, struct sdm660_cdc_priv,
|
||||||
msm_anlg_add_child_devices_work);
|
msm_anlg_add_child_devices_work);
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
pr_err("%s: Memory for pdata does not exist\n",
|
pr_err("%s: Memory for pdata does not exist\n",
|
||||||
|
@ -4527,7 +4501,7 @@ err:
|
||||||
static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct sdm660_cdc *sdm660_cdc = NULL;
|
struct sdm660_cdc_priv *sdm660_cdc = NULL;
|
||||||
struct sdm660_cdc_pdata *pdata;
|
struct sdm660_cdc_pdata *pdata;
|
||||||
int adsp_state;
|
int adsp_state;
|
||||||
|
|
||||||
|
@ -4554,7 +4528,7 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
||||||
__func__);
|
__func__);
|
||||||
goto rtn;
|
goto rtn;
|
||||||
}
|
}
|
||||||
sdm660_cdc = devm_kzalloc(&pdev->dev, sizeof(struct sdm660_cdc),
|
sdm660_cdc = devm_kzalloc(&pdev->dev, sizeof(struct sdm660_cdc_priv),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (sdm660_cdc == NULL) {
|
if (sdm660_cdc == NULL) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
@ -4578,7 +4552,6 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
||||||
/* Allow supplies to be ready */
|
/* Allow supplies to be ready */
|
||||||
usleep_range(5, 6);
|
usleep_range(5, 6);
|
||||||
|
|
||||||
dev_set_drvdata(&pdev->dev, sdm660_cdc);
|
|
||||||
wcd9xxx_spmi_set_dev(pdev, 0);
|
wcd9xxx_spmi_set_dev(pdev, 0);
|
||||||
wcd9xxx_spmi_set_dev(pdev, 1);
|
wcd9xxx_spmi_set_dev(pdev, 1);
|
||||||
if (wcd9xxx_spmi_irq_init()) {
|
if (wcd9xxx_spmi_irq_init()) {
|
||||||
|
@ -4588,6 +4561,7 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
||||||
dev_dbg(&pdev->dev,
|
dev_dbg(&pdev->dev,
|
||||||
"%s: irq initialization passed\n", __func__);
|
"%s: irq initialization passed\n", __func__);
|
||||||
}
|
}
|
||||||
|
dev_set_drvdata(&pdev->dev, sdm660_cdc);
|
||||||
|
|
||||||
ret = snd_soc_register_codec(&pdev->dev,
|
ret = snd_soc_register_codec(&pdev->dev,
|
||||||
&soc_codec_dev_sdm660_cdc,
|
&soc_codec_dev_sdm660_cdc,
|
||||||
|
@ -4599,6 +4573,9 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
goto err_supplies;
|
goto err_supplies;
|
||||||
}
|
}
|
||||||
|
BLOCKING_INIT_NOTIFIER_HEAD(&sdm660_cdc->notifier);
|
||||||
|
BLOCKING_INIT_NOTIFIER_HEAD(&sdm660_cdc->notifier_mbhc);
|
||||||
|
|
||||||
sdm660_cdc->dig_plat_data.handle = (void *) sdm660_cdc;
|
sdm660_cdc->dig_plat_data.handle = (void *) sdm660_cdc;
|
||||||
sdm660_cdc->dig_plat_data.update_clkdiv = update_clkdiv;
|
sdm660_cdc->dig_plat_data.update_clkdiv = update_clkdiv;
|
||||||
sdm660_cdc->dig_plat_data.get_cdc_version = get_cdc_version;
|
sdm660_cdc->dig_plat_data.get_cdc_version = get_cdc_version;
|
||||||
|
@ -4617,7 +4594,7 @@ rtn:
|
||||||
|
|
||||||
static int msm_anlg_cdc_remove(struct platform_device *pdev)
|
static int msm_anlg_cdc_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct sdm660_cdc *sdm660_cdc = dev_get_drvdata(&pdev->dev);
|
struct sdm660_cdc_priv *sdm660_cdc = dev_get_drvdata(&pdev->dev);
|
||||||
struct sdm660_cdc_pdata *pdata = sdm660_cdc->dev->platform_data;
|
struct sdm660_cdc_pdata *pdata = sdm660_cdc->dev->platform_data;
|
||||||
|
|
||||||
snd_soc_unregister_codec(&pdev->dev);
|
snd_soc_unregister_codec(&pdev->dev);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -172,7 +172,7 @@ struct msm_dig_ctrl_platform_data {
|
||||||
bool enable);
|
bool enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sdm660_cdc {
|
struct sdm660_cdc_priv {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
u32 num_of_supplies;
|
u32 num_of_supplies;
|
||||||
struct regulator_bulk_data *supplies;
|
struct regulator_bulk_data *supplies;
|
||||||
|
@ -182,15 +182,6 @@ struct sdm660_cdc {
|
||||||
/* digital codec data structure */
|
/* digital codec data structure */
|
||||||
struct msm_dig_ctrl_data *dig_ctrl_data;
|
struct msm_dig_ctrl_data *dig_ctrl_data;
|
||||||
struct blocking_notifier_head notifier;
|
struct blocking_notifier_head notifier;
|
||||||
};
|
|
||||||
|
|
||||||
struct sdm660_cdc_pdata {
|
|
||||||
struct wcd_micbias_setting micbias;
|
|
||||||
struct sdm660_cdc_regulator regulator[MAX_REGULATOR];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct sdm660_cdc_priv {
|
|
||||||
struct snd_soc_codec *codec;
|
|
||||||
u16 pmic_rev;
|
u16 pmic_rev;
|
||||||
u16 codec_version;
|
u16 codec_version;
|
||||||
u16 analog_major_rev;
|
u16 analog_major_rev;
|
||||||
|
@ -207,7 +198,7 @@ struct sdm660_cdc_priv {
|
||||||
bool ext_spk_boost_set;
|
bool ext_spk_boost_set;
|
||||||
struct on_demand_supply on_demand_list[ON_DEMAND_SUPPLIES_MAX];
|
struct on_demand_supply on_demand_list[ON_DEMAND_SUPPLIES_MAX];
|
||||||
struct regulator *spkdrv_reg;
|
struct regulator *spkdrv_reg;
|
||||||
struct blocking_notifier_head notifier;
|
struct blocking_notifier_head notifier_mbhc;
|
||||||
/* mbhc module */
|
/* mbhc module */
|
||||||
struct wcd_mbhc mbhc;
|
struct wcd_mbhc mbhc;
|
||||||
/* cal info for codec */
|
/* cal info for codec */
|
||||||
|
@ -222,6 +213,12 @@ struct sdm660_cdc_priv {
|
||||||
struct snd_info_entry *version_entry;
|
struct snd_info_entry *version_entry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct sdm660_cdc_pdata {
|
||||||
|
struct wcd_micbias_setting micbias;
|
||||||
|
struct sdm660_cdc_regulator regulator[MAX_REGULATOR];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
extern int msm_anlg_cdc_mclk_enable(struct snd_soc_codec *codec,
|
extern int msm_anlg_cdc_mclk_enable(struct snd_soc_codec *codec,
|
||||||
int mclk_enable, bool dapm);
|
int mclk_enable, bool dapm);
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ static int msm_dig_cdc_codec_enable_interpolator(struct snd_soc_dapm_widget *w,
|
||||||
int event)
|
int event)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
||||||
struct msm_dig *msm_dig_cdc = dev_get_drvdata(codec->dev);
|
struct msm_dig_priv *msm_dig_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
|
|
||||||
dev_dbg(codec->dev, "%s %d %s\n", __func__, event, w->name);
|
dev_dbg(codec->dev, "%s %d %s\n", __func__, event, w->name);
|
||||||
|
|
||||||
|
@ -542,14 +542,14 @@ static void tx_hpf_corner_freq_callback(struct work_struct *work)
|
||||||
struct delayed_work *hpf_delayed_work;
|
struct delayed_work *hpf_delayed_work;
|
||||||
struct hpf_work *hpf_work;
|
struct hpf_work *hpf_work;
|
||||||
struct snd_soc_codec *codec;
|
struct snd_soc_codec *codec;
|
||||||
struct msm_dig *msm_dig_cdc;
|
struct msm_dig_priv *msm_dig_cdc;
|
||||||
u16 tx_mux_ctl_reg;
|
u16 tx_mux_ctl_reg;
|
||||||
u8 hpf_cut_of_freq;
|
u8 hpf_cut_of_freq;
|
||||||
|
|
||||||
hpf_delayed_work = to_delayed_work(work);
|
hpf_delayed_work = to_delayed_work(work);
|
||||||
hpf_work = container_of(hpf_delayed_work, struct hpf_work, dwork);
|
hpf_work = container_of(hpf_delayed_work, struct hpf_work, dwork);
|
||||||
codec = hpf_work->dig_cdc->codec;
|
codec = hpf_work->dig_cdc->codec;
|
||||||
msm_dig_cdc = codec->control_data;
|
msm_dig_cdc = hpf_work->dig_cdc;
|
||||||
hpf_cut_of_freq = hpf_work->tx_hpf_cut_of_freq;
|
hpf_cut_of_freq = hpf_work->tx_hpf_cut_of_freq;
|
||||||
|
|
||||||
tx_mux_ctl_reg = MSM89XX_CDC_CORE_TX1_MUX_CTL +
|
tx_mux_ctl_reg = MSM89XX_CDC_CORE_TX1_MUX_CTL +
|
||||||
|
@ -826,8 +826,7 @@ static int msm_dig_cdc_codec_enable_dec(struct snd_soc_dapm_widget *w,
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
||||||
struct msm_asoc_mach_data *pdata = NULL;
|
struct msm_asoc_mach_data *pdata = NULL;
|
||||||
unsigned int decimator;
|
unsigned int decimator;
|
||||||
struct msm_dig_priv *dig_cdc = snd_soc_codec_get_drvdata(codec);
|
struct msm_dig_priv *msm_dig_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
struct msm_dig *msm_dig_cdc = codec->control_data;
|
|
||||||
char *dec_name = NULL;
|
char *dec_name = NULL;
|
||||||
char *widget_name = NULL;
|
char *widget_name = NULL;
|
||||||
char *temp;
|
char *temp;
|
||||||
|
@ -897,7 +896,7 @@ static int msm_dig_cdc_codec_enable_dec(struct snd_soc_dapm_widget *w,
|
||||||
snd_soc_update_bits(codec, tx_vol_ctl_reg, 0x01, 0x01);
|
snd_soc_update_bits(codec, tx_vol_ctl_reg, 0x01, 0x01);
|
||||||
for (i = 0; i < NUM_DECIMATORS; i++) {
|
for (i = 0; i < NUM_DECIMATORS; i++) {
|
||||||
if (decimator == i + 1)
|
if (decimator == i + 1)
|
||||||
dig_cdc->dec_active[i] = true;
|
msm_dig_cdc->dec_active[i] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
dec_hpf_cut_of_freq = snd_soc_read(codec, tx_mux_ctl_reg);
|
dec_hpf_cut_of_freq = snd_soc_read(codec, tx_mux_ctl_reg);
|
||||||
|
@ -957,7 +956,7 @@ static int msm_dig_cdc_codec_enable_dec(struct snd_soc_dapm_widget *w,
|
||||||
snd_soc_update_bits(codec, tx_vol_ctl_reg, 0x01, 0x00);
|
snd_soc_update_bits(codec, tx_vol_ctl_reg, 0x01, 0x00);
|
||||||
for (i = 0; i < NUM_DECIMATORS; i++) {
|
for (i = 0; i < NUM_DECIMATORS; i++) {
|
||||||
if (decimator == i + 1)
|
if (decimator == i + 1)
|
||||||
dig_cdc->dec_active[i] = false;
|
msm_dig_cdc->dec_active[i] = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -972,7 +971,7 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block,
|
||||||
{
|
{
|
||||||
enum dig_cdc_notify_event event = (enum dig_cdc_notify_event)val;
|
enum dig_cdc_notify_event event = (enum dig_cdc_notify_event)val;
|
||||||
struct snd_soc_codec *codec = registered_digcodec;
|
struct snd_soc_codec *codec = registered_digcodec;
|
||||||
struct msm_dig *msm_dig_cdc = codec->control_data;
|
struct msm_dig_priv *msm_dig_cdc = snd_soc_codec_get_drvdata(codec);
|
||||||
struct msm_asoc_mach_data *pdata = NULL;
|
struct msm_asoc_mach_data *pdata = NULL;
|
||||||
|
|
||||||
pdata = snd_soc_card_get_drvdata(codec->component.card);
|
pdata = snd_soc_card_get_drvdata(codec->component.card);
|
||||||
|
@ -1155,36 +1154,34 @@ int msm_dig_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
msm_dig->version_entry = version_entry;
|
msm_dig->version_entry = version_entry;
|
||||||
|
if (msm_dig->get_cdc_version)
|
||||||
|
msm_dig->version = msm_dig->get_cdc_version(msm_dig->handle);
|
||||||
|
else
|
||||||
|
msm_dig->version = DRAX_CDC;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(msm_dig_codec_info_create_codec_entry);
|
EXPORT_SYMBOL(msm_dig_codec_info_create_codec_entry);
|
||||||
|
|
||||||
static int msm_dig_cdc_soc_probe(struct snd_soc_codec *codec)
|
static int msm_dig_cdc_soc_probe(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct msm_dig_priv *dig_cdc = NULL;
|
struct msm_dig_priv *msm_dig_cdc = dev_get_drvdata(codec->dev);
|
||||||
struct msm_dig *msm_dig_cdc = dev_get_drvdata(codec->dev);
|
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
dig_cdc = devm_kzalloc(codec->dev, sizeof(struct msm_dig_priv),
|
msm_dig_cdc->codec = codec;
|
||||||
GFP_KERNEL);
|
|
||||||
if (!dig_cdc)
|
|
||||||
return -ENOMEM;
|
|
||||||
snd_soc_codec_set_drvdata(codec, dig_cdc);
|
|
||||||
dig_cdc->codec = codec;
|
|
||||||
codec->control_data = msm_dig_cdc;
|
|
||||||
|
|
||||||
snd_soc_add_codec_controls(codec, compander_kcontrols,
|
snd_soc_add_codec_controls(codec, compander_kcontrols,
|
||||||
ARRAY_SIZE(compander_kcontrols));
|
ARRAY_SIZE(compander_kcontrols));
|
||||||
|
|
||||||
for (i = 0; i < NUM_DECIMATORS; i++) {
|
for (i = 0; i < NUM_DECIMATORS; i++) {
|
||||||
tx_hpf_work[i].dig_cdc = dig_cdc;
|
tx_hpf_work[i].dig_cdc = msm_dig_cdc;
|
||||||
tx_hpf_work[i].decimator = i + 1;
|
tx_hpf_work[i].decimator = i + 1;
|
||||||
INIT_DELAYED_WORK(&tx_hpf_work[i].dwork,
|
INIT_DELAYED_WORK(&tx_hpf_work[i].dwork,
|
||||||
tx_hpf_corner_freq_callback);
|
tx_hpf_corner_freq_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MSM89XX_RX_MAX; i++)
|
for (i = 0; i < MSM89XX_RX_MAX; i++)
|
||||||
dig_cdc->comp_enabled[i] = COMPANDER_NONE;
|
msm_dig_cdc->comp_enabled[i] = COMPANDER_NONE;
|
||||||
|
|
||||||
/* Register event notifier */
|
/* Register event notifier */
|
||||||
msm_dig_cdc->nblock.notifier_call = msm_dig_cdc_event_notify;
|
msm_dig_cdc->nblock.notifier_call = msm_dig_cdc_event_notify;
|
||||||
|
@ -1198,15 +1195,14 @@ static int msm_dig_cdc_soc_probe(struct snd_soc_codec *codec)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Assign to DRAX_CDC for initial version */
|
|
||||||
dig_cdc->version = DRAX_CDC;
|
|
||||||
registered_digcodec = codec;
|
registered_digcodec = codec;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_dig_cdc_soc_remove(struct snd_soc_codec *codec)
|
static int msm_dig_cdc_soc_remove(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct msm_dig *msm_dig_cdc = dev_get_drvdata(codec->dev);
|
struct msm_dig_priv *msm_dig_cdc = dev_get_drvdata(codec->dev);
|
||||||
|
|
||||||
if (msm_dig_cdc->register_notifier)
|
if (msm_dig_cdc->register_notifier)
|
||||||
msm_dig_cdc->register_notifier(msm_dig_cdc->handle,
|
msm_dig_cdc->register_notifier(msm_dig_cdc->handle,
|
||||||
|
@ -1968,7 +1964,7 @@ static struct snd_soc_dai_driver msm_codec_dais[] = {
|
||||||
|
|
||||||
static struct regmap *msm_digital_get_regmap(struct device *dev)
|
static struct regmap *msm_digital_get_regmap(struct device *dev)
|
||||||
{
|
{
|
||||||
struct msm_dig *msm_dig_cdc = dev_get_drvdata(dev);
|
struct msm_dig_priv *msm_dig_cdc = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return msm_dig_cdc->regmap;
|
return msm_dig_cdc->regmap;
|
||||||
}
|
}
|
||||||
|
@ -2005,10 +2001,10 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u32 dig_cdc_addr;
|
u32 dig_cdc_addr;
|
||||||
struct msm_dig *msm_dig_cdc;
|
struct msm_dig_priv *msm_dig_cdc;
|
||||||
struct dig_ctrl_platform_data *pdata;
|
struct dig_ctrl_platform_data *pdata;
|
||||||
|
|
||||||
msm_dig_cdc = devm_kzalloc(&pdev->dev, sizeof(struct msm_dig),
|
msm_dig_cdc = devm_kzalloc(&pdev->dev, sizeof(struct msm_dig_priv),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!msm_dig_cdc)
|
if (!msm_dig_cdc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -2019,7 +2015,6 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto rtn;
|
goto rtn;
|
||||||
}
|
}
|
||||||
dev_set_drvdata(&pdev->dev, msm_dig_cdc);
|
|
||||||
|
|
||||||
ret = of_property_read_u32(pdev->dev.of_node, "reg",
|
ret = of_property_read_u32(pdev->dev.of_node, "reg",
|
||||||
&dig_cdc_addr);
|
&dig_cdc_addr);
|
||||||
|
@ -2044,6 +2039,7 @@ static int msm_dig_cdc_probe(struct platform_device *pdev)
|
||||||
msm_dig_cdc->handle = pdata->handle;
|
msm_dig_cdc->handle = pdata->handle;
|
||||||
msm_dig_cdc->register_notifier = pdata->register_notifier;
|
msm_dig_cdc->register_notifier = pdata->register_notifier;
|
||||||
|
|
||||||
|
dev_set_drvdata(&pdev->dev, msm_dig_cdc);
|
||||||
snd_soc_register_codec(&pdev->dev, &soc_msm_dig_codec,
|
snd_soc_register_codec(&pdev->dev, &soc_msm_dig_codec,
|
||||||
msm_codec_dais, ARRAY_SIZE(msm_codec_dais));
|
msm_codec_dais, ARRAY_SIZE(msm_codec_dais));
|
||||||
dev_dbg(&pdev->dev, "%s: registered DIG CODEC 0x%x\n",
|
dev_dbg(&pdev->dev, "%s: registered DIG CODEC 0x%x\n",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -43,9 +43,6 @@ struct msm_dig_priv {
|
||||||
/* Entry for version info */
|
/* Entry for version info */
|
||||||
struct snd_info_entry *entry;
|
struct snd_info_entry *entry;
|
||||||
struct snd_info_entry *version_entry;
|
struct snd_info_entry *version_entry;
|
||||||
};
|
|
||||||
|
|
||||||
struct msm_dig {
|
|
||||||
char __iomem *dig_base;
|
char __iomem *dig_base;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
struct notifier_block nblock;
|
struct notifier_block nblock;
|
||||||
|
|
Loading…
Add table
Reference in a new issue