How do i config pmic device tree and driver code for camera sensor

hi I am developing the code for my camera sensor based on the AGX orin R35.2.1 SDK, but I find that I need to use the max25429 pmic to power the sensor. I don’t know how to configure the device tree information and code on the sdk of agx orin R35.2.1. Do we have relevant routines to refer to? For example, max77620 etc?

Hello

I am not familiar with this chip, but after a quick view of the chip, I think you required 2 o 3 GPIOs to control it.

You could have a custom driver to control the GPIOs but there are other options, for example, you can set the initial state of each GPIO from the device tree. For example:

file: nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-rbpcv2-imx219.dtsi

#define CAM0_RST        TEGRA234_MAIN_GPIO(H, 3
. . .
				gpio@2200000 {
					camera-control-output-low {
						gpio-hog;
						output-low;
						gpios = <CAM0_RST 0>;
						label = "cam0-rst";
					};
				};

Here the GPIO is configured to set an initial low value.

Or you can define the GPIOs as part of the camera driver, and control it from the camera driver, for example

                       rbpcv2_imx219_a@10 {
							reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
						};

In the driver you can get a reference to the GPIO:

   imx219->reset_gpio = devm_gpiod_get_optional(dev, "reset",
						     GPIOD_OUT_HIGH);

And use it, in your power on sequence:

* Power/clock management functions */
static int imx219_power_on(struct device *dev)
{
. . .
	gpiod_set_value_cansleep(imx219->reset_gpio, 1);
}

Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

Thanks~

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.