Re: [PATCH 11/16] media: qcom: camss: csid: Add v4l2 ctrl if TPG mode isn't disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/12/2024 14:07, Depeng Shao wrote:
There is no CSID TPG in some modern HW, so the v4l2 ctrl in CSID driver

"some modern HW" => "on some SoCs"

shouldn't be registered. Checking the supported TPG modes to indicate
if the TPG HW is existing or not, and only register v4l2 ctrl for CSID

"TP HW is existing or not, and only register" => "TPG hardware exists or not and oly registering"

No need to abbreviate hardware to HW.

  only when TPG HW is existing.

"when the TPG hardware exists" you could also say "is present" instead of "exists".

You have additional whitespace in your log before " only"


Signed-off-by: Depeng Shao <quic_depengs@xxxxxxxxxxx>
---
  .../media/platform/qcom/camss/camss-csid.c    | 60 +++++++++++--------
  1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index 6cf8e434dc05..e26a69a454a7 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -760,11 +760,13 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
  	int ret;
if (enable) {
-		ret = v4l2_ctrl_handler_setup(&csid->ctrls);
-		if (ret < 0) {
-			dev_err(csid->camss->dev,
-				"could not sync v4l2 controls: %d\n", ret);
-			return ret;
+		if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED) {
+			ret = v4l2_ctrl_handler_setup(&csid->ctrls);
+			if (ret < 0) {
+				dev_err(csid->camss->dev,
+					"could not sync v4l2 controls: %d\n", ret);
+				return ret;
+			}
  		}
if (!csid->testgen.enabled &&
@@ -838,7 +840,8 @@ static void csid_try_format(struct csid_device *csid,
  		break;
case MSM_CSID_PAD_SRC:
-		if (csid->testgen_mode->cur.val == 0) {
+		if (csid->testgen.nmodes == CSID_PAYLOAD_MODE_DISABLED ||

if (csid->ctrls ||

feels like a more natural test. Less cumbersome and also less typing.

I think that change should be feasible, could you please update your logic from if (csid->testgen.nmodes == CSID_PAYLOAD_MODE_DISABLED) to if (csid->ctrls)

Otherwise looks good but, I'll wait to see your next version before giving an RB.

---
bod




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux