@@ -846,7 +846,8 @@ EXCLUDE = @TOP_SRCDIR@/include/libcamera/span.h \
@TOP_SRCDIR@/src/libcamera/include/device_enumerator_sysfs.h \
@TOP_SRCDIR@/src/libcamera/include/device_enumerator_udev.h \
@TOP_SRCDIR@/src/libcamera/pipeline/ \
- @TOP_SRCDIR@/src/libcamera/proxy/
+ @TOP_SRCDIR@/src/libcamera/proxy/ \
+ @TOP_SRCDIR@/src/libcamera/sensor/
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -57,6 +57,7 @@ includes = [
subdir('pipeline')
subdir('proxy')
+subdir('sensor')
libatomic = cc.find_library('atomic', required : false)
libdl = cc.find_library('dl')
new file mode 100644
@@ -0,0 +1,3 @@
+libcamera_sources += files([
+ 'ov5670.cpp',
+])
new file mode 100644
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * ov5670.cpp - OV5670 camera sensor
+ */
+
+#include <libcamera/property_ids.h>
+
+#include "camera_sensor.h"
+
+namespace libcamera {
+
+class OV5670 final : public CameraSensor
+{
+public:
+ OV5670(const MediaEntity *entity);
+ int initProperties();
+};
+
+/*
+ * \class OV5670
+ * \brief Camera sensor class for Omnivision OV5670 image sensor
+ */
+
+/*
+ * \brief Construct the ov5670 sensor class
+ * \param[in] entity The media entity representing the sensor
+ */
+OV5670::OV5670(const MediaEntity *entity)
+ : CameraSensor(entity)
+{
+}
+
+/*
+ * \brief Initialize Camera properties with ov5670 specific values
+ * \return 0 on success, a negative error code otherwise
+ */
+int OV5670::initProperties()
+{
+ /* Pixel Array Properties. */
+ properties_.set(properties::PixelArraySize, { 2.9457f, 2.214f });
+ properties_.set(properties::PixelArray, { 2592, 1944 });
+ properties_.set(properties::ActiveAreas, { 16, 6, 2560, 1920 });
+ properties_.set(properties::BayerFilterArrangement,
+ properties::BayerFilterGRBG);
+ properties_.set(properties::ISOSensitivityRange, { 50, 800 });
+
+ return CameraSensor::initProperties();
+}
+
+REGISTER_CAMERA_SENSOR(OV5670, "ov5670");
+
+}; /* namespace libcamera */