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.

TDA4VM: How to set the exp5 GPIO under the I2C6

Part Number: TDA4VM
Other Parts Discussed in Thread: TCA6408

Tool/software:


I want to set the 0th pin of gpio expander 5 under i2c6 to output high level mode after power on to power up the max96712, but failed.

&main_i2c6 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_i2c6_pins_default>;
clock-frequency = <400000>;

exp5: gpio@20 {
compatible = "ti,tca6408";
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
};
};

&main_i2c6 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

Max96712: deserializer@29 {
compatible = "maxim,max96712";
reg = <0x29>;
clocks = <&clk_ov5640_fixed>;
clock-names = "xclk";
powerdown-gpios = <&exp5 0 GPIO_ACTIVE_HIGH>;

port {
csi2_cam0: endpoint {
remote-endpoint = <&csi2rx0_in_sensor>;
clock-lanes = <0>;
data-lanes = <1 2 3 4>;
};
};
};
};

board-support/ti-linux-kernel-6.6.32+git-ti/drivers/staging/media/max96712/max96712.c

probe function

priv->gpiod_pwdn = devm_gpiod_get_optional(&client->dev, "powerdown",
GPIOD_OUT_HIGH);
if (IS_ERR(priv->gpiod_pwdn))
     return PTR_ERR(priv->gpiod_pwdn);

gpiod_set_consumer_name(priv->gpiod_pwdn, "max96712-pwdn");
gpiod_set_value_cansleep(priv->gpiod_pwdn, 1);

  • Dear Ti expert,

    I need to power up the max96712 during the driving phase, and connect the pwd of the max96712 to the CSI2_EXP_RSTZ pin of the GPIO expander under the I2C6 of the TDA4.

    The device tree and prob function are as above. The current configuration does not work.

  • Hi,

    File: arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts

    Code:

    &main_i2c0 {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&main_i2c0_pins_default>;
            clock-frequency = <400000>;
    
            exp1: gpio@20 {
                    compatible = "ti,tca6416";
                    reg = <0x20>;
                    gpio-controller;
                    #gpio-cells = <2>;
            };
    
            exp2: gpio@22 {
                    compatible = "ti,tca6424";
                    reg = <0x22>;
                    gpio-controller;
                    #gpio-cells = <2>;
    
                    p09-hog {
                            /* P11 - MCASP/TRACE_MUX_S0 */
                            gpio-hog;
                            gpios = <9 GPIO_ACTIVE_HIGH>;
                            output-low;
                            line-name = "MCASP/TRACE_MUX_S0";
                    };
    
                    p10-hog {
                            /* P12 - MCASP/TRACE_MUX_S1 */
                            gpio-hog;
                            gpios = <10 GPIO_ACTIVE_HIGH>;
                            output-high;
                            line-name = "MCASP/TRACE_MUX_S1";
                    };
            };
    

    You can use the gpio-hog feature to control the state of a line. In the example above:

    * P11 - MCASP/TRACE_MUX_S0 */
    gpio-hog;
    gpios = <9 GPIO_ACTIVE_HIGH>;

    GPIO 9 is set a High state.

    You should try something similar.

    - Keerthy