.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* cx25840 internal API header |
---|
2 | 3 | * |
---|
3 | 4 | * 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. |
---|
14 | 5 | */ |
---|
15 | 6 | |
---|
16 | 7 | #ifndef _CX25840_CORE_H_ |
---|
17 | 8 | #define _CX25840_CORE_H_ |
---|
18 | | - |
---|
19 | 9 | |
---|
20 | 10 | #include <linux/videodev2.h> |
---|
21 | 11 | #include <media/v4l2-device.h> |
---|
.. | .. |
---|
40 | 30 | enum cx25840_media_pads { |
---|
41 | 31 | CX25840_PAD_INPUT, |
---|
42 | 32 | CX25840_PAD_VID_OUT, |
---|
43 | | - CX25840_PAD_VBI_OUT, |
---|
44 | 33 | |
---|
45 | 34 | CX25840_NUM_PADS |
---|
46 | 35 | }; |
---|
.. | .. |
---|
54 | 43 | * @mute: audio mute V4L2 control (non-cx2583x devices only) |
---|
55 | 44 | * @pvr150_workaround: whether we enable workaround for Hauppauge PVR150 |
---|
56 | 45 | * 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 |
---|
57 | 49 | * @radio: set if we are currently in the radio mode, otherwise |
---|
58 | 50 | * the current mode is non-radio (that is, video) |
---|
59 | 51 | * @std: currently set video standard |
---|
60 | 52 | * @vid_input: currently set video input |
---|
| 53 | + * @vid_config: currently set video output configuration |
---|
| 54 | + * only used in the generic mode |
---|
61 | 55 | * @aud_input: currently set audio input |
---|
62 | 56 | * @audclk_freq: currently set audio sample rate |
---|
63 | 57 | * @audmode: currently set audio mode (when in non-radio mode) |
---|
.. | .. |
---|
67 | 61 | * @is_initialized: whether we have already loaded firmware into the chip |
---|
68 | 62 | * and initialized it |
---|
69 | 63 | * @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 |
---|
71 | 65 | * firmware loading (on a separate workqueue) finishes |
---|
72 | 66 | * @fw_work: a work that actually loads the firmware on a separate |
---|
73 | 67 | * workqueue |
---|
.. | .. |
---|
84 | 78 | struct v4l2_ctrl *mute; |
---|
85 | 79 | }; |
---|
86 | 80 | int pvr150_workaround; |
---|
| 81 | + bool generic_mode; |
---|
87 | 82 | int radio; |
---|
88 | 83 | v4l2_std_id std; |
---|
89 | 84 | enum cx25840_video_input vid_input; |
---|
| 85 | + u32 vid_config; |
---|
90 | 86 | enum cx25840_audio_input aud_input; |
---|
91 | 87 | u32 audclk_freq; |
---|
92 | 88 | int audmode; |
---|
.. | .. |
---|
94 | 90 | enum cx25840_model id; |
---|
95 | 91 | u32 rev; |
---|
96 | 92 | int is_initialized; |
---|
97 | | - unsigned vbi_regs_offset; |
---|
| 93 | + unsigned int vbi_regs_offset; |
---|
98 | 94 | wait_queue_head_t fw_wait; |
---|
99 | 95 | struct work_struct fw_work; |
---|
100 | 96 | struct cx25840_ir_state *ir_state; |
---|
.. | .. |
---|
117 | 113 | { |
---|
118 | 114 | return state->id == CX25836 || |
---|
119 | 115 | 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; |
---|
120 | 124 | } |
---|
121 | 125 | |
---|
122 | 126 | static inline bool is_cx231xx(struct cx25840_state *state) |
---|
.. | .. |
---|
152 | 156 | int cx25840_write4(struct i2c_client *client, u16 addr, u32 value); |
---|
153 | 157 | u8 cx25840_read(struct i2c_client *client, u16 addr); |
---|
154 | 158 | 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); |
---|
156 | 161 | int cx25840_and_or4(struct i2c_client *client, u16 addr, u32 and_mask, |
---|
157 | 162 | u32 or_value); |
---|
158 | 163 | void cx25840_std_setup(struct i2c_client *client); |
---|
.. | .. |
---|
171 | 176 | /* ----------------------------------------------------------------------- */ |
---|
172 | 177 | /* cx25850-vbi.c */ |
---|
173 | 178 | 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); |
---|
177 | 185 | |
---|
178 | 186 | /* ----------------------------------------------------------------------- */ |
---|
179 | 187 | /* cx25850-ir.c */ |
---|