forked from Minki/linux
Merge remote-tracking branches 'asoc/fix/ab8500', 'asoc/fix/adau17x1', 'asoc/fix/adsp', 'asoc/fix/cs42l51', 'asoc/fix/da732x' and 'asoc/fix/fsl-ssi' into asoc-linus
This commit is contained in:
commit
92e9f77306
@ -1130,7 +1130,7 @@ static int sid_status_control_get(struct snd_kcontrol *kcontrol,
|
||||
struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
ucontrol->value.integer.value[0] = drvdata->sid_status;
|
||||
ucontrol->value.enumerated.item[0] = drvdata->sid_status;
|
||||
mutex_unlock(&drvdata->ctrl_lock);
|
||||
|
||||
return 0;
|
||||
@ -1147,7 +1147,7 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol,
|
||||
|
||||
dev_dbg(codec->dev, "%s: Enter\n", __func__);
|
||||
|
||||
if (ucontrol->value.integer.value[0] != SID_APPLY_FIR) {
|
||||
if (ucontrol->value.enumerated.item[0] != SID_APPLY_FIR) {
|
||||
dev_err(codec->dev,
|
||||
"%s: ERROR: This control supports '%s' only!\n",
|
||||
__func__, enum_sid_state[SID_APPLY_FIR]);
|
||||
@ -1199,7 +1199,7 @@ static int anc_status_control_get(struct snd_kcontrol *kcontrol,
|
||||
struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
ucontrol->value.integer.value[0] = drvdata->anc_status;
|
||||
ucontrol->value.enumerated.item[0] = drvdata->anc_status;
|
||||
mutex_unlock(&drvdata->ctrl_lock);
|
||||
|
||||
return 0;
|
||||
@ -1220,7 +1220,7 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol,
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
|
||||
req = ucontrol->value.integer.value[0];
|
||||
req = ucontrol->value.enumerated.item[0];
|
||||
if (req >= ARRAY_SIZE(enum_anc_state)) {
|
||||
status = -EINVAL;
|
||||
goto cleanup;
|
||||
|
@ -103,9 +103,9 @@ bool adau17x1_has_dsp(struct adau *adau);
|
||||
#define ADAU17X1_CLOCK_CONTROL_CORECLK_SRC_PLL BIT(3)
|
||||
#define ADAU17X1_CLOCK_CONTROL_SYSCLK_EN BIT(0)
|
||||
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK32 (0x0 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK48 (0x1 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK64 (0x2 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK64 (0x0 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK32 (0x1 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK48 (0x2 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK128 (0x3 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK256 (0x4 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK_MASK (0x7 << 5)
|
||||
|
@ -60,15 +60,15 @@ static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
|
||||
switch (value) {
|
||||
default:
|
||||
case 0:
|
||||
ucontrol->value.integer.value[0] = 0;
|
||||
ucontrol->value.enumerated.item[0] = 0;
|
||||
break;
|
||||
/* same value : (L+R)/2 and (R+L)/2 */
|
||||
case 1:
|
||||
case 2:
|
||||
ucontrol->value.integer.value[0] = 1;
|
||||
ucontrol->value.enumerated.item[0] = 1;
|
||||
break;
|
||||
case 3:
|
||||
ucontrol->value.integer.value[0] = 2;
|
||||
ucontrol->value.enumerated.item[0] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
||||
unsigned char val;
|
||||
|
||||
switch (ucontrol->value.integer.value[0]) {
|
||||
switch (ucontrol->value.enumerated.item[0]) {
|
||||
default:
|
||||
case 0:
|
||||
val = CHAN_MIX_NORMAL;
|
||||
|
@ -334,7 +334,7 @@ static int da732x_hpf_set(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
||||
struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value;
|
||||
unsigned int reg = enum_ctrl->reg;
|
||||
unsigned int sel = ucontrol->value.integer.value[0];
|
||||
unsigned int sel = ucontrol->value.enumerated.item[0];
|
||||
unsigned int bits;
|
||||
|
||||
switch (sel) {
|
||||
@ -368,13 +368,13 @@ static int da732x_hpf_get(struct snd_kcontrol *kcontrol,
|
||||
|
||||
switch (val) {
|
||||
case DA732X_HPF_VOICE_EN:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_VOICE;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_VOICE;
|
||||
break;
|
||||
case DA732X_HPF_MUSIC_EN:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_MUSIC;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_MUSIC;
|
||||
break;
|
||||
default:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_DISABLED;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_DISABLED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -586,7 +586,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
ucontrol->value.integer.value[0] = dsp[e->shift_l].fw;
|
||||
ucontrol->value.enumerated.item[0] = dsp[e->shift_l].fw;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -599,10 +599,10 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
|
||||
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
if (ucontrol->value.integer.value[0] == dsp[e->shift_l].fw)
|
||||
if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw)
|
||||
return 0;
|
||||
|
||||
if (ucontrol->value.integer.value[0] >= WM_ADSP_NUM_FW)
|
||||
if (ucontrol->value.enumerated.item[0] >= WM_ADSP_NUM_FW)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&dsp[e->shift_l].pwr_lock);
|
||||
@ -610,7 +610,7 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
|
||||
if (dsp[e->shift_l].running || dsp[e->shift_l].compr)
|
||||
ret = -EBUSY;
|
||||
else
|
||||
dsp[e->shift_l].fw = ucontrol->value.integer.value[0];
|
||||
dsp[e->shift_l].fw = ucontrol->value.enumerated.item[0];
|
||||
|
||||
mutex_unlock(&dsp[e->shift_l].pwr_lock);
|
||||
|
||||
|
@ -112,6 +112,20 @@ struct fsl_ssi_rxtx_reg_val {
|
||||
struct fsl_ssi_reg_val tx;
|
||||
};
|
||||
|
||||
static const struct reg_default fsl_ssi_reg_defaults[] = {
|
||||
{CCSR_SSI_SCR, 0x00000000},
|
||||
{CCSR_SSI_SIER, 0x00003003},
|
||||
{CCSR_SSI_STCR, 0x00000200},
|
||||
{CCSR_SSI_SRCR, 0x00000200},
|
||||
{CCSR_SSI_STCCR, 0x00040000},
|
||||
{CCSR_SSI_SRCCR, 0x00040000},
|
||||
{CCSR_SSI_SACNT, 0x00000000},
|
||||
{CCSR_SSI_STMSK, 0x00000000},
|
||||
{CCSR_SSI_SRMSK, 0x00000000},
|
||||
{CCSR_SSI_SACCEN, 0x00000000},
|
||||
{CCSR_SSI_SACCDIS, 0x00000000},
|
||||
};
|
||||
|
||||
static bool fsl_ssi_readable_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
switch (reg) {
|
||||
@ -176,7 +190,8 @@ static const struct regmap_config fsl_ssi_regconfig = {
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_format_endian = REGMAP_ENDIAN_NATIVE,
|
||||
.num_reg_defaults_raw = CCSR_SSI_SACCDIS / sizeof(uint32_t) + 1,
|
||||
.reg_defaults = fsl_ssi_reg_defaults,
|
||||
.num_reg_defaults = ARRAY_SIZE(fsl_ssi_reg_defaults),
|
||||
.readable_reg = fsl_ssi_readable_reg,
|
||||
.volatile_reg = fsl_ssi_volatile_reg,
|
||||
.precious_reg = fsl_ssi_precious_reg,
|
||||
@ -186,7 +201,6 @@ static const struct regmap_config fsl_ssi_regconfig = {
|
||||
|
||||
struct fsl_ssi_soc_data {
|
||||
bool imx;
|
||||
bool imx21regs; /* imx21-class SSI - no SACC{ST,EN,DIS} regs */
|
||||
bool offline_config;
|
||||
u32 sisr_write_mask;
|
||||
};
|
||||
@ -289,7 +303,6 @@ static struct fsl_ssi_soc_data fsl_ssi_mpc8610 = {
|
||||
|
||||
static struct fsl_ssi_soc_data fsl_ssi_imx21 = {
|
||||
.imx = true,
|
||||
.imx21regs = true,
|
||||
.offline_config = true,
|
||||
.sisr_write_mask = 0,
|
||||
};
|
||||
@ -573,12 +586,8 @@ static void fsl_ssi_setup_ac97(struct fsl_ssi_private *ssi_private)
|
||||
*/
|
||||
regmap_write(regs, CCSR_SSI_SACNT,
|
||||
CCSR_SSI_SACNT_AC97EN | CCSR_SSI_SACNT_FV);
|
||||
|
||||
/* no SACC{ST,EN,DIS} regs on imx21-class SSI */
|
||||
if (!ssi_private->soc->imx21regs) {
|
||||
regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
|
||||
regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
|
||||
}
|
||||
regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
|
||||
regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
|
||||
|
||||
/*
|
||||
* Enable SSI, Transmit and Receive. AC97 has to communicate with the
|
||||
@ -1388,7 +1397,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
void __iomem *iomem;
|
||||
char name[64];
|
||||
struct regmap_config regconfig = fsl_ssi_regconfig;
|
||||
|
||||
of_id = of_match_device(fsl_ssi_ids, &pdev->dev);
|
||||
if (!of_id || !of_id->data)
|
||||
@ -1436,25 +1444,15 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(iomem);
|
||||
ssi_private->ssi_phys = res->start;
|
||||
|
||||
if (ssi_private->soc->imx21regs) {
|
||||
/*
|
||||
* According to datasheet imx21-class SSI
|
||||
* don't have SACC{ST,EN,DIS} regs.
|
||||
*/
|
||||
regconfig.max_register = CCSR_SSI_SRMSK;
|
||||
regconfig.num_reg_defaults_raw =
|
||||
CCSR_SSI_SRMSK / sizeof(uint32_t) + 1;
|
||||
}
|
||||
|
||||
ret = of_property_match_string(np, "clock-names", "ipg");
|
||||
if (ret < 0) {
|
||||
ssi_private->has_ipg_clk_name = false;
|
||||
ssi_private->regs = devm_regmap_init_mmio(&pdev->dev, iomem,
|
||||
®config);
|
||||
&fsl_ssi_regconfig);
|
||||
} else {
|
||||
ssi_private->has_ipg_clk_name = true;
|
||||
ssi_private->regs = devm_regmap_init_mmio_clk(&pdev->dev,
|
||||
"ipg", iomem, ®config);
|
||||
"ipg", iomem, &fsl_ssi_regconfig);
|
||||
}
|
||||
if (IS_ERR(ssi_private->regs)) {
|
||||
dev_err(&pdev->dev, "Failed to init register map\n");
|
||||
|
Loading…
Reference in New Issue
Block a user