Lines Matching refs:state
156 struct saa711x_state *state = to_state(sd);
165 if (saa711x_has_reg(state->ident, reg)) {
752 struct saa711x_state *state = to_state(sd);
760 if (!saa711x_has_reg(state->ident, R_30_AUD_MAST_CLK_CYCLES_PER_FIELD))
770 hz = (state->std & V4L2_STD_525_60) ? 5994 : 5000;
778 do_div(f, state->crystal_freq);
780 if (state->ucgc) {
781 acpf = acpf * state->cgcdiv / 16;
782 acni = acni * state->cgcdiv / 16;
784 if (state->cgcdiv == 3)
787 if (state->apll)
790 if (state->double_asclk) {
795 saa711x_write(sd, R_39_CLK_RATIO_ASCLK_TO_ALRCLK, 0x10 << state->double_asclk);
807 state->audclk_freq = freq;
814 struct saa711x_state *state = to_state(sd);
819 if (state->agc->val)
820 state->gain->val =
830 struct saa711x_state *state = to_state(sd);
851 if (state->agc->val)
852 saa711x_write(sd, R_0F_CHROMA_GAIN_CNTL, state->gain->val);
854 saa711x_write(sd, R_0F_CHROMA_GAIN_CNTL, state->gain->val | 0x80);
866 struct saa711x_state *state = to_state(sd);
870 int is_50hz = state->std & V4L2_STD_625_50;
881 if (!saa711x_has_reg(state->ident, R_D0_B_HORIZ_PRESCALING)) {
889 state->width = width;
890 state->height = height;
892 if (!saa711x_has_reg(state->ident, R_CC_B_HORIZ_OUTPUT_WINDOW_LENGTH))
972 struct saa711x_state *state = to_state(sd);
981 if (std == state->std)
984 state->std = std;
989 if (state->ident == GM7113C) {
1000 if (state->ident == GM7113C) {
1019 if (state->ident <= SAA7113 ||
1020 state->ident == GM7113C) {
1039 if (taskb && state->ident == SAA7114)
1043 saa711x_s_clock_freq(sd, state->audclk_freq);
1050 struct saa711x_state *state = to_state(sd);
1051 int is_50hz = (state->std & V4L2_STD_625_50);
1057 if (!saa711x_has_reg(state->ident, R_41_LCR_BASE))
1062 if (state->ident != SAA7115)
1192 struct saa711x_state *state = to_state(sd);
1204 if (state->std & V4L2_STD_525_60)
1257 struct saa711x_state *state = to_state(sd);
1260 if (state->radio)
1271 struct saa711x_state *state = to_state(sd);
1273 state->radio = 0;
1280 struct saa711x_state *state = to_state(sd);
1282 state->radio = 1;
1289 struct saa711x_state *state = to_state(sd);
1290 u8 mask = (state->ident <= SAA7111A) ? 0xf8 : 0xf0;
1296 if ((state->ident <= SAA7113 ||
1297 state->ident == GM7113C) &&
1304 if (state->input == input && state->output == output)
1309 state->input = input;
1312 if (state->ident <= SAA7111A) {
1332 (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0));
1334 state->output = output;
1335 if (state->ident == SAA7114 ||
1336 state->ident == SAA7115) {
1339 (state->output & 0x01));
1341 if (state->ident > SAA7111A) {
1352 struct saa711x_state *state = to_state(sd);
1354 if (state->ident > SAA7111A)
1363 struct saa711x_state *state = to_state(sd);
1368 if (state->enable == enable)
1370 state->enable = enable;
1371 if (!saa711x_has_reg(state->ident, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED))
1373 saa711x_write(sd, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED, state->enable);
1379 struct saa711x_state *state = to_state(sd);
1383 state->crystal_freq = freq;
1384 state->double_asclk = flags & SAA7115_FREQ_FL_DOUBLE_ASCLK;
1385 state->cgcdiv = (flags & SAA7115_FREQ_FL_CGCDIV) ? 3 : 4;
1386 state->ucgc = flags & SAA7115_FREQ_FL_UCGC;
1387 state->apll = flags & SAA7115_FREQ_FL_APLL;
1388 saa711x_s_clock_freq(sd, state->audclk_freq);
1433 struct saa711x_state *state = to_state(sd);
1444 if (state->ident == SAA7115) {
1493 struct saa711x_state *state = to_state(sd);
1498 if (state->ident == SAA7115)
1523 struct saa711x_state *state = to_state(sd);
1528 v4l2_info(sd, "Audio frequency: %d Hz\n", state->audclk_freq);
1529 if (state->ident != SAA7115) {
1545 if (state->input >= 6)
1546 v4l2_info(sd, "Input: S-Video %d\n", state->input - 6);
1548 v4l2_info(sd, "Input: Composite %d\n", state->input);
1566 v4l2_info(sd, "Width, Height: %d, %d\n", state->width, state->height);
1567 v4l2_ctrl_handler_log_status(&state->hdl, sd->name);
1631 static void saa711x_write_platform_data(struct saa711x_state *state,
1634 struct v4l2_subdev *sd = &state->sd;
1637 if (state->ident != GM7113C &&
1638 state->ident != SAA7113)
1810 struct saa711x_state *state;
1836 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
1837 if (state == NULL)
1839 sd = &state->sd;
1843 state->pads[SAA711X_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
1844 state->pads[SAA711X_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
1845 state->pads[SAA711X_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
1846 state->pads[SAA711X_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV;
1851 state->pads);
1858 hdl = &state->hdl;
1869 state->agc = v4l2_ctrl_new_std(hdl, &saa711x_ctrl_ops,
1871 state->gain = v4l2_ctrl_new_std(hdl, &saa711x_ctrl_ops,
1880 v4l2_ctrl_auto_cluster(2, &state->agc, 0, true);
1882 state->input = -1;
1883 state->output = SAA7115_IPORT_ON;
1884 state->enable = 1;
1885 state->radio = 0;
1886 state->ident = ident;
1888 state->audclk_freq = 48000;
1893 state->crystal_freq = SAA7115_FREQ_24_576_MHZ;
1895 switch (state->ident) {
1910 state->crystal_freq = SAA7115_FREQ_32_11_MHZ;
1913 if (state->ident > SAA7111A && state->ident != GM7113C)
1917 saa711x_write_platform_data(state, pdata);