linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver
@ 2019-02-21  7:21 Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 2/4] media: platform: Add Mediatek sensor interface driver KConfig Louis Kuo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Louis Kuo @ 2019-02-21  7:21 UTC (permalink / raw)
  To: hans.verkuil, laurent.pinchart+renesas, tfiga, matthias.bgg, mchehab
  Cc: devicetree, Sean.Cheng, Rynn.Wu, srv_heupstream, holmes.chiou,
	Jerry-ch.Chen, jungo.lin, sj.huang, yuzhao, linux-mediatek,
	zwisler, christie.yu, frederic.chen, linux-arm-kernel,
	linux-media

Hello,

This is the first version of the RFC patch series adding Sensor Inferface(seninf) driver on
Mediatek mt8183 SoC, which will be used in camera features on CrOS application.
It belongs to the first Mediatek's camera driver series based on V4L2 and media controller framework.
I posted the main part of the seninf driver as RFC to discuss first and would like some review comments
on the overall structure of the driver.

The driver is implemented with V4L2 framework.
1. Register as a V4L2 sub-device.
2. Only one entity with sink pads linked to camera sensors for choosing desired camera sensor by setup link
   and with source pads linked to cam-io for routing different types of decoded packet datas to PASS1 driver
   to generate sensor image frame and meta-data.

The overall file structure of the seninf driver is as following:

* mtk_seninf.c: Implement software and HW control flow of seninf driver.
* seninf_drv_def.h: Define data structure and enumeration.
* seninf_reg.h: Define HW register R/W macros and HW register names.

Louis Kuo (4):
  media: platform: mtk-isp: Add Mediatek sensor interface driver
  media: platform: Add Mediatek sensor interface driver KConfig
  dt-bindings: mt8183: Added sensor interface dt-bindings
  dts: arm64: mt8183: Add sensor interface nodes

 .../devicetree/bindings/media/mediatek-seninf.txt  |   52 +
 arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   34 +
 drivers/media/platform/Makefile                    |    2 +
 drivers/media/platform/mtk-isp/Kconfig             |   16 +
 drivers/media/platform/mtk-isp/Makefile            |   14 +
 drivers/media/platform/mtk-isp/isp_50/Makefile     |   17 +
 .../media/platform/mtk-isp/isp_50/seninf/Makefile  |    4 +
 .../platform/mtk-isp/isp_50/seninf/mtk_seninf.c    | 1339 ++++++++++++++++++++
 .../mtk-isp/isp_50/seninf/seninf_drv_def.h         |  201 +++
 .../platform/mtk-isp/isp_50/seninf/seninf_reg.h    |  992 +++++++++++++++
 10 files changed, 2671 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/mediatek-seninf.txt
 create mode 100644 drivers/media/platform/mtk-isp/Kconfig
 create mode 100644 drivers/media/platform/mtk-isp/Makefile
 create mode 100644 drivers/media/platform/mtk-isp/isp_50/Makefile
 create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/Makefile
 create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/mtk_seninf.c
 create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/seninf_drv_def.h
 create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/seninf_reg.h

