linux/drivers/staging/media/atomisp/pci/atomisp_v4l2.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Medifield PNW Camera Imaging ISP subsystem.
 *
 * Copyright (c) 2010-2017 Intel Corporation. All Rights Reserved.
 *
 * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 *
 */
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/pm_qos.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/interrupt.h>
#include <linux/bits.h>
#include <media/v4l2-fwnode.h>

#include <asm/iosf_mbi.h>

#include "../../include/linux/atomisp_gmin_platform.h"

#include "atomisp_cmd.h"
#include "atomisp_common.h"
#include "atomisp_fops.h"
#include "atomisp_ioctl.h"
#include "atomisp_internal.h"
#include "atomisp-regs.h"
#include "atomisp_dfs_tables.h"
#include "atomisp_drvfs.h"
#include "hmm/hmm.h"
#include "atomisp_trace_event.h"

#include "sh_css_firmware.h"

#include "device_access.h"

/* Timeouts to wait for all subdevs to be registered */
#define SUBDEV_WAIT_TIMEOUT
#define SUBDEV_WAIT_TIMEOUT_MAX_COUNT

/* G-Min addition: pull this in from intel_mid_pm.h */
#define CSTATE_EXIT_LATENCY_C1

/* cross componnet debug message flag */
int dbg_level;
module_param(dbg_level, int, 0644);
MODULE_PARM_DESC();

/* log function switch */
int dbg_func =;
module_param(dbg_func, int, 0644);
MODULE_PARM_DESC();

/*
 * Set to 16x16 since this is the amount of lines and pixels the sensor
 * exports extra. If these are kept at the 10x8 that they were on, in yuv
 * downscaling modes incorrect resolutions where requested to the sensor
 * driver with strange outcomes as a result. The proper way tot do this
 * would be to have a list of tables the specify the sensor res, mipi rec,
 * output res, and isp output res. however since we do not have this yet,
 * the chosen solution is the next best thing.
 */
int pad_w =;
module_param(pad_w, int, 0644);
MODULE_PARM_DESC();

int pad_h =;
module_param(pad_h, int, 0644);
MODULE_PARM_DESC();

/*
 * FIXME: this is a hack to make easier to support ISP2401 variant.
 * As a given system will either be ISP2401 or not, we can just use
 * a boolean, in order to replace existing #ifdef ISP2401 everywhere.
 *
 * Once this driver gets into a better shape, however, the best would
 * be to replace this to something stored inside atomisp allocated
 * structures.
 */

struct device *atomisp_dev;

static const struct atomisp_freq_scaling_rule dfs_rules_merr[] =;

/* Merrifield and Moorefield DFS rules */
static const struct atomisp_dfs_config dfs_config_merr =;

static const struct atomisp_freq_scaling_rule dfs_rules_merr_1179[] =;

static const struct atomisp_dfs_config dfs_config_merr_1179 =;

static const struct atomisp_freq_scaling_rule dfs_rules_merr_117a[] =;

static struct atomisp_dfs_config dfs_config_merr_117a =;

static const struct atomisp_freq_scaling_rule dfs_rules_byt[] =;

static const struct atomisp_dfs_config dfs_config_byt =;

static const struct atomisp_freq_scaling_rule dfs_rules_cht[] =;

static const struct atomisp_freq_scaling_rule dfs_rules_cht_soc[] =;

static const struct atomisp_dfs_config dfs_config_cht =;

/* This one should be visible also by atomisp_cmd.c */
const struct atomisp_dfs_config dfs_config_cht_soc =;

int atomisp_video_init(struct atomisp_video_pipe *video)
{}

void atomisp_video_unregister(struct atomisp_video_pipe *video)
{}

static int atomisp_save_iunit_reg(struct atomisp_device *isp)
{}

static int atomisp_restore_iunit_reg(struct atomisp_device *isp)
{}

static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp)
{}

/*
 * WA for DDR DVFS enable/disable
 * By default, ISP will force DDR DVFS 1600MHz before disable DVFS
 */
static void punit_ddr_dvfs_enable(bool enable)
{}

static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable)
{}

int atomisp_power_off(struct device *dev)
{}

int atomisp_power_on(struct device *dev)
{}

static int atomisp_suspend(struct device *dev)
{}

static int atomisp_resume(struct device *dev)
{}

int atomisp_csi_lane_config(struct atomisp_device *isp)
{}

static int atomisp_subdev_probe(struct atomisp_device *isp)
{}

static void atomisp_unregister_entities(struct atomisp_device *isp)
{}

static int atomisp_register_entities(struct atomisp_device *isp)
{}

static void atomisp_init_sensor(struct atomisp_input_subdev *input)
{}

int atomisp_register_device_nodes(struct atomisp_device *isp)
{}

static int atomisp_initialize_modules(struct atomisp_device *isp)
{}

static void atomisp_uninitialize_modules(struct atomisp_device *isp)
{}

const struct firmware *
atomisp_load_firmware(struct atomisp_device *isp)
{}

static void atomisp_pm_init(struct atomisp_device *isp)
{}

static void atomisp_pm_uninit(struct atomisp_device *isp)
{}

#define ATOM_ISP_PCI_BAR

static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void atomisp_pci_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id atomisp_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, atomisp_pci_tbl);

static struct pci_driver atomisp_pci_driver =;

module_pci_driver();

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_IMPORT_NS();