linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus
@ 2023-02-07 20:58 Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 2/4] media: samsung: exynos4-is: drop unused pinctrl bits Krzysztof Kozlowski
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07 20:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Sylwester Nawrocki, Alim Akhtar, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski

The FIMC camera node wrapper is not a bus, so using simple-bus fallback
compatible just to instantiate its children nodes was never correct.
Drop the simple-bus compatible and expect driver to explicitly populate
children devices.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. None
---
 Documentation/devicetree/bindings/media/samsung-fimc.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/samsung-fimc.txt b/Documentation/devicetree/bindings/media/samsung-fimc.txt
index 20447529c985..f90267f1180e 100644
--- a/Documentation/devicetree/bindings/media/samsung-fimc.txt
+++ b/Documentation/devicetree/bindings/media/samsung-fimc.txt
@@ -15,7 +15,7 @@ Common 'camera' node
 
 Required properties:
 
-- compatible: must be "samsung,fimc", "simple-bus"
+- compatible: must be "samsung,fimc"
 - clocks: list of clock specifiers, corresponding to entries in
   the clock-names property;
 - clock-names : must contain "sclk_cam0", "sclk_cam1", "pxl_async0",
@@ -156,8 +156,8 @@ Example:
 		};
 	};
 
-	camera {
-		compatible = "samsung,fimc", "simple-bus";
+	camera@11800000 {
+		compatible = "samsung,fimc";
 		clocks = <&clock 132>, <&clock 133>, <&clock 351>,
 			 <&clock 352>;
 		clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0",
@@ -166,6 +166,7 @@ Example:
 		clock-output-names = "cam_a_clkout", "cam_b_clkout";
 		pinctrl-names = "default";
 		pinctrl-0 = <&cam_port_a_clk_active>;
+		ranges;
 		#address-cells = <1>;
 		#size-cells = <1>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] media: samsung: exynos4-is: drop unused pinctrl bits
  2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
@ 2023-02-07 20:58 ` Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 3/4] media: samsung: exynos4-is: do not require pinctrl Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07 20:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Sylwester Nawrocki, Alim Akhtar, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski

Drop unused pinctrl header and pctrl member of struct fimc_is.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. New patch
---
 drivers/media/platform/samsung/exynos4-is/fimc-is.h   | 3 ---
 drivers/media/platform/samsung/exynos4-is/media-dev.h | 1 -
 2 files changed, 4 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.h b/drivers/media/platform/samsung/exynos4-is/fimc-is.h
index 06586e455b1d..c126b779aafc 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.h
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.h
@@ -14,7 +14,6 @@
 #include <linux/clk.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
-#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/sizes.h>
 #include <linux/spinlock.h>
@@ -231,7 +230,6 @@ struct chain_config {
 /**
  * struct fimc_is - fimc-is data structure
  * @pdev: pointer to FIMC-IS platform device
- * @pctrl: pointer to pinctrl structure for this device
  * @v4l2_dev: pointer to the top level v4l2_device
  * @fw: data structure describing the FIMC-IS firmware binary
  * @memory: memory region assigned for the FIMC-IS (firmware)
@@ -262,7 +260,6 @@ struct chain_config {
  */
 struct fimc_is {
 	struct platform_device		*pdev;
-	struct pinctrl			*pctrl;
 	struct v4l2_device		*v4l2_dev;
 
 	struct fimc_is_firmware		fw;
diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.h b/drivers/media/platform/samsung/exynos4-is/media-dev.h
index 62ad5d7e035a..079105d88bab 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.h
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.h
@@ -11,7 +11,6 @@
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
-#include <linux/pinctrl/consumer.h>
 #include <media/media-device.h>
 #include <media/media-entity.h>
 #include <media/v4l2-device.h>
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] media: samsung: exynos4-is: do not require pinctrl
  2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 2/4] media: samsung: exynos4-is: drop unused pinctrl bits Krzysztof Kozlowski
@ 2023-02-07 20:58 ` Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 4/4] media: samsung: exynos4-is: drop simple-bus from compatibles Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07 20:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Sylwester Nawrocki, Alim Akhtar, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski

Driver does not handle pin configuration switching and several DTS
provide empty pinctrl property, just to satisfy the driver's requirement
for it.  Drop requirement for pinctrl property as it is really optional.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. New patch
---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index 98a60f01129d..22baa429ed5d 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1470,10 +1470,8 @@ static int fimc_md_probe(struct platform_device *pdev)
 		goto err_v4l2dev;
 
 	pinctrl = devm_pinctrl_get(dev);
-	if (IS_ERR(pinctrl)) {
-		ret = dev_err_probe(dev, PTR_ERR(pinctrl), "Failed to get pinctrl\n");
-		goto err_clk;
-	}
+	if (IS_ERR(pinctrl))
+		dev_dbg(dev, "Failed to get pinctrl: %pe\n", pinctrl);
 
 	platform_set_drvdata(pdev, fmd);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] media: samsung: exynos4-is: drop simple-bus from compatibles
  2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 2/4] media: samsung: exynos4-is: drop unused pinctrl bits Krzysztof Kozlowski
  2023-02-07 20:58 ` [PATCH v2 3/4] media: samsung: exynos4-is: do not require pinctrl Krzysztof Kozlowski
@ 2023-02-07 20:58 ` Krzysztof Kozlowski
  2023-02-08 23:50 ` [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Rob Herring
  2023-03-12 17:02 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07 20:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Sylwester Nawrocki, Alim Akhtar, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski

The FIMC camera node wrapper is not a bus, so using simple-bus fallback
compatible just to instantiate its children nodes was never correct.
Driver should explicitly populate all its children devices.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. Do not depopulate on errors because it causes several errors.
---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index 22baa429ed5d..6839007edf1d 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1440,6 +1440,10 @@ static int fimc_md_probe(struct platform_device *pdev)
 	if (!fmd)
 		return -ENOMEM;
 
+	ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
+	if (ret < 0)
+		return -ENOMEM;
+
 	spin_lock_init(&fmd->slock);
 	INIT_LIST_HEAD(&fmd->pipelines);
 	fmd->pdev = pdev;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus
  2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-02-07 20:58 ` [PATCH v2 4/4] media: samsung: exynos4-is: drop simple-bus from compatibles Krzysztof Kozlowski
