mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct device in the CODEC to provide diagnostics via a sysfs class rather than via the device tree, at which point it's much better to use the struct device private data rather than having two places to store it. Provide an accessor function to allow this change to be made more easily, and update all the CODEC drivers are updated. To ensure use of the accessor the private data structure member is renamed, meaning that if code developed with older an older core that still uses private_data is merged it will fail to build. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
@@ -414,7 +414,7 @@ struct snd_soc_codec {
|
||||
struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
|
||||
unsigned int active;
|
||||
unsigned int pcm_devs;
|
||||
void *private_data;
|
||||
void *drvdata;
|
||||
|
||||
/* codec IO */
|
||||
void *control_data; /* codec control (i2c/3wire) data */
|
||||
@@ -597,6 +597,17 @@ static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
|
||||
return codec->write(codec, reg, val);
|
||||
}
|
||||
|
||||
static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
|
||||
void *data)
|
||||
{
|
||||
codec->drvdata = data;
|
||||
}
|
||||
|
||||
static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
|
||||
{
|
||||
return codec->drvdata;
|
||||
}
|
||||
|
||||
#include <sound/soc-dai.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -277,7 +277,7 @@ static int ad1836_register(struct ad1836_priv *ad1836)
|
||||
mutex_init(&codec->mutex);
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
codec->private_data = ad1836;
|
||||
snd_soc_codec_set_drvdata(codec, ad1836);
|
||||
codec->reg_cache = ad1836->reg_cache;
|
||||
codec->reg_cache_size = AD1836_NUM_REGS;
|
||||
codec->name = "AD1836";
|
||||
|
||||
@@ -305,7 +305,7 @@ static int ad193x_bus_probe(struct device *dev, void *ctrl_data, int bus_type)
|
||||
mutex_init(&codec->mutex);
|
||||
codec->control_data = ctrl_data;
|
||||
codec->dev = dev;
|
||||
codec->private_data = ad193x;
|
||||
snd_soc_codec_set_drvdata(codec, ad193x);
|
||||
codec->reg_cache = ad193x->reg_cache;
|
||||
codec->reg_cache_size = AD193X_NUM_REGS;
|
||||
codec->name = "AD193X";
|
||||
|
||||
@@ -221,7 +221,7 @@ static int ak4104_spi_probe(struct spi_device *spi)
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->dai = &ak4104_dai;
|
||||
codec->num_dai = 1;
|
||||
codec->private_data = ak4104;
|
||||
snd_soc_codec_set_drvdata(codec, ak4104);
|
||||
codec->control_data = spi;
|
||||
codec->reg_cache = ak4104->reg_cache;
|
||||
codec->reg_cache_size = AK4104_NUM_REGS;
|
||||
|
||||
@@ -301,7 +301,7 @@ static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct ak4535_priv *ak4535 = codec->private_data;
|
||||
struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
ak4535->sysclk = freq;
|
||||
return 0;
|
||||
@@ -314,7 +314,7 @@ static int ak4535_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct ak4535_priv *ak4535 = codec->private_data;
|
||||
struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 mode2 = ak4535_read_reg_cache(codec, AK4535_MODE2) & ~(0x3 << 5);
|
||||
int rate = params_rate(params), fs = 256;
|
||||
|
||||
@@ -599,7 +599,7 @@ static int ak4535_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
codec->private_data = ak4535;
|
||||
snd_soc_codec_set_drvdata(codec, ak4535);
|
||||
socdev->card->codec = codec;
|
||||
mutex_init(&codec->mutex);
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
@@ -616,7 +616,7 @@ static int ak4535_probe(struct platform_device *pdev)
|
||||
#endif
|
||||
|
||||
if (ret != 0) {
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
kfree(codec);
|
||||
}
|
||||
return ret;
|
||||
@@ -638,7 +638,7 @@ static int ak4535_remove(struct platform_device *pdev)
|
||||
i2c_unregister_device(codec->control_data);
|
||||
i2c_del_driver(&ak4535_i2c_driver);
|
||||
#endif
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
kfree(codec);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -431,7 +431,7 @@ static int ak4642_init(struct ak4642_priv *ak4642)
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
|
||||
codec->private_data = ak4642;
|
||||
snd_soc_codec_set_drvdata(codec, ak4642);
|
||||
codec->name = "AK4642";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->read = ak4642_read_reg_cache;
|
||||
|
||||
@@ -701,7 +701,7 @@ static int ak4671_register(struct ak4671_priv *ak4671,
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
|
||||
codec->private_data = ak4671;
|
||||
snd_soc_codec_set_drvdata(codec, ak4671);
|
||||
codec->name = "AK4671";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
|
||||
@@ -210,7 +210,7 @@ static int cs4270_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
unsigned int rates = 0;
|
||||
unsigned int rate_min = -1;
|
||||
unsigned int rate_max = 0;
|
||||
@@ -269,7 +269,7 @@ static int cs4270_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
unsigned int format)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
/* set DAI format */
|
||||
@@ -411,7 +411,7 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret;
|
||||
unsigned int i;
|
||||
unsigned int rate;
|
||||
@@ -490,7 +490,7 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
|
||||
static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute)
|
||||
{
|
||||
struct snd_soc_codec *codec = dai->codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int reg6;
|
||||
|
||||
reg6 = snd_soc_read(codec, CS4270_MUTE);
|
||||
@@ -523,7 +523,7 @@ static int cs4270_soc_put_mute(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int left = !ucontrol->value.integer.value[0];
|
||||
int right = !ucontrol->value.integer.value[1];
|
||||
|
||||
@@ -599,7 +599,7 @@ static int cs4270_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
struct snd_soc_codec *codec = cs4270_codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int i, ret;
|
||||
|
||||
/* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */
|
||||
@@ -656,7 +656,7 @@ static int cs4270_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
struct snd_soc_codec *codec = cs4270_codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
snd_soc_free_pcms(socdev);
|
||||
regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies), cs4270->supplies);
|
||||
@@ -729,7 +729,7 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->dai = &cs4270_dai;
|
||||
codec->num_dai = 1;
|
||||
codec->private_data = cs4270;
|
||||
snd_soc_codec_set_drvdata(codec, cs4270);
|
||||
codec->control_data = i2c_client;
|
||||
codec->read = cs4270_read_reg_cache;
|
||||
codec->write = cs4270_i2c_write;
|
||||
@@ -842,7 +842,7 @@ MODULE_DEVICE_TABLE(i2c, cs4270_id);
|
||||
static int cs4270_soc_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
{
|
||||
struct snd_soc_codec *codec = cs4270_codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
int reg, ret;
|
||||
|
||||
reg = snd_soc_read(codec, CS4270_PWRCTL) | CS4270_PWRCTL_PDN_ALL;
|
||||
@@ -862,7 +862,7 @@ static int cs4270_soc_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
static int cs4270_soc_resume(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_codec *codec = cs4270_codec;
|
||||
struct cs4270_private *cs4270 = codec->private_data;
|
||||
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
|
||||
struct i2c_client *i2c_client = codec->control_data;
|
||||
int reg;
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ static int cx20442_register(struct cx20442_priv *cx20442)
|
||||
|
||||
codec->name = "CX20442";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->private_data = cx20442;
|
||||
snd_soc_codec_set_drvdata(codec, cx20442);
|
||||
|
||||
codec->dai = &cx20442_dai;
|
||||
codec->num_dai = 1;
|
||||
|
||||
@@ -460,7 +460,7 @@ static int da7210_init(struct da7210_priv *da7210)
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
|
||||
codec->private_data = da7210;
|
||||
snd_soc_codec_set_drvdata(codec, da7210);
|
||||
codec->name = "DA7210";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->read = da7210_read;
|
||||
|
||||
@@ -277,7 +277,7 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct ssm2602_priv *ssm2602 = codec->private_data;
|
||||
struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
|
||||
struct i2c_client *i2c = codec->control_data;
|
||||
u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3;
|
||||
int i = get_coeff(ssm2602->sysclk, params_rate(params));
|
||||
@@ -322,7 +322,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct ssm2602_priv *ssm2602 = codec->private_data;
|
||||
struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
|
||||
struct i2c_client *i2c = codec->control_data;
|
||||
struct snd_pcm_runtime *master_runtime;
|
||||
|
||||
@@ -373,7 +373,7 @@ static void ssm2602_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct ssm2602_priv *ssm2602 = codec->private_data;
|
||||
struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
/* deactivate */
|
||||
if (!codec->active)
|
||||
@@ -401,7 +401,7 @@ static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct ssm2602_priv *ssm2602 = codec->private_data;
|
||||
struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
|
||||
switch (freq) {
|
||||
case 11289600:
|
||||
case 12000000:
|
||||
@@ -726,7 +726,7 @@ static int ssm2602_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
codec->private_data = ssm2602;
|
||||
snd_soc_codec_set_drvdata(codec, ssm2602);
|
||||
socdev->card->codec = codec;
|
||||
mutex_init(&codec->mutex);
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
@@ -759,7 +759,7 @@ static int ssm2602_remove(struct platform_device *pdev)
|
||||
i2c_unregister_device(codec->control_data);
|
||||
i2c_del_driver(&ssm2602_i2c_driver);
|
||||
#endif
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
kfree(codec);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -409,7 +409,7 @@ reset_err:
|
||||
pcm_err:
|
||||
snd_soc_free_ac97_codec(codec);
|
||||
codec_err:
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
cache_err:
|
||||
kfree(socdev->card->codec);
|
||||
socdev->card->codec = NULL;
|
||||
|
||||
@@ -763,7 +763,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct aic3x_priv *aic3x = codec->private_data;
|
||||
struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
|
||||
int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0;
|
||||
u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1;
|
||||
u16 d, pll_d = 1;
|
||||
@@ -930,7 +930,7 @@ static int aic3x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct aic3x_priv *aic3x = codec->private_data;
|
||||
struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
aic3x->sysclk = freq;
|
||||
return 0;
|
||||
@@ -940,7 +940,7 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
unsigned int fmt)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct aic3x_priv *aic3x = codec->private_data;
|
||||
struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
|
||||
u8 iface_areg, iface_breg;
|
||||
int delay = 0;
|
||||
|
||||
@@ -994,7 +994,7 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
static int aic3x_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
struct aic3x_priv *aic3x = codec->private_data;
|
||||
struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
|
||||
u8 reg;
|
||||
|
||||
switch (level) {
|
||||
@@ -1338,7 +1338,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
|
||||
|
||||
codec = &aic3x->codec;
|
||||
codec->dev = &i2c->dev;
|
||||
codec->private_data = aic3x;
|
||||
snd_soc_codec_set_drvdata(codec, aic3x);
|
||||
codec->control_data = i2c;
|
||||
codec->hw_write = (hw_write_t) i2c_master_send;
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ static inline void dac33_write_reg_cache(struct snd_soc_codec *codec,
|
||||
static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
|
||||
u8 *value)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int val;
|
||||
|
||||
*value = reg & 0xff;
|
||||
@@ -192,7 +192,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
|
||||
static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
unsigned int value)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 data[2];
|
||||
int ret = 0;
|
||||
|
||||
@@ -219,7 +219,7 @@ static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
static int dac33_write_locked(struct snd_soc_codec *codec, unsigned int reg,
|
||||
unsigned int value)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&dac33->mutex);
|
||||
@@ -233,7 +233,7 @@ static int dac33_write_locked(struct snd_soc_codec *codec, unsigned int reg,
|
||||
static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg,
|
||||
unsigned int value)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 data[3];
|
||||
int ret = 0;
|
||||
|
||||
@@ -265,7 +265,7 @@ static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg,
|
||||
|
||||
static void dac33_restore_regs(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 *cache = codec->reg_cache;
|
||||
u8 data[2];
|
||||
int i, ret;
|
||||
@@ -319,7 +319,7 @@ static inline void dac33_soft_power(struct snd_soc_codec *codec, int power)
|
||||
|
||||
static int dac33_hard_power(struct snd_soc_codec *codec, int power)
|
||||
{
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&dac33->mutex);
|
||||
@@ -366,7 +366,7 @@ static int dac33_get_nsample(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
ucontrol->value.integer.value[0] = dac33->nsample;
|
||||
|
||||
@@ -377,7 +377,7 @@ static int dac33_set_nsample(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
if (dac33->nsample == ucontrol->value.integer.value[0])
|
||||
@@ -396,7 +396,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
ucontrol->value.integer.value[0] = dac33->fifo_mode;
|
||||
|
||||
@@ -407,7 +407,7 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
if (dac33->fifo_mode == ucontrol->value.integer.value[0])
|
||||
@@ -630,7 +630,7 @@ static void dac33_work(struct work_struct *work)
|
||||
static irqreturn_t dac33_interrupt_handler(int irq, void *dev)
|
||||
{
|
||||
struct snd_soc_codec *codec = dev;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
queue_work(dac33->dac33_wq, &dac33->work);
|
||||
|
||||
@@ -697,7 +697,7 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
unsigned int oscset, ratioset, pwr_ctrl, reg_tmp;
|
||||
u8 aictrl_a, aictrl_b, fifoctrl_a;
|
||||
|
||||
@@ -883,7 +883,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
unsigned int nsample_limit;
|
||||
|
||||
/* Number of samples (16bit, stereo) in one period */
|
||||
@@ -936,7 +936,7 @@ static int dac33_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
switch (cmd) {
|
||||
@@ -967,7 +967,7 @@ static int dac33_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 ioc_reg, asrcb_reg;
|
||||
|
||||
ioc_reg = dac33_read_reg_cache(codec, DAC33_INT_OSC_CTRL);
|
||||
@@ -997,7 +997,7 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
unsigned int fmt)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct tlv320dac33_priv *dac33 = codec->private_data;
|
||||
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 aictrl_a, aictrl_b;
|
||||
|
||||
aictrl_a = dac33_read_reg_cache(codec, DAC33_SER_AUDIOIF_CTRL_A);
|
||||
@@ -1088,7 +1088,7 @@ static int dac33_soc_probe(struct platform_device *pdev)
|
||||
|
||||
codec = tlv320dac33_codec;
|
||||
socdev->card->codec = codec;
|
||||
dac33 = codec->private_data;
|
||||
dac33 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
/* Power up the codec */
|
||||
dac33_hard_power(codec, 1);
|
||||
@@ -1209,7 +1209,7 @@ static int __devinit dac33_i2c_probe(struct i2c_client *client,
|
||||
return -ENOMEM;
|
||||
|
||||
codec = &dac33->codec;
|
||||
codec->private_data = dac33;
|
||||
snd_soc_codec_set_drvdata(codec, dac33);
|
||||
codec->control_data = client;
|
||||
|
||||
mutex_init(&codec->mutex);
|
||||
|
||||
@@ -175,7 +175,7 @@ static inline void twl4030_write_reg_cache(struct snd_soc_codec *codec,
|
||||
static int twl4030_write(struct snd_soc_codec *codec,
|
||||
unsigned int reg, unsigned int value)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
int write_to_reg = 0;
|
||||
|
||||
twl4030_write_reg_cache(codec, reg, value);
|
||||
@@ -220,7 +220,7 @@ static int twl4030_write(struct snd_soc_codec *codec,
|
||||
|
||||
static void twl4030_codec_enable(struct snd_soc_codec *codec, int enable)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
int mode;
|
||||
|
||||
if (enable == twl4030->codec_powered)
|
||||
@@ -258,7 +258,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
|
||||
|
||||
static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
int status;
|
||||
|
||||
if (enable == twl4030->apll_enabled)
|
||||
@@ -279,7 +279,7 @@ static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
|
||||
|
||||
static void twl4030_power_up(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 anamicl, regmisc1, byte;
|
||||
int i = 0;
|
||||
|
||||
@@ -570,7 +570,7 @@ static int micpath_event(struct snd_soc_dapm_widget *w,
|
||||
static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \
|
||||
struct snd_kcontrol *kcontrol, int event) \
|
||||
{ \
|
||||
struct twl4030_priv *twl4030 = w->codec->private_data; \
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); \
|
||||
\
|
||||
switch (event) { \
|
||||
case SND_SOC_DAPM_POST_PMU: \
|
||||
@@ -678,7 +678,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp)
|
||||
struct twl4030_setup_data *setup = socdev->codec_data;
|
||||
|
||||
unsigned char hs_gain, hs_pop;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
/* Base values for ramp delay calculation: 2^19 - 2^26 */
|
||||
unsigned int ramp_base[] = {524288, 1048576, 2097152, 4194304,
|
||||
8388608, 16777216, 33554432, 67108864};
|
||||
@@ -741,7 +741,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp)
|
||||
static int headsetlpga_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = w->codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
@@ -765,7 +765,7 @@ static int headsetlpga_event(struct snd_soc_dapm_widget *w,
|
||||
static int headsetrpga_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct twl4030_priv *twl4030 = w->codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
@@ -957,7 +957,7 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
unsigned short val;
|
||||
unsigned short mask, bitmask;
|
||||
@@ -1627,7 +1627,7 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (twl4030->master_substream) {
|
||||
twl4030->slave_substream = substream;
|
||||
@@ -1658,7 +1658,7 @@ static void twl4030_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (twl4030->master_substream == substream)
|
||||
twl4030->master_substream = twl4030->slave_substream;
|
||||
@@ -1684,7 +1684,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 mode, old_mode, format, old_format;
|
||||
|
||||
/* If the substream has 4 channel, do the necessary setup */
|
||||
@@ -1804,7 +1804,7 @@ static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
switch (freq) {
|
||||
case 19200000:
|
||||
@@ -1919,7 +1919,7 @@ static int twl4030_voice_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct twl4030_priv *twl4030 = codec->private_data;
|
||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
u8 mode;
|
||||
|
||||
/* If the system master clock is not 26MHz, the voice PCM interface is
|
||||
@@ -2164,7 +2164,7 @@ static int twl4030_soc_probe(struct platform_device *pdev)
|
||||
BUG_ON(!twl4030_codec);
|
||||
|
||||
codec = twl4030_codec;
|
||||
twl4030 = codec->private_data;
|
||||
twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||
socdev->card->codec = codec;
|
||||
|
||||
/* Configuration for headset ramp delay from setup data */
|
||||
@@ -2227,7 +2227,7 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
codec = &twl4030->codec;
|
||||
codec->private_data = twl4030;
|
||||
snd_soc_codec_set_drvdata(codec, twl4030);
|
||||
codec->dev = &pdev->dev;
|
||||
twl4030_dai[0].dev = &pdev->dev;
|
||||
twl4030_dai[1].dev = &pdev->dev;
|
||||
|
||||
@@ -174,7 +174,7 @@ static int uda134x_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct uda134x_priv *uda134x = codec->private_data;
|
||||
struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
|
||||
struct snd_pcm_runtime *master_runtime;
|
||||
|
||||
if (uda134x->master_substream) {
|
||||
@@ -207,7 +207,7 @@ static void uda134x_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct uda134x_priv *uda134x = codec->private_data;
|
||||
struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (uda134x->master_substream == substream)
|
||||
uda134x->master_substream = uda134x->slave_substream;
|
||||
@@ -222,7 +222,7 @@ static int uda134x_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct uda134x_priv *uda134x = codec->private_data;
|
||||
struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
|
||||
u8 hw_params;
|
||||
|
||||
if (substream == uda134x->slave_substream) {
|
||||
@@ -294,7 +294,7 @@ static int uda134x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct uda134x_priv *uda134x = codec->private_data;
|
||||
struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
pr_debug("%s clk_id: %d, freq: %u, dir: %d\n", __func__,
|
||||
clk_id, freq, dir);
|
||||
@@ -316,7 +316,7 @@ static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
unsigned int fmt)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct uda134x_priv *uda134x = codec->private_data;
|
||||
struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
pr_debug("%s fmt: %08X\n", __func__, fmt);
|
||||
|
||||
@@ -503,7 +503,7 @@ static int uda134x_soc_probe(struct platform_device *pdev)
|
||||
uda134x = kzalloc(sizeof(struct uda134x_priv), GFP_KERNEL);
|
||||
if (uda134x == NULL)
|
||||
goto priv_err;
|
||||
codec->private_data = uda134x;
|
||||
snd_soc_codec_set_drvdata(codec, uda134x);
|
||||
|
||||
codec->reg_cache = kmemdup(uda134x_reg, sizeof(uda134x_reg),
|
||||
GFP_KERNEL);
|
||||
@@ -567,7 +567,7 @@ static int uda134x_soc_probe(struct platform_device *pdev)
|
||||
pcm_err:
|
||||
kfree(codec->reg_cache);
|
||||
reg_err:
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
priv_err:
|
||||
kfree(codec);
|
||||
return ret;
|
||||
@@ -585,7 +585,7 @@ static int uda134x_soc_remove(struct platform_device *pdev)
|
||||
snd_soc_free_pcms(socdev);
|
||||
snd_soc_dapm_free(socdev);
|
||||
|
||||
kfree(codec->private_data);
|
||||
kfree(snd_soc_codec_get_drvdata(codec));
|
||||
kfree(codec->reg_cache);
|
||||
kfree(codec);
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ static int uda1380_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct uda1380_priv *uda1380 = codec->private_data;
|
||||
struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec);
|
||||
int mixer = uda1380_read_reg_cache(codec, UDA1380_MIXER);
|
||||
|
||||
switch (cmd) {
|
||||
@@ -774,7 +774,7 @@ static int uda1380_register(struct uda1380_priv *uda1380)
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
|
||||
codec->private_data = uda1380;
|
||||
snd_soc_codec_set_drvdata(codec, uda1380);
|
||||
codec->name = "UDA1380";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->read = uda1380_read_reg_cache;
|
||||
|
||||
@@ -95,7 +95,7 @@ static int wm8350_codec_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
*/
|
||||
static inline int wm8350_out1_ramp_step(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct wm8350_data *wm8350_data = codec->private_data;
|
||||
struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out1 = &wm8350_data->out1;
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
int left_complete = 0, right_complete = 0;
|
||||
@@ -161,7 +161,7 @@ static inline int wm8350_out1_ramp_step(struct snd_soc_codec *codec)
|
||||
*/
|
||||
static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct wm8350_data *wm8350_data = codec->private_data;
|
||||
struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out2 = &wm8350_data->out2;
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
int left_complete = 0, right_complete = 0;
|
||||
@@ -231,7 +231,7 @@ static void wm8350_pga_work(struct work_struct *work)
|
||||
{
|
||||
struct snd_soc_codec *codec =
|
||||
container_of(work, struct snd_soc_codec, delayed_work.work);
|
||||
struct wm8350_data *wm8350_data = codec->private_data;
|
||||
struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out1 = &wm8350_data->out1,
|
||||
*out2 = &wm8350_data->out2;
|
||||
int i, out1_complete, out2_complete;
|
||||
@@ -278,7 +278,7 @@ static int pga_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8350_data *wm8350_data = codec->private_data;
|
||||
struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out;
|
||||
|
||||
switch (w->shift) {
|
||||
@@ -323,7 +323,7 @@ static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct wm8350_data *wm8350_priv = codec->private_data;
|
||||
struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out = NULL;
|
||||
struct soc_mixer_control *mc =
|
||||
(struct soc_mixer_control *)kcontrol->private_value;
|
||||
@@ -366,7 +366,7 @@ static int wm8350_get_volsw_2r(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||
struct wm8350_data *wm8350_priv = codec->private_data;
|
||||
struct wm8350_data *wm8350_priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_output *out1 = &wm8350_priv->out1;
|
||||
struct wm8350_output *out2 = &wm8350_priv->out2;
|
||||
struct soc_mixer_control *mc =
|
||||
@@ -1108,7 +1108,7 @@ static int wm8350_set_fll(struct snd_soc_dai *codec_dai,
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct _fll_div fll_div;
|
||||
int ret = 0;
|
||||
u16 fll_1, fll_4;
|
||||
@@ -1160,7 +1160,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350_audio_platform_data *platform =
|
||||
wm8350->codec.platform_data;
|
||||
u16 pm1;
|
||||
@@ -1399,7 +1399,7 @@ static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
|
||||
int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which,
|
||||
struct snd_soc_jack *jack, int report)
|
||||
{
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
int irq;
|
||||
int ena;
|
||||
@@ -1471,7 +1471,7 @@ int wm8350_mic_jack_detect(struct snd_soc_codec *codec,
|
||||
struct snd_soc_jack *jack,
|
||||
int detect_report, int short_report)
|
||||
{
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
|
||||
priv->mic.jack = jack;
|
||||
@@ -1508,7 +1508,7 @@ static int wm8350_probe(struct platform_device *pdev)
|
||||
socdev->card->codec = wm8350_codec;
|
||||
codec = socdev->card->codec;
|
||||
wm8350 = codec->control_data;
|
||||
priv = codec->private_data;
|
||||
priv = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
/* Enable the codec */
|
||||
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
|
||||
@@ -1579,7 +1579,7 @@ static int wm8350_remove(struct platform_device *pdev)
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct wm8350 *wm8350 = codec->control_data;
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
int ret;
|
||||
|
||||
wm8350_clear_bits(wm8350, WM8350_JACK_DETECT,
|
||||
@@ -1698,7 +1698,7 @@ static __devinit int wm8350_codec_probe(struct platform_device *pdev)
|
||||
codec->dai = &wm8350_dai;
|
||||
codec->num_dai = 1;
|
||||
codec->reg_cache_size = WM8350_MAX_REGISTER;
|
||||
codec->private_data = priv;
|
||||
snd_soc_codec_set_drvdata(codec, priv);
|
||||
codec->control_data = wm8350;
|
||||
|
||||
/* Put the codec into reset if it wasn't already */
|
||||
@@ -1730,7 +1730,7 @@ static int __devexit wm8350_codec_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct wm8350 *wm8350 = platform_get_drvdata(pdev);
|
||||
struct snd_soc_codec *codec = wm8350->codec.codec;
|
||||
struct wm8350_data *priv = codec->private_data;
|
||||
struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
snd_soc_unregister_dai(&wm8350_dai);
|
||||
snd_soc_unregister_codec(codec);
|
||||
|
||||
@@ -76,7 +76,7 @@ struct wm8400_priv {
|
||||
static inline unsigned int wm8400_read(struct snd_soc_codec *codec,
|
||||
unsigned int reg)
|
||||
{
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (reg == WM8400_INTDRIVBITS)
|
||||
return wm8400->fake_register;
|
||||
@@ -90,7 +90,7 @@ static inline unsigned int wm8400_read(struct snd_soc_codec *codec,
|
||||
static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
unsigned int value)
|
||||
{
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
if (reg == WM8400_INTDRIVBITS) {
|
||||
wm8400->fake_register = value;
|
||||
@@ -101,7 +101,7 @@ static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
|
||||
static void wm8400_codec_reset(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
wm8400_reset_codec_reg_cache(wm8400->wm8400);
|
||||
}
|
||||
@@ -925,7 +925,7 @@ static int wm8400_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
wm8400->sysclk = freq;
|
||||
return 0;
|
||||
@@ -1014,7 +1014,7 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
|
||||
unsigned int freq_out)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
struct fll_factors factors;
|
||||
int ret;
|
||||
u16 reg;
|
||||
@@ -1203,7 +1203,7 @@ static int wm8400_mute(struct snd_soc_dai *dai, int mute)
|
||||
static int wm8400_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
struct wm8400_priv *wm8400 = codec->private_data;
|
||||
struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
|
||||
u16 val;
|
||||
int ret;
|
||||
|
||||
@@ -1466,7 +1466,7 @@ static int wm8400_codec_probe(struct platform_device *dev)
|
||||
return -ENOMEM;
|
||||
|
||||
codec = &priv->codec;
|
||||
codec->private_data = priv;
|
||||
snd_soc_codec_set_drvdata(codec, priv);
|
||||
codec->control_data = dev_get_drvdata(&dev->dev);
|
||||
priv->wm8400 = dev_get_drvdata(&dev->dev);
|
||||
|
||||
@@ -1529,7 +1529,7 @@ err:
|
||||
|
||||
static int __exit wm8400_codec_remove(struct platform_device *dev)
|
||||
{
|
||||
struct wm8400_priv *priv = wm8400_codec->private_data;
|
||||
struct wm8400_priv *priv = snd_soc_codec_get_drvdata(wm8400_codec);
|
||||
u16 reg;
|
||||
|
||||
snd_soc_unregister_dai(&wm8400_dai);
|
||||
|
||||
@@ -137,7 +137,7 @@ static int wm8523_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_codec *codec = dai->codec;
|
||||
struct wm8523_priv *wm8523 = codec->private_data;
|
||||
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
/* The set of sample rates that can be supported depends on the
|
||||
* MCLK supplied to the CODEC - enforce this.
|
||||
@@ -163,7 +163,7 @@ static int wm8523_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
struct wm8523_priv *wm8523 = codec->private_data;
|
||||
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
|
||||
int i;
|
||||
u16 aifctrl1 = snd_soc_read(codec, WM8523_AIF_CTRL1);
|
||||
u16 aifctrl2 = snd_soc_read(codec, WM8523_AIF_CTRL2);
|
||||
@@ -210,7 +210,7 @@ static int wm8523_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
struct snd_soc_codec *codec = codec_dai->codec;
|
||||
struct wm8523_priv *wm8523 = codec->private_data;
|
||||
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
|
||||
unsigned int val;
|
||||
int i;
|
||||
|
||||
@@ -317,7 +317,7 @@ static int wm8523_set_dai_fmt(struct snd_soc_dai *codec_dai,
|
||||
static int wm8523_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
struct wm8523_priv *wm8523 = codec->private_data;
|
||||
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
|
||||
int ret, i;
|
||||
|
||||
switch (level) {
|
||||
@@ -488,7 +488,7 @@ static int wm8523_register(struct wm8523_priv *wm8523,
|
||||
INIT_LIST_HEAD(&codec->dapm_widgets);
|
||||
INIT_LIST_HEAD(&codec->dapm_paths);
|
||||
|
||||
codec->private_data = wm8523;
|
||||
snd_soc_codec_set_drvdata(codec, wm8523);
|
||||
codec->name = "WM8523";
|
||||
codec->owner = THIS_MODULE;
|
||||
codec->bias_level = SND_SOC_BIAS_OFF;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user