forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/i2c/cx25840/cx25840-core.h
....@@ -1,21 +1,11 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* cx25840 internal API header
23 *
34 * Copyright (C) 2003-2004 Chris Kennedy
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version 2
8
- * of the License, or (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
145 */
156
167 #ifndef _CX25840_CORE_H_
178 #define _CX25840_CORE_H_
18
-
199
2010 #include <linux/videodev2.h>
2111 #include <media/v4l2-device.h>
....@@ -40,7 +30,6 @@
4030 enum cx25840_media_pads {
4131 CX25840_PAD_INPUT,
4232 CX25840_PAD_VID_OUT,
43
- CX25840_PAD_VBI_OUT,
4433
4534 CX25840_NUM_PADS
4635 };
....@@ -54,10 +43,15 @@
5443 * @mute: audio mute V4L2 control (non-cx2583x devices only)
5544 * @pvr150_workaround: whether we enable workaround for Hauppauge PVR150
5645 * hardware bug (audio dropping out)
46
+ * @generic_mode: whether we disable ivtv-specific hacks
47
+ * this mode gets turned on when the bridge driver calls
48
+ * cx25840 subdevice init core op
5749 * @radio: set if we are currently in the radio mode, otherwise
5850 * the current mode is non-radio (that is, video)
5951 * @std: currently set video standard
6052 * @vid_input: currently set video input
53
+ * @vid_config: currently set video output configuration
54
+ * only used in the generic mode
6155 * @aud_input: currently set audio input
6256 * @audclk_freq: currently set audio sample rate
6357 * @audmode: currently set audio mode (when in non-radio mode)
....@@ -67,7 +61,7 @@
6761 * @is_initialized: whether we have already loaded firmware into the chip
6862 * and initialized it
6963 * @vbi_regs_offset: offset of vbi regs
70
- * @fw_wait: wait queue to wake an initalization function up when
64
+ * @fw_wait: wait queue to wake an initialization function up when
7165 * firmware loading (on a separate workqueue) finishes
7266 * @fw_work: a work that actually loads the firmware on a separate
7367 * workqueue
....@@ -84,9 +78,11 @@
8478 struct v4l2_ctrl *mute;
8579 };
8680 int pvr150_workaround;
81
+ bool generic_mode;
8782 int radio;
8883 v4l2_std_id std;
8984 enum cx25840_video_input vid_input;
85
+ u32 vid_config;
9086 enum cx25840_audio_input aud_input;
9187 u32 audclk_freq;
9288 int audmode;
....@@ -94,7 +90,7 @@
9490 enum cx25840_model id;
9591 u32 rev;
9692 int is_initialized;
97
- unsigned vbi_regs_offset;
93
+ unsigned int vbi_regs_offset;
9894 wait_queue_head_t fw_wait;
9995 struct work_struct fw_work;
10096 struct cx25840_ir_state *ir_state;
....@@ -117,6 +113,14 @@
117113 {
118114 return state->id == CX25836 ||
119115 state->id == CX25837;
116
+}
117
+
118
+static inline bool is_cx2584x(struct cx25840_state *state)
119
+{
120
+ return state->id == CX25840 ||
121
+ state->id == CX25841 ||
122
+ state->id == CX25842 ||
123
+ state->id == CX25843;
120124 }
121125
122126 static inline bool is_cx231xx(struct cx25840_state *state)
....@@ -152,7 +156,8 @@
152156 int cx25840_write4(struct i2c_client *client, u16 addr, u32 value);
153157 u8 cx25840_read(struct i2c_client *client, u16 addr);
154158 u32 cx25840_read4(struct i2c_client *client, u16 addr);
155
-int cx25840_and_or(struct i2c_client *client, u16 addr, unsigned mask, u8 value);
159
+int cx25840_and_or(struct i2c_client *client, u16 addr, unsigned int mask,
160
+ u8 value);
156161 int cx25840_and_or4(struct i2c_client *client, u16 addr, u32 and_mask,
157162 u32 or_value);
158163 void cx25840_std_setup(struct i2c_client *client);
....@@ -171,9 +176,12 @@
171176 /* ----------------------------------------------------------------------- */
172177 /* cx25850-vbi.c */
173178 int cx25840_s_raw_fmt(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt);
174
-int cx25840_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
175
-int cx25840_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
176
-int cx25840_decode_vbi_line(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi);
179
+int cx25840_s_sliced_fmt(struct v4l2_subdev *sd,
180
+ struct v4l2_sliced_vbi_format *fmt);
181
+int cx25840_g_sliced_fmt(struct v4l2_subdev *sd,
182
+ struct v4l2_sliced_vbi_format *fmt);
183
+int cx25840_decode_vbi_line(struct v4l2_subdev *sd,
184
+ struct v4l2_decode_vbi_line *vbi);
177185
178186 /* ----------------------------------------------------------------------- */
179187 /* cx25850-ir.c */