drivers/gpu/host1x/mipi.c

Source file repositories/reference/linux-study-clean/drivers/gpu/host1x/mipi.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/host1x/mipi.c
Extension
.c
Size
5146 bytes
Lines
196
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013 NVIDIA Corporation
 * Copyright (C) 2025 Svyatoslav Ryhel <clamor95@gmail.com>
 */

#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/tegra-mipi-cal.h>

/* only need to support one provider */
static struct {
	struct device_node *np;
	const struct tegra_mipi_ops *ops;
} provider;

/**
 * tegra_mipi_enable - Enable the Tegra MIPI calibration device.
 * @device: Handle to the Tegra MIPI calibration device.
 *
 * This calls the enable sequence for the Tegra MIPI calibration device.
 *
 * Returns 0 on success or a negative error code on failure.
 */
int tegra_mipi_enable(struct tegra_mipi_device *device)
{
	if (device->ops->enable)
		return device->ops->enable(device);

	return 0;
}
EXPORT_SYMBOL(tegra_mipi_enable);

/**
 * tegra_mipi_disable - Disable the Tegra MIPI calibration device.
 * @device: Handle to the Tegra MIPI calibration device.
 *
 * This calls the disable sequence for the Tegra MIPI calibration device.
 *
 * Returns 0 on success or a negative error code on failure.
 */
int tegra_mipi_disable(struct tegra_mipi_device *device)
{
	if (device->ops->disable)
		return device->ops->disable(device);

	return 0;
}
EXPORT_SYMBOL(tegra_mipi_disable);

/**
 * tegra_mipi_start_calibration - Start the Tegra MIPI calibration sequence.
 * @device: Handle to the Tegra MIPI calibration device.
 *
 * This initiates the calibration of CSI/DSI interfaces via the Tegra MIPI
 * calibration device.
 *
 * Returns 0 on success or a negative error code on failure.
 */
int tegra_mipi_start_calibration(struct tegra_mipi_device *device)
{
	if (device->ops->start_calibration)
		return device->ops->start_calibration(device);

	return 0;
}
EXPORT_SYMBOL(tegra_mipi_start_calibration);

/**
 * tegra_mipi_finish_calibration - Finish the Tegra MIPI calibration sequence.
 * @device: Handle to the Tegra MIPI calibration device.
 *
 * This completes the calibration of CSI/DSI interfaces via the Tegra MIPI
 * calibration device.
 *
 * Returns 0 on success or a negative error code on failure.
 */
int tegra_mipi_finish_calibration(struct tegra_mipi_device *device)
{
	if (device->ops->finish_calibration)
		return device->ops->finish_calibration(device);

	return 0;
}

Annotation

Implementation Notes