@ 2023-02-08 23:50 ` Rob Herring
  2023-03-12 17:02 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2023-02-08 23:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-samsung-soc, linux-kernel, linux-arm-kernel,
	Sylwester Nawrocki, devicetree, linux-media,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar


On Tue, 07 Feb 2023 21:58:31 +0100, Krzysztof Kozlowski wrote:
> The FIMC camera node wrapper is not a bus, so using simple-bus fallback
> compatible just to instantiate its children nodes was never correct.
> Drop the simple-bus compatible and expect driver to explicitly populate
> children devices.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Changes since v1:
> 1. None
> ---
>  Documentation/devicetree/bindings/media/samsung-fimc.txt | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus
  2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-02-08 23:50 ` [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Rob Herring
@ 2023-03-12 17:02 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 17:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Krzysztof Kozlowski, linux-media
  Cc: devicetree, Rob Herring, Sylwester Nawrocki, linux-samsung-soc,
	Alim Akhtar, linux-arm-kernel, linux-kernel

On 07/02/2023 21:58, Krzysztof Kozlowski wrote:
> The FIMC camera node wrapper is not a bus, so using simple-bus fallback
> compatible just to instantiate its children nodes was never correct.
> Drop the simple-bus compatible and expect driver to explicitly populate
> children devices.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Changes since v1:
> 1. None
> ---

Mauro,

Any comments on the patchset? Can you pick it up?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-12 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 20:58 [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Krzysztof Kozlowski
2023-02-07 20:58 ` [PATCH v2 2/4] media: samsung: exynos4-is: drop unused pinctrl bits Krzysztof Kozlowski
2023-02-07 20:58 ` [PATCH v2 3/4] media: samsung: exynos4-is: do not require pinctrl Krzysztof Kozlowski
2023-02-07 20:58 ` [PATCH v2 4/4] media: samsung: exynos4-is: drop simple-bus from compatibles Krzysztof Kozlowski
2023-02-08 23:50 ` [PATCH v2 1/4] media: dt-bindings: samsung-fimc: drop simple-bus Rob Herring
2023-03-12 17:02 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).