/* select tuner-output on saa7111a */
        i = 0;
        saa7111a_call(mxb, video, s_routing, SAA7115_COMPOSITE0,
-               SAA7111_FMT_CCIR | SAA7111_VBI_BYPASS, 0);
+               SAA7111_FMT_CCIR, 0);
 
        /* select a tuner type */
        tun_setup.mode_mask = T_ANALOG_TV;
                return err;
 
        /* switch video in saa7111a */
-       if (saa7111a_call(mxb, video, s_routing, i, 0, 0))
-               printk(KERN_ERR "VIDIOC_S_INPUT: could not address saa7111a #1.\n");
+       if (saa7111a_call(mxb, video, s_routing, i, SAA7111_FMT_CCIR, 0))
+               printk(KERN_ERR "VIDIOC_S_INPUT: could not address saa7111a.\n");
 
        /* switch the audio-source only if necessary */
        if (0 == mxb->cur_mute)
 
        if (id == V4L2_IDENT_SAA7111)
                return reg < 0x20 && reg != 0x01 && reg != 0x0f &&
                       (reg < 0x13 || reg > 0x19) && reg != 0x1d && reg != 0x1e;
+       if (id == V4L2_IDENT_SAA7111A)
+               return reg < 0x20 && reg != 0x01 && reg != 0x0f &&
+                      reg != 0x14 && reg != 0x18 && reg != 0x19 &&
+                      reg != 0x1d && reg != 0x1e;
 
        /* common for saa7113/4/5/8 */
        if (unlikely((reg >= 0x3b && reg <= 0x3f) || reg == 0x5c || reg == 0x5f ||
        011 NTSC N (3.58MHz)            PAL M (3.58MHz)
        100 reserved                    NTSC-Japan (3.58MHz)
        */
-       if (state->ident == V4L2_IDENT_SAA7111 ||
-           state->ident == V4L2_IDENT_SAA7113) {
+       if (state->ident <= V4L2_IDENT_SAA7113) {
                u8 reg = saa711x_read(sd, R_0E_CHROMA_CNTL_1) & 0x8f;
 
                if (std == V4L2_STD_PAL_M) {
                             u32 input, u32 output, u32 config)
 {
        struct saa711x_state *state = to_state(sd);
-       u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0;
+       u8 mask = (state->ident <= V4L2_IDENT_SAA7111A) ? 0xf8 : 0xf0;
 
        v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n",
                input, output);
 
        /* saa7111/3 does not have these inputs */
-       if ((state->ident == V4L2_IDENT_SAA7113 ||
-            state->ident == V4L2_IDENT_SAA7111) &&
+       if (state->ident <= V4L2_IDENT_SAA7113 &&
            (input == SAA7115_COMPOSITE4 ||
             input == SAA7115_COMPOSITE5)) {
                return -EINVAL;
        }
        if (input > SAA7115_SVIDEO3)
                return -EINVAL;
-       if (output > SAA7115_IPORT_ON)
-               return -EINVAL;
        if (state->input == input && state->output == output)
                return 0;
        v4l2_dbg(1, debug, sd, "now setting %s input %s output\n",
        state->input = input;
 
        /* saa7111 has slightly different input numbering */
-       if (state->ident == V4L2_IDENT_SAA7111) {
+       if (state->ident <= V4L2_IDENT_SAA7111A) {
                if (input >= SAA7115_COMPOSITE4)
                        input -= 2;
                /* saa7111 specific */
 {
        struct saa711x_state *state = to_state(sd);
 
-       if (state->ident != V4L2_IDENT_SAA7111)
+       if (state->ident > V4L2_IDENT_SAA7111A)
                return -EINVAL;
        saa711x_write(sd, 0x11, (saa711x_read(sd, 0x11) & 0x7f) |
                (val ? 0x80 : 0));
        switch (chip_id) {
        case '1':
                state->ident = V4L2_IDENT_SAA7111;
+               if (saa711x_read(sd, R_00_CHIP_VERSION) & 0xf0) {
+                       v4l_info(client, "saa7111a variant found\n");
+                       state->ident = V4L2_IDENT_SAA7111A;
+               }
                break;
        case '3':
                state->ident = V4L2_IDENT_SAA7113;
        default:
                state->ident = V4L2_IDENT_SAA7111;
                v4l2_info(sd, "WARNING: Chip is not known - Falling back to saa7111\n");
-
+               break;
        }
 
        state->audclk_freq = 48000;
        state->crystal_freq = SAA7115_FREQ_24_576_MHZ;
        switch (state->ident) {
        case V4L2_IDENT_SAA7111:
+       case V4L2_IDENT_SAA7111A:
                saa711x_writeregs(sd, saa7111_init);
                break;
        case V4L2_IDENT_SAA7113:
                state->crystal_freq = SAA7115_FREQ_32_11_MHZ;
                saa711x_writeregs(sd, saa7115_init_auto_input);
        }
-       if (state->ident != V4L2_IDENT_SAA7111)
+       if (state->ident > V4L2_IDENT_SAA7111A)
                saa711x_writeregs(sd, saa7115_init_misc);
        saa711x_set_v4lstd(sd, V4L2_STD_NTSC);