#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <media/i2c/tvaudio.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
static int debug;
module_param(debug, int, 0644);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
#define UNSET …
#define MAXREGS …
struct CHIPSTATE;
getvalue;
checkit;
initialize;
getrxsubchans;
setaudmode;
audiocmd;
struct CHIPDESC { … };
struct CHIPSTATE { … };
static inline struct CHIPSTATE *to_state(struct v4l2_subdev *sd)
{ … }
static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
{ … }
static int chip_write(struct CHIPSTATE *chip, int subaddr, int val)
{ … }
static int chip_write_masked(struct CHIPSTATE *chip,
int subaddr, int val, int mask)
{ … }
static int chip_read(struct CHIPSTATE *chip)
{ … }
static int chip_read2(struct CHIPSTATE *chip, int subaddr)
{ … }
static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd)
{ … }
static void chip_thread_wake(struct timer_list *t)
{ … }
static int chip_thread(void *data)
{ … }
#define TDA9840_SW …
#define TDA9840_LVADJ …
#define TDA9840_STADJ …
#define TDA9840_TEST …
#define TDA9840_MONO …
#define TDA9840_STEREO …
#define TDA9840_DUALA …
#define TDA9840_DUALB …
#define TDA9840_DUALAB …
#define TDA9840_DUALBA …
#define TDA9840_EXTERNAL …
#define TDA9840_DS_DUAL …
#define TDA9840_ST_STEREO …
#define TDA9840_PONRES …
#define TDA9840_TEST_INT1SN …
#define TDA9840_TEST_INTFU …
static int tda9840_getrxsubchans(struct CHIPSTATE *chip)
{ … }
static void tda9840_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
static int tda9840_checkit(struct CHIPSTATE *chip)
{ … }
#define TDA9855_VR …
#define TDA9855_VL …
#define TDA9855_BA …
#define TDA9855_TR …
#define TDA9855_SW …
#define TDA9850_C4 …
#define TDA985x_C5 …
#define TDA985x_C6 …
#define TDA985x_C7 …
#define TDA985x_A1 …
#define TDA985x_A2 …
#define TDA985x_A3 …
#define TDA9855_MUTE …
#define TDA9855_AVL …
#define TDA9855_LOUD …
#define TDA9855_SUR …
#define TDA9855_EXT …
#define TDA9855_INT …
#define TDA985x_SAP …
#define TDA985x_MONOSAP …
#define TDA985x_STEREO …
#define TDA985x_MONO …
#define TDA985x_LMU …
#define TDA9855_TZCM …
#define TDA9855_VZCM …
#define TDA9855_LINEAR …
#define TDA9855_PSEUDO …
#define TDA9855_SPAT_30 …
#define TDA9855_SPAT_50 …
#define TDA9855_E_MONO …
#define TDA985x_STP …
#define TDA985x_SAPP …
#define TDA985x_STS …
#define TDA985x_ADJ …
static int tda9855_volume(int val) { … }
static int tda9855_bass(int val) { … }
static int tda9855_treble(int val) { … }
static int tda985x_getrxsubchans(struct CHIPSTATE *chip)
{ … }
static void tda985x_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
#define TDA9873_SW …
#define TDA9873_AD …
#define TDA9873_PT …
#define TDA9873_INP_MASK …
#define TDA9873_INTERNAL …
#define TDA9873_EXT_STEREO …
#define TDA9873_EXT_MONO …
#define TDA9873_TR_MASK …
#define TDA9873_TR_MONO …
#define TDA9873_TR_STEREO …
#define TDA9873_TR_REVERSE …
#define TDA9873_TR_DUALA …
#define TDA9873_TR_DUALB …
#define TDA9873_TR_DUALAB …
#define TDA9873_GAIN_NORMAL …
#define TDA9873_MUTE …
#define TDA9873_AUTOMUTE …
#define TDA9873_STEREO_ADJ …
#define TDA9873_BG …
#define TDA9873_M …
#define TDA9873_DK1 …
#define TDA9873_DK2 …
#define TDA9873_DK3 …
#define TDA9873_I …
#define TDA9873_IDR_NORM …
#define TDA9873_IDR_FAST …
#define TDA9873_PORTS …
#define TDA9873_TST_PORT …
#define TDA9873_MOUT_MONO …
#define TDA9873_MOUT_FMONO …
#define TDA9873_MOUT_DUALA …
#define TDA9873_MOUT_DUALB …
#define TDA9873_MOUT_ST …
#define TDA9873_MOUT_EXTM …
#define TDA9873_MOUT_EXTL …
#define TDA9873_MOUT_EXTR …
#define TDA9873_MOUT_EXTLR …
#define TDA9873_MOUT_MUTE …
#define TDA9873_PONR …
#define TDA9873_STEREO …
#define TDA9873_DUAL …
static int tda9873_getrxsubchans(struct CHIPSTATE *chip)
{ … }
static void tda9873_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
static int tda9873_checkit(struct CHIPSTATE *chip)
{ … }
#define TDA9874A_AGCGR …
#define TDA9874A_GCONR …
#define TDA9874A_MSR …
#define TDA9874A_C1FRA …
#define TDA9874A_C1FRB …
#define TDA9874A_C1FRC …
#define TDA9874A_C2FRA …
#define TDA9874A_C2FRB …
#define TDA9874A_C2FRC …
#define TDA9874A_DCR …
#define TDA9874A_FMER …
#define TDA9874A_FMMR …
#define TDA9874A_C1OLAR …
#define TDA9874A_C2OLAR …
#define TDA9874A_NCONR …
#define TDA9874A_NOLAR …
#define TDA9874A_NLELR …
#define TDA9874A_NUELR …
#define TDA9874A_AMCONR …
#define TDA9874A_SDACOSR …
#define TDA9874A_AOSR …
#define TDA9874A_DAICONR …
#define TDA9874A_I2SOSR …
#define TDA9874A_I2SOLAR …
#define TDA9874A_MDACOSR …
#define TDA9874A_ESP …
#define TDA9874A_DSR …
#define TDA9874A_NSR …
#define TDA9874A_NECR …
#define TDA9874A_DR1 …
#define TDA9874A_DR2 …
#define TDA9874A_LLRA …
#define TDA9874A_LLRB …
#define TDA9874A_SIFLR …
#define TDA9874A_TR2 …
#define TDA9874A_TR1 …
#define TDA9874A_DIC …
#define TDA9874A_SIC …
static int tda9874a_mode = …;
static int tda9874a_GCONR = …;
static int tda9874a_NCONR = …;
static int tda9874a_ESP = …;
static int tda9874a_dic = …;
static unsigned int tda9874a_SIF = …;
static unsigned int tda9874a_AMSEL = …;
static unsigned int tda9874a_STD = …;
module_param(tda9874a_SIF, int, 0444);
module_param(tda9874a_AMSEL, int, 0444);
module_param(tda9874a_STD, int, 0444);
static struct tda9874a_MODES { … } tda9874a_modelist[9] = …;
static int tda9874a_setup(struct CHIPSTATE *chip)
{ … }
static int tda9874a_getrxsubchans(struct CHIPSTATE *chip)
{ … }
static void tda9874a_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
static int tda9874a_checkit(struct CHIPSTATE *chip)
{ … }
static int tda9874a_initialize(struct CHIPSTATE *chip)
{ … }
#define TDA9875_MUT …
#define TDA9875_CFG …
#define TDA9875_DACOS …
#define TDA9875_LOSR …
#define TDA9875_CH1V …
#define TDA9875_CH2V …
#define TDA9875_SC1 …
#define TDA9875_SC2 …
#define TDA9875_ADCIS …
#define TDA9875_AER …
#define TDA9875_MCS …
#define TDA9875_MVL …
#define TDA9875_MVR …
#define TDA9875_MBA …
#define TDA9875_MTR …
#define TDA9875_ACS …
#define TDA9875_AVL …
#define TDA9875_AVR …
#define TDA9875_ABA …
#define TDA9875_ATR …
#define TDA9875_MSR …
#define TDA9875_C1MSB …
#define TDA9875_C1MIB …
#define TDA9875_C1LSB …
#define TDA9875_C2MSB …
#define TDA9875_C2MIB …
#define TDA9875_C2LSB …
#define TDA9875_DCR …
#define TDA9875_DEEM …
#define TDA9875_FMAT …
#define TDA9875_MUTE_ON …
#define TDA9875_MUTE_OFF …
static int tda9875_initialize(struct CHIPSTATE *chip)
{ … }
static int tda9875_volume(int val) { … }
static int tda9875_bass(int val) { … }
static int tda9875_treble(int val) { … }
static int tda9875_checkit(struct CHIPSTATE *chip)
{ … }
#define TEA6300_VL …
#define TEA6300_VR …
#define TEA6300_BA …
#define TEA6300_TR …
#define TEA6300_FA …
#define TEA6300_S …
#define TEA6300_S_SA …
#define TEA6300_S_SB …
#define TEA6300_S_SC …
#define TEA6300_S_GMU …
#define TEA6320_V …
#define TEA6320_FFR …
#define TEA6320_FFL …
#define TEA6320_FRR …
#define TEA6320_FRL …
#define TEA6320_BA …
#define TEA6320_TR …
#define TEA6320_S …
#define TEA6320_S_SA …
#define TEA6320_S_SB …
#define TEA6320_S_SC …
#define TEA6320_S_SD …
#define TEA6320_S_GMU …
#define TEA6420_S_SA …
#define TEA6420_S_SB …
#define TEA6420_S_SC …
#define TEA6420_S_SD …
#define TEA6420_S_SE …
#define TEA6420_S_GMU …
static int tea6300_shift10(int val) { … }
static int tea6300_shift12(int val) { … }
static int tea6320_volume(int val) { … }
static int tea6320_shift11(int val) { … }
static int tea6320_initialize(struct CHIPSTATE * chip)
{ … }
#define TDA8425_VL …
#define TDA8425_VR …
#define TDA8425_BA …
#define TDA8425_TR …
#define TDA8425_S1 …
#define TDA8425_S1_OFF …
#define TDA8425_S1_CH1 …
#define TDA8425_S1_CH2 …
#define TDA8425_S1_MU …
#define TDA8425_S1_STEREO …
#define TDA8425_S1_STEREO_SPATIAL …
#define TDA8425_S1_STEREO_LINEAR …
#define TDA8425_S1_STEREO_PSEUDO …
#define TDA8425_S1_STEREO_MONO …
#define TDA8425_S1_ML …
#define TDA8425_S1_ML_SOUND_A …
#define TDA8425_S1_ML_SOUND_B …
#define TDA8425_S1_ML_STEREO …
#define TDA8425_S1_IS …
static int tda8425_shift10(int val) { … }
static int tda8425_shift12(int val) { … }
static void tda8425_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
#define PIC16C54_REG_KEY_CODE …
#define PIC16C54_REG_MISC …
#define PIC16C54_MISC_RESET_REMOTE_CTL …
#define PIC16C54_MISC_MTS_MAIN …
#define PIC16C54_MISC_MTS_SAP …
#define PIC16C54_MISC_MTS_BOTH …
#define PIC16C54_MISC_SND_MUTE …
#define PIC16C54_MISC_SND_NOTMUTE …
#define PIC16C54_MISC_SWITCH_TUNER …
#define PIC16C54_MISC_SWITCH_LINE …
#define TA8874Z_LED_STE …
#define TA8874Z_LED_BIL …
#define TA8874Z_LED_EXT …
#define TA8874Z_MONO_SET …
#define TA8874Z_MUTE …
#define TA8874Z_F_MONO …
#define TA8874Z_MODE_SUB …
#define TA8874Z_MODE_MAIN …
#define TA8874Z_SEPARATION …
#define TA8874Z_SEPARATION_DEFAULT …
#define TA8874Z_B1 …
#define TA8874Z_B0 …
#define TA8874Z_CHAG_FLAG …
static int ta8874z_getrxsubchans(struct CHIPSTATE *chip)
{ … }
static audiocmd ta8874z_stereo = …;
static audiocmd ta8874z_mono = …;
static audiocmd ta8874z_main = …;
static audiocmd ta8874z_sub = …;
static audiocmd ta8874z_both = …;
static void ta8874z_setaudmode(struct CHIPSTATE *chip, int mode)
{ … }
static int ta8874z_checkit(struct CHIPSTATE *chip)
{ … }
static int tda8425 = …;
static int tda9840 = …;
static int tda9850 = …;
static int tda9855 = …;
static int tda9873 = …;
static int tda9874a = …;
static int tda9875 = …;
static int tea6300;
static int tea6320;
static int tea6420 = …;
static int pic16c54 = …;
static int ta8874z;
module_param(tda8425, int, 0444);
module_param(tda9840, int, 0444);
module_param(tda9850, int, 0444);
module_param(tda9855, int, 0444);
module_param(tda9873, int, 0444);
module_param(tda9874a, int, 0444);
module_param(tda9875, int, 0444);
module_param(tea6300, int, 0444);
module_param(tea6320, int, 0444);
module_param(tea6420, int, 0444);
module_param(pic16c54, int, 0444);
module_param(ta8874z, int, 0444);
static struct CHIPDESC chiplist[] = …;
static int tvaudio_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int tvaudio_s_radio(struct v4l2_subdev *sd)
{ … }
static int tvaudio_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{ … }
static int tvaudio_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{ … }
static int tvaudio_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
{ … }
static int tvaudio_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{ … }
static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{ … }
static int tvaudio_log_status(struct v4l2_subdev *sd)
{ … }
static const struct v4l2_ctrl_ops tvaudio_ctrl_ops = …;
static const struct v4l2_subdev_core_ops tvaudio_core_ops = …;
static const struct v4l2_subdev_tuner_ops tvaudio_tuner_ops = …;
static const struct v4l2_subdev_audio_ops tvaudio_audio_ops = …;
static const struct v4l2_subdev_video_ops tvaudio_video_ops = …;
static const struct v4l2_subdev_ops tvaudio_ops = …;
static int tvaudio_probe(struct i2c_client *client)
{ … }
static void tvaudio_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id tvaudio_id[] = …;
MODULE_DEVICE_TABLE(i2c, tvaudio_id);
static struct i2c_driver tvaudio_driver = …;
module_i2c_driver(…) …;