Permalink
Browse files

Bypassing audio DAC configuration

Currently cubox platform defines cs42l51 as an audio DAC, although it doesn't exist.
The reason to make a DAC available for the kernel is for it to hook the audio subsystem and output to the SPDIF. The hack is actually removing the read/write to the DAC registers (otherwise it gets stuck).
  • Loading branch information...
1 parent db3d2a7 commit 887b66b76388a49360f15be76fcf3729f1eb8f0c @rabeeh committed Dec 18, 2011
@@ -784,6 +784,7 @@ struct snd_soc_dai mv88fx_i2s_dai1 = {
.suspend = mv88fx_i2s_suspend,
.resume = mv88fx_i2s_resume,
.ops = &mv88fx_i2s_dai_ops,
+#if 0
.capture = {
.stream_name = "i2s-capture",
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
@@ -796,6 +797,7 @@ struct snd_soc_dai mv88fx_i2s_dai1 = {
.channels_min = 1,
.channels_max = 2,
},
+#endif
.playback = {
.stream_name = "i2s-playback",
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
@@ -382,7 +382,7 @@ static int mv88fx_snd_ctrl_new(struct snd_card *card)
&chip->stream[SNDRV_PCM_STREAM_CAPTURE].dig_mode;
capture_mono_mixer.rec =
&chip->stream[SNDRV_PCM_STREAM_CAPTURE].mono_mode;
-
+#if 0
if (chip->pdata->i2s_play && chip->pdata->spdif_play) {
err =
snd_ctl_add(card,
@@ -418,7 +418,7 @@ static int mv88fx_snd_ctrl_new(struct snd_card *card)
if (err < 0)
return err;
}
-
+#endif
if (chip->pdata->spdif_play) {
err = snd_ctl_add(card, snd_ctl_new1(&mv88fx_snd_spdif_mask,
chip));
@@ -659,9 +659,10 @@ static struct platform_driver mv88fx_snd_driver = {
static int __init mv88fx_snd_init(void)
{
+#if 0 // Rabeeh - add the new machine
if (!machine_is_dove_db() && !machine_is_dove_db_z0() && !machine_is_videoplug() && !machine_is_dove_db_b())
return -ENODEV;
-
+#endif
mv88fx_snd_debug("");
return platform_driver_register(&mv88fx_snd_driver);
}
View
@@ -21,10 +21,8 @@
#define CS42L51_CACHE_SIZE (CS42L51_REG_MAX+1)
-/*
-#define CS42L51_DEBUG(format, args...) \
- printk(KERN_DEBUG "%s(%d): "format"\n", __FUNCTION__, __LINE__, ##args)
-*/
+//#define CS42L51_DEBUG(format, args...) \
+// printk(KERN_DEBUG "%s(%d): "format"\n", __FUNCTION__, __LINE__, ##args)
#define CS42L51_DEBUG(format, args...)
@@ -60,7 +58,7 @@ static int cs42l51_write(struct snd_soc_codec *codec, unsigned int reg,
reg &= 0x7f;
data[0] = reg & 0xff;
data[1] = value & 0xff;
-
+ return 0; // Rabeeh
cs42l51_write_reg_cache(codec, data[0], data[1]);
if (codec->hw_write(codec->control_data, data, 2) == 2)
return 0;
@@ -70,6 +68,7 @@ static int cs42l51_write(struct snd_soc_codec *codec, unsigned int reg,
static unsigned int cs42l51_read(struct snd_soc_codec *codec, unsigned int reg)
{
+ return 0;// Rabeeh
return cs42l51_read_reg_cache(codec, reg);
}
@@ -80,7 +79,7 @@ static unsigned int cs42l51_read_no_cache(struct snd_soc_codec *codec,
u8 data[2];
struct i2c_client *i2c_client = codec->control_data;
int ret;
-
+ return 0; // Rabeeh
i2c_client = (struct i2c_client *)codec->control_data;
data[0] = reg & 0xff;
@@ -94,7 +93,7 @@ static unsigned int cs42l51_read_no_cache(struct snd_soc_codec *codec,
msg[1].buf = &data[1];
msg[1].len = 1;
- ret = i2c_transfer(i2c_client->adapter, &msg[0], 2);
+// Rabeeh ret = i2c_transfer(i2c_client->adapter, &msg[0], 2);
return (ret == 2) ? data[1] : -EIO;
}

0 comments on commit 887b66b

Please sign in to comment.