// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2005-2006 Micronas USA Inc. */ #include <linux/module.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/videodev2.h> #include <media/tuner.h> #include <media/v4l2-common.h> #include <media/v4l2-ioctl.h> #include <media/v4l2-device.h> #include <linux/slab.h> MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; static int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(…) …; /* #define MPX_DEBUG */ /* * Note: * * AS(IF/MPX) pin: LOW HIGH/OPEN * IF/MPX address: 0x42/0x40 0x43/0x44 */ static int force_mpx_mode = …; module_param(force_mpx_mode, int, 0644); struct sony_btf_mpx { … }; static inline struct sony_btf_mpx *to_state(struct v4l2_subdev *sd) { … } static int mpx_write(struct i2c_client *client, int dev, int addr, int val) { … } /* * MPX register values for the BTF-PG472Z: * * FM_ NICAM_ SCART_ * MODUS SOURCE ACB PRESCAL PRESCAL PRESCAL SYSTEM VOLUME * 10/0030 12/0008 12/0013 12/000E 12/0010 12/0000 10/0020 12/0000 * --------------------------------------------------------------- * Auto 1003 0020 0100 2603 5000 XXXX 0001 7500 * * B/G * Mono 1003 0020 0100 2603 5000 XXXX 0003 7500 * A2 1003 0020 0100 2601 5000 XXXX 0003 7500 * NICAM 1003 0120 0100 2603 5000 XXXX 0008 7500 * * I * Mono 1003 0020 0100 2603 7900 XXXX 000A 7500 * NICAM 1003 0120 0100 2603 7900 XXXX 000A 7500 * * D/K * Mono 1003 0020 0100 2603 5000 XXXX 0004 7500 * A2-1 1003 0020 0100 2601 5000 XXXX 0004 7500 * A2-2 1003 0020 0100 2601 5000 XXXX 0005 7500 * A2-3 1003 0020 0100 2601 5000 XXXX 0007 7500 * NICAM 1003 0120 0100 2603 5000 XXXX 000B 7500 * * L/L' * Mono 0003 0200 0100 7C03 5000 2200 0009 7500 * NICAM 0003 0120 0100 7C03 5000 XXXX 0009 7500 * * M * Mono 1003 0200 0100 2B03 5000 2B00 0002 7500 * * For Asia, replace the 0x26XX in FM_PRESCALE with 0x14XX. * * Bilingual selection in A2/NICAM: * * High byte of SOURCE Left chan Right chan * 0x01 MAIN SUB * 0x03 MAIN MAIN * 0x04 SUB SUB * * Force mono in NICAM by setting the high byte of SOURCE to 0x02 (L/L') or * 0x00 (all other bands). Force mono in A2 with FMONO_A2: * * FMONO_A2 * 10/0022 * -------- * Forced mono ON 07F0 * Forced mono OFF 0190 */ static const struct { … } mpx_audio_modes[] = …; #define MPX_NUM_MODES … static int mpx_setup(struct sony_btf_mpx *t) { … } static int sony_btf_mpx_s_std(struct v4l2_subdev *sd, v4l2_std_id std) { … } static int sony_btf_mpx_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) { … } static int sony_btf_mpx_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt) { … } /* --------------------------------------------------------------------------*/ static const struct v4l2_subdev_tuner_ops sony_btf_mpx_tuner_ops = …; static const struct v4l2_subdev_video_ops sony_btf_mpx_video_ops = …; static const struct v4l2_subdev_ops sony_btf_mpx_ops = …; /* --------------------------------------------------------------------------*/ static int sony_btf_mpx_probe(struct i2c_client *client) { … } static void sony_btf_mpx_remove(struct i2c_client *client) { … } /* ----------------------------------------------------------------------- */ static const struct i2c_device_id sony_btf_mpx_id[] = …; MODULE_DEVICE_TABLE(i2c, sony_btf_mpx_id); static struct i2c_driver sony_btf_mpx_driver = …; module_i2c_driver(…) …;