34 #define CX18_REG_GPIO_IN 0xc72010
35 #define CX18_REG_GPIO_OUT1 0xc78100
36 #define CX18_REG_GPIO_DIR1 0xc78108
37 #define CX18_REG_GPIO_OUT2 0xc78104
38 #define CX18_REG_GPIO_DIR2 0xc7810c
59 cx18_write_reg_expect(cx, dir_lo << 16,
61 cx18_write_reg_expect(cx, (dir_lo << 16) | val_lo,
63 cx18_write_reg_expect(cx, dir_hi << 16,
65 cx18_write_reg_expect(cx, (dir_hi << 16) | val_hi,
80 static void gpio_reset_seq(
struct cx18 *cx,
u32 active_lo,
u32 active_hi,
81 unsigned int assert_msecs,
82 unsigned int recovery_msecs)
86 mask = active_lo | active_hi;
97 gpio_update(cx, mask, ~active_lo);
101 gpio_update(cx, mask, ~active_hi);
110 struct cx18 *cx = v4l2_get_subdevdata(sd);
121 struct cx18 *cx = v4l2_get_subdevdata(sd);
128 gpio_update(cx, cx->
card->gpio_audio_input.mask,
129 cx->
card->gpio_audio_input.radio);
135 struct cx18 *cx = v4l2_get_subdevdata(sd);
140 data = cx->
card->gpio_audio_input.linein;
143 data = cx->
card->gpio_audio_input.tuner;
151 data = cx->
card->gpio_audio_input.tuner;
154 gpio_update(cx, cx->
card->gpio_audio_input.mask, data);
158 static int gpiomux_s_audio_routing(
struct v4l2_subdev *sd,
161 struct cx18 *cx = v4l2_get_subdevdata(sd);
166 data = cx->
card->gpio_audio_input.tuner;
169 data = cx->
card->gpio_audio_input.linein;
172 data = cx->
card->gpio_audio_input.radio;
177 gpio_update(cx, cx->
card->gpio_audio_input.mask, data);
182 .log_status = gpiomux_log_status,
183 .s_std = gpiomux_s_std,
187 .s_radio = gpiomux_s_radio,
191 .s_routing = gpiomux_s_audio_routing,
195 .core = &gpiomux_core_ops,
196 .tuner = &gpiomux_tuner_ops,
197 .audio = &gpiomux_audio_ops,
203 static int resetctrl_log_status(
struct v4l2_subdev *sd)
205 struct cx18 *cx = v4l2_get_subdevdata(sd);
216 struct cx18 *cx = v4l2_get_subdevdata(sd);
219 p = &cx->
card->gpio_i2c_slave_reset;
244 if (cx->
card->tuners[0].tuner == TUNER_XC2028)
245 gpio_reset_seq(cx, (1 << cx->
card->xceive_pin), 0,
253 .log_status = resetctrl_log_status,
254 .reset = resetctrl_reset,
258 .core = &resetctrl_core_ops,
270 if (cx->
card->tuners[0].tuner == TUNER_XC2028) {
304 ops = &resetctrl_ops;
305 str =
"gpio-reset-ctrl";
312 v4l2_set_subdevdata(sd, cx);
322 if (cx->
card->gpio_i2c_slave_reset.ir_reset_mask == 0)
338 struct cx18 *cx = cb_data->
cx;
341 cx->
card->tuners[0].tuner != TUNER_XC2028)