This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Video problems in linux

Other Parts Discussed in Thread: TVP5150AM1, TVP5150, AM3517

Hello,

I have some problems with video device. I am using TVP5150am1 video Encoder. I want to connect to video camera (using composite inpute of TVP5150am1). But when I try to use /dev/video0 (device of encoder) V4L freeze and It does not show anything. I try to acces it with a simple code using V4L, and mplayer.

Actually I configured enconder in this way

/*
 * VPFE - Video Decoder interface
 *
 * Based in board-am3517evm with TVP514x chipset we use TVP5150AM1
 */

#define TVP5150_STD_ALL        (V4L2_STD_NTSC | V4L2_STD_PAL)

static struct v4l2_input tvp5150_inputs[] = {
    {
        .index    = 0,
        .name    = "Composite",
        .type    = V4L2_INPUT_TYPE_CAMERA,
        .std    = TVP5150_STD_ALL,
    },
};

static struct vpfe_route tvp5150_routes[] = {
    {
        .input    = TVP5150_COMPOSITE0,
        .output    = TVP5150_NORMAL,
    },
};

static struct vpfe_subdev_info vpfe_sub_devs[] = {
    {
        .name        = "tvp5150",
        .grp_id        = 0,
        .num_inputs    = ARRAY_SIZE(tvp5150_inputs),
        .inputs        = tvp5150_inputs,
        .routes        = tvp5150_routes,
        .can_route    = 1,
        /*.ccdc_if_params    = {
            .if_type = VPFE_BT656,
            .hdpol    = VPFE_PINPOL_POSITIVE,
            .vdpol    = VPFE_PINPOL_POSITIVE,
        },*/
        .board_info    = {
            I2C_BOARD_INFO("tvp5150", 0x5C),
        },
    },
};


static void am3517_evm_clear_vpfe_intr(int vdint)
{
    unsigned int vpfe_int_clr;

    vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);

    switch (vdint) {
    /* VD0 interrrupt */
    case INT_35XX_CCDC_VD0_IRQ:
        vpfe_int_clr &= ~AM35XX_VPFE_CCDC_VD0_INT_CLR;
        vpfe_int_clr |= AM35XX_VPFE_CCDC_VD0_INT_CLR;
        break;
    /* VD1 interrrupt */
    case INT_35XX_CCDC_VD1_IRQ:
        vpfe_int_clr &= ~AM35XX_VPFE_CCDC_VD1_INT_CLR;
        vpfe_int_clr |= AM35XX_VPFE_CCDC_VD1_INT_CLR;
        break;
    /* VD2 interrrupt */
    case INT_35XX_CCDC_VD2_IRQ:
        vpfe_int_clr &= ~AM35XX_VPFE_CCDC_VD2_INT_CLR;
        vpfe_int_clr |= AM35XX_VPFE_CCDC_VD2_INT_CLR;
        break;
    /* Clear all interrrupts */
    default:
        vpfe_int_clr &= ~(AM35XX_VPFE_CCDC_VD0_INT_CLR |
                AM35XX_VPFE_CCDC_VD1_INT_CLR |
                AM35XX_VPFE_CCDC_VD2_INT_CLR);
        vpfe_int_clr |= (AM35XX_VPFE_CCDC_VD0_INT_CLR |
                AM35XX_VPFE_CCDC_VD1_INT_CLR |
                AM35XX_VPFE_CCDC_VD2_INT_CLR);
        break;
    }
    omap_ctrl_writel(vpfe_int_clr, AM35XX_CONTROL_LVL_INTR_CLEAR);
    vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
}

static struct vpfe_config vpfe_cfg = {
    .num_subdevs    = ARRAY_SIZE(vpfe_sub_devs),
    .i2c_adapter_id    = 2,
    .sub_devs    = vpfe_sub_devs,
    .clr_intr    = am3517_evm_clear_vpfe_intr,
    .card_name    = "DM6446 EVM",
    .ccdc        = "DM6446 CCDC",
};

static struct resource vpfe_resources[] = {
    {
        .start    = INT_35XX_CCDC_VD0_IRQ,
        .end    = INT_35XX_CCDC_VD0_IRQ,
        .flags    = IORESOURCE_IRQ,
    },
    {
        .start    = INT_35XX_CCDC_VD1_IRQ,
        .end    = INT_35XX_CCDC_VD1_IRQ,
        .flags    = IORESOURCE_IRQ,
    },
};

static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
static struct platform_device vpfe_capture_dev = {
    .name        = CAPTURE_DRV_NAME,
    .id        = -1,
    .num_resources    = ARRAY_SIZE(vpfe_resources),
    .resource    = vpfe_resources,
    .dev = {
        .dma_mask        = &vpfe_capture_dma_mask,
        .coherent_dma_mask    = DMA_BIT_MASK(32),
        .platform_data        = &vpfe_cfg,
    },
};

/* END - VPFE - Video Decoder interface */

I do not know how I am doing wrong. Suggestions?

Thanks a lot.