提交 ac911b31 编写于 作者: L Linus Torvalds

Merge tag 'media/v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull more media updates from Mauro Carvalho Chehab:

 - a set of atomisp patches. They remove several abstraction layers, and
   fixes clang and gcc warnings (that were hidden via some macros that
   were disabling 4 or 5 types of warnings there). There are also some
   important fixes and sensor auto-detection on newer BIOSes via ACPI
   _DCM tables.

 - some fixes

* tag 'media/v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (95 commits)
  media: rkvdec: Fix H264 scaling list order
  media: v4l2-ctrls: Unset correct HEVC loop filter flag
  media: videobuf2-dma-contig: fix bad kfree in vb2_dma_contig_clear_max_seg_size
  media: v4l2-subdev.rst: correct information about v4l2 events
  media: s5p-mfc: Properly handle dma_parms for the allocated devices
  media: medium: cec: Make MEDIA_CEC_SUPPORT default to n if !MEDIA_SUPPORT
  media: cedrus: Implement runtime PM
  media: cedrus: Program output format during each run
  media: atomisp: improve ACPI/DMI detection logs
  media: Revert "media: atomisp: add Asus Transform T101HA ACPI vars"
  media: Revert "media: atomisp: Add some ACPI detection info"
  media: atomisp: improve sensor detection code to use _DSM table
  media: atomisp: get rid of an iomem abstraction layer
  media: atomisp: get rid of a string_support.h abstraction layer
  media: atomisp: use strscpy() instead of less secure variants
  media: atomisp: set DFS to MAX if sensor doesn't report fps
  media: atomisp: use different dfs failed messages
  media: atomisp: change the detection of ISP2401 at runtime
  media: atomisp: use macros from intel-family.h
  media: atomisp: don't set hpll_freq twice with different values
  ...
