summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/rkisp1.cpp
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2021-03-09 07:38:29 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-11 02:13:28 +0200
commite32d33b11d6a20d6b8f5ddd102c9083b42f15d55 (patch)
tree4f9bed806537fffc1cbc1c14478e4a97ee0e6253 /src/ipa/rkisp1/rkisp1.cpp
parentf4fe8cf58820c171d6d355001ff4bdf17484275a (diff)
ipa: rkisp1: Fail on init if hw revision is not RKISP1_V10
In kernel 5.11 the rkisp1 uapi had changed to support different hardware revisions. Currently only revision 10 is supported by the rkisp1 IPA and therefore 'init' should fail if the revision is not 10. This changes depends on the kernel driver reporting the hardware revision, and thus requires the rkisp1 driver from v5.11 or newer. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/rkisp1.cpp')
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 7d37645b..d2a10bb9 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -31,10 +31,7 @@ LOG_DEFINE_CATEGORY(IPARkISP1)
class IPARkISP1 : public ipa::rkisp1::IPARkISP1Interface
{
public:
- int init([[maybe_unused]] const IPASettings &settings) override
- {
- return 0;
- }
+ int init(unsigned int hwRevision) override;
int start() override { return 0; }
void stop() override {}
@@ -69,6 +66,20 @@ private:
uint32_t maxGain_;
};
+int IPARkISP1::init(unsigned int hwRevision)
+{
+ /* \todo Add support for other revisions */
+ if (hwRevision != RKISP1_V10) {
+ LOG(IPARkISP1, Error)
+ << "Hardware revision " << hwRevision
+ << " is currently not supported";
+ return -ENODEV;
+ }
+
+ LOG(IPARkISP1, Debug) << "Hardware revision is " << hwRevision;
+ return 0;
+}
+
/**
* \todo The RkISP1 pipeline currently provides an empty CameraSensorInfo
* if the connected sensor does not provide enough information to properly