From patchwork Tue May 13 14:23:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 889659 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B90EA2BD009 for ; Tue, 13 May 2025 14:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146247; cv=none; b=q5ioQlZsm48sueJCyNt/VrC5CRWzT6TPRfo6kK0tAlPTCHLraGpT510Ri3U7YfNPkY+vPXRZNIEItCVAQYHDRnNZ+AMpRiQHH7s7yaS/RC3f4uXaHyUdxRcWpwcp+qY/+l+4FRe4GKVB57HuWAeth8cvJmKtbFZLA86hpd9Tf6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146247; c=relaxed/simple; bh=1dbZKTa/g+MzsnzTQFCT1jdM3evL1vIx93omGHH0mS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JMw9GtT1a3Twmc5SH2dE01RgE8+cPnLnoWkLMFmjT40RjvP6LnqKAvpMq2KvkSoj/PLPChN9NvWURY51erBbQLjOH+ANTigHP2LeeTdnaWNu6Zvc/amqLz3uoXDTUg71Ohb92Z8eYvPsJXwJpaEQw4+YxXRr2i7mvv5ZRxCYqeE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Vs5/NShG; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Vs5/NShG" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-54fcdc99478so349604e87.0 for ; Tue, 13 May 2025 07:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747146244; x=1747751044; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FLyQNl/IfprA8mrvUU0qzCD9YVX1jlfRaaDTODi+QbM=; b=Vs5/NShGV04HpSXCK/5zy/JjMa9blTs5UiwgGyiEK1kvBWF/aTzhATN5kAGKAy5H7V bkGZVDaoz0zKMABDVh43J4iQiKbee1mKP/+XNbsv2dtmgCV4xLSdiTo+uLQi6J1Cq8Kt 88xNudE8lFtgC6163eAFf/Diblf/r0zyz6Ll1YYaLwk5mGfBjzxiLizcPZOy60zyDLgL r6/+AsJ0gHTxd47sqHEy8ReEEuSXEbTC6C6tK5ymH0o0Xe68Q1gnhiv57ZcJVzzMClYQ R4cJlwbtthIJj8qUUdjdsWwTHPi1XN5Md93CARSX3bl1x124R8RZHZIbm6wHLylWUkoE Huqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146244; x=1747751044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FLyQNl/IfprA8mrvUU0qzCD9YVX1jlfRaaDTODi+QbM=; b=rb3QM0tZRXZQ4FYNksVyMUraouHmRxmAT4LAR2EMkFatD2Tme+RLU2xffVLnkLNCih 7PunI3n/OSFtMP880IMbiv0EKd7+vkMA1StJURmzDb1sjugYIl7TfdHqIJDHbV1WLtF8 oRwXPtR+dxdNU9wNBWzQl4wExltnVAIcKDV8obn4qhHdOsueVhD8RN+ZrsYarCw0Yxz0 /b7ZMhQkL44oiq8QbPsY0wzyJb1ERIbTBYTIytxZKTW/VRDTlfppQQ7LeSvO85JfCcYY ErLepTjLha9ka303buJOUmtq7er3kstrDnAfVfbKi6IDDmpi1WNTpxhOujtTZ1X4cmI4 7tqQ== X-Forwarded-Encrypted: i=1; AJvYcCWciVnu3IUgZDckBQXzqwYzZovZ1jNsxWySbO2GSPtKgB/ho9Pywitqp1fUfHMn0bkoWNLSVe1CunoxYe9E@vger.kernel.org X-Gm-Message-State: AOJu0YztKo/tQh7GICPbFk+4Mw01QVNbKKgGPplIqhnpvqY/X5128Iba ZEy7H0S7TidIeAEdBxYy7vzBQ8j95TU0GLkCnp6UmaX3Yeg+9z3eirNm9tREYUNkpKm4m1kzzkS u X-Gm-Gg: ASbGncv+iLpfJcz1geMojHmzXSNoOhtK6MVgy/qlfxd1RRZQUWoEAEAS3GRE3Wgan4T ElazLUWog2GAefbu9MsqhVbS7GX/2V8P5jlUUwbL8+B/C6HeBIp5i7XbORbAliPAS6FoFZzjXxf T2rWZS/ERE9E2inTgda0jSTdN5kqcn8FwC40nw4hVDa3AImL+1WqoRLJhC4WQiUIOdfsAsaAJ7O Gmya5NQUsxLv+cPK1fBmPL43+St/XZdcBRr65MG3LNYVtD5TlbUIplw7RUaQwIivXmJb3YKnXIv /upgJ/iNEkN8BoyHcbOGBBC3FO2u7iCS7I2ckT2bgPrpD8Bs/Xh1ie204elAMvvIEgWeG5OZmh1 j+cqnDPr1ZoX7kjeuVYtPZJLw48PqVaT3q7ntD4eq X-Google-Smtp-Source: AGHT+IHtk921lEO/dQfipJFfEuJ1GeNiLuhJwnGHgJR1JF/11YYx8N67y8WnOW6vPy9eWziLe0e9eQ== X-Received: by 2002:a05:6512:3da6:b0:54f:c10b:7286 with SMTP id 2adb3069b0e04-54fc67ad7f5mr2070039e87.3.1747146243820; Tue, 13 May 2025 07:24:03 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54fc644fba0sm1871813e87.23.2025.05.13.07.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:24:03 -0700 (PDT) From: Vladimir Zapolskiy To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/9] media: qcom: camss: remove duplicated csiphy_formats_sc7280 data Date: Tue, 13 May 2025 17:23:46 +0300 Message-ID: <20250513142353.2572563-3-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> References: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It's sufficient to have just one previously set csiphy_formats_sdm845 data. Signed-off-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss-csiphy.c | 5 ----- drivers/media/platform/qcom/camss/camss-csiphy.h | 1 - drivers/media/platform/qcom/camss/camss.c | 10 +++++----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index c622efcc92ff..2de97f58f9ae 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -103,11 +103,6 @@ const struct csiphy_formats csiphy_formats_8x96 = { .formats = formats_8x96 }; -const struct csiphy_formats csiphy_formats_sc7280 = { - .nformats = ARRAY_SIZE(formats_sdm845), - .formats = formats_sdm845 -}; - const struct csiphy_formats csiphy_formats_sdm845 = { .nformats = ARRAY_SIZE(formats_sdm845), .formats = formats_sdm845 diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h index ab91273303b9..895f80003c44 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.h +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h @@ -126,7 +126,6 @@ void msm_csiphy_unregister_entity(struct csiphy_device *csiphy); extern const struct csiphy_formats csiphy_formats_8x16; extern const struct csiphy_formats csiphy_formats_8x96; -extern const struct csiphy_formats csiphy_formats_sc7280; extern const struct csiphy_formats csiphy_formats_sdm845; extern const struct csiphy_hw_ops csiphy_ops_2ph_1_0; diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index f76773dbd296..8c844ebf9cb6 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1481,7 +1481,7 @@ static const struct camss_subdev_resources csiphy_res_7280[] = { .csiphy = { .id = 0, .hw_ops = &csiphy_ops_3ph_1_0, - .formats = &csiphy_formats_sc7280 + .formats = &csiphy_formats_sdm845, } }, /* CSIPHY1 */ @@ -1496,7 +1496,7 @@ static const struct camss_subdev_resources csiphy_res_7280[] = { .csiphy = { .id = 1, .hw_ops = &csiphy_ops_3ph_1_0, - .formats = &csiphy_formats_sc7280 + .formats = &csiphy_formats_sdm845, } }, /* CSIPHY2 */ @@ -1511,7 +1511,7 @@ static const struct camss_subdev_resources csiphy_res_7280[] = { .csiphy = { .id = 2, .hw_ops = &csiphy_ops_3ph_1_0, - .formats = &csiphy_formats_sc7280 + .formats = &csiphy_formats_sdm845, } }, /* CSIPHY3 */ @@ -1526,7 +1526,7 @@ static const struct camss_subdev_resources csiphy_res_7280[] = { .csiphy = { .id = 3, .hw_ops = &csiphy_ops_3ph_1_0, - .formats = &csiphy_formats_sc7280 + .formats = &csiphy_formats_sdm845, } }, /* CSIPHY4 */ @@ -1541,7 +1541,7 @@ static const struct camss_subdev_resources csiphy_res_7280[] = { .csiphy = { .id = 4, .hw_ops = &csiphy_ops_3ph_1_0, - .formats = &csiphy_formats_sc7280 + .formats = &csiphy_formats_sdm845, } }, }; From patchwork Tue May 13 14:23:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 889658 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A801128F538 for ; Tue, 13 May 2025 14:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146251; cv=none; b=LURLKtM9V+2EPmfPgGH+eOzAy+XOJyYydGyiHVA51CUWoKLYEKoAG2bdk48Ugy0iKM9a6C9EfUjcyNJeVzQpXyOXO9Enc8QKmMSHvWd6k2i0FJ0UToSaDp7wHo/+0ad15XU4AbpqucVyzyIhtWFTx2HhZduVFP3Wp63+2TU9kyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146251; c=relaxed/simple; bh=V+yA0wwcS/bVf5oT8EHOGAo5JiL/HicUzO3XXCHGScE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D1gDaJfNB8nYRwqsbdSBDw/iAiRuoA/HeiVEWE/Cn1rc7SHYqS6QgiVtOsK2uPrW8KBZJ71EcgR/48v5hGGWfcxhKSQsPCQr1147Q2WiPqPvm9hp6xCwzflAno+KCcwmhSyGOCffgV9IwhRa5y8Erb9RNFZTaxLaendMvOEt6no= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Vr2C19Q8; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Vr2C19Q8" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-54fc36137caso538992e87.2 for ; Tue, 13 May 2025 07:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747146248; x=1747751048; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P+mIWe4f7/ePA4eiTd6mBWZ/3eo5UNvBmTQDWz6UZOo=; b=Vr2C19Q8UQrlRGw30BYh5g29Z+4kEMYE9XewAWBKBjrstcr3s+O+J+SReRrVgIpjKy ahCFUFnFRB+e/cM+1U5K39V48VRmKf+gDHZPAIbEdS9WJAnEQa+8UHudDVYP2z6EvHjU R476q71FoTuhEFHJ90kAUeBmwsT2I8L2Zj8Hdt+SthICmAPdX27e1ELRGLhS3Tyi46Y8 8ly41YHABoaF86ZyqSxYhTjdQf2ijut3M858ZOv9C9iNZ6s+dEWG7wKMsRuzzu6jkC3+ 30BZF3AwqdyZevXojPG1x1vOk4vzgHxXmIHStnl/NS7UiwX+jwKL6+efOxrHOV/XN1b+ Ib+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146248; x=1747751048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P+mIWe4f7/ePA4eiTd6mBWZ/3eo5UNvBmTQDWz6UZOo=; b=ItXODR5uW40GDCrEpV8/09s6u76q3YP2fZ0TvP8Xx6Qoeivd1G+CbNr5ofPILfNd/N o77Awj0QGNLyN1bANro7isvnLkHMV3NGNwr32IlgvyPj3sIg2fNiTl8BD3HI2m/o1xyd YFvVWw5d0PT3xKrpoyOUF/sSFHYcmUTd/LGdx7BBznTeMllfaSKlobYRCBrUSGlf+LYm VBQ6xhMtGALcH+ooutc0mhomc/mwR8bZHw1EsKL0QbxA/849cJ4DbI78edqwvBiO1JCe HgHsD7tGdjMkRRpcGqbglWOFUwCkAIgAUI0yKSH5dZ/qhMDL/BY5J+XopegCdIbYp2Lp oP7w== X-Forwarded-Encrypted: i=1; AJvYcCXTYFLsrs4PGMO2pFB4n9DUN47tmOkZ+U2I+lT5koyv+eEE35OxgpvDUWh3hp2c5nyHcDVpvg5ud/kYf793@vger.kernel.org X-Gm-Message-State: AOJu0YxLLrGnD9/NHbI8KX0jbyMpCJN+MbJYgPzDsB2Zz2sVdNLSkReI TIRXNcaj8fJp1ANUl5rVVzkCeftNnm0pxvAo2xIOR5VXxUGfg0xU4j6v8X9LOgQ= X-Gm-Gg: ASbGnct+t8fxtiv+s+EXEK9cw2Nz5EAO9srtoob0lpeTCpp7Y3ickfPVkmPo5Ilu54d 3PVKORbrDDMd7SukLXwlF26aiDrRFS5sBFmIRbz0oEXd2Q72kH9JWzeGvXii5KpByNhLpz4Jp0/ awypUm3BQtpkcrl9UejEsFbQEL3n3fEOzDpRSoFX1Po73F7KBhlkfaLp5egnUTs+weB+oaVyP5r v5M9FLhDCHkjZgQWWJUVSJbYXqjrn4SGqQ2+9UhyjMSa7++o8vXumGDWWVIkrdqlY8rPd8aU2fp gnC49cZOSk/UfVHV/qm6rx6Ke9fSvplugmQ5K+xoTHcA0sdhg43y+VgiLEOpWqYg01IdKBvseWn uB6CXFz0u8eph5bugRyq5xrCeb6BtD0pIK2YqbsRJ X-Google-Smtp-Source: AGHT+IETgSn1urVnMun+WYtNS1QXqt+HyQMwe0j+DtEuUcdRDUPi7bIqRr9TigWkClOwQ9fQ4/Hijg== X-Received: by 2002:a05:6512:4019:b0:54f:c2ab:c6be with SMTP id 2adb3069b0e04-54fc67bee89mr2089901e87.7.1747146247658; Tue, 13 May 2025 07:24:07 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54fc644fba0sm1871813e87.23.2025.05.13.07.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:24:07 -0700 (PDT) From: Vladimir Zapolskiy To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 4/9] media: qcom: camss: register camss media device before subdevices Date: Tue, 13 May 2025 17:23:48 +0300 Message-ID: <20250513142353.2572563-5-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> References: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 A media device can and at least for sake of simplicity should be registered before V4L2 devices including the ones added on async completion. The change removes the second and out of camss_probe() media device registration path, and it allows to get a working ISP media device independently from connected or not sensor devices. Signed-off-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss.c | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 2977aeaf27e1..976b70cc6d6a 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -3417,11 +3417,7 @@ static int camss_subdev_notifier_complete(struct v4l2_async_notifier *async) } } - ret = v4l2_device_register_subdev_nodes(&camss->v4l2_dev); - if (ret < 0) - return ret; - - return media_device_register(&camss->media_dev); + return v4l2_device_register_subdev_nodes(&camss->v4l2_dev); } static const struct v4l2_async_notifier_operations camss_subdev_notifier_ops = { @@ -3645,6 +3641,12 @@ static int camss_probe(struct platform_device *pdev) if (ret < 0) goto err_register_subdevs; + ret = media_device_register(&camss->media_dev); + if (ret < 0) { + dev_err(dev, "Failed to register media device: %d\n", ret); + goto err_register_subdevs; + } + if (num_subdevs) { camss->notifier.ops = &camss_subdev_notifier_ops; @@ -3653,26 +3655,21 @@ static int camss_probe(struct platform_device *pdev) dev_err(dev, "Failed to register async subdev nodes: %d\n", ret); - goto err_register_subdevs; + goto err_media_device_unregister; } } else { ret = v4l2_device_register_subdev_nodes(&camss->v4l2_dev); if (ret < 0) { dev_err(dev, "Failed to register subdev nodes: %d\n", ret); - goto err_register_subdevs; - } - - ret = media_device_register(&camss->media_dev); - if (ret < 0) { - dev_err(dev, "Failed to register media device: %d\n", - ret); - goto err_register_subdevs; + goto err_media_device_unregister; } } return 0; +err_media_device_unregister: + media_device_unregister(&camss->media_dev); err_register_subdevs: camss_unregister_entities(camss); err_v4l2_device_unregister: From patchwork Tue May 13 14:23:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 889657 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBA042BE101 for ; Tue, 13 May 2025 14:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146253; cv=none; b=R2JKQ1G7TziymTKWyvGIRsqxyhhiEE3KL68e4eyu0r4qomejGZj/y8PVWxlG8AMkDooeRAW+YEfHgr08ynyGz40KpTf4LFmjn6eBoQLtHnbbWZlgybG5xONKnlf7A6IPnAyEjCTMPlZpeJ6N5o2IL/EOUgYDqcT+OnJdAvw0CB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146253; c=relaxed/simple; bh=n5GbW9547xms/973wpMFEJ+iyozutW75ILZ3e5FuJag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AWF/nHCzojXA7rDQ+T/v8cpCnWePWvBU42BZq7ytjynPW6ZgZ4xtZlx4v0Tot63mmb7c5T5vF3mFatx/K7/3WkCO0pwxWT6xJ0aNtU7+K8CupqnO13kFXEvIf0vYrJEM3Z71h0WPtY93s0UF1SUr6nQX++WXfBrOOTliB85u+VI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=n5fJgXZG; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n5fJgXZG" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-54fc509e7eeso635693e87.0 for ; Tue, 13 May 2025 07:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747146250; x=1747751050; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Je1pnbYGeDSwO8l0nWcUWFR3rRs+nLJrQdN1nv9aVoQ=; b=n5fJgXZGNwfmbKs+Ga9tFehNOy7onWR9RNIgdZbdchKERdnzJHaTgL8+LrxADT02gy bByHIe/ohE8pssKrZV0ynxNvNQWhVWRXaxhSnJEqauVb82wkZLMgpefMiyfIAGA2INAS AYQXZmcpTqyvbQAoPjxps4k1AJgp4HKpOhJfB3ORWQDYXRwbQ/UVU1Wd0I5YNy4PhDUs 5ih+0Mx/2AvQg+i1242OYSs2QDDd7ky/UJOKT+TTKJB7sDrkZGYRoFjm87BiI0iGGTLF wc7BaXBrv7LrsNqUrR7fedmyJCPOJX4izU6rE5VrgO1mN96m1ad9DbUGtlvHvbi8L8cV sTjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146250; x=1747751050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Je1pnbYGeDSwO8l0nWcUWFR3rRs+nLJrQdN1nv9aVoQ=; b=CVDbMV7ucPldO83DzPgBxoxseAXkL1J+PSS43sAdnR6CvHVmrQAEaZuxKs9kOmA/Aj WDxaJGIRvoufLunr8285VW3xyisekI4OTWvggTX0qEf9/+qBWi8Nb4EzeYB7l33ZeLcC hIFkdOJVGzfoQpQE2WlMa4dj/Nz7QKCSPw9FE3Kp0/Itf8W/Msm4bl0kB0Wjgl/1Sa18 fKq3gki69S8NqsMmPcButjcX1vGZt0P+NQ2EmAjgFjGJJeWwGSmTZoYuYYtzcNjsmDbV pC6Pgz8Lz0bYMwuwpDW+xAFjjd5/YUQ9FzjDws37KGUTIJ7GXainoV5MAVBeyf5aDNP8 GtrQ== X-Forwarded-Encrypted: i=1; AJvYcCVgB91LS7MQLGAEiyjVX8DvS+XempKZWCKQrw1Lw7NaN3XGrzIj+LL5SmKcV4iS1lZd0Sh5XptmFsxHtTdf@vger.kernel.org X-Gm-Message-State: AOJu0YxLoyO5+KSFDoudO5Ojw9hZRZHPUSo0aBobxXnDVqt1e9TOSj8e WgGTbZTctlbSu4PXoy/ZKwBEoKJi3RqJWTsDN30M/twSXFpsx8sqTwReT7ShPlI= X-Gm-Gg: ASbGnctv6Lbj50uVcIvzmB10tjywjLFgkLqKr875dJ4SVwGmxpstuZMJODiitFIPnCq J10bQuRimiQtPi8FSeRDAT8YgyyrIYT0jWXlh8tTn9cXkTlc5ldOxIa1N5EwdXEqMhrX9/PWCsh 8jLH+tgkgoBx0qryRX1/SCWvcE47ZZq7PTECoSFWPASqj2JUmLoIUQCpCzXK/D9rb1p+HcL3Vrd R71Aug5M+/j/TE18XWzlw1hHi5GJsDtbU2oQpMR5+3Y8yjWdtt9oAPsQAMnP4DuvU1LFtRQZnw3 7PRvzuoYFNygpFIY8FSRs3ZX/XmVYGuRMfckbwza6kbFqahF/UEYrMNlM2B6CSP/CxmDvHFEVCV JQSOfTprz+Dj0BhAHQo3tJ+7tnNoMbYTLR5QT9y5EqjI8g6rv39g= X-Google-Smtp-Source: AGHT+IHTeW9zs26KYKOPDOT1amI557o7iaow9p3jy/WNJzSFNHOCm9k+ajDzGAdoM1UDpUNvywcrSQ== X-Received: by 2002:a05:6512:10c5:b0:54f:c088:fb11 with SMTP id 2adb3069b0e04-54fc67d3101mr2037761e87.13.1747146249850; Tue, 13 May 2025 07:24:09 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54fc644fba0sm1871813e87.23.2025.05.13.07.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:24:09 -0700 (PDT) From: Vladimir Zapolskiy To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 6/9] media: qcom: camss: simplify camss_subdev_notifier_complete() function Date: Tue, 13 May 2025 17:23:50 +0300 Message-ID: <20250513142353.2572563-7-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> References: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 For sake of code simplicity and readability reduce the function code by one level of indentation, the change is non-functional. Signed-off-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss.c | 50 +++++++++++------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 4e91e4b6ef52..39c5472f4552 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -3385,35 +3385,35 @@ static int camss_subdev_notifier_complete(struct v4l2_async_notifier *async) struct camss *camss = container_of(async, struct camss, notifier); struct v4l2_device *v4l2_dev = &camss->v4l2_dev; struct v4l2_subdev *sd; - int ret; list_for_each_entry(sd, &v4l2_dev->subdevs, list) { - if (sd->host_priv) { - struct media_entity *sensor = &sd->entity; - struct csiphy_device *csiphy = - (struct csiphy_device *) sd->host_priv; - struct media_entity *input = &csiphy->subdev.entity; - unsigned int i; - - for (i = 0; i < sensor->num_pads; i++) { - if (sensor->pads[i].flags & MEDIA_PAD_FL_SOURCE) - break; - } - if (i == sensor->num_pads) { - dev_err(camss->dev, - "No source pad in external entity\n"); - return -EINVAL; - } + struct csiphy_device *csiphy = sd->host_priv; + struct media_entity *input, *sensor; + unsigned int i; + int ret; + + if (!csiphy) + continue; + + input = &csiphy->subdev.entity; + sensor = &sd->entity; + + for (i = 0; i < sensor->num_pads; i++) { + if (sensor->pads[i].flags & MEDIA_PAD_FL_SOURCE) + break; + } + if (i == sensor->num_pads) { + dev_err(camss->dev, + "No source pad in external entity\n"); + return -EINVAL; + } - ret = media_create_pad_link(sensor, i, - input, MSM_CSIPHY_PAD_SINK, + ret = media_create_pad_link(sensor, i, input, + MSM_CSIPHY_PAD_SINK, MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - camss_link_err(camss, sensor->name, - input->name, - ret); - return ret; - } + if (ret < 0) { + camss_link_err(camss, sensor->name, input->name, ret); + return ret; } } From patchwork Tue May 13 14:23:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 889656 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BB4B2BE113 for ; Tue, 13 May 2025 14:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146255; cv=none; b=ss7n5anasWGWxG2SxjIVreukNksTyTtqR/dyFDf8GatuotNPpYUqX8C1kOViJ9Mlt7kGynzBH1OGWmJKnP5ehedZJirL0p9UUixEAnF3Qe2NSYccnKrTlUjUCKo7loAavSwkRYeUuOrlS4dANFdm0S1LG3oRlvkqsVertTsDc9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747146255; c=relaxed/simple; bh=XdEO4KmhdzkmFgTppxOTLqYmKKiZ4V91Zop709Tv7QM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UqtfK0ObjiWNTZXEJFL4M5jQ+bQEagk0uSF8jVuf99aN3kU/EkvCCC0ek/sDvZPSMr0cs511pnBjxY8QLsgpmJMcAOrlrJWk3yezqr5J2NRHCj864TtxQ2+cva+jEcc4+c8h5ohrYHcOG16zoHczCKCG8C5WF3cb6j5JPkj7F8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fA0/DqK1; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fA0/DqK1" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-54fbf721fd7so752561e87.0 for ; Tue, 13 May 2025 07:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747146252; x=1747751052; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bkvIXboeSQ7DpFMEdb2LOpzhdD+Ul3bkMffg79IGGvk=; b=fA0/DqK1u1AHapDtBP7DbQ1EE7NbFRf5SZIFkfVDBavvYxzDxcFJSJBCR11orhq/LQ RivDUbg5JZJCZOhdRRY/rx94p/6tw93fI6SjJqE3ELjv6qmKP5e6yRAiabjVl2AnIfSa LhXjQ7X9DV9j2Q0liUibRkfqEtzGqYCnHs1Kz+3c0jqN3yx711uJXol1mQwN9iF+/VSc MmsC9G4NsNmxApGYRL6WOpllJLPudkrzi/t25K/dISF3/aveuCp9L58uxp+vOzu1FcBC lM07mqOHSojQALWDsw5F6THJcZt7advAgdzAf5HTeVTwU8yav51TZVzwWNz9TsxPwLOD fUxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747146252; x=1747751052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bkvIXboeSQ7DpFMEdb2LOpzhdD+Ul3bkMffg79IGGvk=; b=dh6xtwsGvYQTbUKWlsKf20Y//SECoRnIEwiitE58v0IjLCBxDYUXZVzHqxRIc49VrZ Br8gXO51W/QTcIF7+XfvT2GdtRKikNJmDVI5vto3BraI2lIGmdL17jnANmrXpNdNIJ1X E/yXpOxnhS/z6Iwv/yD380GbVBNn+yikWrrrTFofT5UnTyHx4Z8DIEALG7umCFnD+S+X 6+x9WfPFowmaaM3gtDd7RykgneoELtmrQIqaAiSfM3ikNGYGrSLxxPhrDjy194M6y27I WaITwbKohwwL6rWeRX4Uqf4/p9WkTwg13uoK8M4msuoxvywhLfKThViDrIQz5vFkJf24 fc1A== X-Forwarded-Encrypted: i=1; AJvYcCUMbR61Yrhk2AHFvmkc85olr/jUwFhZzMBYABgeiKYkwPGp+s396MJRogqjecgLC5FZxo+iiWnMRDC7PHeE@vger.kernel.org X-Gm-Message-State: AOJu0Yy2LKpXFqObQExjYpuChBjkgINqo4m7yEk+dbgKUCa9dSzlOCJ6 qsh48oxMJXrYH9SUrWwcoXVh1Td2y9JGt8KMopMMtvHf0N9coRGnkcC5CZknMFE= X-Gm-Gg: ASbGnctiwh92cV24Q+ql28qtUye6yNGk5e5tGxzp4FPosgNd3NAVl/rGEO61nzLO0lt pIc4X/UQHKXLN5anwJo40vtR5tH+ma+K8C3IW1G6MGn2bauZnsujtTUvQfqcyD0x5ljYOrAGVlH arTaLe52OXRZsCUCwFWujv6HkoTTYGVYbnScXhp4AJ89NqykMm7+EFoV51vElvVK70D7yD5Rstv hpQu2lam8F158nINsRn7KpNmMEw8xA/bLRTEMaoBKqpAVz8wjAGCCpxT3iWmAy+7hV29bD4lptd 7ftQT2pDrCLPHbQLpL42D/QFPDxRA5YqNl1i974a6Dc+pECXxtTUW32LJzD3eswXkZGudkyrstw egXTD22elYnrLtfFvGgwIvpp6DWs0WQpPmId83TNC3+iKEStoy3Y= X-Google-Smtp-Source: AGHT+IGQvf2B9ZgZKrTjzA36UsxZkfwbIxpb/CDy+kO+0v3DXVBuJa/bdlFuqAoJspo3OGr97iZJ5A== X-Received: by 2002:a05:6512:3d28:b0:54c:a7c:cbda with SMTP id 2adb3069b0e04-54fc67d30e8mr2165049e87.15.1747146251725; Tue, 13 May 2025 07:24:11 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54fc644fba0sm1871813e87.23.2025.05.13.07.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 07:24:11 -0700 (PDT) From: Vladimir Zapolskiy To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 8/9] media: qcom: camss: use a handy v4l2_async_nf_add_fwnode_remote() function Date: Tue, 13 May 2025 17:23:52 +0300 Message-ID: <20250513142353.2572563-9-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> References: <20250513142353.2572563-1-vladimir.zapolskiy@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 One more code simplification makes parsing of remote endpoints easy. Signed-off-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index d4745fb21152..0d05f52a6e92 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -3038,18 +3038,9 @@ static int camss_parse_ports(struct camss *camss) fwnode_graph_for_each_endpoint(fwnode, ep) { struct camss_async_subdev *csd; - struct fwnode_handle *remote; - remote = fwnode_graph_get_remote_port_parent(ep); - if (!remote) { - dev_err(dev, "Cannot get remote parent\n"); - ret = -EINVAL; - goto err_cleanup; - } - - csd = v4l2_async_nf_add_fwnode(&camss->notifier, remote, - struct camss_async_subdev); - fwnode_handle_put(remote); + csd = v4l2_async_nf_add_fwnode_remote(&camss->notifier, ep, + struct camss_async_subdev); if (IS_ERR(csd)) { ret = PTR_ERR(csd); goto err_cleanup;