无相关合并请求
......@@ -319,8 +319,7 @@ The device node handles a subset of the V4L2 API.
events can also be reported by one (or several) V4L2 device nodes.
Sub-device drivers that want to use events need to set the
``V4L2_SUBDEV_USES_EVENTS`` :c:type:`v4l2_subdev`.flags and initialize
:c:type:`v4l2_subdev`.nevents to events queue depth before registering
``V4L2_SUBDEV_FL_HAS_EVENTS`` :c:type:`v4l2_subdev`.flags before registering
the sub-device. After registration events can be queued as usual on the
:c:type:`v4l2_subdev`.devnode device node.
......
......@@ -24,7 +24,7 @@ config CEC_PIN_ERROR_INJ
menuconfig MEDIA_CEC_SUPPORT
bool
prompt "HDMI CEC drivers"
default y if !MEDIA_SUPPORT_FILTER
default y if MEDIA_SUPPORT && !MEDIA_SUPPORT_FILTER
help
Enable support for HDMI CEC (Consumer Electronics Control),
which is an optional HDMI feature.
......
......@@ -726,9 +726,8 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_memops);
int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
{
if (!dev->dma_parms) {
dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
dev_err(dev, "Failed to set max_seg_size: dma_parms is NULL\n");
return -ENODEV;
}
if (dma_get_max_seg_size(dev) < size)
return dma_set_max_seg_size(dev, size);
......@@ -737,21 +736,6 @@ int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
}
EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);
/*
* vb2_dma_contig_clear_max_seg_size() - release resources for DMA parameters
* @dev: device for configuring DMA parameters
*
* This function releases resources allocated to configure DMA parameters
* (see vb2_dma_contig_set_max_seg_size() function). It should be called from
* device drivers on driver remove.
*/
void vb2_dma_contig_clear_max_seg_size(struct device *dev)
{
kfree(dev->dma_parms);
dev->dma_parms = NULL;
}
EXPORT_SYMBOL_GPL(vb2_dma_contig_clear_max_seg_size);
MODULE_DESCRIPTION("DMA-contig memory handling routines for videobuf2");
MODULE_AUTHOR("Pawel Osciak <pawel@osciak.com>");
MODULE_LICENSE("GPL");
......@@ -1089,6 +1089,10 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
child->coherent_dma_mask = dev->coherent_dma_mask;
child->dma_mask = dev->dma_mask;
child->release = s5p_mfc_memdev_release;
child->dma_parms = devm_kzalloc(dev, sizeof(*child->dma_parms),
GFP_KERNEL);
if (!child->dma_parms)
goto err;
/*
* The memdevs are not proper OF platform devices, so in order for them
......@@ -1104,7 +1108,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
return child;
device_del(child);
}
err:
put_device(child);
return NULL;
}
......
......@@ -1844,7 +1844,7 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
sizeof(p_hevc_pps->row_height_minus1));
p_hevc_pps->flags &=
~V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED;
~V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED;
}
if (p_hevc_pps->flags &
......
# SPDX-License-Identifier: GPL-2.0
menuconfig INTEL_ATOMISP
bool "Enable support to Intel Atom ISP camera drivers"
depends on X86 && EFI && PCI && ACPI
......@@ -11,6 +12,7 @@ menuconfig INTEL_ATOMISP
config VIDEO_ATOMISP
tristate "Intel Atom Image Signal Processor Driver"
depends on VIDEO_V4L2 && INTEL_ATOMISP
depends on PMIC_OPREGION
select IOSF_MBI
select VIDEOBUF_VMALLOC
---help---
......
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for camera drivers.
#
......@@ -36,7 +37,6 @@ atomisp-objs += \
pci/sh_css_param_dvs.o \
pci/sh_css_param_shading.o \
pci/sh_css_params.o \
pci/sh_css_pipe.o \
pci/sh_css_properties.o \
pci/sh_css_shading.o \
pci/sh_css_sp.o \
......@@ -53,10 +53,7 @@ atomisp-objs += \
pci/hmm/hmm_dynamic_pool.o \
pci/hmm/hmm.o \
pci/hmm/hmm_reserved_pool.o \
pci/hmm/hmm_vm.o \
pci/hrt/hive_isp_css_mm_hrt.o \
pci/ia_css_device_access.o \
pci/ia_css_memory_access.o \
pci/isp/kernels/aa/aa_2/ia_css_aa2.host.o \
pci/isp/kernels/anr/anr_1.0/ia_css_anr.host.o \
pci/isp/kernels/anr/anr_2/ia_css_anr2.host.o \
......@@ -117,7 +114,6 @@ atomisp-objs += \
pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.o \
pci/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.o \
pci/isp/kernels/ynr/ynr_2/ia_css_ynr2.host.o \
pci/memory_realloc.o \
pci/mmu/isp_mmu.o \
pci/mmu/sh_mmu_mrfld.o \
pci/runtime/binary/src/binary.o \
......@@ -328,11 +324,6 @@ INCLUDES_cht += \
# -I$(atomisp)/pci/css_2401_system/hrt/ \
# -I$(atomisp)/pci/css_2401_system/hive_isp_css_2401_system_generated/ \
ifeq ($(CONFIG_ION),y)
INCLUDES += -I$(srctree)/drivers/staging/android/ion
endif
DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__
#DEFINES += -DUSE_DYNAMIC_BIN
#DEFINES += -DISP_POWER_GATING
......@@ -352,12 +343,3 @@ DEFINES += -DISP2400 -DSYSTEM_hive_isp_css_2400_system
endif
ccflags-y += $(INCLUDES) $(DEFINES) -fno-common
# HACK! While this driver is in bad shape, don't enable several warnings
# that would be otherwise enabled with W=1
ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
ccflags-y += $(call cc-disable-warning, missing-prototypes)
ccflags-y += $(call cc-disable-warning, missing-declarations)
ccflags-y += $(call cc-disable-warning, suggest-attribute=format)
ccflags-y += $(call cc-disable-warning, unused-const-variable)
ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
1. A single AtomISP driver needs to be implemented to support both
Baytrail (BYT and Cherrytail (CHT) platforms at the same time.
NOTE:
=====
While the driver probes the hardware and reports itself as a
V4L2 driver, there are still some issues preventing it to
stream (at least it doesn't with the standard V4L2 applications.
Didn't test yet with some custom-made app for this driver).
Solving the related bugs and issues preventing it to work is
needed (items 6 and 7 from the list below).
TODO
====
1. The atomisp doesn't rely at the usual i2c stuff to discover the
sensors. Instead, it calls a function from atomisp_gmin_platform.c.
There are some hacks added there for it to wait for sensors to be
probed (with a timeout of 2 seconds or so).
This should be converted to the usual way, using V4L2 async subdev
framework to wait for cameras to be probed;
2. Use ACPI _DSM table - DONE!
3. Switch the driver to use pm_runtime stuff. Right now, it probes the
existing PMIC code and sensors call it directly.
4. There's a problem at the sensor drivers: when trying to set a video
format, the atomisp main driver calls the sensor drivers with the
sensor turned off. This causes them to fail.
The only exception is the atomisp-ov2880, which has a hack inside it
to turn it on when VIDIOC_S_FMT is called.
The right fix seems to power on the sensor when a video device is
opened (or at the first VIDIOC_ ioctl - except for VIDIOC_QUERYCAP),
powering it down at close() syscall.
Such kind of control would need to be done inside the atomisp driver,
not at the sensors code.
5. There are several issues related to memory management, causing
crashes. The atomisp splits the memory management on three separate
regions:
- dynamic pool;
- reserved pool;
- generic pool
The code implementing it is at:
drivers/staging/media/atomisp/pci/hmm/
It also has a separate code for managing DMA buffers at:
drivers/staging/media/atomisp/pci/mmu/
The code there is really dirty, ugly and probably wrong. I fixed
one bug there already, but the best would be to just trash it and use
something else. Maybe the code from the newer intel driver could
serve as a model:
drivers/staging/media/ipu3/ipu3-mmu.c
But converting it to use something like that is painful and may
cause some breakages.
6. There is some issues at the frame receive logic, causing the
DQBUF ioctls to fail.
7. A single AtomISP driver needs to be implemented to support both
Baytrail (BYT) and Cherrytail (CHT) platforms at the same time.
The current driver is a mechanical and hand combined merge of the
two using several runtime macros, plus some ifdef ISP2401 to select the
CHT version. Yet, there are some ISP-specific headers that change the
driver's behavior during compile time.
2. The file structure needs to get tidied up to resemble a normal Linux
8. The file structure needs to get tidied up to resemble a normal Linux
driver.
3. Lots of the midlayer glue. unused code and abstraction needs removing.
9. Lots of the midlayer glue. unused code and abstraction needs removing.
3. The sensor drivers read MIPI settings from EFI variables or default to the
settings hard-coded in the platform data file for different platforms.
It should be possible to improve it, by adding support for _DSM tables.
10. The AtomISP driver includes some special IOCTLS (ATOMISP_IOC_XXXX_XXXX)
and controls that require some cleanup. Some of those code may have
been removed during the cleanups. They could be needed in order to
properly support 3A algorithms
4. The sensor drivers use PMIC and the regulator framework API. In the ideal
world it would be using ACPI but that's not how the existing devices work.
Such IOCTL interface needs more documentation. The better would
be to use something close to the interface used by the IPU3 IMGU driver.
5. The AtomISP driver includes some special IOCTLS (ATOMISP_IOC_XXXX_XXXX)
and controls that require some cleanup.
11. The ISP code has some dependencies of the exact FW version.
The version defined in pci/sh_css_firmware.c:
6. Correct Coding Style. Please don't send coding style patches for this
driver until the other work is done.
BYT (isp2400): "irci_stable_candrpv_0415_20150521_0458"
7. The ISP code has some dependencies of the exact FW version.
The version defined in pci/sh_css_firmware.c:
BYT:
static const char *isp2400_release_version = STR(irci_stable_candrpv_0415_20150521_0458);
CHT (isp2401): "irci_ecr - master_20150911_0724"
CHT:
static const char *isp2401_release_version = STR(irci_ecr - master_20150911_0724);
Those versions don't seem to be available anymore. On the tests we've
done so far, this version also seems to work for CHT:
Those versions don't seem to be available anymore. On the tests we've
done so far, this version also seems to work for isp2401:
"irci_stable_candrpv_0415_20150521_0458"
irci_stable_candrpv_0415_20150521_0458
Which can be obtainable from Yocto Atom ISP respository.
At some point we may need to round up a few driver versions and see if
there are any specific things that can be done to fold in support for
multiple firmware versions.
but this was not thoroughly tested.
8. Switch to V4L2 async API to set up sensor, lens and flash devices.
Control those devices using V4L2 sub-device API without custom
extensions.
At some point we may need to round up a few driver versions and see if
there are any specific things that can be done to fold in support for
multiple firmware versions.
9. Switch to standard V4L2 sub-device API for sensor and lens. In
particular, the user space API needs to support V4L2 controls as
defined in the V4L2 spec and references to atomisp must be removed from
these drivers.
12. Switch to standard V4L2 sub-device API for sensor and lens. In
particular, the user space API needs to support V4L2 controls as
defined in the V4L2 spec and references to atomisp must be removed from
these drivers.
10. Use LED flash API for flash LED drivers such as LM3554 (which already
13. Use LED flash API for flash LED drivers such as LM3554 (which already
has a LED class driver).
11. Switch from videobuf1 to videobuf2. Videobuf1 is being removed!
12. There are some memory management code that seems to be
forked from Kernel 3.10 inside hmm/ directory. Get rid of it,
making the driver to use a more standard memory management module.
14. Switch from videobuf1 to videobuf2. Videobuf1 is being removed!
13. While the driver probes the hardware and reports itself as a
V4L2 driver, there are still some issues preventing it to
stream (at least it doesn't with the standard V4L2 applications.
Didn't test yet with some custom-made app for this driver).
Solving the related bugs and issues preventing it to work is
needed.
15. Correct Coding Style. Please refrain sending coding style patches
for this driver until the other work is done, as there will be a lot
of code churn until this driver becomes functional again.
Limitations:
Limitations
===========
1. To test the patches, you also need the ISP firmware
......@@ -76,14 +132,16 @@ Limitations:
device but can also be extracted from the upgrade kit if you've managed
to lose them somehow.
2. Without a 3A libary the capture behaviour is not very good. To take a good
picture, you need tune ISP parameters by IOCTL functions or use a 3A libary
2. Without a 3A library the capture behaviour is not very good. To take a good
picture, you need tune ISP parameters by IOCTL functions or use a 3A library
such as libxcam.
3. The driver is intended to drive the PCI exposed versions of the device.
It will not detect those devices enumerated via ACPI as a field of the
i915 GPU driver.
There are some patches adding i915 GPU support floating at the Yocto's
Aero repository (so far, untested upstream).
4. The driver supports only v2 of the IPU/Camera. It will not work with the
versions of the hardware in other SoCs.
# SPDX-License-Identifier: GPL-2.0
#
# Kconfig for sensor drivers
#
......@@ -57,7 +58,7 @@ config VIDEO_ATOMISP_GC0310
---help---
This is a Video4Linux2 sensor-level driver for the Galaxycore
GC0310 0.3MP sensor.
config VIDEO_ATOMISP_OV2680
tristate "Omnivision OV2680 sensor support"
depends on ACPI
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for GalaxyCore GC0310 VGA camera sensor.
*
......@@ -1309,18 +1310,6 @@ static int gc0310_probe(struct i2c_client *client)
int ret;
void *pdata;
unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for GalaxyCore GC2235 2M camera sensor.
*
......@@ -1051,17 +1052,6 @@ static int gc2235_probe(struct i2c_client *client)
void *gcpdev;
int ret;
unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
......
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2013 Intel Corporation. All Rights Reserved.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* LED flash driver for LM3554
*
......@@ -850,17 +851,6 @@ static int lm3554_probe(struct i2c_client *client)
struct lm3554 *flash;
unsigned int i;
int ret;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
flash = kzalloc(sizeof(*flash), GFP_KERNEL);
if (!flash)
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for mt9m114 Camera Sensor.
*
......@@ -1816,17 +1817,6 @@ static int mt9m114_probe(struct i2c_client *client)
int ret = 0;
unsigned int i;
void *pdata;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
/* Setup sensor configuration structure */
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for OmniVision OV2680 1080p HD camera sensor.
*
......@@ -703,7 +704,7 @@ static int power_ctrl(struct v4l2_subdev *sd, bool flag)
if (!dev || !dev->platform_data)
return -ENODEV;
dev_dbg(&client->dev, "%s: %s", __func__, flag? "on" : "off");
dev_dbg(&client->dev, "%s: %s", __func__, flag ? "on" : "off");
if (flag) {
ret |= dev->platform_data->v1p8_ctrl(sd, 1);
......@@ -1243,17 +1244,6 @@ static int ov2680_probe(struct i2c_client *client)
int ret;
void *pdata;
unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for OmniVision OV2722 1080p HD camera sensor.
*
......@@ -1214,17 +1215,6 @@ static int ov2722_probe(struct i2c_client *client)
struct ov2722_device *dev;
void *ovpdev;
int ret;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for GalaxyCore GC0310 VGA camera sensor.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for GalaxyCore GC2235 2M camera sensor.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for mt9m114 Camera Sensor.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for OmniVision OV2680 5M camera sensor.
*
......@@ -456,6 +457,7 @@ static struct ov2680_reg const ov2680_656x496_30fps[] = {
// {0x5090, 0x0c},
{}
};
/*
* 800x600 30fps VBlanking 1lane 10Bit (binning)
*/
......@@ -500,6 +502,7 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {
{0x5081, 0x41},
{}
};
/*
* 800x600 30fps VBlanking 1lane 10Bit (binning)
*/
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for OmniVision OV2722 1080p HD camera sensor.
*
......
# SPDX-License-Identifier: GPL-2.0
config VIDEO_ATOMISP_OV5693
tristate "Omnivision ov5693 sensor support"
depends on ACPI
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for AD5823 VCM.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for OmniVision OV5693 1080p HD camera sensor.
*
......@@ -1087,7 +1088,7 @@ static int ov5693_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_VCM_SLEW:
ret = ov5693_t_vcm_slew(&dev->sd, ctrl->val);
break;
case V4L2_CID_VCM_TIMEING:
case V4L2_CID_VCM_TIMING:
ret = ov5693_t_vcm_timing(&dev->sd, ctrl->val);
break;
default:
......@@ -1230,7 +1231,7 @@ static const struct v4l2_ctrl_config ov5693_controls[] = {
},
{
.ops = &ctrl_ops,
.id = V4L2_CID_VCM_TIMEING,
.id = V4L2_CID_VCM_TIMING,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "vcm step time",
.min = 0,
......@@ -1901,17 +1902,6 @@ static int ov5693_probe(struct i2c_client *client)
int ret = 0;
void *pdata;
unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
/*
* Firmware workaround: Some modules use a "secondary default"
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for OmniVision OV5693 5M camera sensor.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -28,8 +29,8 @@
#include "hmm/hmm_pool.h"
#include "ia_css_types.h"
#define HMM_CACHED true
#define HMM_UNCACHED false
#define mmgr_NULL ((ia_css_ptr)0)
#define mmgr_EXCEPTION ((ia_css_ptr) - 1)
int hmm_pool_register(unsigned int pool_size, enum hmm_pool_type pool_type);
void hmm_pool_unregister(enum hmm_pool_type pool_type);
......@@ -38,7 +39,8 @@ int hmm_init(void);
void hmm_cleanup(void);
ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
int from_highmem, const void __user *userptr, bool cached);
int from_highmem, const void __user *userptr,
const uint16_t attrs);
void hmm_free(ia_css_ptr ptr);
int hmm_load(ia_css_ptr virt, void *data, unsigned int bytes);
int hmm_store(ia_css_ptr virt, const void *data, unsigned int bytes);
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -77,9 +78,6 @@ enum hmm_bo_type {
HMM_BO_PRIVATE,
HMM_BO_SHARE,
HMM_BO_USER,
#ifdef CONFIG_ION
HMM_BO_ION,
#endif
HMM_BO_LAST,
};
......@@ -111,9 +109,6 @@ struct hmm_bo_device {
/* list lock is used to protect the entire_bo_list */
spinlock_t list_lock;
#ifdef CONFIG_ION
struct ion_client *iclient;
#endif
int flag;
/* linked list for entire buffer object */
......@@ -136,15 +131,14 @@ struct hmm_buffer_object {
struct list_head list;
struct kref kref;
struct page **pages;
/* mutex protecting this BO */
struct mutex mutex;
enum hmm_bo_type type;
struct hmm_page_object *page_obj; /* physical pages */
int from_highmem;
int mmap_count;
#ifdef CONFIG_ION
struct ion_handle *ihandle;
#endif
int status;
int mem_type;
void *vmap_addr; /* kernel virtual address by vmap */
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
* Copyright (c) 2010 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.
*
*
*/
#ifndef __HMM_VM_H__
#define __HMM_VM_H__
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/list.h>
struct hmm_vm {
unsigned int start;
unsigned int pgnr;
unsigned int size;
struct list_head vm_node_list;
spinlock_t lock;
struct kmem_cache *cache;
};
struct hmm_vm_node {
struct list_head list;
unsigned int start;
unsigned int pgnr;
unsigned int size;
struct hmm_vm *vm;
};
#define ISP_VM_START 0x0
#define ISP_VM_SIZE (0x7FFFFFFF) /* 2G address space */
#define ISP_PTR_NULL NULL
int hmm_vm_init(struct hmm_vm *vm, unsigned int start,
unsigned int size);
void hmm_vm_clean(struct hmm_vm *vm);
struct hmm_vm_node *hmm_vm_alloc_node(struct hmm_vm *vm,
unsigned int pgnr);
void hmm_vm_free_node(struct hmm_vm_node *node);
struct hmm_vm_node *hmm_vm_find_node_start(struct hmm_vm *vm,
unsigned int addr);
struct hmm_vm_node *hmm_vm_find_node_in_range(struct hmm_vm *vm,
unsigned int addr);
#endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -69,9 +70,6 @@
#define V4L2_MBUS_FMT_CUSTOM_M10MO_RAW 0x800b
#endif
/* FIXME: for now, let's use a boolean to identify the type of atomisp chipset */
extern bool atomisp_hw_is_isp2401;
/* Configuration used by Bayer noise reduction and YCC noise reduction */
struct atomisp_nr_config {
/* [gain] Strength of noise reduction for Bayer NR (Used by Bayer NR) */
......@@ -509,7 +507,7 @@ struct atomisp_parameters {
struct atomisp_shading_table *shading_table;
struct atomisp_morph_table *morph_table;
struct atomisp_dvs_coefficients *dvs_coefs; /* DVS 1.0 coefficients */
struct atomisp_dvs2_coefficients *dvs2_coefs; /* DVS 2.0 coefficients */
struct atomisp_dis_coefficients *dvs2_coefs; /* DVS 2.0 coefficients */
struct atomisp_capture_config *capture_config;
struct atomisp_anr_thres *anr_thres;
......@@ -917,6 +915,8 @@ struct atomisp_acc_map {
#define ATOMISP_MAP_FLAG_NOFLUSH 0x0001 /* Do not flush cache */
#define ATOMISP_MAP_FLAG_CACHED 0x0002 /* Enable cache */
#define ATOMISP_MAP_FLAG_CONTIGUOUS 0x0004
#define ATOMISP_MAP_FLAG_CLEARED 0x0008
struct atomisp_acc_state {
__u32 flags; /* Flags, see list below */
......@@ -1272,7 +1272,7 @@ struct atomisp_sensor_ae_bracketing_lut {
/* VCM slew control */
#define V4L2_CID_VCM_SLEW (V4L2_CID_CAMERA_LASTP1 + 11)
/* VCM step time */
#define V4L2_CID_VCM_TIMEING (V4L2_CID_CAMERA_LASTP1 + 12)
#define V4L2_CID_VCM_TIMING (V4L2_CID_CAMERA_LASTP1 + 12)
/* Query Focus Status */
#define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_LASTP1 + 14)
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel MID SoC Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -17,6 +18,9 @@
#ifndef ATOMISP_PLATFORM_H_
#define ATOMISP_PLATFORM_H_
#include <asm/intel-family.h>
#include <asm/processor.h>
#include <linux/i2c.h>
#include <linux/sfi.h>
#include <media/v4l2-subdev.h>
......@@ -237,11 +241,19 @@ const struct atomisp_camera_caps *atomisp_get_default_camera_caps(void);
/* API from old platform_camera.h, new CPUID implementation */
#define __IS_SOC(x) (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && \
boot_cpu_data.x86 == 6 && \
boot_cpu_data.x86_model == x)
boot_cpu_data.x86_model == (x))
#define __IS_SOCS(x,y) (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && \
boot_cpu_data.x86 == 6 && \
(boot_cpu_data.x86_model == (x) || \
boot_cpu_data.x86_model == (y)))
#define IS_MFLD __IS_SOC(INTEL_FAM6_ATOM_SALTWELL_MID)
#define IS_BYT __IS_SOC(INTEL_FAM6_ATOM_SILVERMONT)
#define IS_CHT __IS_SOC(INTEL_FAM6_ATOM_AIRMONT)
#define IS_MOFD __IS_SOC(INTEL_FAM6_ATOM_AIRMONT_MID)
#define IS_MFLD __IS_SOC(0x27)
#define IS_BYT __IS_SOC(0x37)
#define IS_CHT __IS_SOC(0x4C)
#define IS_MOFD __IS_SOC(0x5A)
/* Both CHT and MOFD come with ISP2401 */
#define IS_ISP2401 __IS_SOCS(INTEL_FAM6_ATOM_AIRMONT, \
INTEL_FAM6_ATOM_AIRMONT_MID)
#endif /* ATOMISP_PLATFORM_H_ */
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2013 Intel Corporation. All Rights Reserved.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* include/media/lm3554.h
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Merrifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Clovertrail PNW Camera Imaging ISP subsystem.
*
......@@ -23,24 +24,24 @@
#include <linux/init.h>
#include <media/v4l2-event.h>
#include "hmm.h"
#include "atomisp_acc.h"
#include "atomisp_internal.h"
#include "atomisp_compat.h"
#include "atomisp_cmd.h"
#include "hrt/hive_isp_css_mm_hrt.h"
#include "memory_access/memory_access.h"
#include "ia_css.h"
static const struct {
unsigned int flag;
enum atomisp_css_pipe_id pipe_id;
enum ia_css_pipe_id pipe_id;
} acc_flag_to_pipe[] = {
{ ATOMISP_ACC_FW_LOAD_FL_PREVIEW, CSS_PIPE_ID_PREVIEW },
{ ATOMISP_ACC_FW_LOAD_FL_COPY, CSS_PIPE_ID_COPY },
{ ATOMISP_ACC_FW_LOAD_FL_VIDEO, CSS_PIPE_ID_VIDEO },
{ ATOMISP_ACC_FW_LOAD_FL_CAPTURE, CSS_PIPE_ID_CAPTURE },
{ ATOMISP_ACC_FW_LOAD_FL_ACC, CSS_PIPE_ID_ACC }
{ ATOMISP_ACC_FW_LOAD_FL_PREVIEW, IA_CSS_PIPE_ID_PREVIEW },
{ ATOMISP_ACC_FW_LOAD_FL_COPY, IA_CSS_PIPE_ID_COPY },
{ ATOMISP_ACC_FW_LOAD_FL_VIDEO, IA_CSS_PIPE_ID_VIDEO },
{ ATOMISP_ACC_FW_LOAD_FL_CAPTURE, IA_CSS_PIPE_ID_CAPTURE },
{ ATOMISP_ACC_FW_LOAD_FL_ACC, IA_CSS_PIPE_ID_ACC }
};
/*
......@@ -353,16 +354,23 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
}
pgnr = DIV_ROUND_UP(map->length, PAGE_SIZE);
cssptr = hrt_isp_css_mm_alloc_user_ptr(map->length,
map->user_ptr,
pgnr, HRT_USR_PTR,
(map->flags & ATOMISP_MAP_FLAG_CACHED));
if (pgnr < ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
dev_err(atomisp_dev,
"user space memory size is less than the expected size..\n");
return -ENOMEM;
} else if (pgnr > ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
dev_err(atomisp_dev,
"user space memory size is large than the expected size..\n");
return -ENOMEM;
}
cssptr = hmm_alloc(map->length, HMM_BO_USER, 0, map->user_ptr,
map->flags & ATOMISP_MAP_FLAG_CACHED);
} else {
/* Allocate private buffer. */
if (map->flags & ATOMISP_MAP_FLAG_CACHED)
cssptr = hrt_isp_css_mm_calloc_cached(map->length);
else
cssptr = hrt_isp_css_mm_calloc(map->length);
cssptr = hmm_alloc(map->length, HMM_BO_PRIVATE, 0, NULL,
map->flags & ATOMISP_MAP_FLAG_CACHED);
}
if (!cssptr)
......@@ -552,7 +560,7 @@ int atomisp_acc_set_state(struct atomisp_sub_device *asd,
struct atomisp_acc_fw *acc_fw;
bool enable = (arg->flags & ATOMISP_STATE_FLAG_ENABLE) != 0;
struct ia_css_pipe *pipe;
enum ia_css_err r;
int r;
int i;
if (!asd->acc.extension_mode)
......@@ -574,7 +582,7 @@ int atomisp_acc_set_state(struct atomisp_sub_device *asd,
pipes[acc_flag_to_pipe[i].pipe_id];
r = ia_css_pipe_set_qos_ext_state(pipe, acc_fw->handle,
enable);
if (r != IA_CSS_SUCCESS)
if (r)
return -EBADRQC;
}
}
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Clovertrail PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -32,7 +33,7 @@
#include "ia_css.h"
struct atomisp_device;
struct atomisp_css_frame;
struct ia_css_frame;
#define MSI_ENABLE_BIT 16
#define INTR_DISABLE_BIT 10
......@@ -64,16 +65,6 @@ bool atomisp_buffers_queued(struct atomisp_sub_device *asd);
/* ISP2401 */
bool atomisp_buffers_queued_pipe(struct atomisp_video_pipe *pipe);
/* TODO:should be here instead of atomisp_helper.h
extern void __iomem *atomisp_io_base;
static inline void __iomem *atomisp_get_io_virt_addr(unsigned int address)
{
void __iomem *ret = atomisp_io_base + (address & 0x003FFFFF);
return ret;
}
*/
/*
* Interrupt functions
*/
......@@ -88,7 +79,7 @@ const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus(
u32 mbus_code);
bool atomisp_is_mbuscode_raw(uint32_t code);
int atomisp_get_frame_pgnr(struct atomisp_device *isp,
const struct atomisp_css_frame *frame, u32 *p_pgnr);
const struct ia_css_frame *frame, u32 *p_pgnr);
void atomisp_delayed_init_work(struct work_struct *work);
/*
......@@ -301,8 +292,8 @@ int atomisp_set_array_res(struct atomisp_sub_device *asd,
* Function to calculate real zoom region for every pipe
*/
int atomisp_calculate_real_zoom_region(struct atomisp_sub_device *asd,
struct atomisp_css_dz_config *dz_config,
enum atomisp_css_pipe_id css_pipe_id);
struct ia_css_dz_config *dz_config,
enum ia_css_pipe_id css_pipe_id);
int atomisp_cp_general_isp_parameters(struct atomisp_sub_device *asd,
struct atomisp_parameters *arg,
......@@ -372,8 +363,8 @@ int atomisp_freq_scaling(struct atomisp_device *vdev,
bool force);
void atomisp_buf_done(struct atomisp_sub_device *asd, int error,
enum atomisp_css_buffer_type buf_type,
enum atomisp_css_pipe_id css_pipe_id,
enum ia_css_buffer_type buf_type,
enum ia_css_pipe_id css_pipe_id,
bool q_buffers, enum atomisp_input_stream_id stream_id);
void atomisp_css_flush(struct atomisp_device *isp);
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -43,15 +44,11 @@ extern int pad_h;
/* ISP2401 */
#define ATOMISP_CSS_ISP_PIPE_VERSION_2_7 1
#define IS_ISP2401(isp) \
(((isp)->media_dev.hw_revision & ATOMISP_HW_REVISION_MASK) \
>= (ATOMISP_HW_REVISION_ISP2401_LEGACY << ATOMISP_HW_REVISION_SHIFT))
struct atomisp_format_bridge {
unsigned int pixelformat;
unsigned int depth;
u32 mbus_code;
enum atomisp_css_frame_format sh_fmt;
enum ia_css_frame_format sh_fmt;
unsigned char description[32]; /* the same as struct v4l2_fmtdesc */
bool planar;
};
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Clovertrail PNW Camera Imaging ISP subsystem.
*
......@@ -30,97 +31,6 @@
#define ATOMISP_CSS2_NUM_OFFLINE_INIT_CONTINUOUS_FRAMES_LOCK_EN 4
#define ATOMISP_CSS2_NUM_DVS_FRAME_DELAY 2
#define atomisp_css_pipe_id ia_css_pipe_id
#define atomisp_css_pipeline ia_css_pipe
#define atomisp_css_buffer_type ia_css_buffer_type
#define atomisp_css_dis_data ia_css_isp_dvs_statistics
#define atomisp_css_irq_info ia_css_irq_info
#define atomisp_css_isp_config ia_css_isp_config
#define atomisp_css_bayer_order ia_css_bayer_order
#define atomisp_css_capture_mode ia_css_capture_mode
#define atomisp_css_input_mode ia_css_input_mode
#define atomisp_css_frame ia_css_frame
#define atomisp_css_frame_format ia_css_frame_format
#define atomisp_css_frame_info ia_css_frame_info
#define atomisp_css_dp_config ia_css_dp_config
#define atomisp_css_wb_config ia_css_wb_config
#define atomisp_css_cc_config ia_css_cc_config
#define atomisp_css_nr_config ia_css_nr_config
#define atomisp_css_ee_config ia_css_ee_config
#define atomisp_css_ob_config ia_css_ob_config
#define atomisp_css_de_config ia_css_de_config
#define atomisp_css_dz_config ia_css_dz_config
#define atomisp_css_ce_config ia_css_ce_config
#define atomisp_css_gc_config ia_css_gc_config
#define atomisp_css_tnr_config ia_css_tnr_config
#define atomisp_css_cnr_config ia_css_cnr_config
#define atomisp_css_ctc_config ia_css_ctc_config
#define atomisp_css_3a_config ia_css_3a_config
#define atomisp_css_ecd_config ia_css_ecd_config
#define atomisp_css_ynr_config ia_css_ynr_config
#define atomisp_css_fc_config ia_css_fc_config
#define atomisp_css_aa_config ia_css_aa_config
#define atomisp_css_baa_config ia_css_aa_config
#define atomisp_css_anr_config ia_css_anr_config
#define atomisp_css_xnr_config ia_css_xnr_config
#define atomisp_css_macc_config ia_css_macc_config
#define atomisp_css_gamma_table ia_css_gamma_table
#define atomisp_css_ctc_table ia_css_ctc_table
#define atomisp_css_macc_table ia_css_macc_table
#define atomisp_css_xnr_table ia_css_xnr_table
#define atomisp_css_rgb_gamma_table ia_css_rgb_gamma_table
#define atomisp_css_anr_thres ia_css_anr_thres
#define atomisp_css_dvs_6axis ia_css_dvs_6axis_config
#define atomisp_css_grid_info ia_css_grid_info
#define atomisp_css_3a_grid_info ia_css_3a_grid_info
#define atomisp_css_dvs_grid_info ia_css_dvs_grid_info
#define atomisp_css_shading_table ia_css_shading_table
#define atomisp_css_morph_table ia_css_morph_table
#define atomisp_css_dvs_6axis_config ia_css_dvs_6axis_config
#define atomisp_css_fw_info ia_css_fw_info
#define atomisp_css_formats_config ia_css_formats_config
#define CSS_PIPE_ID_PREVIEW IA_CSS_PIPE_ID_PREVIEW
#define CSS_PIPE_ID_COPY IA_CSS_PIPE_ID_COPY
#define CSS_PIPE_ID_VIDEO IA_CSS_PIPE_ID_VIDEO
#define CSS_PIPE_ID_CAPTURE IA_CSS_PIPE_ID_CAPTURE
#define CSS_PIPE_ID_ACC IA_CSS_PIPE_ID_ACC
#define CSS_PIPE_ID_YUVPP IA_CSS_PIPE_ID_YUVPP
#define CSS_PIPE_ID_NUM IA_CSS_PIPE_ID_NUM
#define CSS_INPUT_MODE_SENSOR IA_CSS_INPUT_MODE_BUFFERED_SENSOR
#define CSS_INPUT_MODE_FIFO IA_CSS_INPUT_MODE_FIFO
#define CSS_INPUT_MODE_TPG IA_CSS_INPUT_MODE_TPG
#define CSS_INPUT_MODE_PRBS IA_CSS_INPUT_MODE_PRBS
#define CSS_INPUT_MODE_MEMORY IA_CSS_INPUT_MODE_MEMORY
#define CSS_IRQ_INFO_CSS_RECEIVER_ERROR IA_CSS_IRQ_INFO_CSS_RECEIVER_ERROR
#define CSS_IRQ_INFO_EVENTS_READY IA_CSS_IRQ_INFO_EVENTS_READY
#define CSS_IRQ_INFO_INPUT_SYSTEM_ERROR \
IA_CSS_IRQ_INFO_INPUT_SYSTEM_ERROR
#define CSS_IRQ_INFO_IF_ERROR IA_CSS_IRQ_INFO_IF_ERROR
#define CSS_BUFFER_TYPE_NUM IA_CSS_BUFFER_TYPE_NUM
#define CSS_FRAME_FLASH_STATE_NONE IA_CSS_FRAME_FLASH_STATE_NONE
#define CSS_FRAME_FLASH_STATE_PARTIAL IA_CSS_FRAME_FLASH_STATE_PARTIAL
#define CSS_FRAME_FLASH_STATE_FULL IA_CSS_FRAME_FLASH_STATE_FULL
#define CSS_BAYER_ORDER_GRBG IA_CSS_BAYER_ORDER_GRBG
#define CSS_BAYER_ORDER_RGGB IA_CSS_BAYER_ORDER_RGGB
#define CSS_BAYER_ORDER_BGGR IA_CSS_BAYER_ORDER_BGGR
#define CSS_BAYER_ORDER_GBRG IA_CSS_BAYER_ORDER_GBRG
/*
* Hide IA_ naming difference in otherwise common CSS macros.
*/
#define CSS_ID(val) (IA_ ## val)
#define CSS_EVENT(val) (IA_CSS_EVENT_TYPE_ ## val)
#define CSS_FORMAT(val) (ATOMISP_INPUT_FORMAT_ ## val)
#define CSS_EVENT_PORT_EOF CSS_EVENT(PORT_EOF)
#define CSS_EVENT_FRAME_TAGGED CSS_EVENT(FRAME_TAGGED)
#define CSS_MIPI_FRAME_BUFFER_SIZE_1 0x60000
#define CSS_MIPI_FRAME_BUFFER_SIZE_2 0x80000
......@@ -181,7 +91,7 @@ struct atomisp_s3a_buf {
};
struct atomisp_dis_buf {
struct atomisp_css_dis_data *dis_data;
struct ia_css_isp_dvs_statistics *dis_data;
struct ia_css_isp_dvs_statistics_map *dvs_map;
struct list_head list;
};
......@@ -191,71 +101,53 @@ struct atomisp_css_buffer {
};
struct atomisp_css_event {
enum atomisp_css_pipe_id pipe;
enum ia_css_pipe_id pipe;
struct ia_css_event event;
};
void atomisp_css_set_macc_config(struct atomisp_sub_device *asd,
struct atomisp_css_macc_config *macc_config);
struct ia_css_macc_config *macc_config);
void atomisp_css_set_ecd_config(struct atomisp_sub_device *asd,
struct atomisp_css_ecd_config *ecd_config);
struct ia_css_ecd_config *ecd_config);
void atomisp_css_set_ynr_config(struct atomisp_sub_device *asd,
struct atomisp_css_ynr_config *ynr_config);
struct ia_css_ynr_config *ynr_config);
void atomisp_css_set_fc_config(struct atomisp_sub_device *asd,
struct atomisp_css_fc_config *fc_config);
struct ia_css_fc_config *fc_config);
void atomisp_css_set_aa_config(struct atomisp_sub_device *asd,
struct atomisp_css_aa_config *aa_config);
struct ia_css_aa_config *aa_config);
void atomisp_css_set_baa_config(struct atomisp_sub_device *asd,
struct atomisp_css_baa_config *baa_config);
struct ia_css_aa_config *baa_config);
void atomisp_css_set_anr_config(struct atomisp_sub_device *asd,
struct atomisp_css_anr_config *anr_config);
struct ia_css_anr_config *anr_config);
void atomisp_css_set_xnr_config(struct atomisp_sub_device *asd,
struct atomisp_css_xnr_config *xnr_config);
struct ia_css_xnr_config *xnr_config);
void atomisp_css_set_cnr_config(struct atomisp_sub_device *asd,
struct atomisp_css_cnr_config *cnr_config);
struct ia_css_cnr_config *cnr_config);
void atomisp_css_set_ctc_config(struct atomisp_sub_device *asd,
struct atomisp_css_ctc_config *ctc_config);
struct ia_css_ctc_config *ctc_config);
void atomisp_css_set_yuv2rgb_cc_config(struct atomisp_sub_device *asd,
struct atomisp_css_cc_config *yuv2rgb_cc_config);
struct ia_css_cc_config *yuv2rgb_cc_config);
void atomisp_css_set_rgb2yuv_cc_config(struct atomisp_sub_device *asd,
struct atomisp_css_cc_config *rgb2yuv_cc_config);
void atomisp_css_set_xnr_table(struct atomisp_sub_device *asd,
struct atomisp_css_xnr_table *xnr_table);
void atomisp_css_set_r_gamma_table(struct atomisp_sub_device *asd,
struct atomisp_css_rgb_gamma_table *r_gamma_table);
void atomisp_css_set_g_gamma_table(struct atomisp_sub_device *asd,
struct atomisp_css_rgb_gamma_table *g_gamma_table);
void atomisp_css_set_b_gamma_table(struct atomisp_sub_device *asd,
struct atomisp_css_rgb_gamma_table *b_gamma_table);
struct ia_css_cc_config *rgb2yuv_cc_config);
void atomisp_css_set_anr_thres(struct atomisp_sub_device *asd,
struct atomisp_css_anr_thres *anr_thres);
int atomisp_css_check_firmware_version(struct atomisp_device *isp);
struct ia_css_anr_thres *anr_thres);
int atomisp_css_load_firmware(struct atomisp_device *isp);
void atomisp_css_unload_firmware(struct atomisp_device *isp);
void atomisp_css_set_dvs_6axis(struct atomisp_sub_device *asd,
struct atomisp_css_dvs_6axis *dvs_6axis);
unsigned int atomisp_css_debug_get_dtrace_level(void);
struct ia_css_dvs_6axis_config *dvs_6axis);
int atomisp_css_debug_dump_isp_binary(void);
......@@ -267,11 +159,11 @@ void atomisp_css_set_isp_config_id(struct atomisp_sub_device *asd,
uint32_t isp_config_id);
void atomisp_css_set_isp_config_applied_frame(struct atomisp_sub_device *asd,
struct atomisp_css_frame *output_frame);
struct ia_css_frame *output_frame);
int atomisp_get_css_dbgfunc(void);
int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt);
struct atomisp_css_dvs_grid_info *atomisp_css_get_dvs_grid_info(
struct atomisp_css_grid_info *grid_info);
struct ia_css_dvs_grid_info *atomisp_css_get_dvs_grid_info(
struct ia_css_grid_info *grid_info);
#endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -384,9 +385,9 @@ static void atomisp_csi2_configure_isp2401(struct atomisp_sub_device *asd)
for (n = 0; n < csi2_port_lanes[port] + 1; n++) {
hrt_address base = csi2_port_base[port] + csi2_lane_base[n];
atomisp_store_uint32(base + CSI2_REG_RX_CSI_DLY_CNT_TERMEN,
atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_TERMEN,
n == 0 ? clk_termen : dat_termen);
atomisp_store_uint32(base + CSI2_REG_RX_CSI_DLY_CNT_SETTLE,
atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_SETTLE,
n == 0 ? clk_settle : dat_settle);
}
}
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for atomisp driver sysfs interface
*
......@@ -24,6 +25,7 @@
#include "atomisp_ioctl.h"
#include "atomisp_drvfs.h"
#include "hmm/hmm.h"
#include "ia_css_debug.h"
/*
* _iunit_debug:
......@@ -94,7 +96,7 @@ static inline int iunit_dump_dbgopt(struct atomisp_device *isp,
static ssize_t iunit_dbglvl_show(struct device_driver *drv, char *buf)
{
iunit_debug.dbglvl = atomisp_css_debug_get_dtrace_level();
iunit_debug.dbglvl = dbg_level;
return sprintf(buf, "dtrace level:%u\n", iunit_debug.dbglvl);
}
......@@ -106,7 +108,7 @@ static ssize_t iunit_dbglvl_store(struct device_driver *drv, const char *buf,
|| iunit_debug.dbglvl > 9) {
return -ERANGE;
}
atomisp_css_debug_set_dtrace_level(iunit_debug.dbglvl);
ia_css_debug_set_dtrace_level(iunit_debug.dbglvl);
return size;
}
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for atomisp driver sysfs interface.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -50,11 +51,12 @@ static void file_work(struct work_struct *work)
V4L2_SUBDEV_FORMAT_ACTIVE,
ATOMISP_SUBDEV_PAD_SINK);
while (!atomisp_css_isp_has_started())
while (!ia_css_isp_has_started())
usleep_range(1000, 1500);
atomisp_css_send_input_frame(asd, buf, isp_sink_fmt.width,
isp_sink_fmt.height);
ia_css_stream_send_input_frame(asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream,
buf, isp_sink_fmt.width,
isp_sink_fmt.height);
dev_dbg(isp->dev, "<%s: streaming done\n", __func__);
}
......@@ -217,7 +219,7 @@ int atomisp_file_input_init(struct atomisp_device *isp)
v4l2_subdev_init(sd, &file_input_ops);
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
strcpy(sd->name, "file_input_subdev");
strscpy(sd->name, "file_input_subdev", sizeof(sd->name));
v4l2_set_subdevdata(sd, file_dev);
pads[0].flags = MEDIA_PAD_FL_SINK;
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -34,11 +35,8 @@
#include "atomisp-regs.h"
#include "hmm/hmm.h"
#include "hrt/hive_isp_css_mm_hrt.h"
#include "type_support.h"
#include "device_access/device_access.h"
#include "memory_access/memory_access.h"
#include "atomisp_acc.h"
......@@ -88,7 +86,7 @@ static int atomisp_buf_prepare(struct videobuf_queue *vq,
static int atomisp_q_one_metadata_buffer(struct atomisp_sub_device *asd,
enum atomisp_input_stream_id stream_id,
enum atomisp_css_pipe_id css_pipe_id)
enum ia_css_pipe_id css_pipe_id)
{
struct atomisp_metadata_buf *metadata_buf;
enum atomisp_metadata_type md_type =
......@@ -128,7 +126,7 @@ static int atomisp_q_one_metadata_buffer(struct atomisp_sub_device *asd,
static int atomisp_q_one_s3a_buffer(struct atomisp_sub_device *asd,
enum atomisp_input_stream_id stream_id,
enum atomisp_css_pipe_id css_pipe_id)
enum ia_css_pipe_id css_pipe_id)
{
struct atomisp_s3a_buf *s3a_buf;
struct list_head *s3a_list;
......@@ -170,7 +168,7 @@ static int atomisp_q_one_s3a_buffer(struct atomisp_sub_device *asd,
static int atomisp_q_one_dis_buffer(struct atomisp_sub_device *asd,
enum atomisp_input_stream_id stream_id,
enum atomisp_css_pipe_id css_pipe_id)
enum ia_css_pipe_id css_pipe_id)
{
struct atomisp_dis_buf *dis_buf;
unsigned long irqflags;
......@@ -213,12 +211,12 @@ static int atomisp_q_one_dis_buffer(struct atomisp_sub_device *asd,
int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
struct atomisp_video_pipe *pipe,
enum atomisp_input_stream_id stream_id,
enum atomisp_css_buffer_type css_buf_type,
enum atomisp_css_pipe_id css_pipe_id)
enum ia_css_buffer_type css_buf_type,
enum ia_css_pipe_id css_pipe_id)
{
struct videobuf_vmalloc_memory *vm_mem;
struct atomisp_css_params_with_list *param;
struct atomisp_css_dvs_grid_info *dvs_grid =
struct ia_css_dvs_grid_info *dvs_grid =
atomisp_css_get_dvs_grid_info(&asd->params.curr_grid_info);
unsigned long irqflags;
int err = 0;
......@@ -255,14 +253,13 @@ int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
err = atomisp_calculate_real_zoom_region(asd,
&param->params.dz_config, css_pipe_id);
if (!err)
atomisp_css_set_dz_config(asd,
&param->params.dz_config);
asd->params.config.dz_config = &param->params.dz_config;
}
atomisp_css_set_isp_config_applied_frame(asd,
vm_mem->vaddr);
atomisp_css_update_isp_params_on_pipe(asd,
asd->stream_env[stream_id].pipes[css_pipe_id]);
asd->params.dvs_6axis = (struct atomisp_css_dvs_6axis *)
asd->params.dvs_6axis = (struct ia_css_dvs_6axis_config *)
param->params.dvs_6axis;
/*
......@@ -302,19 +299,19 @@ int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
/* enqueue 3A/DIS/metadata buffers */
if (asd->params.curr_grid_info.s3a_grid.enable &&
css_pipe_id == asd->params.s3a_enabled_pipe &&
css_buf_type == CSS_BUFFER_TYPE_OUTPUT_FRAME)
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_s3a_buffer(asd, stream_id,
css_pipe_id);
if (asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream_info.
metadata_info.size &&
css_buf_type == CSS_BUFFER_TYPE_OUTPUT_FRAME)
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_metadata_buffer(asd, stream_id,
css_pipe_id);
if (dvs_grid && dvs_grid->enable &&
css_pipe_id == CSS_PIPE_ID_VIDEO &&
css_buf_type == CSS_BUFFER_TYPE_OUTPUT_FRAME)
css_pipe_id == IA_CSS_PIPE_ID_VIDEO &&
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_dis_buffer(asd, stream_id,
css_pipe_id);
}
......@@ -323,7 +320,7 @@ int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
}
static int atomisp_get_css_buf_type(struct atomisp_sub_device *asd,
enum atomisp_css_pipe_id pipe_id,
enum ia_css_pipe_id pipe_id,
uint16_t source_pad)
{
if (ATOMISP_USE_YUVPP(asd)) {
......@@ -331,24 +328,24 @@ static int atomisp_get_css_buf_type(struct atomisp_sub_device *asd,
if (asd->continuous_mode->val &&
asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE)
return CSS_BUFFER_TYPE_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME;
else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW)
return CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME;
else
return CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
}
/*when run SDV case*/
if (asd->continuous_mode->val &&
asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) {
if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE)
return CSS_BUFFER_TYPE_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME;
else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW)
return CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME;
else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO)
return CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME;
else
return CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
}
/*other case: default setting*/
......@@ -356,27 +353,27 @@ static int atomisp_get_css_buf_type(struct atomisp_sub_device *asd,
source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO ||
(source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW &&
asd->run_mode->val != ATOMISP_RUN_MODE_VIDEO))
return CSS_BUFFER_TYPE_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME;
else
return CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
}
if (pipe_id == CSS_PIPE_ID_COPY ||
if (pipe_id == IA_CSS_PIPE_ID_COPY ||
source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE ||
source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO ||
(source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW &&
asd->run_mode->val != ATOMISP_RUN_MODE_VIDEO))
return CSS_BUFFER_TYPE_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME;
else
return CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME;
}
static int atomisp_qbuffers_to_css_for_all_pipes(struct atomisp_sub_device *asd)
{
enum atomisp_css_buffer_type buf_type;
enum atomisp_css_pipe_id css_capture_pipe_id = CSS_PIPE_ID_COPY;
enum atomisp_css_pipe_id css_preview_pipe_id = CSS_PIPE_ID_COPY;
enum atomisp_css_pipe_id css_video_pipe_id = CSS_PIPE_ID_COPY;
enum ia_css_buffer_type buf_type;
enum ia_css_pipe_id css_capture_pipe_id = IA_CSS_PIPE_ID_COPY;
enum ia_css_pipe_id css_preview_pipe_id = IA_CSS_PIPE_ID_COPY;
enum ia_css_pipe_id css_video_pipe_id = IA_CSS_PIPE_ID_COPY;
enum atomisp_input_stream_id input_stream_id;
struct atomisp_video_pipe *capture_pipe;
struct atomisp_video_pipe *preview_pipe;
......@@ -413,10 +410,10 @@ static int atomisp_qbuffers_to_css_for_all_pipes(struct atomisp_sub_device *asd)
/* queue all available buffers to css */
int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
{
enum atomisp_css_buffer_type buf_type;
enum atomisp_css_pipe_id css_capture_pipe_id = CSS_PIPE_ID_NUM;
enum atomisp_css_pipe_id css_preview_pipe_id = CSS_PIPE_ID_NUM;
enum atomisp_css_pipe_id css_video_pipe_id = CSS_PIPE_ID_NUM;
enum ia_css_buffer_type buf_type;
enum ia_css_pipe_id css_capture_pipe_id = IA_CSS_PIPE_ID_NUM;
enum ia_css_pipe_id css_preview_pipe_id = IA_CSS_PIPE_ID_NUM;
enum ia_css_pipe_id css_video_pipe_id = IA_CSS_PIPE_ID_NUM;
enum atomisp_input_stream_id input_stream_id;
struct atomisp_video_pipe *capture_pipe = NULL;
struct atomisp_video_pipe *vf_pipe = NULL;
......@@ -432,43 +429,43 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER) {
video_pipe = &asd->video_out_video_capture;
css_video_pipe_id = CSS_PIPE_ID_VIDEO;
css_video_pipe_id = IA_CSS_PIPE_ID_VIDEO;
} else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_LOWLAT) {
preview_pipe = &asd->video_out_capture;
css_preview_pipe_id = CSS_PIPE_ID_CAPTURE;
css_preview_pipe_id = IA_CSS_PIPE_ID_CAPTURE;
} else if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) {
if (asd->continuous_mode->val) {
capture_pipe = &asd->video_out_capture;
vf_pipe = &asd->video_out_vf;
css_capture_pipe_id = CSS_PIPE_ID_CAPTURE;
css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE;
}
video_pipe = &asd->video_out_video_capture;
preview_pipe = &asd->video_out_preview;
css_video_pipe_id = CSS_PIPE_ID_VIDEO;
css_preview_pipe_id = CSS_PIPE_ID_VIDEO;
css_video_pipe_id = IA_CSS_PIPE_ID_VIDEO;
css_preview_pipe_id = IA_CSS_PIPE_ID_VIDEO;
} else if (asd->continuous_mode->val) {
capture_pipe = &asd->video_out_capture;
vf_pipe = &asd->video_out_vf;
preview_pipe = &asd->video_out_preview;
css_preview_pipe_id = CSS_PIPE_ID_PREVIEW;
css_capture_pipe_id = CSS_PIPE_ID_CAPTURE;
css_preview_pipe_id = IA_CSS_PIPE_ID_PREVIEW;
css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE;
} else if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
preview_pipe = &asd->video_out_preview;
css_preview_pipe_id = CSS_PIPE_ID_PREVIEW;
css_preview_pipe_id = IA_CSS_PIPE_ID_PREVIEW;
} else {
/* ATOMISP_RUN_MODE_STILL_CAPTURE */
capture_pipe = &asd->video_out_capture;
if (!raw_mode)
vf_pipe = &asd->video_out_vf;
css_capture_pipe_id = CSS_PIPE_ID_CAPTURE;
css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE;
}
#ifdef ISP2401_NEW_INPUT_SYSTEM
if (asd->copy_mode) {
css_capture_pipe_id = CSS_PIPE_ID_COPY;
css_preview_pipe_id = CSS_PIPE_ID_COPY;
css_video_pipe_id = CSS_PIPE_ID_COPY;
css_capture_pipe_id = IA_CSS_PIPE_ID_COPY;
css_preview_pipe_id = IA_CSS_PIPE_ID_COPY;
css_video_pipe_id = IA_CSS_PIPE_ID_COPY;
}
#endif
......@@ -476,9 +473,9 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
capture_pipe = &asd->video_out_capture;
video_pipe = &asd->video_out_video_capture;
preview_pipe = &asd->video_out_preview;
css_capture_pipe_id = CSS_PIPE_ID_COPY;
css_video_pipe_id = CSS_PIPE_ID_YUVPP;
css_preview_pipe_id = CSS_PIPE_ID_YUVPP;
css_capture_pipe_id = IA_CSS_PIPE_ID_COPY;
css_video_pipe_id = IA_CSS_PIPE_ID_YUVPP;
css_preview_pipe_id = IA_CSS_PIPE_ID_YUVPP;
}
if (capture_pipe) {
......@@ -491,7 +488,7 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
* use yuvpp pipe for SOC camera.
*/
if (ATOMISP_USE_YUVPP(asd))
css_capture_pipe_id = CSS_PIPE_ID_YUVPP;
css_capture_pipe_id = IA_CSS_PIPE_ID_YUVPP;
atomisp_q_video_buffers_to_css(asd, capture_pipe,
input_stream_id,
......@@ -511,7 +508,7 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
* use yuvpp pipe for SOC camera.
*/
if (ATOMISP_USE_YUVPP(asd))
css_capture_pipe_id = CSS_PIPE_ID_YUVPP;
css_capture_pipe_id = IA_CSS_PIPE_ID_YUVPP;
atomisp_q_video_buffers_to_css(asd, vf_pipe,
input_stream_id,
buf_type, css_capture_pipe_id);
......@@ -521,10 +518,10 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
buf_type = atomisp_get_css_buf_type(
asd, css_preview_pipe_id,
atomisp_subdev_source_pad(&preview_pipe->vdev));
if (ATOMISP_SOC_CAMERA(asd) && css_preview_pipe_id == CSS_PIPE_ID_YUVPP)
if (ATOMISP_SOC_CAMERA(asd) && css_preview_pipe_id == IA_CSS_PIPE_ID_YUVPP)
input_stream_id = ATOMISP_INPUT_STREAM_GENERAL;
/* else for ext isp use case */
else if (css_preview_pipe_id == CSS_PIPE_ID_YUVPP)
else if (css_preview_pipe_id == IA_CSS_PIPE_ID_YUVPP)
input_stream_id = ATOMISP_INPUT_STREAM_VIDEO;
else if (asd->stream_env[ATOMISP_INPUT_STREAM_PREVIEW].stream)
input_stream_id = ATOMISP_INPUT_STREAM_PREVIEW;
......@@ -535,7 +532,7 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
* use yuvpp pipe for SOC camera.
*/
if (ATOMISP_USE_YUVPP(asd))
css_preview_pipe_id = CSS_PIPE_ID_YUVPP;
css_preview_pipe_id = IA_CSS_PIPE_ID_YUVPP;
atomisp_q_video_buffers_to_css(asd, preview_pipe,
input_stream_id,
......@@ -555,7 +552,7 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
* use yuvpp pipe for SOC camera.
*/
if (ATOMISP_USE_YUVPP(asd))
css_video_pipe_id = CSS_PIPE_ID_YUVPP;
css_video_pipe_id = IA_CSS_PIPE_ID_YUVPP;
atomisp_q_video_buffers_to_css(asd, video_pipe,
input_stream_id,
......@@ -717,7 +714,7 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd)
asd->params.online_process = 1;
asd->params.yuv_ds_en = 0;
/* s3a grid not enabled for any pipe */
asd->params.s3a_enabled_pipe = CSS_PIPE_ID_NUM;
asd->params.s3a_enabled_pipe = IA_CSS_PIPE_ID_NUM;
asd->params.offline_parm.num_captures = 1;
asd->params.offline_parm.skip_frames = 0;
......@@ -1000,7 +997,7 @@ static int atomisp_release(struct file *file)
atomisp_css_uninit(isp);
if (defer_fw_load) {
atomisp_css_unload_firmware(isp);
ia_css_unload_firmware();
isp->css_env.isp_css_fw.data = NULL;
isp->css_env.isp_css_fw.bytes = 0;
}
......@@ -1054,7 +1051,7 @@ static int do_isp_mm_remap(struct atomisp_device *isp,
}
static int frame_mmap(struct atomisp_device *isp,
const struct atomisp_css_frame *frame, struct vm_area_struct *vma)
const struct ia_css_frame *frame, struct vm_area_struct *vma)
{
ia_css_ptr isp_virt;
u32 host_virt;
......@@ -1127,7 +1124,7 @@ int atomisp_videobuf_mmap_mapper(struct videobuf_queue *q,
* There is also padding on the right (padded_width - width).
*/
static int remove_pad_from_frame(struct atomisp_device *isp,
struct atomisp_css_frame *in_frame, __u32 width, __u32 height)
struct ia_css_frame *in_frame, __u32 width, __u32 height)
{
unsigned int i;
unsigned short *buffer;
......@@ -1164,7 +1161,7 @@ static int atomisp_mmap(struct file *file, struct vm_area_struct *vma)
struct atomisp_device *isp = video_get_drvdata(vdev);
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
struct atomisp_sub_device *asd = pipe->asd;
struct atomisp_css_frame *raw_virt_addr;
struct ia_css_frame *raw_virt_addr;
u32 start = vma->vm_start;
u32 end = vma->vm_end;
u32 size = end - start;
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -24,8 +25,8 @@
int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
struct atomisp_video_pipe *pipe,
enum atomisp_input_stream_id stream_id,
enum atomisp_css_buffer_type css_buf_type,
enum atomisp_css_pipe_id css_pipe_id);
enum ia_css_buffer_type css_buf_type,
enum ia_css_pipe_id css_pipe_id);
unsigned int atomisp_dev_users(struct atomisp_device *isp);
unsigned int atomisp_sub_dev_users(struct atomisp_sub_device *asd);
......
// SPDX-License-Identifier: GPL-2.0
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/dmi.h>
......@@ -327,15 +328,6 @@ static struct gmin_cfg_var i8880_vars[] = {
{},
};
static struct gmin_cfg_var asus_vars[] = {
{"OVTI2680:00_CsiPort", "1"},
{"OVTI2680:00_CsiLanes", "1"},
{"OVTI2680:00_CsiFmt", "15"},
{"OVTI2680:00_CsiBayer", "0"},
{"OVTI2680:00_CamClk", "1"},
{},
};
static const struct dmi_system_id gmin_vars[] = {
{
.ident = "BYT-T FFD8",
......@@ -373,13 +365,6 @@ static const struct dmi_system_id gmin_vars[] = {
},
.driver_data = i8880_vars,
},
{
.ident = "T101HA",
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "T101HA"),
},
.driver_data = asus_vars,
},
{}
};
......@@ -387,6 +372,10 @@ static const struct dmi_system_id gmin_vars[] = {
0xa9, 0x71, 0xe8, 0x77, \
0x75, 0x60, 0x68, 0xf7)
static const guid_t atomisp_dsm_guid = GUID_INIT(0xdc2f6c4f, 0x045b, 0x4f1d,
0x97, 0xb9, 0x88, 0x2a,
0x68, 0x60, 0xa4, 0xbe);
#define CFG_VAR_NAME_MAX 64
#define GMIN_PMC_CLK_NAME 14 /* "pmc_plt_clk_[0..5]" */
......@@ -454,15 +443,28 @@ static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg,
static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
{
int i, ret;
struct device *dev;
struct i2c_client *power = NULL, *client = v4l2_get_subdevdata(subdev);
struct acpi_device *adev;
acpi_handle handle;
struct device *dev;
int i, ret;
if (!client)
return NULL;
dev = &client->dev;
handle = ACPI_HANDLE(dev);
// FIXME: may need to release resources allocated by acpi_bus_get_device()
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(dev, "Error could not get ACPI device\n");
return NULL;
}
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
if (!pmic_id) {
if (gmin_i2c_dev_exists(dev, PMIC_ACPI_TI, &power))
pmic_id = PMIC_TI;
......@@ -479,7 +481,6 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
if (i >= MAX_SUBDEVS)
return NULL;
if (power) {
gmin_subdevs[i].pwm_i2c_addr = power->addr;
dev_info(dev,
......@@ -616,6 +617,7 @@ static int axp_regulator_set(struct device *dev, struct gmin_subdev *gs,
static int axp_v1p8_on(struct device *dev, struct gmin_subdev *gs)
{
int ret;
ret = axp_regulator_set(dev, gs, gs->eldo2_sel_reg, gs->eldo2_1p8v,
ELDO_CTRL_REG, gs->eldo2_ctrl_shift, true);
if (ret)
......@@ -640,6 +642,7 @@ static int axp_v1p8_on(struct device *dev, struct gmin_subdev *gs)
static int axp_v1p8_off(struct device *dev, struct gmin_subdev *gs)
{
int ret;
ret = axp_regulator_set(dev, gs, gs->eldo1_sel_reg, gs->eldo1_1p8v,
ELDO_CTRL_REG, gs->eldo1_ctrl_shift, false);
if (ret)
......@@ -650,7 +653,6 @@ static int axp_v1p8_off(struct device *dev, struct gmin_subdev *gs)
return ret;
}
static int gmin_gpio0_ctrl(struct v4l2_subdev *subdev, int on)
{
struct gmin_subdev *gs = find_gmin_subdev(subdev);
......@@ -753,7 +755,6 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
dev_err(subdev->dev, "Couldn't set power mode for v1p2\n");
}
return -EINVAL;
}
......@@ -921,7 +922,8 @@ int atomisp_gmin_register_vcm_control(struct camera_vcm_control *vcmCtrl)
}
EXPORT_SYMBOL_GPL(atomisp_gmin_register_vcm_control);
static int gmin_get_hardcoded_var(struct gmin_cfg_var *varlist,
static int gmin_get_hardcoded_var(struct device *dev,
struct gmin_cfg_var *varlist,
const char *var8, char *out, size_t *out_len)
{
struct gmin_cfg_var *gv;
......@@ -932,11 +934,13 @@ static int gmin_get_hardcoded_var(struct gmin_cfg_var *varlist,
if (strcmp(var8, gv->name))
continue;
dev_info(dev, "Found DMI entry for '%s'\n", var8);
vl = strlen(gv->val);
if (vl > *out_len - 1)
return -ENOSPC;
strcpy(out, gv->val);
strscpy(out, gv->val, *out_len);
*out_len = vl;
return 0;
}
......@@ -944,6 +948,75 @@ static int gmin_get_hardcoded_var(struct gmin_cfg_var *varlist,
return -EINVAL;
}
static int gmin_get_config_dsm_var(struct device *dev,
const char *var,
char *out, size_t *out_len)
{
acpi_handle handle = ACPI_HANDLE(dev);
union acpi_object *obj, *cur = NULL;
int i;
obj = acpi_evaluate_dsm(handle, &atomisp_dsm_guid, 0, 0, NULL);
if (!obj) {
dev_info_once(dev, "Didn't find ACPI _DSM table.\n");
return -EINVAL;
}
#if 0 /* Just for debugging purposes */
for (i = 0; i < obj->package.count; i++) {
union acpi_object *cur = &obj->package.elements[i];
if (cur->type == ACPI_TYPE_INTEGER)
dev_info(dev, "object #%d, type %d, value: %lld\n",
i, cur->type, cur->integer.value);
else if (cur->type == ACPI_TYPE_STRING)
dev_info(dev, "object #%d, type %d, string: %s\n",
i, cur->type, cur->string.pointer);
else
dev_info(dev, "object #%d, type %d\n",
i, cur->type);
}
#endif
/* Seek for the desired var */
for (i = 0; i < obj->package.count - 1; i += 2) {
if (obj->package.elements[i].type == ACPI_TYPE_STRING &&
!strcmp(obj->package.elements[i].string.pointer, var)) {
/* Next element should be the required value */
cur = &obj->package.elements[i + 1];
break;
}
}
if (!cur) {
dev_info(dev, "didn't found _DSM entry for '%s'\n", var);
ACPI_FREE(obj);
return -EINVAL;
}
/*
* While it could be possible to have an ACPI_TYPE_INTEGER,
* and read the value from cur->integer.value, the table
* seen so far uses the string type. So, produce a warning
* if it founds something different than string, letting it
* to fall back to the old code.
*/
if (cur && cur->type != ACPI_TYPE_STRING) {
dev_info(dev, "found non-string _DSM entry for '%s'\n", var);
ACPI_FREE(obj);
return -EINVAL;
}
dev_info(dev, "found _DSM entry for '%s': %s\n", var,
cur->string.pointer);
strscpy(out, cur->string.pointer, *out_len);
*out_len = strlen(cur->string.pointer);
ACPI_FREE(obj);
return 0;
}
/* Retrieves a device-specific configuration variable. The dev
* argument should be a device with an ACPI companion, as all
* configuration is based on firmware ID.
......@@ -953,12 +1026,21 @@ static int gmin_get_config_var(struct device *maindev,
const char *var,
char *out, size_t *out_len)
{
char var8[CFG_VAR_NAME_MAX];
efi_char16_t var16[CFG_VAR_NAME_MAX];
struct efivar_entry *ev;
const struct dmi_system_id *id;
int i, ret;
struct device *dev = maindev;
char var8[CFG_VAR_NAME_MAX];
struct efivar_entry *ev;
int i, ret;
/* For sensors, try first to use the _DSM table */
if (!is_gmin) {
ret = gmin_get_config_dsm_var(maindev, var, out, out_len);
if (!ret)
return 0;
}
/* Fall-back to other approaches */
if (!is_gmin && ACPI_COMPANION(dev))
dev = &ACPI_COMPANION(dev)->dev;
......@@ -977,9 +1059,10 @@ static int gmin_get_config_var(struct device *maindev,
*/
id = dmi_first_match(gmin_vars);
if (id) {
dev_info(maindev, "Found DMI entry for '%s'\n", var8);
return gmin_get_hardcoded_var(id->driver_data, var8, out,
out_len);
ret = gmin_get_hardcoded_var(maindev, id->driver_data, var8,
out, out_len);
if (!ret)
return 0;
}
/* Our variable names are ASCII by construction, but EFI names
......@@ -1009,9 +1092,9 @@ static int gmin_get_config_var(struct device *maindev,
*out_len = ev->var.DataSize;
dev_info(maindev, "found EFI entry for '%s'\n", var8);
} else if (is_gmin) {
dev_warn(maindev, "Failed to find gmin variable %s\n", var8);
dev_info(maindev, "Failed to find EFI gmin variable %s\n", var8);
} else {
dev_warn(maindev, "Failed to find variable %s\n", var8);
dev_info(maindev, "Failed to find EFI variable %s\n", var8);
}
kfree(ev);
......@@ -1030,6 +1113,8 @@ int gmin_get_var_int(struct device *dev, bool is_gmin, const char *var, int def)
if (!ret) {
val[len] = 0;
ret = kstrtol(val, 0, &result);
} else {
dev_info(dev, "%s: using default (%d)\n", var, def);
}
return ret ? def : result;
......
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
* Copyright (c) 2010 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.
*
*
*/
#ifndef _atomisp_helper_h_
#define _atomisp_helper_h_
extern void __iomem *atomisp_io_base;
static inline void __iomem *atomisp_get_io_virt_addr(unsigned int address)
{
void __iomem *ret = atomisp_io_base + (address & 0x003FFFFF);
return ret;
}
#endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -43,7 +44,7 @@ int __atomisp_reqbufs(struct file *file, void *fh,
int atomisp_reqbufs(struct file *file, void *fh,
struct v4l2_requestbuffers *req);
enum atomisp_css_pipe_id atomisp_get_css_pipe_id(struct atomisp_sub_device
enum ia_css_pipe_id atomisp_get_css_pipe_id(struct atomisp_sub_device
*asd);
void atomisp_videobuf_free_buf(struct videobuf_buffer *vb);
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -30,29 +31,31 @@
#include "atomisp_internal.h"
const struct atomisp_in_fmt_conv atomisp_in_fmt_conv[] = {
{ MEDIA_BUS_FMT_SBGGR8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, CSS_BAYER_ORDER_BGGR, CSS_FORMAT_RAW_8 },
{ MEDIA_BUS_FMT_SGBRG8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, CSS_BAYER_ORDER_GBRG, CSS_FORMAT_RAW_8 },
{ MEDIA_BUS_FMT_SGRBG8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, CSS_BAYER_ORDER_GRBG, CSS_FORMAT_RAW_8 },
{ MEDIA_BUS_FMT_SRGGB8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, CSS_BAYER_ORDER_RGGB, CSS_FORMAT_RAW_8 },
{ MEDIA_BUS_FMT_SBGGR10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, CSS_BAYER_ORDER_BGGR, CSS_FORMAT_RAW_10 },
{ MEDIA_BUS_FMT_SGBRG10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, CSS_BAYER_ORDER_GBRG, CSS_FORMAT_RAW_10 },
{ MEDIA_BUS_FMT_SGRBG10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, CSS_BAYER_ORDER_GRBG, CSS_FORMAT_RAW_10 },
{ MEDIA_BUS_FMT_SRGGB10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, CSS_BAYER_ORDER_RGGB, CSS_FORMAT_RAW_10 },
{ MEDIA_BUS_FMT_SBGGR12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_BGGR, CSS_FORMAT_RAW_12 },
{ MEDIA_BUS_FMT_SGBRG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_GBRG, CSS_FORMAT_RAW_12 },
{ MEDIA_BUS_FMT_SGRBG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_GRBG, CSS_FORMAT_RAW_12 },
{ MEDIA_BUS_FMT_SRGGB12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_RGGB, CSS_FORMAT_RAW_12 },
{ MEDIA_BUS_FMT_UYVY8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, ATOMISP_INPUT_FORMAT_YUV422_8 },
{ MEDIA_BUS_FMT_YUYV8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, ATOMISP_INPUT_FORMAT_YUV422_8 },
{ MEDIA_BUS_FMT_JPEG_1X8, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 },
{ V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, CSS_FRAME_FORMAT_NV12, 0, CSS_FRAME_FORMAT_NV12 },
{ V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, CSS_FRAME_FORMAT_NV21, 0, CSS_FRAME_FORMAT_NV21 },
{ V4L2_MBUS_FMT_CUSTOM_YUV420, 12, 12, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, 0, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY },
{ MEDIA_BUS_FMT_SBGGR8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, IA_CSS_BAYER_ORDER_BGGR },
{ MEDIA_BUS_FMT_SGBRG8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, IA_CSS_BAYER_ORDER_GBRG },
{ MEDIA_BUS_FMT_SGRBG8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, IA_CSS_BAYER_ORDER_GRBG },
{ MEDIA_BUS_FMT_SRGGB8_1X8, 8, 8, ATOMISP_INPUT_FORMAT_RAW_8, IA_CSS_BAYER_ORDER_RGGB },
{ MEDIA_BUS_FMT_SBGGR10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, IA_CSS_BAYER_ORDER_BGGR },
{ MEDIA_BUS_FMT_SGBRG10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, IA_CSS_BAYER_ORDER_GBRG },
{ MEDIA_BUS_FMT_SGRBG10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, IA_CSS_BAYER_ORDER_GRBG },
{ MEDIA_BUS_FMT_SRGGB10_1X10, 10, 10, ATOMISP_INPUT_FORMAT_RAW_10, IA_CSS_BAYER_ORDER_RGGB },
{ MEDIA_BUS_FMT_SBGGR12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, IA_CSS_BAYER_ORDER_BGGR },
{ MEDIA_BUS_FMT_SGBRG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, IA_CSS_BAYER_ORDER_GBRG },
{ MEDIA_BUS_FMT_SGRBG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, IA_CSS_BAYER_ORDER_GRBG },
{ MEDIA_BUS_FMT_SRGGB12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, IA_CSS_BAYER_ORDER_RGGB },
{ MEDIA_BUS_FMT_UYVY8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0 },
{ MEDIA_BUS_FMT_YUYV8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0 },
#if 0 // disabled due to clang warnings
{ MEDIA_BUS_FMT_JPEG_1X8, 8, 8, IA_CSS_FRAME_FORMAT_BINARY_8, 0 },
{ V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, IA_CSS_FRAME_FORMAT_NV12, 0 },
{ V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, IA_CSS_FRAME_FORMAT_NV21, 0 },
#endif
{ V4L2_MBUS_FMT_CUSTOM_YUV420, 12, 12, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, 0 },
#if 0
{ V4L2_MBUS_FMT_CUSTOM_M10MO_RAW, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 },
{ V4L2_MBUS_FMT_CUSTOM_M10MO_RAW, 8, 8, IA_CSS_FRAME_FORMAT_BINARY_8, 0 },
#endif
/* no valid V4L2 MBUS code for metadata format, so leave it 0. */
{ 0, 0, 0, ATOMISP_INPUT_FORMAT_EMBEDDED, 0, ATOMISP_INPUT_FORMAT_EMBEDDED },
{ 0, 0, 0, ATOMISP_INPUT_FORMAT_EMBEDDED, 0 },
{}
};
......@@ -639,7 +642,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
atomisp_css_input_set_bayer_order(isp_sd, stream_id,
fc->bayer_order);
atomisp_css_input_set_format(isp_sd, stream_id,
fc->css_stream_fmt);
fc->atomisp_in_fmt);
atomisp_css_set_default_isys_config(isp_sd, stream_id,
ffmt);
}
......@@ -1219,15 +1222,10 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
v4l2_ctrl_new_custom(&asd->ctrl_handler,
&ctrl_disable_dz,
NULL);
if (atomisp_hw_is_isp2401) {
if (IS_ISP2401) {
asd->select_isp_version = v4l2_ctrl_new_custom(&asd->ctrl_handler,
&ctrl_select_isp_version,
NULL);
#if 0 /* #ifdef CONFIG_ION */
asd->ion_dev_fd = v4l2_ctrl_new_custom(&asd->ctrl_handler,
&ctrl_ion_dev_fd,
NULL);
#endif
}
/* Make controls visible on subdev as well. */
......@@ -1348,8 +1346,7 @@ int atomisp_subdev_register_entities(struct atomisp_sub_device *asd,
* Should any of those use V4L2_CAP_META_OUTPUT? Probably yes.
*/
device_caps = V4L2_CAP_IO_MC |
V4L2_CAP_VIDEO_CAPTURE |
device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING;
/* Register the subdev and video node. */
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -59,8 +60,7 @@ struct atomisp_in_fmt_conv {
u8 bpp; /* bits per pixel */
u8 depth; /* uncompressed */
enum atomisp_input_format atomisp_in_fmt;
enum atomisp_css_bayer_order bayer_order;
enum atomisp_input_format css_stream_fmt;
enum ia_css_bayer_order bayer_order;
};
struct atomisp_sub_device;
......@@ -215,8 +215,8 @@ struct atomisp_subdev_params {
unsigned int histogram_elenum;
/* Current grid info */
struct atomisp_css_grid_info curr_grid_info;
enum atomisp_css_pipe_id s3a_enabled_pipe;
struct ia_css_grid_info curr_grid_info;
enum ia_css_pipe_id s3a_enabled_pipe;
int s3a_output_bytes;
......@@ -225,7 +225,7 @@ struct atomisp_subdev_params {
struct ia_css_dz_config dz_config; /** Digital Zoom */
struct ia_css_capture_config capture_config;
struct atomisp_css_isp_config config;
struct ia_css_isp_config config;
/* current configurations */
struct atomisp_css_params css_param;
......@@ -240,7 +240,7 @@ struct atomisp_subdev_params {
u32 metadata_width_size;
struct ia_css_dvs2_statistics *dvs_stat;
struct atomisp_css_dvs_6axis *dvs_6axis;
struct ia_css_dvs_6axis_config *dvs_6axis;
u32 exp_id;
int dvs_hor_coef_bytes;
int dvs_ver_coef_bytes;
......@@ -265,7 +265,7 @@ struct atomisp_css_params_with_list {
};
struct atomisp_acc_fw {
struct atomisp_css_fw_info *fw;
struct ia_css_fw_info *fw;
unsigned int handle;
unsigned int flags;
unsigned int type;
......@@ -323,7 +323,7 @@ struct atomisp_sub_device {
struct {
struct list_head fw;
struct list_head memory_maps;
struct atomisp_css_pipeline *pipeline;
struct ia_css_pipe *pipeline;
bool extension_mode;
struct ida ida;
struct completion acc_done;
......@@ -335,11 +335,11 @@ struct atomisp_sub_device {
struct atomisp_stream_env stream_env[ATOMISP_INPUT_STREAM_NUM];
struct v4l2_pix_format dvs_envelop;
unsigned int s3a_bufs_in_css[CSS_PIPE_ID_NUM];
unsigned int s3a_bufs_in_css[IA_CSS_PIPE_ID_NUM];
unsigned int dis_bufs_in_css;
unsigned int metadata_bufs_in_css
[ATOMISP_INPUT_STREAM_NUM][CSS_PIPE_ID_NUM];
[ATOMISP_INPUT_STREAM_NUM][IA_CSS_PIPE_ID_NUM];
/* The list of free and available metadata buffers for CSS */
struct list_head metadata[ATOMISP_METADATA_TYPE_NUM];
/* The list of metadata buffers which have been en-queued to CSS */
......@@ -358,8 +358,8 @@ struct atomisp_sub_device {
struct list_head dis_stats_in_css;
spinlock_t dis_stats_lock;
struct atomisp_css_frame *vf_frame; /* TODO: needed? */
struct atomisp_css_frame *raw_output_frame;
struct ia_css_frame *vf_frame; /* TODO: needed? */
struct ia_css_frame *raw_output_frame;
enum atomisp_frame_status frame_status[VIDEO_MAX_FRAME];
/* This field specifies which camera (v4l2 input) is selected. */
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -22,25 +23,25 @@
#include "sh_css_params.h"
/*Sepia image effect table*/
static struct atomisp_css_cc_config sepia_cc_config = {
static struct ia_css_cc_config sepia_cc_config = {
.fraction_bits = 8,
.matrix = {141, 18, 68, -40, -5, -19, 35, 4, 16},
};
/*Negative image effect table*/
static struct atomisp_css_cc_config nega_cc_config = {
static struct ia_css_cc_config nega_cc_config = {
.fraction_bits = 8,
.matrix = {255, 29, 120, 0, 374, 342, 0, 672, -301},
};
/*Mono image effect table*/
static struct atomisp_css_cc_config mono_cc_config = {
static struct ia_css_cc_config mono_cc_config = {
.fraction_bits = 8,
.matrix = {255, 29, 120, 0, 0, 0, 0, 0, 0},
};
/*Skin whiten image effect table*/
static struct atomisp_css_macc_table skin_low_macc_table = {
static struct ia_css_macc_table skin_low_macc_table = {
.data = {
8192, 0, 0, 8192,
8192, 0, 0, 8192,
......@@ -61,7 +62,7 @@ static struct atomisp_css_macc_table skin_low_macc_table = {
}
};
static struct atomisp_css_macc_table skin_medium_macc_table = {
static struct ia_css_macc_table skin_medium_macc_table = {
.data = {
8192, 0, 0, 8192,
8192, 0, 0, 8192,
......@@ -82,7 +83,7 @@ static struct atomisp_css_macc_table skin_medium_macc_table = {
}
};
static struct atomisp_css_macc_table skin_high_macc_table = {
static struct ia_css_macc_table skin_high_macc_table = {
.data = {
8192, 0, 0, 8192,
8192, 0, 0, 8192,
......@@ -104,7 +105,7 @@ static struct atomisp_css_macc_table skin_high_macc_table = {
};
/*Blue enhencement image effect table*/
static struct atomisp_css_macc_table blue_macc_table = {
static struct ia_css_macc_table blue_macc_table = {
.data = {
9728, -3072, 0, 8192,
8192, 0, 0, 8192,
......@@ -126,7 +127,7 @@ static struct atomisp_css_macc_table blue_macc_table = {
};
/*Green enhencement image effect table*/
static struct atomisp_css_macc_table green_macc_table = {
static struct ia_css_macc_table green_macc_table = {
.data = {
8192, 0, 0, 8192,
8192, 0, 0, 8192,
......@@ -147,7 +148,7 @@ static struct atomisp_css_macc_table green_macc_table = {
}
};
static struct atomisp_css_ctc_table vivid_ctc_table = {
static struct ia_css_ctc_table vivid_ctc_table = {
.data.vamem_2 = {
0, 384, 837, 957, 1011, 1062, 1083, 1080,
1078, 1077, 1053, 1039, 1012, 992, 969, 951,
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......@@ -147,7 +148,7 @@ int atomisp_tpg_init(struct atomisp_device *isp)
tpg->isp = isp;
v4l2_subdev_init(sd, &tpg_ops);
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
strcpy(sd->name, "tpg_subdev");
strscpy(sd->name, "tpg_subdev", sizeof(sd->name));
v4l2_set_subdevdata(sd, tpg);
pads[0].flags = MEDIA_PAD_FL_SINK;
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support Camera Imaging tracer core.
*
......@@ -43,7 +44,7 @@ TRACE_EVENT(camera_meminfo,
),
TP_fast_assign(
strlcpy(__entry->name, name, 24);
strscpy(__entry->name, name, 24);
__entry->uptr_size = uptr_size;
__entry->counter = counter;
__entry->sys_size = sys_size;
......@@ -73,8 +74,8 @@ TRACE_EVENT(camera_debug,
),
TP_fast_assign(
strlcpy(__entry->name, name, 24);
strlcpy(__entry->info, info, 24);
strscpy(__entry->name, name, 24);
strscpy(__entry->info, info, 24);
__entry->line = line;
),
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Medifield PNW Camera Imaging ISP subsystem.
*
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -16,17 +17,18 @@
#define _IA_CSS_REFCOUNT_H_
#include <type_support.h>
#include <system_types.h>
#include <system_local.h>
#include <ia_css_err.h>
#include <ia_css_types.h>
typedef void (*clear_func)(hrt_vaddress ptr);
typedef void (*clear_func)(ia_css_ptr ptr);
/*! \brief Function for initializing refcount list
*
* \param[in] size Size of the refcount list.
* \return ia_css_err
*/
enum ia_css_err ia_css_refcount_init(uint32_t size);
int ia_css_refcount_init(uint32_t size);
/*! \brief Function for de-initializing refcount list
*
......@@ -38,9 +40,9 @@ void ia_css_refcount_uninit(void);
*
* \param[in] id ID of the object.
* \param[in] ptr Data of the object (ptr).
* \return hrt_vaddress (saved address)
* \return ia_css_ptr (saved address)
*/
hrt_vaddress ia_css_refcount_increment(s32 id, hrt_vaddress ptr);
ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr);
/*! \brief Function for decrease reference by 1.
*
......@@ -50,7 +52,7 @@ hrt_vaddress ia_css_refcount_increment(s32 id, hrt_vaddress ptr);
* - true, if it is successful.
* - false, otherwise.
*/
bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr);
bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr);
/*! \brief Function to check if reference count is 1.
*
......@@ -59,7 +61,7 @@ bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr);
* - true, if it is successful.
* - false, otherwise.
*/
bool ia_css_refcount_is_single(hrt_vaddress ptr);
bool ia_css_refcount_is_single(ia_css_ptr ptr);
/*! \brief Function to clear reference list objects.
*
......@@ -78,6 +80,6 @@ void ia_css_refcount_clear(s32 id,
* - true, if valid
* - false, if invalid
*/
bool ia_css_refcount_is_valid(hrt_vaddress ptr);
bool ia_css_refcount_is_valid(ia_css_ptr ptr);
#endif /* _IA_CSS_REFCOUNT_H_ */
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -12,8 +13,9 @@
* more details.
*/
#include "hmm.h"
#include "ia_css_refcount.h"
#include "memory_access/memory_access.h"
#include "sh_css_defs.h"
#include "platform_support.h"
......@@ -23,10 +25,10 @@
#include "ia_css_debug.h"
/* TODO: enable for other memory aswell
now only for hrt_vaddress */
now only for ia_css_ptr */
struct ia_css_refcount_entry {
u32 count;
hrt_vaddress data;
ia_css_ptr data;
s32 id;
};
......@@ -37,7 +39,7 @@ struct ia_css_refcount_list {
static struct ia_css_refcount_list myrefcount;
static struct ia_css_refcount_entry *refcount_find_entry(hrt_vaddress ptr,
static struct ia_css_refcount_entry *refcount_find_entry(ia_css_ptr ptr,
bool firstfree)
{
u32 i;
......@@ -46,7 +48,7 @@ static struct ia_css_refcount_entry *refcount_find_entry(hrt_vaddress ptr,
return NULL;
if (!myrefcount.items) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
"refcount_find_entry(): Ref count not initiliazed!\n");
"refcount_find_entry(): Ref count not initialized!\n");
return NULL;
}
......@@ -65,25 +67,25 @@ static struct ia_css_refcount_entry *refcount_find_entry(hrt_vaddress ptr,
return NULL;
}
enum ia_css_err ia_css_refcount_init(uint32_t size)
int ia_css_refcount_init(uint32_t size)
{
enum ia_css_err err = IA_CSS_SUCCESS;
int err = 0;
if (size == 0) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_refcount_init(): Size of 0 for Ref count init!\n");
return IA_CSS_ERR_INVALID_ARGUMENTS;
return -EINVAL;
}
if (myrefcount.items) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_refcount_init(): Ref count is already initialized\n");
return IA_CSS_ERR_INTERNAL_ERROR;
return -EINVAL;
}
myrefcount.items =
sh_css_malloc(sizeof(struct ia_css_refcount_entry) * size);
kvmalloc(sizeof(struct ia_css_refcount_entry) * size, GFP_KERNEL);
if (!myrefcount.items)
err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
if (err == IA_CSS_SUCCESS) {
err = -ENOMEM;
if (!err) {
memset(myrefcount.items, 0,
sizeof(struct ia_css_refcount_entry) * size);
myrefcount.size = size;
......@@ -114,14 +116,14 @@ void ia_css_refcount_uninit(void)
entry->id = 0;
}
}
sh_css_free(myrefcount.items);
kvfree(myrefcount.items);
myrefcount.items = NULL;
myrefcount.size = 0;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_refcount_uninit() leave\n");
}
hrt_vaddress ia_css_refcount_increment(s32 id, hrt_vaddress ptr)
ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr)
{
struct ia_css_refcount_entry *entry;
......@@ -158,7 +160,7 @@ hrt_vaddress ia_css_refcount_increment(s32 id, hrt_vaddress ptr)
return ptr;
}
bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr)
bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr)
{
struct ia_css_refcount_entry *entry;
......@@ -201,7 +203,7 @@ bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr)
return false;
}
bool ia_css_refcount_is_single(hrt_vaddress ptr)
bool ia_css_refcount_is_single(ia_css_ptr ptr)
{
struct ia_css_refcount_entry *entry;
......@@ -262,7 +264,7 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr)
count);
}
bool ia_css_refcount_is_valid(hrt_vaddress ptr)
bool ia_css_refcount_is_valid(ia_css_ptr ptr)
{
struct ia_css_refcount_entry *entry;
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部