-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC PATCH V0 2/4] media: platform: Add Mediatek sensor interface driver KConfig
  2019-02-21  7:21 [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Louis Kuo
@ 2019-02-21  7:21 ` Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 3/4] dt-bindings: mt8183: Added sensor interface dt-bindings Louis Kuo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Louis Kuo @ 2019-02-21  7:21 UTC (permalink / raw)
  To: hans.verkuil, laurent.pinchart+renesas, tfiga, matthias.bgg, mchehab
  Cc: devicetree, Sean.Cheng, Rynn.Wu, srv_heupstream, holmes.chiou,
	Jerry-ch.Chen, jungo.lin, sj.huang, yuzhao, linux-mediatek,
	zwisler, Louis Kuo, christie.yu, frederic.chen, linux-arm-kernel,
	linux-media

This patch adds KConfig for sensor interface driver. Sensor interface driver
is a MIPI-CSI2 host driver, namely, a HW camera interface controller.
It support a widely adopted, simple, high-speed protocol primarily intended
for point-to-point image and video transmission between cameras and host
devices.

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
---
 drivers/media/platform/mtk-isp/Kconfig | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 drivers/media/platform/mtk-isp/Kconfig

diff --git a/drivers/media/platform/mtk-isp/Kconfig b/drivers/media/platform/mtk-isp/Kconfig
new file mode 100644
index 0000000..c665fa1
--- /dev/null
+++ b/drivers/media/platform/mtk-isp/Kconfig
@@ -0,0 +1,16 @@
+config MTK_SENINF
+	bool "Mediatek mipi csi2 driver"
+	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on MEDIA_CAMERA_SUPPORT
+	select V4L2_FWNODE
+
+	default n
+	help
+	    This driver provides a mipi-csi2 host driver used as a
+	    interface to connect camera with Mediatek's
+	    MT8183 SOCs. It is able to handle multiple cameras
+	    at the same time.
+
+		Choose y if you want to use Mediatek SoCs to create image
+		capture application such as video recording and still image
+		capture.
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC PATCH V0 3/4] dt-bindings: mt8183: Added sensor interface dt-bindings
  2019-02-21  7:21 [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 2/4] media: platform: Add Mediatek sensor interface driver KConfig Louis Kuo
@ 2019-02-21  7:21 ` Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 4/4] dts: arm64: mt8183: Add sensor interface nodes Louis Kuo
  2019-03-14  8:42 ` [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Hans Verkuil
  3 siblings, 0 replies; 5+ messages in thread
From: Louis Kuo @ 2019-02-21  7:21 UTC (permalink / raw)
  To: hans.verkuil, laurent.pinchart+renesas, tfiga, matthias.bgg, mchehab
  Cc: devicetree, Sean.Cheng, Rynn.Wu, srv_heupstream, holmes.chiou,
	Jerry-ch.Chen, jungo.lin, sj.huang, yuzhao, linux-mediatek,
	zwisler, Louis Kuo, christie.yu, frederic.chen, linux-arm-kernel,
	linux-media

This patch adds the DT binding documentation for the sensor interface
module in Mediatek SoCs.

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
---
 .../devicetree/bindings/media/mediatek-seninf.txt  | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/mediatek-seninf.txt

diff --git a/Documentation/devicetree/bindings/media/mediatek-seninf.txt b/Documentation/devicetree/bindings/media/mediatek-seninf.txt
new file mode 100644
index 0000000..5c84a77
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek-seninf.txt
@@ -0,0 +1,52 @@
+* Mediatek seninf MIPI-CSI2 host driver
+
+Seninf MIPI-CSI2 host driver is a HW camera interface controller. It support a widely adopted,
+simple, high-speed protocol primarily intended for point-to-point image and video
+transmission between cameras and host devices.
+
+Required properties:
+  - compatible: "mediatek,mt8183-seninf"
+  - reg: Must contain an entry for each entry in reg-names.
+  - reg-names: Must include the following entries:
+    "base_reg": seninf registers base
+    "rx_reg": Rx analog registers base
+  - interrupts: interrupt number to the cpu.
+  - clocks : clock name from clock manager
+  - clock-names: must be CLK_CAM_SENINF and CLK_TOP_MUX_SENINF.
+    It is the clocks of seninf
+  - port : port for camera sensor
+  - port reg : must be '0' for camera 0, '1' for camera 1
+  - endpoint : config mipi-csi2 port setting for each camera
+  - data-lanes : the number of the data lane
+
+Example:
+    seninf: seninf@1a040000 {
+       compatible = "mediatek,mt8183_seninf";
+		reg = <0 0x1a040000 0 0x8000>,
+		      <0 0x11C80000 0 0x6000>;
+		reg-names = "base_reg", "ana_reg";
+		interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_LOW>;
+		power-domains = <&scpsys MT8183_POWER_DOMAIN_CAM>;
+	    clocks =
+			<&camsys CLK_CAM_SENINF>, <&topckgen CLK_TOP_MUX_SENINF>;
+		clock-names =
+			"CLK_CAM_SENINF", "CLK_TOP_MUX_SENINF";
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			port@0 {
+				reg = <0>;
+				mipi_in_cam0: endpoint@0 {
+					reg = <0>;
+					data-lanes = <1 3>;
+				};
+			};
+			port@1 {
+				reg = <1>;
+				mipi_in_cam1: endpoint@0 {
+					reg = <1>;
+					data-lanes = <1 3>;
+				};
+			};
+		};
+	}
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC PATCH V0 4/4] dts: arm64: mt8183: Add sensor interface nodes
  2019-02-21  7:21 [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 2/4] media: platform: Add Mediatek sensor interface driver KConfig Louis Kuo
  2019-02-21  7:21 ` [RFC PATCH V0 3/4] dt-bindings: mt8183: Added sensor interface dt-bindings Louis Kuo
@ 2019-02-21  7:21 ` Louis Kuo
  2019-03-14  8:42 ` [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Hans Verkuil
  3 siblings, 0 replies; 5+ messages in thread
From: Louis Kuo @ 2019-02-21  7:21 UTC (permalink / raw)
  To: hans.verkuil, laurent.pinchart+renesas, tfiga, matthias.bgg, mchehab
  Cc: devicetree, Sean.Cheng, Rynn.Wu, srv_heupstream, holmes.chiou,
	Jerry-ch.Chen, jungo.lin, sj.huang, yuzhao, linux-mediatek,
	zwisler, Louis Kuo, christie.yu, frederic.chen, linux-arm-kernel,
	linux-media

Add nodes for Mediatek's sensor interface device. Sensor interface module
embedded in Mediatek SOCs, works as a HW camera interface controller
intended for image and data transmission between cameras and host devices.

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8183.dtsi | 34 ++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index c3a516e..2fe97e8 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -474,4 +474,38 @@
 			#clock-cells = <1>;
 		};
 	};
+
+	seninf: seninf@1a040000 {
+		compatible = "mediatek,mt8183-seninf";
+		reg = <0 0x1a040000 0 0x8000>,
+		      <0 0x11C80000 0 0x6000>;
+		reg-names = "base_reg", "rx_reg";
+		interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_LOW>;
+		power-domains = <&scpsys MT8183_POWER_DOMAIN_CAM>;
+		clocks =
+			<&camsys CLK_CAM_SENINF>,
+			<&topckgen CLK_TOP_MUX_SENINF>;
+		clock-names =
+			"CLK_CAM_SENINF", "CLK_TOP_MUX_SENINF";
+		status = "disabled";
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			port@0 {
+				reg = <0>;
+				mipi_in_cam0: endpoint@0 {
+					reg = <0>;
+					data-lanes = <1 3>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				mipi_in_cam1: endpoint@0 {
+					reg = <1>;
+					data-lanes = <1 3>;
+				};
+			};
+		};
+	};
 };
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver
  2019-02-21  7:21 [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Louis Kuo
                   ` (2 preceding siblings ...)
  2019-02-21  7:21 ` [RFC PATCH V0 4/4] dts: arm64: mt8183: Add sensor interface nodes Louis Kuo
@ 2019-03-14  8:42 ` Hans Verkuil
  3 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2019-03-14  8:42 UTC (permalink / raw)
  To: Louis Kuo, hans.verkuil, laurent.pinchart+renesas, tfiga,
	matthias.bgg, mchehab
  Cc: devicetree, Sean.Cheng, Rynn.Wu, srv_heupstream, holmes.chiou,
	Jerry-ch.Chen, jungo.lin, sj.huang, yuzhao, linux-mediatek,
	zwisler, christie.yu, frederic.chen, linux-arm-kernel,
	linux-media

Hi Louis Kuo,

On 2/21/19 8:21 AM, Louis Kuo wrote:
> Hello,
> 
> This is the first version of the RFC patch series adding Sensor Inferface(seninf) driver on
> Mediatek mt8183 SoC, which will be used in camera features on CrOS application.
> It belongs to the first Mediatek's camera driver series based on V4L2 and media controller framework.
> I posted the main part of the seninf driver as RFC to discuss first and would like some review comments
> on the overall structure of the driver.
> 
> The driver is implemented with V4L2 framework.
> 1. Register as a V4L2 sub-device.
> 2. Only one entity with sink pads linked to camera sensors for choosing desired camera sensor by setup link
>    and with source pads linked to cam-io for routing different types of decoded packet datas to PASS1 driver
>    to generate sensor image frame and meta-data.

Just a high-level comment before you post the next version of this series:

Please compile the latest version of v4l2-compliance (part of
git://linuxtv.org/v4l-utils.git) and run it against your driver:

v4l2-compliance -d /dev/videoX -s10 -f

Whenever you post a new version of this series, please do a 'git pull' of
the v4l-utils repo, recompile and retest with v4l2-compliance and post the
test results in the cover letter.

Obviously, there should be no FAILs and probably no warnings.

Regards,

	Hans

> 
> The overall file structure of the seninf driver is as following:
> 
> * mtk_seninf.c: Implement software and HW control flow of seninf driver.
> * seninf_drv_def.h: Define data structure and enumeration.
> * seninf_reg.h: Define HW register R/W macros and HW register names.
> 
> Louis Kuo (4):
>   media: platform: mtk-isp: Add Mediatek sensor interface driver
>   media: platform: Add Mediatek sensor interface driver KConfig
>   dt-bindings: mt8183: Added sensor interface dt-bindings
>   dts: arm64: mt8183: Add sensor interface nodes
> 
>  .../devicetree/bindings/media/mediatek-seninf.txt  |   52 +
>  arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   34 +
>  drivers/media/platform/Makefile                    |    2 +
>  drivers/media/platform/mtk-isp/Kconfig             |   16 +
>  drivers/media/platform/mtk-isp/Makefile            |   14 +
>  drivers/media/platform/mtk-isp/isp_50/Makefile     |   17 +
>  .../media/platform/mtk-isp/isp_50/seninf/Makefile  |    4 +
>  .../platform/mtk-isp/isp_50/seninf/mtk_seninf.c    | 1339 ++++++++++++++++++++
>  .../mtk-isp/isp_50/seninf/seninf_drv_def.h         |  201 +++
>  .../platform/mtk-isp/isp_50/seninf/seninf_reg.h    |  992 +++++++++++++++
>  10 files changed, 2671 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/mediatek-seninf.txt
>  create mode 100644 drivers/media/platform/mtk-isp/Kconfig
>  create mode 100644 drivers/media/platform/mtk-isp/Makefile
>  create mode 100644 drivers/media/platform/mtk-isp/isp_50/Makefile
>  create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/Makefile
>  create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/mtk_seninf.c
>  create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/seninf_drv_def.h
>  create mode 100644 drivers/media/platform/mtk-isp/isp_50/seninf/seninf_reg.h
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-03-14  8:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21  7:21 [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Louis Kuo
2019-02-21  7:21 ` [RFC PATCH V0 2/4] media: platform: Add Mediatek sensor interface driver KConfig Louis Kuo
2019-02-21  7:21 ` [RFC PATCH V0 3/4] dt-bindings: mt8183: Added sensor interface dt-bindings Louis Kuo
2019-02-21  7:21 ` [RFC PATCH V0 4/4] dts: arm64: mt8183: Add sensor interface nodes Louis Kuo
2019-03-14  8:42 ` [RFC PATCH V0 0/4] media: support Mediatek sensor interface driver Hans Verkuil

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).