#include "rt_codec_ioctl.h"
#include "rt3261_ioctl.h"
#include "rt3261.h"
+#if defined (CONFIG_SND_SOC_RT3261)
+#include "rt3261-dsp.h"
+#endif
hweq_t hweq_param[] = {
{/* NORMAL */
{0},
0x0000,
},
- {/* CLUB */
- {0xa0, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xaf},
- {0x1c10, 0xc1cc, 0x1e5d, 0x0699, 0xcd48, 0x188d, 0x0699, 0xc3b6, 0x1cd0, 0x0699, 0x0436},
- 0x000e,
- },
- {/* DANCE */
- {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xae},
- {0x1f2c, 0x095b, 0xc071, 0x1f95, 0x0616, 0xc96e, 0x1b11, 0xfc91, 0xdcf2, 0x1194, 0xfaf2, 0x0436},
- 0x000f,
- },
- {/* LIVE */
- {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xae},
- {0x1eb5, 0xfcb6, 0xc24a, 0x1df8, 0x0e7c, 0xc883, 0x1c10, 0x0699, 0xda41, 0x1561, 0xd295, 0x0436},
- 0x000f,
- },
- {/* POP */
- {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, 0xae},
- {0x1eb5, 0xfcb6, 0xc1d4, 0x1e5d, 0x0e23, 0xd92e, 0x16e6, 0xfcb6, 0x0969, 0xf988, 0x0436},
- 0x000f,
- },
- {/* ROCK */
- {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xae},
- {0x1eb5, 0xfcb6, 0xc071, 0x1f95, 0x0424, 0xc30a, 0x1d27, 0xf900, 0x0c5d, 0x0fc7, 0x0e23, 0x0436},
- 0x000f,
- },
- {/* OPPO */
- {0xa2, 0xa3, 0xa4, 0xa5, 0xa6},
- {0xca4a, 0x17f8, 0x0fec, 0xca4a, 0x17f8},
- 0x000f,
- },
- {/* TREBLE */
- {0xae, 0xaf},
- {0x188d, 0x1699},
- 0x0020,
+ {/* SPK */
+ {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2},
+ {0x1c10,0x01f4, 0xc5e9, 0x1a98, 0x1d2c, 0xc882, 0x1c10, 0x01f4, 0xe904, 0x1c10, 0x01f4, 0xe904, 0x1c10, 0x01f4, 0x1c10, 0x01f4, 0x2000, 0x0000, 0x2000},
+ 0x0000,
},
- {/* BASS */
- {0xa0, 0xa1,},
- {0x1a43, 0x0c00},
- 0x0001,
+ {/* HP */
+ {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2},
+ {0x1c10,0x01f4, 0xc5e9, 0x1a98, 0x1d2c, 0xc882, 0x1c10, 0x01f4, 0xe904, 0x1c10, 0x01f4, 0xe904, 0x1c10, 0x01f4, 0x1c10, 0x01f4, 0x2000, 0x0000, 0x2000},
+ 0x0000,
},
};
#define RT3261_HWEQ_LEN ARRAY_SIZE(hweq_param)
-static int rt3261_update_eqmode(
+int rt3261_update_eqmode(
struct snd_soc_codec *codec, int mode)
{
struct rt_codec_ops *ioctl_ops = rt_codec_get_ioctl_ops();
int i;
+ static int eq_mode;
if(codec == NULL || mode >= RT3261_HWEQ_LEN)
return -EINVAL;
dev_dbg(codec->dev, "%s(): mode=%d\n", __func__, mode);
+ if(mode == eq_mode)
+ return 0;
for(i = 0; i <= EQ_REG_NUM; i++) {
- if(hweq_param[mode].value[i])
+ if(hweq_param[mode].reg[i])
ioctl_ops->index_write(codec, hweq_param[mode].reg[i],
hweq_param[mode].value[i]);
else
RT3261_EQ_UPD, RT3261_EQ_UPD);
snd_soc_update_bits(codec, RT3261_EQ_CTRL1, RT3261_EQ_UPD, 0);
+ eq_mode = mode;
return 0;
}
if (copy_to_user(rt_codec.buf, buf, sizeof(*buf) * rt_codec.number))
goto err;
break;
-
+#if defined (CONFIG_SND_SOC_RT3261)
+ case RT_READ_CODEC_DSP_IOCTL:
+ case RT_WRITE_CODEC_DSP_IOCTL:
+ case RT_GET_CODEC_DSP_MODE_IOCTL:
+ return rt_codec_dsp_ioctl_common(hw, file, cmd, arg);
+#endif
case RT_GET_CODEC_HWEQ_IOCTL:
case RT_GET_CODEC_3D_SPK_IOCTL:
case RT_GET_CODEC_MP3PLUS_IOCTL: