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.

Linux: ADV7180 configuration

Tool/software: Linux

Hello every one.

I used am5728-evm board and I want to use adv7180 to show something of camera in LCD of my board !

in config of kernel CONFIG_VIDEO_ADV7180 set to "m" and in device tree :

&i2c5 {
status = "okay";
adv7180@20 {
compatible = "adi,adv7180";
reg = <0x20>;
port {
adv7180_1: endpoint{
remore-endpoint=<&vin3a>;
};

};
};
};


&vip2 {
status = "okay";
};

&vin3a {
status = "okay";
endpoint@0 {
slave-mode;
remote-endpoint = <&adv7180_1>;
};
};

after boot linux up by this command i faced with these errors:

root@am57xx-evm:~# dmesg | grep adv
[ 8.193027] systemd[1]: System time before build time, advancing clock.
[ 14.103261] probing adv7180 driver
[ 14.103268] adv7180 0-0020: chip found @ 0x20 (OMAP I2C adapter)
[ 14.103276] adv7180 0-0020: GPIO lookup for consumer powerdown
[ 14.103281] adv7180 0-0020: using device tree for GPIO lookup
[ 14.103387] of_get_named_gpiod_flags: can't parse 'powerdown-gpios' property of node '/ocp/i2c@48070000/adv7180@20[0]'
[ 14.103392] of_get_named_gpiod_flags: can't parse 'powerdown-gpio' property of node '/ocp/i2c@48070000/adv7180@20[0]'
[ 14.103397] adv7180 0-0020: using lookup tables for GPIO lookup
[ 14.103403] adv7180 0-0020: lookup for GPIO powerdown failed
[ 14.112658] adv7180: probe of 0-0020 failed with error -121
root@am57xx-evm:~#

  • I am still here for your help...!
  • Have you checked if pin-mux settings are proper?

  • Thanks for your reply...
    No I did not check pin-mux settings...
    How can check this?
    Is the problem from pin mux settings?
    My device tree is Ok?
  • I am still here for your help...!
  • I am still here....
    can not any one help me?
  • Hi Saman,

    <<[ 14.112658] adv7180: probe of 0-0020 failed with error -121

    This error code 121 is related to the I/O error. This means that i2c read/write of sensor registers are failing. Please ensure that camera board is connected properly to the EVM and also the pin-mux settings are as per the camera board pins needs. You can set the pin-mux in mux_data.h file under u-boot-xxxx/board/ti/am57xx folder.

    Also, if your intention is to capture the images in embedded sync mode, then you will need to modify the dts settings to add "channels" entry as shown below.

    adv7180@20 {
    compatible = "adi,adv7180";
    reg = <0x20>;
    port {
    adv7180_1: endpoint{
    channels = <0 >;
    remore-endpoint=<&vin3a>;
    };
  • Thank you very much for your response...
    I comment a few line in driver of adv7180 that about power down gpio.... :

    static int adv7180_probe(struct i2c_client *client,
    const struct i2c_device_id *id)
    {
    struct adv7180_state *state;
    struct v4l2_subdev *sd;
    int ret;
    printk("SaMan Mahmoodi probing adv7180 driver SaMan Mahmoodi\n");
    /* Check if the adapter supports the needed features */
    if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
    return -EIO;

    v4l_info(client, "chip found @ 0x%02x (%s)\n",
    client->addr, client->adapter->name);

    state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
    if (state == NULL){
    printk("SaMan Mahmoodi: ADV7180 Error state = NULL\n");
    return -ENOMEM;
    }
    state->client = client;
    state->field = V4L2_FIELD_INTERLACED;
    state->chip_info = (struct adv7180_chip_info *)id->driver_data;

    /*state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
    GPIOD_OUT_HIGH);*/
    /*if (IS_ERR(state->pwdn_gpio)) {
    ret = PTR_ERR(state->pwdn_gpio);
    v4l_err(client, "request for power pin failed: %d\n", ret);
    printk("SaMan Mahmoodi: ADV7180 Error request\n");
    return ret;
    }*/

    after that I modify my dts file like this:

    &i2c5 {
    status = "okay";
    adv7180@20 {
    compatible = "adi,adv7180";
    reg = <0x20>;
    port {
    adv7180_1: endpoint{
    remore-endpoint=<&vin3a>;
    };

    };
    };
    };

    &vip2 {
    status = "okay";
    };

    &vin3a {
    status = "okay";
    endpoint {
    slave-mode;
    remote-endpoint = <&adv7180_1>;
    };
    };

    after these changes on linux and after boot, when I use dmesg command to view log of system, I faced with this error:

    root@am57xx-evm:~# dmesg | grep adv
    [ 22.849932] systemd[1]: System time before build time, advancing clock.
    [ 29.700030] probing adv7180 driver
    [ 29.706454] adv7180 4-0020: chip found @ 0x20 (OMAP I2C adapter)
    [ 29.731297] adv7180: probe of 4-0020 failed with error -121
    root@am57xx-evm:~#


    How can Solve this?

  • Hi Saman,

    You are still getting IO error code -121. I don't know how to help you as this is related to i2c read failing in the initial probe phase itself. You might have to check your sensor board.

    Regards,
    Manisha