Power_on call from camera_common_pdata

I have difficulties finding where the following code snippet is implemented. It is defined in camera_common.h, but I find no implementation so I wonder how it works. Can you please help?

struct camera_common_pdata {

int (*power_on)(struct camera_common_power_rail *pw);
int (*power_off)(struct camera_common_power_rail *pw);

hello nouuata,

please access L4T sources, it contains source data for the BSP.
this structure is used by Tegra camera framework, you may also check below for reference,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/nvidia/include/media/camera_common.h
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c

please also refer to Camera Architecture Stack to helps you understand the camera software architecture includes NVIDIA components.
thanks

Hi @JerryChang

I took a look at those two files before asking, but I saw no implementation in the source file. Maybe it is not part of the public_sources. I wanted to understand the following code better, but I am fine to take it for granted.

static int imx185_power_on(struct camera_common_data *s_data)
{
	int err = 0;
	struct camera_common_power_rail *pw = s_data->power;
	struct camera_common_pdata *pdata = s_data->pdata;
	struct device *dev = s_data->dev;

	dev_dbg(dev, "%s: power on\n", __func__);
	if (pdata && pdata->power_on) {
		err = pdata->power_on(pw);

hello nouuata,

that’s common function to include platform data, use the APIs to have sensor operation.
for example,

static struct camera_common_sensor_ops imx185_common_ops = {
        ...
        .power_on = imx185_power_on,

it’s power on and power off function to indicate the sequence of the power supplies, please also check the sensor specification to confirm the correct sequence to enable power supplies.
thanks