From patchwork Thu Feb 6 18:52:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 2797 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4150B60965 for ; Thu, 6 Feb 2020 19:50:20 +0100 (CET) X-Originating-IP: 93.34.114.233 Received: from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 03C28FF804 for ; Thu, 6 Feb 2020 18:50:19 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Feb 2020 19:52:44 +0100 Message-Id: <20200206185247.202233-5-jacopo@jmondi.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200206185247.202233-1-jacopo@jmondi.org> References: <20200206185247.202233-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/7] libcamera: sensor: Add OV5670 camera sensor X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:50:20 -0000 Add OV5670CameraSensor class to handle Omnivision OV5670 image sensor and register it to the camera sensor factory. Signed-off-by: Jacopo Mondi --- src/libcamera/camera_sensor.cpp | 1 + src/libcamera/meson.build | 1 + src/libcamera/sensor/meson.build | 3 +++ src/libcamera/sensor/ov5670.cpp | 43 ++++++++++++++++++++++++++++++++ src/libcamera/sensor/ov5670.h | 24 ++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 src/libcamera/sensor/meson.build create mode 100644 src/libcamera/sensor/ov5670.cpp create mode 100644 src/libcamera/sensor/ov5670.h diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index fc8452b607a0..06d10295a80e 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -6,6 +6,7 @@ */ #include "camera_sensor.h" +#include "sensor/ov5670.h" #include #include diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index ecc5b5fe4023..7dd7358b174e 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -58,6 +58,7 @@ includes = [ subdir('pipeline') subdir('proxy') +subdir('sensor') libudev = dependency('libudev', required : false) diff --git a/src/libcamera/sensor/meson.build b/src/libcamera/sensor/meson.build new file mode 100644 index 000000000000..7af70370cf5c --- /dev/null +++ b/src/libcamera/sensor/meson.build @@ -0,0 +1,3 @@ +libcamera_sources += files([ + 'ov5670.cpp', +]) diff --git a/src/libcamera/sensor/ov5670.cpp b/src/libcamera/sensor/ov5670.cpp new file mode 100644 index 000000000000..de6011875a2d --- /dev/null +++ b/src/libcamera/sensor/ov5670.cpp @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * ov5670.cpp - OV5670 camera sensor + */ + +#include "ov5670.h" +#include "camera_sensor.h" + +/** + * \file ov5670.h + * \brief Omnivision OV5670 image sensor handler + */ + +namespace libcamera { + +/** + * \class OV5670CameraSensor + * \brief Camera sensor handler for Omnivision OV5670 image sensor + */ + +/** + * \brief Retrieve the name of the sensor entity supported by the handler + * \return The supported sensor entity name + */ +const char *OV5670CameraSensor::entityName() +{ + return "ov5670"; +} + +/** + * \brief Construct the ov5670 sensor handler + * \param[in] entity The media entity representing the sensor + */ +OV5670CameraSensor::OV5670CameraSensor(const MediaEntity *entity) + : CameraSensor(entity) +{ +} + +REGISTER_CAMERA_SENSOR(OV5670); + +}; /* namespace libcamera */ diff --git a/src/libcamera/sensor/ov5670.h b/src/libcamera/sensor/ov5670.h new file mode 100644 index 000000000000..4acf02a8b06b --- /dev/null +++ b/src/libcamera/sensor/ov5670.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * ov5670.h - OV5670 camera sensor + */ +#ifndef __LIBCAMERA_SENSOR_OV5670_H__ +#define __LIBCAMERA_SENSOR_OV5670_H__ + +#include "camera_sensor.h" + +namespace libcamera { + +class OV5670CameraSensor final : public CameraSensor +{ +public: + static const char *entityName(); + + OV5670CameraSensor(const MediaEntity *entity); +}; + +}; /* namespace libcamera */ + +#endif /* __LIBCAMERA_SENSOR_OV5670_H__ */