linux/drivers/media/platform/qcom/camss/camss.c

// SPDX-License-Identifier: GPL-2.0
/*
 * camss.c
 *
 * Qualcomm MSM Camera Subsystem - Core
 *
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015-2018 Linaro Ltd.
 */
#include <linux/clk.h>
#include <linux/interconnect.h>
#include <linux/media-bus-format.h>
#include <linux/media.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/pm_runtime.h>
#include <linux/pm_domain.h>
#include <linux/slab.h>
#include <linux/videodev2.h>

#include <media/media-device.h>
#include <media/v4l2-async.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mc.h>
#include <media/v4l2-fwnode.h>

#include "camss.h"

#define CAMSS_CLOCK_MARGIN_NUMERATOR
#define CAMSS_CLOCK_MARGIN_DENOMINATOR

static const struct parent_dev_ops vfe_parent_dev_ops;

static const struct camss_subdev_resources csiphy_res_8x16[] =;

static const struct camss_subdev_resources csid_res_8x16[] =;

static const struct camss_subdev_resources ispif_res_8x16 =;

static const struct camss_subdev_resources vfe_res_8x16[] =;

static const struct camss_subdev_resources csiphy_res_8x96[] =;

static const struct camss_subdev_resources csid_res_8x96[] =;

static const struct camss_subdev_resources ispif_res_8x96 =;

static const struct camss_subdev_resources vfe_res_8x96[] =;

static const struct camss_subdev_resources csiphy_res_660[] =;

static const struct camss_subdev_resources csid_res_660[] =;

static const struct camss_subdev_resources ispif_res_660 =;

static const struct camss_subdev_resources vfe_res_660[] =;

static const struct camss_subdev_resources csiphy_res_845[] =;

static const struct camss_subdev_resources csid_res_845[] =;

static const struct camss_subdev_resources vfe_res_845[] =;

static const struct camss_subdev_resources csiphy_res_8250[] =;

static const struct camss_subdev_resources csid_res_8250[] =;

static const struct camss_subdev_resources vfe_res_8250[] =;

static const struct resources_icc icc_res_sm8250[] =;

static const struct camss_subdev_resources csiphy_res_sc8280xp[] =;

static const struct camss_subdev_resources csid_res_sc8280xp[] =;

static const struct camss_subdev_resources vfe_res_sc8280xp[] =;

static const struct resources_icc icc_res_sc8280xp[] =;

/*
 * camss_add_clock_margin - Add margin to clock frequency rate
 * @rate: Clock frequency rate
 *
 * When making calculations with physical clock frequency values
 * some safety margin must be added. Add it.
 */
inline void camss_add_clock_margin(u64 *rate)
{}

/*
 * camss_enable_clocks - Enable multiple clocks
 * @nclocks: Number of clocks in clock array
 * @clock: Clock array
 * @dev: Device
 *
 * Return 0 on success or a negative error code otherwise
 */
int camss_enable_clocks(int nclocks, struct camss_clock *clock,
			struct device *dev)
{}

/*
 * camss_disable_clocks - Disable multiple clocks
 * @nclocks: Number of clocks in clock array
 * @clock: Clock array
 */
void camss_disable_clocks(int nclocks, struct camss_clock *clock)
{}

/*
 * camss_find_sensor - Find a linked media entity which represents a sensor
 * @entity: Media entity to start searching from
 *
 * Return a pointer to sensor media entity or NULL if not found
 */
struct media_entity *camss_find_sensor(struct media_entity *entity)
{}

/**
 * camss_get_link_freq - Get link frequency from sensor
 * @entity: Media entity in the current pipeline
 * @bpp: Number of bits per pixel for the current format
 * @lanes: Number of lanes in the link to the sensor
 *
 * Return link frequency on success or a negative error code otherwise
 */
s64 camss_get_link_freq(struct media_entity *entity, unsigned int bpp,
			unsigned int lanes)
{}

