drivers/media/platform/arm/mali-c55/mali-c55-isp.c

Source file repositories/reference/linux-study-clean/drivers/media/platform/arm/mali-c55/mali-c55-isp.c

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/arm/mali-c55/mali-c55-isp.c
Extension
.c
Size
18216 bytes
Lines
647
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: implementation source
Status
source 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
/*
 * ARM Mali-C55 ISP Driver - Image signal processor
 *
 * Copyright (C) 2025 Ideas on Board Oy
 */

#include <linux/media/arm/mali-c55-config.h>

#include <linux/delay.h>
#include <linux/iopoll.h>
#include <linux/property.h>
#include <linux/string.h>

#include <uapi/linux/media/arm/mali-c55-config.h>

#include <media/media-entity.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-mc.h>
#include <media/v4l2-subdev.h>

#include "mali-c55-common.h"
#include "mali-c55-registers.h"

static const struct mali_c55_isp_format_info mali_c55_isp_fmts[] = {
	{
		.code = MEDIA_BUS_FMT_SRGGB20_1X20,
		.shifted_code = MEDIA_BUS_FMT_SRGGB16_1X16,
		.order = MALI_C55_BAYER_ORDER_RGGB,
		.bypass = false,
	},
	{
		.code = MEDIA_BUS_FMT_SGRBG20_1X20,
		.shifted_code = MEDIA_BUS_FMT_SGRBG16_1X16,
		.order = MALI_C55_BAYER_ORDER_GRBG,
		.bypass = false,
	},
	{
		.code = MEDIA_BUS_FMT_SGBRG20_1X20,
		.shifted_code = MEDIA_BUS_FMT_SGBRG16_1X16,
		.order = MALI_C55_BAYER_ORDER_GBRG,
		.bypass = false,
	},
	{
		.code = MEDIA_BUS_FMT_SBGGR20_1X20,
		.shifted_code = MEDIA_BUS_FMT_SBGGR16_1X16,
		.order = MALI_C55_BAYER_ORDER_BGGR,
		.bypass = false,
	},
	{
		.code = MEDIA_BUS_FMT_RGB202020_1X60,
		.shifted_code = 0, /* Not relevant for this format */
		.order = 0, /* Not relevant for this format */
		.bypass = true,
	}
	/*
	 * TODO: Support MEDIA_BUS_FMT_YUV20_1X60 here. This is so that we can
	 * also support YUV input from a sensor passed-through to the output. At
	 * present we have no mechanism to test that though so it may have to
	 * wait a while...
	 */
};

const struct mali_c55_isp_format_info *
mali_c55_isp_get_mbus_config_by_index(u32 index)
{
	if (index < ARRAY_SIZE(mali_c55_isp_fmts))
		return &mali_c55_isp_fmts[index];

	return NULL;
}

const struct mali_c55_isp_format_info *
mali_c55_isp_get_mbus_config_by_code(u32 code)
{
	unsigned int i;

	for (i = 0; i < ARRAY_SIZE(mali_c55_isp_fmts); i++) {
		if (mali_c55_isp_fmts[i].code == code)
			return &mali_c55_isp_fmts[i];
	}

	return NULL;
}

const struct mali_c55_isp_format_info *
mali_c55_isp_get_mbus_config_by_shifted_code(u32 code)
{

Annotation

Implementation Notes