mirror of https://gitee.com/openkylin/linux.git
Merge remote branch 'broonie-asoc/for-2.6.37' into for-2.6.37
This commit is contained in:
commit
611ad378b3
|
@ -551,7 +551,7 @@ static struct resource siu_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device siu_device = {
|
||||
.name = "sh_siu",
|
||||
.name = "siu-pcm-audio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &siu_platform_data,
|
||||
|
|
|
@ -12,4 +12,4 @@ TODO:
|
|||
- get rid of non-linux related stuff
|
||||
|
||||
Please send patches to:
|
||||
Arnaud Patard <apatard@mandriva.com>
|
||||
Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
|
|
|
@ -1919,6 +1919,7 @@ config FB_SH_MOBILE_HDMI
|
|||
tristate "SuperH Mobile HDMI controller support"
|
||||
depends on FB_SH_MOBILE_LCDC
|
||||
select FB_MODE_HELPERS
|
||||
select SND_SOC
|
||||
---help---
|
||||
Driver for the on-chip SH-Mobile HDMI controller.
|
||||
|
||||
|
|
|
@ -224,13 +224,9 @@ static u8 hdmi_read(struct sh_hdmi *hdmi, u8 reg)
|
|||
return ioread8(hdmi->base + reg);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
|
||||
HDMI sound
|
||||
|
||||
|
||||
************************************************************************/
|
||||
/*
|
||||
* HDMI sound
|
||||
*/
|
||||
static unsigned int sh_hdmi_snd_read(struct snd_soc_codec *codec,
|
||||
unsigned int reg)
|
||||
{
|
||||
|
@ -253,9 +249,12 @@ static struct snd_soc_dai_driver sh_hdmi_dai = {
|
|||
.name = "sh_mobile_hdmi-hifi",
|
||||
.playback = {
|
||||
.stream_name = "Playback",
|
||||
.channels_min = 1,
|
||||
.channels_max = 2,
|
||||
.rates = SNDRV_PCM_RATE_8000_48000,
|
||||
.channels_min = 2,
|
||||
.channels_max = 8,
|
||||
.rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
|
||||
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
|
||||
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
|
||||
SNDRV_PCM_RATE_192000,
|
||||
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
|
||||
},
|
||||
};
|
||||
|
@ -273,13 +272,10 @@ static struct snd_soc_codec_driver soc_codec_dev_sh_hdmi = {
|
|||
.write = sh_hdmi_snd_write,
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* HDMI video
|
||||
*/
|
||||
|
||||
|
||||
HDMI video
|
||||
|
||||
|
||||
************************************************************************/
|
||||
/* External video parameter settings */
|
||||
static void hdmi_external_video_param(struct sh_hdmi *hdmi)
|
||||
{
|
||||
|
@ -396,20 +392,20 @@ static void sh_hdmi_audio_config(struct sh_hdmi *hdmi)
|
|||
* [6:5] set required down sampling rate if required
|
||||
* [4:3] set required audio source
|
||||
*/
|
||||
switch (pdata->flags & HDMI_SRC_MASK) {
|
||||
switch (pdata->flags & HDMI_SND_SRC_MASK) {
|
||||
default:
|
||||
/* FALL THROUGH */
|
||||
case HDMI_SRC_I2S:
|
||||
data = (0x0 << 3);
|
||||
/* fall through */
|
||||
case HDMI_SND_SRC_I2S:
|
||||
data = 0x0 << 3;
|
||||
break;
|
||||
case HDMI_SRC_SPDIF:
|
||||
data = (0x1 << 3);
|
||||
case HDMI_SND_SRC_SPDIF:
|
||||
data = 0x1 << 3;
|
||||
break;
|
||||
case HDMI_SRC_DSD:
|
||||
data = (0x2 << 3);
|
||||
case HDMI_SND_SRC_DSD:
|
||||
data = 0x2 << 3;
|
||||
break;
|
||||
case HDMI_SRC_HBR:
|
||||
data = (0x3 << 3);
|
||||
case HDMI_SND_SRC_HBR:
|
||||
data = 0x3 << 3;
|
||||
break;
|
||||
}
|
||||
hdmi_write(hdmi, data, HDMI_AUDIO_SETTING_1);
|
||||
|
@ -971,7 +967,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
|
|||
ret = snd_soc_register_codec(&pdev->dev,
|
||||
&soc_codec_dev_sh_hdmi, &sh_hdmi_dai, 1);
|
||||
if (ret < 0)
|
||||
goto egetclk;
|
||||
goto esndreg;
|
||||
|
||||
hdmi->dev = &pdev->dev;
|
||||
|
||||
|
@ -1058,6 +1054,8 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
|
|||
erate:
|
||||
clk_put(hdmi->hdmi_clk);
|
||||
egetclk:
|
||||
snd_soc_unregister_codec(&pdev->dev);
|
||||
esndreg:
|
||||
kfree(hdmi);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -23,11 +23,11 @@ struct device;
|
|||
*/
|
||||
|
||||
/* Audio source select */
|
||||
#define HDMI_SRC_MASK (0xF << 0)
|
||||
#define HDMI_SRC_I2S (0 << 0) /* default */
|
||||
#define HDMI_SRC_SPDIF (1 << 0)
|
||||
#define HDMI_SRC_DSD (2 << 0)
|
||||
#define HDMI_SRC_HBR (3 << 0)
|
||||
#define HDMI_SND_SRC_MASK (0xF << 0)
|
||||
#define HDMI_SND_SRC_I2S (0 << 0) /* default */
|
||||
#define HDMI_SND_SRC_SPDIF (1 << 0)
|
||||
#define HDMI_SND_SRC_DSD (2 << 0)
|
||||
#define HDMI_SND_SRC_HBR (3 << 0)
|
||||
|
||||
struct sh_mobile_hdmi_info {
|
||||
struct sh_mobile_lcdc_chan_cfg *lcd_chan;
|
||||
|
|
|
@ -67,6 +67,7 @@ config SND_SOC_ALL_CODECS
|
|||
select SND_SOC_WM8971 if I2C
|
||||
select SND_SOC_WM8974 if I2C
|
||||
select SND_SOC_WM8978 if I2C
|
||||
select SND_SOC_WM8985 if SND_SOC_I2C_AND_SPI
|
||||
select SND_SOC_WM8988 if SND_SOC_I2C_AND_SPI
|
||||
select SND_SOC_WM8990 if I2C
|
||||
select SND_SOC_WM8993 if I2C
|
||||
|
@ -269,6 +270,9 @@ config SND_SOC_WM8974
|
|||
config SND_SOC_WM8978
|
||||
tristate
|
||||
|
||||
config SND_SOC_WM8985
|
||||
tristate
|
||||
|
||||
config SND_SOC_WM8988
|
||||
tristate
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ snd-soc-wm8962-objs := wm8962.o wm8962-tables.o
|
|||
snd-soc-wm8971-objs := wm8971.o
|
||||
snd-soc-wm8974-objs := wm8974.o
|
||||
snd-soc-wm8978-objs := wm8978.o
|
||||
snd-soc-wm8985-objs := wm8985.o
|
||||
snd-soc-wm8988-objs := wm8988.o
|
||||
snd-soc-wm8990-objs := wm8990.o
|
||||
snd-soc-wm8993-objs := wm8993.o
|
||||
|
@ -124,6 +125,7 @@ obj-$(CONFIG_SND_SOC_WM8962) += snd-soc-wm8962.o
|
|||
obj-$(CONFIG_SND_SOC_WM8971) += snd-soc-wm8971.o
|
||||
obj-$(CONFIG_SND_SOC_WM8974) += snd-soc-wm8974.o
|
||||
obj-$(CONFIG_SND_SOC_WM8978) += snd-soc-wm8978.o
|
||||
obj-$(CONFIG_SND_SOC_WM8985) += snd-soc-wm8985.o
|
||||
obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o
|
||||
obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o
|
||||
obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o
|
||||
|
|
|
@ -247,6 +247,7 @@ static struct snd_soc_codec_driver soc_codec_dev_ad1980 = {
|
|||
.remove = ad1980_soc_remove,
|
||||
.reg_cache_size = ARRAY_SIZE(ad1980_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = ad1980_reg,
|
||||
.reg_cache_step = 2,
|
||||
.write = ac97_write,
|
||||
.read = ac97_read,
|
||||
|
|
|
@ -422,7 +422,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
|
|||
dev_info(codec->dev, "AK4642 Audio Codec %s", AK4642_VERSION);
|
||||
|
||||
codec->hw_write = (hw_write_t)i2c_master_send;
|
||||
codec->control_data = ak4642->control_data;
|
||||
codec->control_data = ak4642->control_data;
|
||||
|
||||
snd_soc_add_controls(codec, ak4642_snd_controls,
|
||||
ARRAY_SIZE(ak4642_snd_controls));
|
||||
|
@ -431,12 +431,12 @@ static int ak4642_probe(struct snd_soc_codec *codec)
|
|||
}
|
||||
|
||||
static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
|
||||
.probe = ak4642_probe,
|
||||
.resume = ak4642_resume,
|
||||
.read = ak4642_read_reg_cache,
|
||||
.write = ak4642_write,
|
||||
.reg_cache_size = ARRAY_SIZE(ak4642_reg),
|
||||
.reg_word_size = sizeof(u8),
|
||||
.probe = ak4642_probe,
|
||||
.resume = ak4642_resume,
|
||||
.read = ak4642_read_reg_cache,
|
||||
.write = ak4642_write,
|
||||
.reg_cache_size = ARRAY_SIZE(ak4642_reg),
|
||||
.reg_word_size = sizeof(u8),
|
||||
.reg_cache_default = ak4642_reg,
|
||||
};
|
||||
|
||||
|
@ -448,7 +448,7 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c,
|
|||
int ret;
|
||||
|
||||
ak4642 = kzalloc(sizeof(struct ak4642_priv), GFP_KERNEL);
|
||||
if (ak4642 == NULL)
|
||||
if (!ak4642)
|
||||
return -ENOMEM;
|
||||
|
||||
i2c_set_clientdata(i2c, ak4642);
|
||||
|
@ -481,9 +481,9 @@ static struct i2c_driver ak4642_i2c_driver = {
|
|||
.name = "ak4642-codec",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = ak4642_i2c_probe,
|
||||
.remove = __devexit_p(ak4642_i2c_remove),
|
||||
.id_table = ak4642_i2c_id,
|
||||
.probe = ak4642_i2c_probe,
|
||||
.remove = __devexit_p(ak4642_i2c_remove),
|
||||
.id_table = ak4642_i2c_id,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -642,7 +642,6 @@ static int ak4671_probe(struct snd_soc_codec *codec)
|
|||
int ret;
|
||||
|
||||
codec->hw_write = (hw_write_t)i2c_master_send;
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
|
||||
ret = snd_soc_codec_set_cache_io(codec, 8, 8, ak4671->control_type);
|
||||
if (ret < 0) {
|
||||
|
|
|
@ -649,6 +649,6 @@ static void __exit cs42l51_exit(void)
|
|||
}
|
||||
module_exit(cs42l51_exit);
|
||||
|
||||
MODULE_AUTHOR("Arnaud Patard <apatard@mandriva.com>");
|
||||
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
|
||||
MODULE_DESCRIPTION("Cirrus Logic CS42L51 ALSA SoC Codec Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
@ -454,7 +454,7 @@ static int da7210_probe(struct snd_soc_codec *codec)
|
|||
|
||||
dev_info(codec->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION);
|
||||
|
||||
codec->control_data = da7210->control_data;
|
||||
codec->control_data = da7210->control_data;
|
||||
codec->hw_write = (hw_write_t)i2c_master_send;
|
||||
|
||||
/* FIXME
|
||||
|
@ -547,11 +547,11 @@ static int da7210_probe(struct snd_soc_codec *codec)
|
|||
}
|
||||
|
||||
static struct snd_soc_codec_driver soc_codec_dev_da7210 = {
|
||||
.probe = da7210_probe,
|
||||
.read = da7210_read,
|
||||
.write = da7210_write,
|
||||
.reg_cache_size = ARRAY_SIZE(da7210_reg),
|
||||
.reg_word_size = sizeof(u8),
|
||||
.probe = da7210_probe,
|
||||
.read = da7210_read,
|
||||
.write = da7210_write,
|
||||
.reg_cache_size = ARRAY_SIZE(da7210_reg),
|
||||
.reg_word_size = sizeof(u8),
|
||||
.reg_cache_default = da7210_reg,
|
||||
};
|
||||
|
||||
|
@ -597,9 +597,9 @@ static struct i2c_driver da7210_i2c_driver = {
|
|||
.name = "da7210-codec",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = da7210_i2c_probe,
|
||||
.remove = __devexit_p(da7210_i2c_remove),
|
||||
.id_table = da7210_i2c_id,
|
||||
.probe = da7210_i2c_probe,
|
||||
.remove = __devexit_p(da7210_i2c_remove),
|
||||
.id_table = da7210_i2c_id,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -560,7 +560,6 @@ static int ssm2602_probe(struct snd_soc_codec *codec)
|
|||
|
||||
pr_info("ssm2602 Audio Codec %s", SSM2602_VERSION);
|
||||
|
||||
codec->bias_level = SND_SOC_BIAS_OFF,
|
||||
codec->control_data = ssm2602->control_data;
|
||||
|
||||
ssm2602_reset(codec);
|
||||
|
|
|
@ -1385,7 +1385,6 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
|
|||
|
||||
codec->control_data = dac33->control_data;
|
||||
codec->hw_write = (hw_write_t) i2c_master_send;
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
codec->idle_bias_off = 1;
|
||||
dac33->codec = codec;
|
||||
|
||||
|
|
|
@ -2245,7 +2245,6 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
|
|||
snd_soc_codec_set_drvdata(codec, twl4030);
|
||||
/* Set the defaults, and power up the codec */
|
||||
twl4030->sysclk = twl4030_codec_get_mclk() / 1000;
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
codec->idle_bias_off = 1;
|
||||
|
||||
twl4030_init_chip(codec);
|
||||
|
|
|
@ -569,7 +569,6 @@ static int wm8510_probe(struct snd_soc_codec *codec)
|
|||
wm8510_reset(codec);
|
||||
|
||||
/* power on device */
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
||||
snd_soc_add_controls(codec, wm8510_snd_controls,
|
||||
ARRAY_SIZE(wm8510_snd_controls));
|
||||
|
|
|
@ -907,7 +907,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8580 = {
|
|||
.probe = wm8580_probe,
|
||||
.remove = wm8580_remove,
|
||||
.set_bias_level = wm8580_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8580_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8580_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = &wm8580_reg,
|
||||
};
|
||||
|
|
|
@ -418,7 +418,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8711 = {
|
|||
.suspend = wm8711_suspend,
|
||||
.resume = wm8711_resume,
|
||||
.set_bias_level = wm8711_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8711_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8711_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8711_reg,
|
||||
};
|
||||
|
|
|
@ -272,7 +272,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
|
|||
.suspend = wm8728_suspend,
|
||||
.resume = wm8728_resume,
|
||||
.set_bias_level = wm8728_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8728_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8728_reg_defaults,
|
||||
};
|
||||
|
|
|
@ -488,8 +488,6 @@ static int wm8731_probe(struct snd_soc_codec *codec)
|
|||
struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0, i;
|
||||
|
||||
codec->bias_level = SND_SOC_BIAS_OFF,
|
||||
|
||||
ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8731->control_type);
|
||||
if (ret < 0) {
|
||||
dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
|
||||
|
@ -567,7 +565,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8731 = {
|
|||
.suspend = wm8731_suspend,
|
||||
.resume = wm8731_resume,
|
||||
.set_bias_level = wm8731_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8731_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8731_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8731_reg,
|
||||
};
|
||||
|
|
|
@ -453,7 +453,7 @@ static int wm8741_probe(struct snd_soc_codec *codec)
|
|||
static struct snd_soc_codec_driver soc_codec_dev_wm8741 = {
|
||||
.probe = wm8741_probe,
|
||||
.resume = wm8741_resume,
|
||||
.reg_cache_size = sizeof(wm8741_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = &wm8741_reg_defaults,
|
||||
};
|
||||
|
|
|
@ -747,7 +747,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8750 = {
|
|||
.suspend = wm8750_suspend,
|
||||
.resume = wm8750_resume,
|
||||
.set_bias_level = wm8750_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8750_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8750_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8750_reg,
|
||||
};
|
||||
|
|
|
@ -1550,7 +1550,6 @@ static int wm8753_probe(struct snd_soc_codec *codec)
|
|||
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0, reg;
|
||||
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
|
||||
|
||||
ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8753->control_type);
|
||||
|
@ -1617,7 +1616,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8753 = {
|
|||
.suspend = wm8753_suspend,
|
||||
.resume = wm8753_resume,
|
||||
.set_bias_level = wm8753_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8753_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8753_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8753_reg,
|
||||
};
|
||||
|
|
|
@ -448,7 +448,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8776 = {
|
|||
.suspend = wm8776_suspend,
|
||||
.resume = wm8776_resume,
|
||||
.set_bias_level = wm8776_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8776_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8776_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8776_reg,
|
||||
};
|
||||
|
|
|
@ -1256,7 +1256,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8900 = {
|
|||
.resume = wm8900_resume,
|
||||
.set_bias_level = wm8900_set_bias_level,
|
||||
.volatile_register = wm8900_volatile_register,
|
||||
.reg_cache_size = sizeof(wm8900_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8900_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8900_reg_defaults,
|
||||
};
|
||||
|
|
|
@ -750,7 +750,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8940 = {
|
|||
.suspend = wm8940_suspend,
|
||||
.resume = wm8940_resume,
|
||||
.set_bias_level = wm8940_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8940_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8940_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8940_reg_defaults,
|
||||
};
|
||||
|
|
|
@ -1075,7 +1075,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8961 = {
|
|||
.suspend = wm8961_suspend,
|
||||
.resume = wm8961_resume,
|
||||
.set_bias_level = wm8961_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8961_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8961_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8961_reg_defaults,
|
||||
.volatile_register = wm8961_volatile_register,
|
||||
|
|
|
@ -1780,7 +1780,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8962 = {
|
|||
.remove = wm8962_remove,
|
||||
.resume = wm8962_resume,
|
||||
.set_bias_level = wm8962_set_bias_level,
|
||||
.reg_cache_size = WM8962_MAX_REGISTER,
|
||||
.reg_cache_size = WM8962_MAX_REGISTER + 1,
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8962_reg,
|
||||
.volatile_register = wm8962_volatile_register,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -809,7 +809,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8988 = {
|
|||
.suspend = wm8988_suspend,
|
||||
.resume = wm8988_resume,
|
||||
.set_bias_level = wm8988_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8988_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8988_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8988_reg,
|
||||
};
|
||||
|
|
|
@ -1354,7 +1354,6 @@ static int wm8990_probe(struct snd_soc_codec *codec)
|
|||
wm8990_reset(codec);
|
||||
|
||||
/* charge output caps */
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
wm8990_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
||||
|
||||
reg = snd_soc_read(codec, WM8990_AUDIO_INTERFACE_4);
|
||||
|
|
|
@ -1586,7 +1586,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8993 = {
|
|||
.suspend = wm8993_suspend,
|
||||
.resume = wm8993_resume,
|
||||
.set_bias_level = wm8993_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm8993_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm8993_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm8993_reg_defaults,
|
||||
.volatile_register = wm8993_volatile,
|
||||
|
|
|
@ -1317,7 +1317,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9081 = {
|
|||
.suspend = wm9081_suspend,
|
||||
.resume = wm9081_resume,
|
||||
.set_bias_level = wm9081_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm9081_reg_defaults),
|
||||
.reg_cache_size = ARRAY_SIZE(wm9081_reg_defaults),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_default = wm9081_reg_defaults,
|
||||
.volatile_register = wm9081_volatile_register,
|
||||
|
|
|
@ -385,7 +385,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9705 = {
|
|||
.resume = wm9705_soc_resume,
|
||||
.read = ac97_read,
|
||||
.write = ac97_write,
|
||||
.reg_cache_size = sizeof(wm9705_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm9705_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_step = 2,
|
||||
.reg_cache_default = wm9705_reg,
|
||||
|
|
|
@ -674,7 +674,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9712 = {
|
|||
.read = ac97_read,
|
||||
.write = ac97_write,
|
||||
.set_bias_level = wm9712_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm9712_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm9712_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_step = 2,
|
||||
.reg_cache_default = wm9712_reg,
|
||||
|
|
|
@ -1257,7 +1257,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9713 = {
|
|||
.read = ac97_read,
|
||||
.write = ac97_write,
|
||||
.set_bias_level = wm9713_set_bias_level,
|
||||
.reg_cache_size = sizeof(wm9713_reg),
|
||||
.reg_cache_size = ARRAY_SIZE(wm9713_reg),
|
||||
.reg_word_size = sizeof(u16),
|
||||
.reg_cache_step = 2,
|
||||
.reg_cache_default = wm9713_reg,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* kirkwood-dma.c
|
||||
*
|
||||
* (c) 2010 Arnaud Patard <apatard@mandriva.com>
|
||||
* (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -397,7 +398,7 @@ static void __exit kirkwood_pcm_exit(void)
|
|||
}
|
||||
module_exit(kirkwood_pcm_exit);
|
||||
|
||||
MODULE_AUTHOR("Arnaud Patard <apatard@mandriva.com>");
|
||||
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
|
||||
MODULE_DESCRIPTION("Marvell Kirkwood Audio DMA module");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:kirkwood-pcm-audio");
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* kirkwood-i2s.c
|
||||
*
|
||||
* (c) 2010 Arnaud Patard <apatard@mandriva.com>
|
||||
* (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -495,7 +496,7 @@ static void __exit kirkwood_i2s_exit(void)
|
|||
module_exit(kirkwood_i2s_exit);
|
||||
|
||||
/* Module information */
|
||||
MODULE_AUTHOR("Arnaud Patard, <apatard@mandriva.com>");
|
||||
MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>");
|
||||
MODULE_DESCRIPTION("Kirkwood I2S SoC Interface");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:kirkwood-i2s");
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* kirkwood-openrd.c
|
||||
*
|
||||
* (c) 2010 Arnaud Patard <apatard@mandriva.com>
|
||||
* (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -113,7 +114,7 @@ module_init(openrd_client_init);
|
|||
module_exit(openrd_client_exit);
|
||||
|
||||
/* Module information */
|
||||
MODULE_AUTHOR("Arnaud Patard <apatard@mandriva.com>");
|
||||
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
|
||||
MODULE_DESCRIPTION("ALSA SoC OpenRD Client");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:soc-audio");
|
||||
|
|
|
@ -78,7 +78,7 @@ static void s3c_pcm_snd_txctrl(struct s3c_pcm_info *pcm, int on)
|
|||
ctl |= S3C_PCM_CTL_TXDMA_EN;
|
||||
ctl |= S3C_PCM_CTL_TXFIFO_EN;
|
||||
ctl |= S3C_PCM_CTL_ENABLE;
|
||||
ctl |= (0x20<<S3C_PCM_CTL_TXDIPSTICK_SHIFT);
|
||||
ctl |= (0x4<<S3C_PCM_CTL_TXDIPSTICK_SHIFT);
|
||||
clkctl |= S3C_PCM_CLKCTL_SERCLK_EN;
|
||||
} else {
|
||||
ctl &= ~S3C_PCM_CTL_TXDMA_EN;
|
||||
|
@ -102,11 +102,14 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
|
|||
|
||||
ctl = readl(regs + S3C_PCM_CTL);
|
||||
clkctl = readl(regs + S3C_PCM_CLKCTL);
|
||||
ctl &= ~(S3C_PCM_CTL_RXDIPSTICK_MASK
|
||||
<< S3C_PCM_CTL_RXDIPSTICK_SHIFT);
|
||||
|
||||
if (on) {
|
||||
ctl |= S3C_PCM_CTL_RXDMA_EN;
|
||||
ctl |= S3C_PCM_CTL_RXFIFO_EN;
|
||||
ctl |= S3C_PCM_CTL_ENABLE;
|
||||
ctl |= (0x20<<S3C_PCM_CTL_RXDIPSTICK_SHIFT);
|
||||
clkctl |= S3C_PCM_CLKCTL_SERCLK_EN;
|
||||
} else {
|
||||
ctl &= ~S3C_PCM_CTL_RXDMA_EN;
|
||||
|
@ -361,8 +364,6 @@ static struct snd_soc_dai_ops s3c_pcm_dai_ops = {
|
|||
#define S3C_PCM_RATES SNDRV_PCM_RATE_8000_96000
|
||||
|
||||
#define S3C_PCM_DAI_DECLARE \
|
||||
{ \
|
||||
.name = "samsung-dai", \
|
||||
.symmetric_rates = 1, \
|
||||
.ops = &s3c_pcm_dai_ops, \
|
||||
.playback = { \
|
||||
|
@ -376,12 +377,17 @@ static struct snd_soc_dai_ops s3c_pcm_dai_ops = {
|
|||
.channels_max = 2, \
|
||||
.rates = S3C_PCM_RATES, \
|
||||
.formats = SNDRV_PCM_FMTBIT_S16_LE, \
|
||||
}, \
|
||||
}
|
||||
}
|
||||
|
||||
struct snd_soc_dai_driver s3c_pcm_dai[] = {
|
||||
S3C_PCM_DAI_DECLARE,
|
||||
S3C_PCM_DAI_DECLARE,
|
||||
[0] = {
|
||||
.name = "samsung-pcm.0",
|
||||
S3C_PCM_DAI_DECLARE,
|
||||
},
|
||||
[1] = {
|
||||
.name = "samsung-pcm.1",
|
||||
S3C_PCM_DAI_DECLARE,
|
||||
},
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(s3c_pcm_dai);
|
||||
|
||||
|
@ -465,7 +471,7 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
|
|||
}
|
||||
clk_enable(pcm->pclk);
|
||||
|
||||
ret = snd_soc_register_dai(&pdev->dev, s3c_pcm_dai);
|
||||
ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]);
|
||||
if (ret != 0) {
|
||||
dev_err(&pdev->dev, "failed to get pcm_clock\n");
|
||||
goto err5;
|
||||
|
@ -522,7 +528,7 @@ static struct platform_driver s3c_pcm_driver = {
|
|||
.probe = s3c_pcm_dev_probe,
|
||||
.remove = s3c_pcm_dev_remove,
|
||||
.driver = {
|
||||
.name = "samsung-pcm-audio",
|
||||
.name = "samsung-pcm",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
@ -543,4 +549,4 @@ module_exit(s3c_pcm_exit);
|
|||
MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>");
|
||||
MODULE_DESCRIPTION("S3C PCM Controller Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:samsung-pcm-audio");
|
||||
MODULE_ALIAS("platform:samsung-pcm");
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
/* PCM_CTL Bit-Fields */
|
||||
#define S3C_PCM_CTL_TXDIPSTICK_MASK (0x3f)
|
||||
#define S3C_PCM_CTL_TXDIPSTICK_SHIFT (13)
|
||||
#define S3C_PCM_CTL_RXDIPSTICK_MSK (0x3f<<7)
|
||||
#define S3C_PCM_CTL_RXDIPSTICK_MASK (0x3f)
|
||||
#define S3C_PCM_CTL_RXDIPSTICK_SHIFT (7)
|
||||
#define S3C_PCM_CTL_TXDMA_EN (0x1<<6)
|
||||
#define S3C_PCM_CTL_RXDMA_EN (0x1<<5)
|
||||
#define S3C_PCM_CTL_TXMSB_AFTER_FSYNC (0x1<<4)
|
||||
|
|
|
@ -28,7 +28,7 @@ static struct snd_soc_dai_link smdk2443_dai[] = {
|
|||
{
|
||||
.name = "AC97",
|
||||
.stream_name = "AC97 HiFi",
|
||||
.cpu_dai_name = "s3c-ac97-dai",
|
||||
.cpu_dai_name = "s3c-ac97",
|
||||
.codec_dai_name = "ac97-hifi",
|
||||
.codec_name = "ac97-codec",
|
||||
.platform_name = "s3c24xx-pcm-audio",
|
||||
|
|
|
@ -242,7 +242,7 @@ static struct snd_soc_dai_link smdk64xx_dai[] = {
|
|||
};
|
||||
|
||||
static struct snd_soc_card smdk64xx = {
|
||||
.name = "smdk64xx",
|
||||
.name = "SMDK64xx 5.1",
|
||||
.dai_link = smdk64xx_dai,
|
||||
.num_links = ARRAY_SIZE(smdk64xx_dai),
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ static struct snd_soc_dai_link smdk_dai = {
|
|||
.name = "AC97",
|
||||
.stream_name = "AC97 PCM",
|
||||
.platform_name = "s3c24xx-pcm-audio",
|
||||
.cpu_dai_name = "s3c-ac97-dai",
|
||||
.cpu_dai_name = "s3c-ac97",
|
||||
.codec_dai_name = "wm9713-hifi",
|
||||
.codec_name = "wm9713-codec",
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ config SND_SH7760_AC97
|
|||
AC97 unit of the SH7760.
|
||||
|
||||
config SND_FSI_AK4642
|
||||
bool "FSI-AK4642 sound support"
|
||||
tristate "FSI-AK4642 sound support"
|
||||
depends on SND_SOC_SH4_FSI && I2C_SH_MOBILE
|
||||
select SND_SOC_AK4642
|
||||
help
|
||||
|
@ -55,7 +55,7 @@ config SND_FSI_AK4642
|
|||
FSI - AK4642 unit
|
||||
|
||||
config SND_FSI_DA7210
|
||||
bool "FSI-DA7210 sound support"
|
||||
tristate "FSI-DA7210 sound support"
|
||||
depends on SND_SOC_SH4_FSI && I2C_SH_MOBILE
|
||||
select SND_SOC_DA7210
|
||||
help
|
||||
|
@ -63,7 +63,7 @@ config SND_FSI_DA7210
|
|||
FSI - DA7210 unit
|
||||
|
||||
config SND_FSI_HDMI
|
||||
bool "FSI-HDMI sound support"
|
||||
tristate "FSI-HDMI sound support"
|
||||
depends on SND_SOC_SH4_FSI && FB_SH_MOBILE_HDMI
|
||||
help
|
||||
This option enables generic sound support for the
|
||||
|
|
|
@ -32,7 +32,7 @@ static struct snd_soc_dai_link fsi_dai_link = {
|
|||
.cpu_dai_name = "fsia-dai", /* fsi A */
|
||||
.codec_dai_name = "ak4642-hifi",
|
||||
#ifdef CONFIG_MACH_AP4EVB
|
||||
.platform_name = "sh_fsi2.0",
|
||||
.platform_name = "sh_fsi2",
|
||||
.codec_name = "ak4642-codec.0-0013",
|
||||
#else
|
||||
.platform_name = "sh_fsi.0",
|
||||
|
@ -43,7 +43,7 @@ static struct snd_soc_dai_link fsi_dai_link = {
|
|||
};
|
||||
|
||||
static struct snd_soc_card fsi_soc_card = {
|
||||
.name = "FSI",
|
||||
.name = "FSI (AK4642)",
|
||||
.dai_link = &fsi_dai_link,
|
||||
.num_links = 1,
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ static struct snd_soc_dai_link fsi_da7210_dai = {
|
|||
};
|
||||
|
||||
static struct snd_soc_card fsi_soc_card = {
|
||||
.name = "FSI",
|
||||
.name = "FSI (DA7210)",
|
||||
.dai_link = &fsi_da7210_dai,
|
||||
.num_links = 1,
|
||||
};
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/platform_device.h>
|
||||
#include <sound/sh_fsi.h>
|
||||
#include <video/sh_mobile_hdmi.h>
|
||||
|
||||
static struct snd_soc_dai_link fsi_dai_link = {
|
||||
.name = "HDMI",
|
||||
|
@ -23,7 +22,7 @@ static struct snd_soc_dai_link fsi_dai_link = {
|
|||
};
|
||||
|
||||
static struct snd_soc_card fsi_soc_card = {
|
||||
.name = "FSI",
|
||||
.name = "FSI (SH MOBILE HDMI)",
|
||||
.dai_link = &fsi_dai_link,
|
||||
.num_links = 1,
|
||||
};
|
||||
|
|
|
@ -101,13 +101,10 @@
|
|||
|
||||
#define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* struct
|
||||
*/
|
||||
|
||||
|
||||
struct
|
||||
|
||||
|
||||
************************************************************************/
|
||||
struct fsi_priv {
|
||||
void __iomem *base;
|
||||
struct snd_pcm_substream *substream;
|
||||
|
@ -142,13 +139,10 @@ struct fsi_master {
|
|||
spinlock_t lock;
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* basic read write function
|
||||
*/
|
||||
|
||||
|
||||
basic read write function
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static void __fsi_reg_write(u32 reg, u32 data)
|
||||
{
|
||||
/* valid data area is 24bit */
|
||||
|
@ -251,13 +245,10 @@ static void fsi_master_mask_set(struct fsi_master *master,
|
|||
spin_unlock_irqrestore(&master->lock, flags);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* basic function
|
||||
*/
|
||||
|
||||
|
||||
basic function
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static struct fsi_master *fsi_get_master(struct fsi_priv *fsi)
|
||||
{
|
||||
return fsi->master;
|
||||
|
@ -357,13 +348,63 @@ static int fsi_get_fifo_residue(struct fsi_priv *fsi, int is_play)
|
|||
return residue;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* dma function
|
||||
*/
|
||||
|
||||
static u8 *fsi_dma_get_area(struct fsi_priv *fsi)
|
||||
{
|
||||
return fsi->substream->runtime->dma_area + fsi->byte_offset;
|
||||
}
|
||||
|
||||
irq function
|
||||
static void fsi_dma_soft_push16(struct fsi_priv *fsi, int size)
|
||||
{
|
||||
u16 *start;
|
||||
int i;
|
||||
|
||||
start = (u16 *)fsi_dma_get_area(fsi);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
fsi_reg_write(fsi, DODT, ((u32)*(start + i) << 8));
|
||||
}
|
||||
|
||||
static void fsi_dma_soft_pop16(struct fsi_priv *fsi, int size)
|
||||
{
|
||||
u16 *start;
|
||||
int i;
|
||||
|
||||
start = (u16 *)fsi_dma_get_area(fsi);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
*(start + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
|
||||
}
|
||||
|
||||
static void fsi_dma_soft_push32(struct fsi_priv *fsi, int size)
|
||||
{
|
||||
u32 *start;
|
||||
int i;
|
||||
|
||||
start = (u32 *)fsi_dma_get_area(fsi);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
fsi_reg_write(fsi, DODT, *(start + i));
|
||||
}
|
||||
|
||||
static void fsi_dma_soft_pop32(struct fsi_priv *fsi, int size)
|
||||
{
|
||||
u32 *start;
|
||||
int i;
|
||||
|
||||
start = (u32 *)fsi_dma_get_area(fsi);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
*(start + i) = fsi_reg_read(fsi, DIDT);
|
||||
}
|
||||
|
||||
/*
|
||||
* irq function
|
||||
*/
|
||||
|
||||
************************************************************************/
|
||||
static void fsi_irq_enable(struct fsi_priv *fsi, int is_play)
|
||||
{
|
||||
u32 data = fsi_port_ab_io_bit(fsi, is_play);
|
||||
|
@ -404,13 +445,11 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi)
|
|||
fsi_master_mask_set(master, master->core->int_st, data, 0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
|
||||
SPDIF master clock function
|
||||
|
||||
These functions are used later FSI2
|
||||
************************************************************************/
|
||||
/*
|
||||
* SPDIF master clock function
|
||||
*
|
||||
* These functions are used later FSI2
|
||||
*/
|
||||
static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
|
||||
{
|
||||
struct fsi_master *master = fsi_get_master(fsi);
|
||||
|
@ -427,13 +466,10 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
|
|||
fsi_master_mask_set(master, fsi->mst_ctrl, val, 0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* ctrl function
|
||||
*/
|
||||
|
||||
|
||||
ctrl function
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable)
|
||||
{
|
||||
u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4);
|
||||
|
@ -512,8 +548,7 @@ static int fsi_data_push(struct fsi_priv *fsi, int startup)
|
|||
int send;
|
||||
int fifo_free;
|
||||
int width;
|
||||
u8 *start;
|
||||
int i, over_period;
|
||||
int over_period;
|
||||
|
||||
if (!fsi ||
|
||||
!fsi->substream ||
|
||||
|
@ -550,18 +585,12 @@ static int fsi_data_push(struct fsi_priv *fsi, int startup)
|
|||
if (fifo_free < send)
|
||||
send = fifo_free;
|
||||
|
||||
start = runtime->dma_area;
|
||||
start += fsi->byte_offset;
|
||||
|
||||
switch (width) {
|
||||
case 2:
|
||||
for (i = 0; i < send; i++)
|
||||
fsi_reg_write(fsi, DODT,
|
||||
((u32)*((u16 *)start + i) << 8));
|
||||
fsi_dma_soft_push16(fsi, send);
|
||||
break;
|
||||
case 4:
|
||||
for (i = 0; i < send; i++)
|
||||
fsi_reg_write(fsi, DODT, *((u32 *)start + i));
|
||||
fsi_dma_soft_push32(fsi, send);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
@ -596,8 +625,7 @@ static int fsi_data_pop(struct fsi_priv *fsi, int startup)
|
|||
int free;
|
||||
int fifo_fill;
|
||||
int width;
|
||||
u8 *start;
|
||||
int i, over_period;
|
||||
int over_period;
|
||||
|
||||
if (!fsi ||
|
||||
!fsi->substream ||
|
||||
|
@ -633,18 +661,12 @@ static int fsi_data_pop(struct fsi_priv *fsi, int startup)
|
|||
if (free < fifo_fill)
|
||||
fifo_fill = free;
|
||||
|
||||
start = runtime->dma_area;
|
||||
start += fsi->byte_offset;
|
||||
|
||||
switch (width) {
|
||||
case 2:
|
||||
for (i = 0; i < fifo_fill; i++)
|
||||
*((u16 *)start + i) =
|
||||
(u16)(fsi_reg_read(fsi, DIDT) >> 8);
|
||||
fsi_dma_soft_pop16(fsi, fifo_fill);
|
||||
break;
|
||||
case 4:
|
||||
for (i = 0; i < fifo_fill; i++)
|
||||
*((u32 *)start + i) = fsi_reg_read(fsi, DIDT);
|
||||
fsi_dma_soft_pop32(fsi, fifo_fill);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
@ -694,13 +716,10 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* dai ops
|
||||
*/
|
||||
|
||||
|
||||
dai ops
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static int fsi_dai_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
|
@ -919,13 +938,10 @@ static struct snd_soc_dai_ops fsi_dai_ops = {
|
|||
.hw_params = fsi_dai_hw_params,
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* pcm ops
|
||||
*/
|
||||
|
||||
|
||||
pcm ops
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static struct snd_pcm_hardware fsi_pcm_hardware = {
|
||||
.info = SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_MMAP |
|
||||
|
@ -991,13 +1007,10 @@ static struct snd_pcm_ops fsi_pcm_ops = {
|
|||
.pointer = fsi_pointer,
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* snd_soc_platform
|
||||
*/
|
||||
|
||||
|
||||
snd_soc_platform
|
||||
|
||||
|
||||
************************************************************************/
|
||||
#define PREALLOC_BUFFER (32 * 1024)
|
||||
#define PREALLOC_BUFFER_MAX (32 * 1024)
|
||||
|
||||
|
@ -1021,13 +1034,10 @@ static int fsi_pcm_new(struct snd_card *card,
|
|||
PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* alsa struct
|
||||
*/
|
||||
|
||||
|
||||
alsa struct
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static struct snd_soc_dai_driver fsi_soc_dai[] = {
|
||||
{
|
||||
.name = "fsia-dai",
|
||||
|
@ -1069,13 +1079,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
|
|||
.pcm_free = fsi_pcm_free,
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
/*
|
||||
* platform function
|
||||
*/
|
||||
|
||||
|
||||
platform function
|
||||
|
||||
|
||||
************************************************************************/
|
||||
static int fsi_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct fsi_master *master;
|
||||
|
@ -1219,6 +1226,7 @@ static struct platform_device_id fsi_id_table[] = {
|
|||
{ "sh_fsi", (kernel_ulong_t)&fsi1_core },
|
||||
{ "sh_fsi2", (kernel_ulong_t)&fsi2_core },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(platform, fsi_id_table);
|
||||
|
||||
static struct platform_driver fsi_driver = {
|
||||
.driver = {
|
||||
|
@ -1239,6 +1247,7 @@ static void __exit fsi_mobile_exit(void)
|
|||
{
|
||||
platform_driver_unregister(&fsi_driver);
|
||||
}
|
||||
|
||||
module_init(fsi_mobile_init);
|
||||
module_exit(fsi_mobile_exit);
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/firmware.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/clkdev.h>
|
||||
#include <asm/clock.h>
|
||||
|
||||
#include <cpu/sh7722.h>
|
||||
|
@ -40,12 +41,12 @@ static struct clk_ops siumckb_clk_ops = {
|
|||
};
|
||||
|
||||
static struct clk siumckb_clk = {
|
||||
.name = "siumckb_clk",
|
||||
.id = -1,
|
||||
.ops = &siumckb_clk_ops,
|
||||
.rate = 0, /* initialised at run-time */
|
||||
};
|
||||
|
||||
static struct clk_lookup *siumckb_lookup;
|
||||
|
||||
static int migor_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
|
@ -177,6 +178,13 @@ static int __init migor_init(void)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL);
|
||||
if (!siumckb_lookup) {
|
||||
ret = -ENOMEM;
|
||||
goto eclkdevalloc;
|
||||
}
|
||||
clkdev_add(siumckb_lookup);
|
||||
|
||||
/* Port number used on this machine: port B */
|
||||
migor_snd_device = platform_device_alloc("soc-audio", 1);
|
||||
if (!migor_snd_device) {
|
||||
|
@ -195,12 +203,15 @@ static int __init migor_init(void)
|
|||
epdevadd:
|
||||
platform_device_put(migor_snd_device);
|
||||
epdevalloc:
|
||||
clkdev_drop(siumckb_lookup);
|
||||
eclkdevalloc:
|
||||
clk_unregister(&siumckb_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit migor_exit(void)
|
||||
{
|
||||
clkdev_drop(siumckb_lookup);
|
||||
clk_unregister(&siumckb_clk);
|
||||
platform_device_unregister(migor_snd_device);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,9 @@ enum {
|
|||
SIU_CLKB_EXT
|
||||
};
|
||||
|
||||
struct device;
|
||||
struct siu_info {
|
||||
struct device *dev;
|
||||
int port_id;
|
||||
u32 __iomem *pram;
|
||||
u32 __iomem *xram;
|
||||
|
@ -182,7 +184,6 @@ static inline u32 siu_read32(u32 __iomem *addr)
|
|||
#define SIU_BRRB (0x10c / sizeof(u32))
|
||||
|
||||
extern struct snd_soc_platform_driver siu_platform;
|
||||
extern struct snd_soc_dai_driver siu_i2s_dai;
|
||||
extern struct siu_info *siu_i2s_data;
|
||||
|
||||
int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card);
|
||||
|
|
|
@ -71,8 +71,7 @@ struct port_flag {
|
|||
struct format_flag capture;
|
||||
};
|
||||
|
||||
struct siu_info *siu_i2s_data = NULL;
|
||||
EXPORT_SYMBOL_GPL(siu_i2s_data);
|
||||
struct siu_info *siu_i2s_data;
|
||||
|
||||
static struct port_flag siu_flags[SIU_PORT_NUM] = {
|
||||
[SIU_PORT_A] = {
|
||||
|
@ -113,7 +112,7 @@ static void siu_dai_start(struct siu_port *port_info)
|
|||
dev_dbg(port_info->pcm->card->dev, "%s\n", __func__);
|
||||
|
||||
/* Turn on SIU clock */
|
||||
pm_runtime_get_sync(port_info->pcm->card->dev);
|
||||
pm_runtime_get_sync(info->dev);
|
||||
|
||||
/* Issue software reset to siu */
|
||||
siu_write32(base + SIU_SRCTL, 0);
|
||||
|
@ -160,7 +159,7 @@ static void siu_dai_stop(struct siu_port *port_info)
|
|||
siu_write32(base + SIU_SRCTL, 0);
|
||||
|
||||
/* Turn off SIU clock */
|
||||
pm_runtime_put_sync(port_info->pcm->card->dev);
|
||||
pm_runtime_put_sync(info->dev);
|
||||
}
|
||||
|
||||
static void siu_dai_spbAselect(struct siu_port *port_info)
|
||||
|
@ -675,20 +674,36 @@ static int siu_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
|
|||
}
|
||||
|
||||
siu_clk = clk_get(dai->dev, siu_name);
|
||||
if (IS_ERR(siu_clk))
|
||||
if (IS_ERR(siu_clk)) {
|
||||
dev_err(dai->dev, "%s: cannot get a SIU clock: %ld\n", __func__,
|
||||
PTR_ERR(siu_clk));
|
||||
return PTR_ERR(siu_clk);
|
||||
|
||||
parent_clk = clk_get(dai->dev, parent_name);
|
||||
if (!IS_ERR(parent_clk)) {
|
||||
ret = clk_set_parent(siu_clk, parent_clk);
|
||||
if (!ret)
|
||||
clk_set_rate(siu_clk, freq);
|
||||
clk_put(parent_clk);
|
||||
}
|
||||
|
||||
parent_clk = clk_get(dai->dev, parent_name);
|
||||
if (IS_ERR(parent_clk)) {
|
||||
ret = PTR_ERR(parent_clk);
|
||||
dev_err(dai->dev, "cannot get a SIU clock parent: %d\n", ret);
|
||||
goto epclkget;
|
||||
}
|
||||
|
||||
ret = clk_set_parent(siu_clk, parent_clk);
|
||||
if (ret < 0) {
|
||||
dev_err(dai->dev, "cannot reparent the SIU clock: %d\n", ret);
|
||||
goto eclksetp;
|
||||
}
|
||||
|
||||
ret = clk_set_rate(siu_clk, freq);
|
||||
if (ret < 0)
|
||||
dev_err(dai->dev, "cannot set SIU clock rate: %d\n", ret);
|
||||
|
||||
/* TODO: when clkdev gets reference counting we'll move these to siu_dai_shutdown() */
|
||||
eclksetp:
|
||||
clk_put(parent_clk);
|
||||
epclkget:
|
||||
clk_put(siu_clk);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct snd_soc_dai_ops siu_dai_ops = {
|
||||
|
@ -700,7 +715,7 @@ static struct snd_soc_dai_ops siu_dai_ops = {
|
|||
};
|
||||
|
||||
static struct snd_soc_dai_driver siu_i2s_dai = {
|
||||
.name = "sui-i2s-dai",
|
||||
.name = "siu-i2s-dai",
|
||||
.playback = {
|
||||
.channels_min = 2,
|
||||
.channels_max = 2,
|
||||
|
@ -727,6 +742,7 @@ static int __devinit siu_probe(struct platform_device *pdev)
|
|||
if (!info)
|
||||
return -ENOMEM;
|
||||
siu_i2s_data = info;
|
||||
info->dev = &pdev->dev;
|
||||
|
||||
ret = request_firmware(&fw_entry, "siu_spb.bin", &pdev->dev);
|
||||
if (ret)
|
||||
|
@ -828,6 +844,7 @@ static int __devexit siu_remove(struct platform_device *pdev)
|
|||
|
||||
static struct platform_driver siu_driver = {
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "siu-pcm-audio",
|
||||
},
|
||||
.probe = siu_probe,
|
||||
|
|
|
@ -341,7 +341,7 @@ static int siu_pcm_open(struct snd_pcm_substream *ss)
|
|||
{
|
||||
/* Playback / Capture */
|
||||
struct snd_soc_pcm_runtime *rtd = ss->private_data;
|
||||
struct siu_platform *pdata = snd_soc_platform_get_drvdata(rtd->platform);
|
||||
struct siu_platform *pdata = rtd->platform->dev->platform_data;
|
||||
struct siu_info *info = siu_i2s_data;
|
||||
struct siu_port *port_info = siu_port_info(ss);
|
||||
struct siu_stream *siu_stream;
|
||||
|
|
|
@ -270,6 +270,87 @@ static void soc_cleanup_codec_debugfs(struct snd_soc_codec *codec)
|
|||
debugfs_remove_recursive(codec->debugfs_codec_root);
|
||||
}
|
||||
|
||||
static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
ssize_t ret = 0;
|
||||
struct snd_soc_codec *codec;
|
||||
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
list_for_each_entry(codec, &codec_list, list)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
|
||||
codec->name);
|
||||
|
||||
if (ret >= 0)
|
||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
||||
|
||||
kfree(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations codec_list_fops = {
|
||||
.read = codec_list_read_file,
|
||||
.llseek = default_llseek,/* read accesses f_pos */
|
||||
};
|
||||
|
||||
static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
ssize_t ret = 0;
|
||||
struct snd_soc_dai *dai;
|
||||
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
list_for_each_entry(dai, &dai_list, list)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%s\n", dai->name);
|
||||
|
||||
if (ret >= 0)
|
||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
||||
|
||||
kfree(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations dai_list_fops = {
|
||||
.read = dai_list_read_file,
|
||||
.llseek = default_llseek,/* read accesses f_pos */
|
||||
};
|
||||
|
||||
static ssize_t platform_list_read_file(struct file *file,
|
||||
char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
ssize_t ret = 0;
|
||||
struct snd_soc_platform *platform;
|
||||
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
list_for_each_entry(platform, &platform_list, list)
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
|
||||
platform->name);
|
||||
|
||||
if (ret >= 0)
|
||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
||||
|
||||
kfree(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations platform_list_fops = {
|
||||
.read = platform_list_read_file,
|
||||
.llseek = default_llseek,/* read accesses f_pos */
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
static inline void soc_init_codec_debugfs(struct snd_soc_codec *codec)
|
||||
|
@ -3191,6 +3272,18 @@ static int __init snd_soc_init(void)
|
|||
"ASoC: Failed to create debugfs directory\n");
|
||||
debugfs_root = NULL;
|
||||
}
|
||||
|
||||
if (!debugfs_create_file("codecs", 0444, debugfs_root, NULL,
|
||||
&codec_list_fops))
|
||||
pr_warn("ASoC: Failed to create CODEC list debugfs file\n");
|
||||
|
||||
if (!debugfs_create_file("dais", 0444, debugfs_root, NULL,
|
||||
&dai_list_fops))
|
||||
pr_warn("ASoC: Failed to create DAI list debugfs file\n");
|
||||
|
||||
if (!debugfs_create_file("platforms", 0444, debugfs_root, NULL,
|
||||
&platform_list_fops))
|
||||
pr_warn("ASoC: Failed to create platform list debugfs file\n");
|
||||
#endif
|
||||
|
||||
return platform_driver_register(&soc_driver);
|
||||
|
|
Loading…
Reference in New Issue