Message ID | 20220728130237.3396663-4-alexander.stein@ew.tq-group.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Sakari Ailus |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1oH3AD-00Bkbo-IB; Thu, 28 Jul 2022 13:02:53 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238818AbiG1NCw (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 28 Jul 2022 09:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236063AbiG1NCu (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 28 Jul 2022 09:02:50 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48CE3E776; Thu, 28 Jul 2022 06:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1659013369; x=1690549369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G4u1tivvbK5IkZ2oQaHeT7PpCwIMbfiPJFHfYAMie1U=; b=gFBhab7XUi4Yp8BpTtnd2vLQDVqh5JQvomrTqAc2Ggl21RBnkYXgs5bt 0G8rwBR2VH2XURdbgUQH17Rdx4sVw43mVrERePxOYLhXcGwcGVRXaTqE/ KngOw8h/qKXWp/NZysojjeBePKRHJjD6TNsb8dnie0x1YcrSdSTSJadNO +QeQQ4f7dI5lO+AE5+VnxYs63obb+vfF3JS17dUG6KMjdA7ybf+V9HH2J kKoJwpsInA8J2L4J+f43K2wkrlMGo5TnLimKA5ZrSiOo0ueRfIDQ4gc8Q 2REdsKZBDqr0xtAIeA4kc/dlGN0s1X6s0LAcDR03c0HfcrjdcMLXkcxPP g==; X-IronPort-AV: E=Sophos;i="5.93,198,1654552800"; d="scan'208";a="25321369" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 28 Jul 2022 15:02:43 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 28 Jul 2022 15:02:43 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 28 Jul 2022 15:02:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1659013363; x=1690549363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G4u1tivvbK5IkZ2oQaHeT7PpCwIMbfiPJFHfYAMie1U=; b=izBtzfY4utTI1L2Gg3znF7GrWm4Hq/mU8UL53G7AO3jcdhx5p3dj9/9G 0jPXXv09favnrYTKW4Qn/1qxheYm8NLt3lLPUBQZwv9EEnnH1pACXVE9M f/oaQfrgFTakwIvCvWDzt5zY89pNSOpA+8wPRo8KdJkBPxMaX4yYqMqYa 1c7PlKumyUW/eeIo9Se6IjImlrTgZ4o+qPJztXpOMraUa+tC0IfP76JZN LhUwu8MzGucrm7fc0iFMTs2MRxeUs/t8KIZWzyuDh5PPp0X1sSbV2egcn xpCMbYQFd0bPUu/0eGkj5epFAB1xV3KharkBox3sWt1lo9Dp4MdNVYtnO g==; X-IronPort-AV: E=Sophos;i="5.93,198,1654552800"; d="scan'208";a="25321368" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 28 Jul 2022 15:02:43 +0200 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id AAFCA280072; Thu, 28 Jul 2022 15:02:43 +0200 (CEST) From: Alexander Stein <alexander.stein@ew.tq-group.com> To: "Paul J . Murphy" <paul.j.murphy@intel.com>, Daniele Alessandrelli <daniele.alessandrelli@intel.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Sakari Ailus <sakari.ailus@iki.fi> Subject: [PATCH v4 3/7] media: i2c: ov9282: Add ov9281 compatible Date: Thu, 28 Jul 2022 15:02:33 +0200 Message-Id: <20220728130237.3396663-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220728130237.3396663-1-alexander.stein@ew.tq-group.com> References: <20220728130237.3396663-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
OV9281 support
|
|
Commit Message
Alexander Stein
July 28, 2022, 1:02 p.m. UTC
According to product brief they are identical from software point of view. Differences are a different chief ray angle (CRA) and the package. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> --- drivers/media/i2c/ov9282.c | 1 + 1 file changed, 1 insertion(+)
Comments
On 28/07/2022 15:02, Alexander Stein wrote: > According to product brief they are identical from software point of view. > Differences are a different chief ray angle (CRA) and the package. > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > --- > drivers/media/i2c/ov9282.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > index 8a252bf3b59f..c8d83a29f9bb 100644 > --- a/drivers/media/i2c/ov9282.c > +++ b/drivers/media/i2c/ov9282.c > @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { > }; > > static const struct of_device_id ov9282_of_match[] = { > + { .compatible = "ovti,ov9281" }, The devices seem entirely compatible, so why you add a new compatible and not re-use existing? The difference in lens does not explain this. Best regards, Krzysztof
Hi Krzysztof, On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: > On 28/07/2022 15:02, Alexander Stein wrote: > > According to product brief they are identical from software point of view. > > Differences are a different chief ray angle (CRA) and the package. > > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > > Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > > --- > > drivers/media/i2c/ov9282.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > > index 8a252bf3b59f..c8d83a29f9bb 100644 > > --- a/drivers/media/i2c/ov9282.c > > +++ b/drivers/media/i2c/ov9282.c > > @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { > > }; > > > > static const struct of_device_id ov9282_of_match[] = { > > + { .compatible = "ovti,ov9281" }, > > The devices seem entirely compatible, so why you add a new compatible > and not re-use existing? > > The difference in lens does not explain this. It is typically necessary to know what kind of related hardware can be found in the system, beyond just the device's register interface. Apart from USB cameras, less integrated cameras require low-level software control in which specific device properties are important. In this case it could be the lens shading table, among other things. https://www.ovt.com/sensor/ov9282/ Therefore I think adding a specific compatible string for this one is justified. Also cc Laurent.
Hi Sakari, (Adding Dave and Naush to the CC list) On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: > On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: > > On 28/07/2022 15:02, Alexander Stein wrote: > > > According to product brief they are identical from software point of view. > > > Differences are a different chief ray angle (CRA) and the package. > > > > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > > > Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > > > --- > > > drivers/media/i2c/ov9282.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > > > index 8a252bf3b59f..c8d83a29f9bb 100644 > > > --- a/drivers/media/i2c/ov9282.c > > > +++ b/drivers/media/i2c/ov9282.c > > > @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { > > > }; > > > > > > static const struct of_device_id ov9282_of_match[] = { > > > + { .compatible = "ovti,ov9281" }, > > > > The devices seem entirely compatible, so why you add a new compatible > > and not re-use existing? > > > > The difference in lens does not explain this. > > It is typically necessary to know what kind of related hardware can be > found in the system, beyond just the device's register interface. Apart > from USB cameras, less integrated cameras require low-level software > control in which specific device properties are important. In this case it > could be the lens shading table, among other things. > > https://www.ovt.com/sensor/ov9282/ > > Therefore I think adding a specific compatible string for this one is > justified. > > Also cc Laurent. Interesting coincidence, we've talked about this topic (as part of a broader discussion) no later than yesterday. I agree with Sakari in that userspace needs to know the exact model of the camera sensor. I don't see a good alternative to providing that information through the platform firmware, so the device tree in this case. The question is how it should be provided (the question of how it should then be exposed to userspace is also important, but out of scope in this discussion). The compatible string is meant to indicate a device's compatibility with "something", and that something is often considered from the point of view of software support, and in particular to pick an appropriate kernel driver and tune its behaviour for the device. Here, one could argue that the exact model is also needed to ensure proper software support, but in userspace this time, not in the kernel. I think using a dedicated compatible string would be reasonable. An alternative would be to use another DT property, which should then be standardized. I'm not sure it's worth it. Broadening the discussion, we also need to know detailed information about the camera lens (I'm talking about the lens itself here, not the lens controller IC that controls the motor that moves the focus lens). The lens isn't described in the device tree with a dedicated device tree node today, and I don't think it should (I'd have a hard time coming up with a naming scheme for lenses that we could use in compatible strings, and the lens-related data that a system requires can possibly vary based not only on the lens itself but on the ISP that the camera sensor is used with). Typical useful data are the lens movement range, the hyperfocal distance, but also the lens shading tables. (Part of) that information is sometimes stored in non-volatile memory in the camera module (OTP in the camera sensor itself, or a separate EEPROM), but that's not always the case. We have considered the possibility of storing the information in the device tree, but I doubt that would be accepted. We can store the information in userspace in configuration files, but we will still need to device tree to provide lens identification information to select the correct configuration file. I don't know how that should be done.
On 29/07/2022 10:18, Laurent Pinchart wrote: > Hi Sakari, > > (Adding Dave and Naush to the CC list) > > On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: >> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: >>> On 28/07/2022 15:02, Alexander Stein wrote: >>>> According to product brief they are identical from software point of view. >>>> Differences are a different chief ray angle (CRA) and the package. >>>> >>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> >>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> >>>> --- >>>> drivers/media/i2c/ov9282.c | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c >>>> index 8a252bf3b59f..c8d83a29f9bb 100644 >>>> --- a/drivers/media/i2c/ov9282.c >>>> +++ b/drivers/media/i2c/ov9282.c >>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { >>>> }; >>>> >>>> static const struct of_device_id ov9282_of_match[] = { >>>> + { .compatible = "ovti,ov9281" }, >>> >>> The devices seem entirely compatible, so why you add a new compatible >>> and not re-use existing? >>> >>> The difference in lens does not explain this. >> >> It is typically necessary to know what kind of related hardware can be >> found in the system, beyond just the device's register interface. Apart >> from USB cameras, less integrated cameras require low-level software >> control in which specific device properties are important. In this case it >> could be the lens shading table, among other things. >> >> https://www.ovt.com/sensor/ov9282/ >> >> Therefore I think adding a specific compatible string for this one is >> justified. Specific compatible in binding is a requirement. No one discussed this. However not in the driver. None of the arguments above justify adding such binding, unless user-space depends on matching compatible, but not real compatible? >> >> Also cc Laurent. > > Interesting coincidence, we've talked about this topic (as part of a > broader discussion) no later than yesterday. > > I agree with Sakari in that userspace needs to know the exact model of > the camera sensor. I don't see a good alternative to providing that > information through the platform firmware, so the device tree in this > case. The question is how it should be provided (the question of how it > should then be exposed to userspace is also important, but out of scope > in this discussion). > > The compatible string is meant to indicate a device's compatibility with > "something", and that something is often considered from the point of > view of software support, and in particular to pick an appropriate > kernel driver and tune its behaviour for the device. Here, one could > argue that the exact model is also needed to ensure proper software > support, but in userspace this time, not in the kernel. I think using a > dedicated compatible string would be reasonable. An alternative would be > to use another DT property, which should then be standardized. I'm not > sure it's worth it. > > Broadening the discussion, we also need to know detailed information > about the camera lens (I'm talking about the lens itself here, not the > lens controller IC that controls the motor that moves the focus lens). > The lens isn't described in the device tree with a dedicated device tree > node today, and I don't think it should (I'd have a hard time coming up > with a naming scheme for lenses that we could use in compatible strings, > and the lens-related data that a system requires can possibly vary based > not only on the lens itself but on the ISP that the camera sensor is > used with). Typical useful data are the lens movement range, the > hyperfocal distance, but also the lens shading tables. (Part of) that > information is sometimes stored in non-volatile memory in the camera > module (OTP in the camera sensor itself, or a separate EEPROM), but > that's not always the case. We have considered the possibility of > storing the information in the device tree, but I doubt that would be > accepted. We can store the information in userspace in configuration > files, but we will still need to device tree to provide lens > identification information to select the correct configuration file. I > don't know how that should be done. It seems both you and Sakari suggested not to have specific compatible. Such idea (not to have specific compatible) was not proposed by me. Quite contrary - specific compatible is a requirement. However device driver does no need it. Just use fallback for the driver. Best regards, Krzysztof
On 01/08/2022 20:07, Krzysztof Kozlowski wrote: > On 29/07/2022 10:18, Laurent Pinchart wrote: >> Hi Sakari, >> >> (Adding Dave and Naush to the CC list) >> >> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: >>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: >>>> On 28/07/2022 15:02, Alexander Stein wrote: >>>>> According to product brief they are identical from software point of view. >>>>> Differences are a different chief ray angle (CRA) and the package. >>>>> >>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> >>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> >>>>> --- >>>>> drivers/media/i2c/ov9282.c | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c >>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 >>>>> --- a/drivers/media/i2c/ov9282.c >>>>> +++ b/drivers/media/i2c/ov9282.c >>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { >>>>> }; >>>>> >>>>> static const struct of_device_id ov9282_of_match[] = { >>>>> + { .compatible = "ovti,ov9281" }, >>>> >>>> The devices seem entirely compatible, so why you add a new compatible >>>> and not re-use existing? >>>> >>>> The difference in lens does not explain this. >>> >>> It is typically necessary to know what kind of related hardware can be >>> found in the system, beyond just the device's register interface. Apart >>> from USB cameras, less integrated cameras require low-level software >>> control in which specific device properties are important. In this case it >>> could be the lens shading table, among other things. >>> >>> https://www.ovt.com/sensor/ov9282/ >>> >>> Therefore I think adding a specific compatible string for this one is >>> justified. > > Specific compatible in binding is a requirement. No one discussed this. > However not in the driver. None of the arguments above justify adding > such binding, unless user-space depends on matching compatible, but not > real compatible? Eh, now I used vague words. This should be instead: "However not in the driver. None of the arguments above justify adding such compatible to driver, unless user-space depends on matching compatible, but not real compatible?" > >>> >>> Also cc Laurent. >> >> Interesting coincidence, we've talked about this topic (as part of a >> broader discussion) no later than yesterday. >> >> I agree with Sakari in that userspace needs to know the exact model of >> the camera sensor. I don't see a good alternative to providing that >> information through the platform firmware, so the device tree in this >> case. The question is how it should be provided (the question of how it >> should then be exposed to userspace is also important, but out of scope >> in this discussion). >> >> The compatible string is meant to indicate a device's compatibility with >> "something", and that something is often considered from the point of >> view of software support, and in particular to pick an appropriate >> kernel driver and tune its behaviour for the device. Here, one could >> argue that the exact model is also needed to ensure proper software >> support, but in userspace this time, not in the kernel. I think using a >> dedicated compatible string would be reasonable. An alternative would be >> to use another DT property, which should then be standardized. I'm not >> sure it's worth it. >> >> Broadening the discussion, we also need to know detailed information >> about the camera lens (I'm talking about the lens itself here, not the >> lens controller IC that controls the motor that moves the focus lens). >> The lens isn't described in the device tree with a dedicated device tree >> node today, and I don't think it should (I'd have a hard time coming up >> with a naming scheme for lenses that we could use in compatible strings, >> and the lens-related data that a system requires can possibly vary based >> not only on the lens itself but on the ISP that the camera sensor is >> used with). Typical useful data are the lens movement range, the >> hyperfocal distance, but also the lens shading tables. (Part of) that >> information is sometimes stored in non-volatile memory in the camera >> module (OTP in the camera sensor itself, or a separate EEPROM), but >> that's not always the case. We have considered the possibility of >> storing the information in the device tree, but I doubt that would be >> accepted. We can store the information in userspace in configuration >> files, but we will still need to device tree to provide lens >> identification information to select the correct configuration file. I >> don't know how that should be done. > > It seems both you and Sakari suggested not to have specific compatible. > Such idea (not to have specific compatible) was not proposed by me. > Quite contrary - specific compatible is a requirement. However device > driver does no need it. Just use fallback for the driver. Best regards, Krzysztof
On Mon, Aug 01, 2022 at 08:08:58PM +0200, Krzysztof Kozlowski wrote: > On 01/08/2022 20:07, Krzysztof Kozlowski wrote: > > On 29/07/2022 10:18, Laurent Pinchart wrote: > >> Hi Sakari, > >> > >> (Adding Dave and Naush to the CC list) > >> > >> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: > >>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: > >>>> On 28/07/2022 15:02, Alexander Stein wrote: > >>>>> According to product brief they are identical from software point of view. > >>>>> Differences are a different chief ray angle (CRA) and the package. > >>>>> > >>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > >>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > >>>>> --- > >>>>> drivers/media/i2c/ov9282.c | 1 + > >>>>> 1 file changed, 1 insertion(+) > >>>>> > >>>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > >>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 > >>>>> --- a/drivers/media/i2c/ov9282.c > >>>>> +++ b/drivers/media/i2c/ov9282.c > >>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { > >>>>> }; > >>>>> > >>>>> static const struct of_device_id ov9282_of_match[] = { > >>>>> + { .compatible = "ovti,ov9281" }, > >>>> > >>>> The devices seem entirely compatible, so why you add a new compatible > >>>> and not re-use existing? > >>>> > >>>> The difference in lens does not explain this. > >>> > >>> It is typically necessary to know what kind of related hardware can be > >>> found in the system, beyond just the device's register interface. Apart > >>> from USB cameras, less integrated cameras require low-level software > >>> control in which specific device properties are important. In this case it > >>> could be the lens shading table, among other things. > >>> > >>> https://www.ovt.com/sensor/ov9282/ > >>> > >>> Therefore I think adding a specific compatible string for this one is > >>> justified. > > > > Specific compatible in binding is a requirement. No one discussed this. > > However not in the driver. None of the arguments above justify adding > > such binding, unless user-space depends on matching compatible, but not > > real compatible? > > Eh, now I used vague words. This should be instead: > > "However not in the driver. None of the arguments above justify adding > such compatible to driver, unless user-space depends on matching > compatible, but not real compatible?" If I understand you right, you'd put the more specific model name as well as the more generic one to the compatible property and let the driver match against the more generic one? But in this case neither of these models is more generic than the other.
On 02/08/2022 10:23, Sakari Ailus wrote: > On Mon, Aug 01, 2022 at 08:08:58PM +0200, Krzysztof Kozlowski wrote: >> On 01/08/2022 20:07, Krzysztof Kozlowski wrote: >>> On 29/07/2022 10:18, Laurent Pinchart wrote: >>>> Hi Sakari, >>>> >>>> (Adding Dave and Naush to the CC list) >>>> >>>> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: >>>>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: >>>>>> On 28/07/2022 15:02, Alexander Stein wrote: >>>>>>> According to product brief they are identical from software point of view. >>>>>>> Differences are a different chief ray angle (CRA) and the package. >>>>>>> >>>>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> >>>>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> >>>>>>> --- >>>>>>> drivers/media/i2c/ov9282.c | 1 + >>>>>>> 1 file changed, 1 insertion(+) >>>>>>> >>>>>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c >>>>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 >>>>>>> --- a/drivers/media/i2c/ov9282.c >>>>>>> +++ b/drivers/media/i2c/ov9282.c >>>>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { >>>>>>> }; >>>>>>> >>>>>>> static const struct of_device_id ov9282_of_match[] = { >>>>>>> + { .compatible = "ovti,ov9281" }, >>>>>> >>>>>> The devices seem entirely compatible, so why you add a new compatible >>>>>> and not re-use existing? >>>>>> >>>>>> The difference in lens does not explain this. >>>>> >>>>> It is typically necessary to know what kind of related hardware can be >>>>> found in the system, beyond just the device's register interface. Apart >>>>> from USB cameras, less integrated cameras require low-level software >>>>> control in which specific device properties are important. In this case it >>>>> could be the lens shading table, among other things. >>>>> >>>>> https://www.ovt.com/sensor/ov9282/ >>>>> >>>>> Therefore I think adding a specific compatible string for this one is >>>>> justified. >>> >>> Specific compatible in binding is a requirement. No one discussed this. >>> However not in the driver. None of the arguments above justify adding >>> such binding, unless user-space depends on matching compatible, but not >>> real compatible? >> >> Eh, now I used vague words. This should be instead: >> >> "However not in the driver. None of the arguments above justify adding >> such compatible to driver, unless user-space depends on matching >> compatible, but not real compatible?" > > If I understand you right, you'd put the more specific model name as well > as the more generic one to the compatible property and let the driver match > against the more generic one? Yes. > > But in this case neither of these models is more generic than the other. It's not a problem. Also the spec explains it similar way: "They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices." Of course the numbers would suggest that ov9281 should be the family (as lower number usually means designed earlier), but it is a matter of convention which here can be skipped. The point is that ov9281 and ov9282 are compatible between each other, therefore they belong to single family. Best regards, Krzysztof
Hello, Am Dienstag, 2. August 2022, 10:30:40 CEST schrieb Krzysztof Kozlowski: > On 02/08/2022 10:23, Sakari Ailus wrote: > > On Mon, Aug 01, 2022 at 08:08:58PM +0200, Krzysztof Kozlowski wrote: > >> On 01/08/2022 20:07, Krzysztof Kozlowski wrote: > >>> On 29/07/2022 10:18, Laurent Pinchart wrote: > >>>> Hi Sakari, > >>>> > >>>> (Adding Dave and Naush to the CC list) > >>>> > >>>> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: > >>>>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: > >>>>>> On 28/07/2022 15:02, Alexander Stein wrote: > >>>>>>> According to product brief they are identical from software point of > >>>>>>> view. > >>>>>>> Differences are a different chief ray angle (CRA) and the package. > >>>>>>> > >>>>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > >>>>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > >>>>>>> --- > >>>>>>> > >>>>>>> drivers/media/i2c/ov9282.c | 1 + > >>>>>>> 1 file changed, 1 insertion(+) > >>>>>>> > >>>>>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > >>>>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 > >>>>>>> --- a/drivers/media/i2c/ov9282.c > >>>>>>> +++ b/drivers/media/i2c/ov9282.c > >>>>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = > >>>>>>> { > >>>>>>> > >>>>>>> }; > >>>>>>> > >>>>>>> static const struct of_device_id ov9282_of_match[] = { > >>>>>>> > >>>>>>> + { .compatible = "ovti,ov9281" }, > >>>>>> > >>>>>> The devices seem entirely compatible, so why you add a new compatible > >>>>>> and not re-use existing? > >>>>>> > >>>>>> The difference in lens does not explain this. > >>>>> > >>>>> It is typically necessary to know what kind of related hardware can be > >>>>> found in the system, beyond just the device's register interface. > >>>>> Apart > >>>>> from USB cameras, less integrated cameras require low-level software > >>>>> control in which specific device properties are important. In this > >>>>> case it > >>>>> could be the lens shading table, among other things. > >>>>> > >>>>> https://www.ovt.com/sensor/ov9282/ > >>>>> > >>>>> Therefore I think adding a specific compatible string for this one is > >>>>> justified. > >>> > >>> Specific compatible in binding is a requirement. No one discussed this. > >>> However not in the driver. None of the arguments above justify adding > >>> such binding, unless user-space depends on matching compatible, but not > >>> real compatible? > >> > >> Eh, now I used vague words. This should be instead: > >> > >> "However not in the driver. None of the arguments above justify adding > >> such compatible to driver, unless user-space depends on matching > >> compatible, but not real compatible?" > > > > If I understand you right, you'd put the more specific model name as well > > as the more generic one to the compatible property and let the driver > > match > > against the more generic one? > > Yes. > > > But in this case neither of these models is more generic than the other. > > It's not a problem. Also the spec explains it similar way: > "They > allow a device to express its compatibility with a family of similar > devices, potentially allowing a single > device driver to match against several devices." > > Of course the numbers would suggest that ov9281 should be the family (as > lower number usually means designed earlier), but it is a matter of > convention which here can be skipped. The point is that ov9281 and > ov9282 are compatible between each other, therefore they belong to > single family. > > Best regards, > Krzysztof So what is the conclusion of this? If using the "family" name there is no way for userspace to see the actual device name rather than the driver name. This might be confusing, especially of both ov9281 and ov9282 are attached to the same platform. The only difference would be the i2c-bus-address. You can also go for ov928x but this is not a real improvement. Best regards, Alexander
On 15/08/2022 14:19, Alexander Stein wrote: > Hello, > > Am Dienstag, 2. August 2022, 10:30:40 CEST schrieb Krzysztof Kozlowski: >> On 02/08/2022 10:23, Sakari Ailus wrote: >>> On Mon, Aug 01, 2022 at 08:08:58PM +0200, Krzysztof Kozlowski wrote: >>>> On 01/08/2022 20:07, Krzysztof Kozlowski wrote: >>>>> On 29/07/2022 10:18, Laurent Pinchart wrote: >>>>>> Hi Sakari, >>>>>> >>>>>> (Adding Dave and Naush to the CC list) >>>>>> >>>>>> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: >>>>>>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: >>>>>>>> On 28/07/2022 15:02, Alexander Stein wrote: >>>>>>>>> According to product brief they are identical from software point of >>>>>>>>> view. >>>>>>>>> Differences are a different chief ray angle (CRA) and the package. >>>>>>>>> >>>>>>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> >>>>>>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> >>>>>>>>> --- >>>>>>>>> >>>>>>>>> drivers/media/i2c/ov9282.c | 1 + >>>>>>>>> 1 file changed, 1 insertion(+) >>>>>>>>> >>>>>>>>> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c >>>>>>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 >>>>>>>>> --- a/drivers/media/i2c/ov9282.c >>>>>>>>> +++ b/drivers/media/i2c/ov9282.c >>>>>>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = >>>>>>>>> { >>>>>>>>> >>>>>>>>> }; >>>>>>>>> >>>>>>>>> static const struct of_device_id ov9282_of_match[] = { >>>>>>>>> >>>>>>>>> + { .compatible = "ovti,ov9281" }, >>>>>>>> >>>>>>>> The devices seem entirely compatible, so why you add a new compatible >>>>>>>> and not re-use existing? >>>>>>>> >>>>>>>> The difference in lens does not explain this. >>>>>>> >>>>>>> It is typically necessary to know what kind of related hardware can be >>>>>>> found in the system, beyond just the device's register interface. >>>>>>> Apart >>>>>>> from USB cameras, less integrated cameras require low-level software >>>>>>> control in which specific device properties are important. In this >>>>>>> case it >>>>>>> could be the lens shading table, among other things. >>>>>>> >>>>>>> https://www.ovt.com/sensor/ov9282/ >>>>>>> >>>>>>> Therefore I think adding a specific compatible string for this one is >>>>>>> justified. >>>>> >>>>> Specific compatible in binding is a requirement. No one discussed this. >>>>> However not in the driver. None of the arguments above justify adding >>>>> such binding, unless user-space depends on matching compatible, but not >>>>> real compatible? >>>> >>>> Eh, now I used vague words. This should be instead: >>>> >>>> "However not in the driver. None of the arguments above justify adding >>>> such compatible to driver, unless user-space depends on matching >>>> compatible, but not real compatible?" >>> >>> If I understand you right, you'd put the more specific model name as well >>> as the more generic one to the compatible property and let the driver >>> match >>> against the more generic one? >> >> Yes. >> >>> But in this case neither of these models is more generic than the other. >> >> It's not a problem. Also the spec explains it similar way: >> "They >> allow a device to express its compatibility with a family of similar >> devices, potentially allowing a single >> device driver to match against several devices." >> >> Of course the numbers would suggest that ov9281 should be the family (as >> lower number usually means designed earlier), but it is a matter of >> convention which here can be skipped. The point is that ov9281 and >> ov9282 are compatible between each other, therefore they belong to >> single family. >> >> Best regards, >> Krzysztof > > So what is the conclusion of this? > If using the "family" name there is no way for userspace to see the actual > device name rather than the driver name. This might be confusing, especially > of both ov9281 and ov9282 are attached to the same platform. The only > difference would be the i2c-bus-address. > You can also go for ov928x but this is not a real improvement. I still don't understand. Why user-space cannot see this? I really cannot find any trouble... Your 3/7 patch does nothing special here for user-space... Best regards, Krzysztof
Am Dienstag, 16. August 2022, 09:16:44 CEST schrieb Krzysztof Kozlowski: > On 15/08/2022 14:19, Alexander Stein wrote: > > Hello, > > > > Am Dienstag, 2. August 2022, 10:30:40 CEST schrieb Krzysztof Kozlowski: > >> On 02/08/2022 10:23, Sakari Ailus wrote: > >>> On Mon, Aug 01, 2022 at 08:08:58PM +0200, Krzysztof Kozlowski wrote: > >>>> On 01/08/2022 20:07, Krzysztof Kozlowski wrote: > >>>>> On 29/07/2022 10:18, Laurent Pinchart wrote: > >>>>>> Hi Sakari, > >>>>>> > >>>>>> (Adding Dave and Naush to the CC list) > >>>>>> > >>>>>> On Fri, Jul 29, 2022 at 10:07:36AM +0300, Sakari Ailus wrote: > >>>>>>> On Thu, Jul 28, 2022 at 03:13:11PM +0200, Krzysztof Kozlowski wrote: > >>>>>>>> On 28/07/2022 15:02, Alexander Stein wrote: > >>>>>>>>> According to product brief they are identical from software point > >>>>>>>>> of > >>>>>>>>> view. > >>>>>>>>> Differences are a different chief ray angle (CRA) and the package. > >>>>>>>>> > >>>>>>>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > >>>>>>>>> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > >>>>>>>>> --- > >>>>>>>>> > >>>>>>>>> drivers/media/i2c/ov9282.c | 1 + > >>>>>>>>> 1 file changed, 1 insertion(+) > >>>>>>>>> > >>>>>>>>> diff --git a/drivers/media/i2c/ov9282.c > >>>>>>>>> b/drivers/media/i2c/ov9282.c > >>>>>>>>> index 8a252bf3b59f..c8d83a29f9bb 100644 > >>>>>>>>> --- a/drivers/media/i2c/ov9282.c > >>>>>>>>> +++ b/drivers/media/i2c/ov9282.c > >>>>>>>>> @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops > >>>>>>>>> = > >>>>>>>>> { > >>>>>>>>> > >>>>>>>>> }; > >>>>>>>>> > >>>>>>>>> static const struct of_device_id ov9282_of_match[] = { > >>>>>>>>> > >>>>>>>>> + { .compatible = "ovti,ov9281" }, > >>>>>>>> > >>>>>>>> The devices seem entirely compatible, so why you add a new > >>>>>>>> compatible > >>>>>>>> and not re-use existing? > >>>>>>>> > >>>>>>>> The difference in lens does not explain this. > >>>>>>> > >>>>>>> It is typically necessary to know what kind of related hardware can > >>>>>>> be > >>>>>>> found in the system, beyond just the device's register interface. > >>>>>>> Apart > >>>>>>> from USB cameras, less integrated cameras require low-level software > >>>>>>> control in which specific device properties are important. In this > >>>>>>> case it > >>>>>>> could be the lens shading table, among other things. > >>>>>>> > >>>>>>> https://www.ovt.com/sensor/ov9282/ > >>>>>>> > >>>>>>> Therefore I think adding a specific compatible string for this one > >>>>>>> is > >>>>>>> justified. > >>>>> > >>>>> Specific compatible in binding is a requirement. No one discussed > >>>>> this. > >>>>> However not in the driver. None of the arguments above justify adding > >>>>> such binding, unless user-space depends on matching compatible, but > >>>>> not > >>>>> real compatible? > >>>> > >>>> Eh, now I used vague words. This should be instead: > >>>> > >>>> "However not in the driver. None of the arguments above justify adding > >>>> such compatible to driver, unless user-space depends on matching > >>>> compatible, but not real compatible?" > >>> > >>> If I understand you right, you'd put the more specific model name as > >>> well > >>> as the more generic one to the compatible property and let the driver > >>> match > >>> against the more generic one? > >> > >> Yes. > >> > >>> But in this case neither of these models is more generic than the other. > >> > >> It's not a problem. Also the spec explains it similar way: > >> "They > >> > >> allow a device to express its compatibility with a family of similar > >> > >> devices, potentially allowing a single > >> > >> device driver to match against several devices." > >> > >> Of course the numbers would suggest that ov9281 should be the family (as > >> lower number usually means designed earlier), but it is a matter of > >> convention which here can be skipped. The point is that ov9281 and > >> ov9282 are compatible between each other, therefore they belong to > >> single family. > >> > >> Best regards, > >> Krzysztof > > > > So what is the conclusion of this? > > If using the "family" name there is no way for userspace to see the actual > > device name rather than the driver name. This might be confusing, > > especially of both ov9281 and ov9282 are attached to the same platform. > > The only difference would be the i2c-bus-address. > > You can also go for ov928x but this is not a real improvement. > > I still don't understand. Why user-space cannot see this? I really > cannot find any trouble... Your 3/7 patch does nothing special here for > user-space... 3/7 itself does nothing for userspace, but 6/7 does, which relies on separate compatibles in the driver. Best regards, Alexander
On 16/08/2022 10:21, Alexander Stein wrote: >>> >>> So what is the conclusion of this? >>> If using the "family" name there is no way for userspace to see the actual >>> device name rather than the driver name. This might be confusing, >>> especially of both ov9281 and ov9282 are attached to the same platform. >>> The only difference would be the i2c-bus-address. >>> You can also go for ov928x but this is not a real improvement. >> >> I still don't understand. Why user-space cannot see this? I really >> cannot find any trouble... Your 3/7 patch does nothing special here for >> user-space... > > 3/7 itself does nothing for userspace, but 6/7 does, which relies on separate > compatibles in the driver. Ah, that's so confusing... First adding new incomplete device support in patch 3 and then in patch 6 fixing it. 6 and 3 should be squashed. They really do not make any sense being separate and this just brings this unnecessary confusion. I would argue that the binding still should have devices compatible (in one family), but now it is a bit less important. Best regards, Krzysztof
Hello Kieran, Am Samstag, 12. November 2022, 00:48:24 CET schrieb Kieran Bingham: > Hi All, > > Quoting Alexander Stein (2022-07-28 14:02:33) > > > According to product brief they are identical from software point of view. > > Differences are a different chief ray angle (CRA) and the package. > > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > > Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> > > Throwing my hat in the ring on this thread as I see it has been hanging > around for a while and my attention was sent here from [0] > > [0] > https://lists.libcamera.org/pipermail/libcamera-devel/2022-November/035495. > html I postponed working on this change for a while, because there are (at least) two series from Dave pending which conflict a bit with this series. > > --- > > > > drivers/media/i2c/ov9282.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > > index 8a252bf3b59f..c8d83a29f9bb 100644 > > --- a/drivers/media/i2c/ov9282.c > > +++ b/drivers/media/i2c/ov9282.c > > @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { > > > > }; > > > > static const struct of_device_id ov9282_of_match[] = { > > > > + { .compatible = "ovti,ov9281" }, > > I believe from my existing understanding of how we would support > existing sensors even with very similar parts is that a direct > compatible lets the DT express this. > > If there were a common name that we could apply, we could have a generic > name here too, but I don't see anything specifically generic, and I > haven't yet seen a clear pattern in the namings schemes from omnivision > so ov928x wouldn't be appropriate as I couldn't be sure that an > unrelated ov9289 wouldn't exist with very different properties ... so .. > > > { .compatible = "ovti,ov9282" }, > > Either squashed with the later 6/7 that adds the name or not: (I think > it's fine either separated or squashed) > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > It does in turn bring questions into how we handle both the ov9281 and > ov9282 together in libcamera, but I don't think that's an issue to solve > here. Expressing the two separately to userspace also allows libcamera > to make a distiction between the CRA should it need to. Krzysztof is in favor of squashing so I'll respin this accordingly, removing the other changes from the ov9281 support series. Best regards, Alexander
diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 8a252bf3b59f..c8d83a29f9bb 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -1113,6 +1113,7 @@ static const struct dev_pm_ops ov9282_pm_ops = { }; static const struct of_device_id ov9282_of_match[] = { + { .compatible = "ovti,ov9281" }, { .compatible = "ovti,ov9282" }, { } };