/*
 * camss_get_pixel_clock - Get pixel clock rate from sensor
 * @entity: Media entity in the current pipeline
 * @pixel_clock: Received pixel clock value
 *
 * Return 0 on success or a negative error code otherwise
 */
int camss_get_pixel_clock(struct media_entity *entity, u64 *pixel_clock)
{}

int camss_pm_domain_on(struct camss *camss, int id)
{}

void camss_pm_domain_off(struct camss *camss, int id)
{}

static int vfe_parent_dev_ops_get(struct camss *camss, int id)
{}

static int vfe_parent_dev_ops_put(struct camss *camss, int id)
{}

static void __iomem
*vfe_parent_dev_ops_get_base_address(struct camss *camss, int id)
{}

static const struct parent_dev_ops vfe_parent_dev_ops =;

/*
 * camss_of_parse_endpoint_node - Parse port endpoint node
 * @dev: Device
 * @node: Device node to be parsed
 * @csd: Parsed data from port endpoint node
 *
 * Return 0 on success or a negative error code on failure
 */
static int camss_of_parse_endpoint_node(struct device *dev,
					struct device_node *node,
					struct camss_async_subdev *csd)
{}

/*
 * camss_of_parse_ports - Parse ports node
 * @dev: Device
 * @notifier: v4l2_device notifier data
 *
 * Return number of "port" nodes found in "ports" node
 */
static int camss_of_parse_ports(struct camss *camss)
{}

/*
 * camss_init_subdevices - Initialize subdev structures and resources
 * @camss: CAMSS device
 *
 * Return 0 on success or a negative error code on failure
 */
static int camss_init_subdevices(struct camss *camss)
{}

/*
 * camss_link_entities - Register subdev nodes and create links
 * @camss: CAMSS device
 *
 * Return 0 on success or a negative error code on failure
 */
static int camss_link_entities(struct camss *camss)
{}

/*
 * camss_register_entities - Register subdev nodes and create links
 * @camss: CAMSS device
 *
 * Return 0 on success or a negative error code on failure
 */
static int camss_register_entities(struct camss *camss)
{}

/*
 * camss_unregister_entities - Unregister subdev nodes
 * @camss: CAMSS device
 *
 * Return 0 on success or a negative error code on failure
 */
static void camss_unregister_entities(struct camss *camss)
{}

static int camss_subdev_notifier_bound(struct v4l2_async_notifier *async,
				       struct v4l2_subdev *subdev,
				       struct v4l2_async_connection *asd)
{}

static int camss_subdev_notifier_complete(struct v4l2_async_notifier *async)
{}

static const struct v4l2_async_notifier_operations camss_subdev_notifier_ops =;

static const struct media_device_ops camss_media_ops =;

static int camss_configure_pd(struct camss *camss)
{}

static int camss_icc_get(struct camss *camss)
{}

static void camss_genpd_subdevice_cleanup(struct camss *camss)
{}

static void camss_genpd_cleanup(struct camss *camss)
{}

/*
 * camss_probe - Probe CAMSS platform device
 * @pdev: Pointer to CAMSS platform device
 *
 * Return 0 on success or a negative error code on failure
 */
static int camss_probe(struct platform_device *pdev)
{}

void camss_delete(struct camss *camss)
{}

/*
 * camss_remove - Remove CAMSS platform device
 * @pdev: Pointer to CAMSS platform device
 *
 * Always returns 0.
 */
static void camss_remove(struct platform_device *pdev)
{}

static const struct camss_resources msm8916_resources =;

static const struct camss_resources msm8996_resources =;

static const struct camss_resources sdm660_resources =;

static const struct camss_resources sdm845_resources =;

static const struct camss_resources sm8250_resources =;

static const struct camss_resources sc8280xp_resources =;

static const struct of_device_id camss_dt_match[] =;

MODULE_DEVICE_TABLE(of, camss_dt_match);

static int __maybe_unused camss_runtime_suspend(struct device *dev)
{}

static int __maybe_unused camss_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops camss_pm_ops =;

static struct platform_driver qcom_camss_driver =;

module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();