media: i2c: Add ON Semiconductor AP1302 ISP driver
Subsystems (2)
PATCH v2 1/2 media: i2c: Add ON Semiconductor AP1302 ISP driver
The AP1302 is a standalone ISP for ON Semiconductor sensors. AP1302 ISP supports single and dual sensor inputs. The driver code supports AR1335, AR0144 and AR0330 sensors with single and dual mode by loading the corresponding firmware.
--- MAINTAINERS | 9 + drivers/media/i2c/Kconfig | 14 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/ap1302.c | 2802 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 2826 insertions(+) create mode 100644 drivers/media/i2c/ap1302.c
MAINTAINERS +9 -0
@@ -1232,6 +1232,15 @@ L: [email protected] (moderated for non-subscribers) S: Maintained F: sound/aoa/ +AP1302 ON SEMICONDUCTOR CAMERA ISP +M: Laurent Pinchart <[email protected]> +M: Anil Kumar Mamidala <[email protected]> +L: [email protected] +S: Maintained +T: git git://linuxtv.org/media_tree.git +F: Documentation/devicetree/bindings/media/i2c/onnn,ap1302.yaml +F: drivers/media/i2c/ap1302.c + APEX EMBEDDED SYSTEMS STX104 IIO DRIVER M: William Breathitt Gray <[email protected]> L: [email protected]
drivers/media/i2c/Kconfig +14 -0
@@ -629,6 +629,20 @@ config VIDEO_UPD64083 To compile this driver as a module, choose M here: the module will be called upd64083. + +config VIDEO_AP1302 + tristate "ON Semiconductor AP1302 ISP" + depends on I2C && VIDEO_V4L2 + select VIDEO_V4L2_SUBDEV_API + select V4L2_FWNODE + + help + This is a Video4Linux2 sensor-level driver for the ON Semiconductor + AP1302 ISP. + + To compile this driver as a module, choose M here: the + module will be called ap1302. + endmenu menu "Audio/Video compression chips"
drivers/media/i2c/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_VIDEO_VP27SMPX) += vp27smpx.o obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o +obj-$(CONFIG_VIDEO_AP1302) += ap1302.o obj-$(CONFIG_VIDEO_OV02A10) += ov02a10.o obj-$(CONFIG_VIDEO_OV2640) += ov2640.o obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
drivers/media/i2c/ap1302.c new file +2802 -0
2,802 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/2 media: dt-bindings: media: i2c: Add bindings for AP1302
The AP1302 is a standalone ISP for ON Semiconductor sensors. Add corresponding DT bindings.
--- .../devicetree/bindings/media/i2c/onnn,ap1302.yaml | 202 +++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/onnn,ap1302.yaml
Documentation/devicetree/bindings/media/i2c/onnn,ap1302.yaml new file +202 -0
@@ -0,0 +1,202 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/onnn,ap1302.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ON Semiconductor AP1302 Advanced Image Coprocessor + +maintainers: + - Laurent Pinchart <[email protected]> + - Anil Kumar M <[email protected]> + +description: |- + The AP1302 is a standalone ISP for ON Semiconductor sensors. It interfaces to + up to two RAW CMOS sensors over MIPI CSI-2 connections, processes the two + video streams and outputs YUV frames to the host over a MIPI CSI-2 interface. + Frames are output side by side or on two virtual channels. + + The sensors must be identical. They are connected to the AP1302 on dedicated + I2C buses, and are controlled by the AP1302 firmware. They are not accessible + from the host. + +properties: + compatible: + const: onnn,ap1302 + + reg: + description: I2C device address. + maxItems: 1 + + clocks: + description: Reference to the CLK clock. + maxItems: 1 + + reset-gpios: + description: Reference to the GPIO connected to the RST pin (active low). + maxItems: 1 + + standby-gpios: + description: + Reference to the GPIO connected to the STANDBY pin (active high). + maxItems: 1 + + port: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: MIPI CSI-2 output interface to the host. + + properties: + endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + unevaluatedProperties: false + + properties: + clock-noncontinuous: + type: boolean + + data-lanes: + oneOf: + - items: + - const: 1 + - items: + - const: 1 + - const: 2 + - items: + - const: 1 + - const: 2 + - const: 3 + - const: 4 + + required: + - data-lanes + + sensors: + type: object + description: List of connected sensors + + properties: + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + onnn,model: + $ref: "/schemas/types.yaml#/definitions/string" + description: | + Model of the connected sensors. Must be a valid compatible string. + + If no sensor is connected, this property must no be specified, and + the AP1302 can be used with it's internal test pattern generator. + + patternProperties: + "^sensor@[01]": + type: object + description: | + Sensors connected to the first and second input, with one node per + sensor. + + properties: + reg: + description: AP1302 input port number + maxItems: 1 + + patternProperties: + ".*-supply": + description: Power supplies for the sensor + + required: + - reg + + additionalProperties: false + + required: + - "#address-cells" + - "#size-cells" + + # How can we express that onnn,model requires one sensor object to be set ? + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - port + - sensors + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "onnn,ap1302"; + reg = <0x3c>; + + clocks = <&clk24mhz>; + + reset-gpios = <&pio 102 GPIO_ACTIVE_LOW>; + standby-gpios = <&pio 40 GPIO_ACTIVE_HIGH>; + + port { + isp1_out: endpoint { + remote-endpoint = <&seninf_in1>; + data-lanes = <1 2 3 4>; + }; + }; + + sensors { + #address-cells = <1>; + #size-cells = <0>; + + onnn,model = "onnn,ar0144"; + + sensor@0 { + reg = <0>; + + vdd-supply = <&mt6358_vcamd_reg>; + vaa-supply = <&mt6358_vcama1_reg>; + vddio-supply = <®_1p8v_ext>; + }; + }; + }; + }; + + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "onnn,ap1302"; + reg = <0x3c>; + + clocks = <&topckgen 0>; + + reset-gpios = <&pio 102 GPIO_ACTIVE_LOW>; + standby-gpios = <&pio 40 GPIO_ACTIVE_HIGH>; + + port { + isp2_out: endpoint { + remote-endpoint = <&seninf_in1>; + data-lanes = <1 2>; + }; + }; + + sensors { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + +...
Signature · 1 line
2.7.4
Hi Sakari,
Can you please review ap1302 ISP driver patch. Sorry for the delay in pushing the changes.
Thanks and regards,
Anil.
-----Original Message-----
From: Anil Kumar Mamidala <[email protected]>
Sent: Thursday, July 29, 2021 5:42 PM
To: [email protected]
Cc: [email protected]; Naveen Kumar Gaddipati <[email protected]>; Anil Kumar Mamidala <[email protected]>; Laurent Pinchart <[email protected]>; Stefan Hladnik <[email protected]>; Florian Rebaudo <[email protected]>
Subject: [PATCH v2 1/2] media: i2c: Add ON Semiconductor AP1302 ISP driver
The AP1302 is a standalone ISP for ON Semiconductor sensors. AP1302 ISP supports single and dual sensor inputs. The driver code supports AR1335, AR0144 and AR0330 sensors with single and dual mode by loading the corresponding firmware.
--- MAINTAINERS | 9 + drivers/media/i2c/Kconfig | 14 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/ap1302.c | 2802 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 2826 insertions(+) create mode 100644 drivers/media/i2c/ap1302.c
MAINTAINERS +9 -0
@@ -1232,6 +1232,15 @@ L: [email protected] (moderated for non-subscribers) S: Maintained F: sound/aoa/ +AP1302 ON SEMICONDUCTOR CAMERA ISP +M: Laurent Pinchart <[email protected]> +M: Anil Kumar Mamidala <[email protected]> +L: [email protected] +S: Maintained +T: git git://linuxtv.org/media_tree.git +F: Documentation/devicetree/bindings/media/i2c/onnn,ap1302.yaml +F: drivers/media/i2c/ap1302.c + APEX EMBEDDED SYSTEMS STX104 IIO DRIVER M: William Breathitt Gray <[email protected]> L: [email protected]
drivers/media/i2c/Kconfig +14 -0
@@ -629,6 +629,20 @@ config VIDEO_UPD64083 To compile this driver as a module, choose M here: the module will be called upd64083. + +config VIDEO_AP1302 + tristate "ON Semiconductor AP1302 ISP" + depends on I2C && VIDEO_V4L2 + select VIDEO_V4L2_SUBDEV_API + select V4L2_FWNODE + + help + This is a Video4Linux2 sensor-level driver for the ON Semiconductor + AP1302 ISP. + + To compile this driver as a module, choose M here: the + module will be called ap1302. + endmenu menu "Audio/Video compression chips"
drivers/media/i2c/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_VIDEO_VP27SMPX) += vp27smpx.o obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o +obj-$(CONFIG_VIDEO_AP1302) += ap1302.o obj-$(CONFIG_VIDEO_OV02A10) += ov02a10.o obj-$(CONFIG_VIDEO_OV2640) += ov2640.o obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
drivers/media/i2c/ap1302.c new file +2802 -0
2,802 lines not on this page · raw message
Signature · 1 line
2.7.4
Hi Anil,
Quoted 3 lines · Anil Kumar Mamidala
Hi Sakari,
Can you please review ap1302 ISP driver patch. Sorry for the delay in pushing the changes.
No worries.
Could you elaborate what has changed here since v1?
Signature · 1 line
Sakari Ailus
Hi Sakari,
Please find my reply inline.
Thanks and regards,
Anil
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Tuesday, August 10, 2021 8:56 PM
To: Anil Kumar Mamidala <[email protected]>
Cc: [email protected]; Naveen Kumar Gaddipati <[email protected]>; Laurent Pinchart <[email protected]>; Stefan Hladnik <[email protected]>; Florian Rebaudo <[email protected]>
Subject: Re: [PATCH v2 1/2] media: i2c: Add ON Semiconductor AP1302 ISP driver
Hi Anil,
Quoted 3 lines · Anil Kumar Mamidala
Hi Sakari,
Can you please review ap1302 ISP driver patch. Sorry for the delay in pushing the changes.
No worries.
Could you elaborate what has changed here since v1?
<Anil> Please find the changes list below.
1. Updated code with the review comments from you for patch v1.
- Add check for firmware size
- Remove hardcoding of MIPI lanes
- Use fwnode_graph_get_endpoint_by_id() API instead of fwnode_graph_get_next_endpoint
2. Add streaming flag to avoid multiple times calling of stream on/off functionality if already in that state.
3. Add v4l2_ctrls for setting brightness, saturation, AE metering mode, contrast, gain ctrls.
Signature · 1 line
Sakari Ailus
Hi Sakari,
Can you please review the patches and provide your valuable feedback.
Please find the change list w.r.to v1 patch below.
1. Updated code with the review comments from you for patch v1.
- Add check for firmware size
- Remove hardcoding of MIPI lanes
- Use fwnode_graph_get_endpoint_by_id() API instead of fwnode_graph_get_next_endpoint
2. Add streaming flag to avoid multiple times calling of stream on/off functionality if already in that state.
3. Add v4l2_ctrls for setting brightness, saturation, AE metering mode, contrast, gain ctrls.
Thanks and regards,
Anil.
-----Original Message-----
From: Anil Kumar Mamidala
Sent: Wednesday, August 11, 2021 3:52 PM
To: [email protected]
Cc: [email protected]; Naveen Kumar Gaddipati <[email protected]>; Laurent Pinchart <[email protected]>; Stefan Hladnik <[email protected]>; Florian Rebaudo <[email protected]>
Subject: RE: [PATCH v2 1/2] media: i2c: Add ON Semiconductor AP1302 ISP driver
Hi Sakari,
Please find my reply inline.
Thanks and regards,
Anil
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Tuesday, August 10, 2021 8:56 PM
To: Anil Kumar Mamidala <[email protected]>
Cc: [email protected]; Naveen Kumar Gaddipati <[email protected]>; Laurent Pinchart <[email protected]>; Stefan Hladnik <[email protected]>; Florian Rebaudo <[email protected]>
Subject: Re: [PATCH v2 1/2] media: i2c: Add ON Semiconductor AP1302 ISP driver
Hi Anil,
Quoted 3 lines · Anil Kumar Mamidala
Hi Sakari,
Can you please review ap1302 ISP driver patch. Sorry for the delay in pushing the changes.
No worries.
Could you elaborate what has changed here since v1?
<Anil> Please find the changes list below.
1. Updated code with the review comments from you for patch v1.
- Add check for firmware size
- Remove hardcoding of MIPI lanes
- Use fwnode_graph_get_endpoint_by_id() API instead of fwnode_graph_get_next_endpoint
2. Add streaming flag to avoid multiple times calling of stream on/off functionality if already in that state.
3. Add v4l2_ctrls for setting brightness, saturation, AE metering mode, contrast, gain ctrls.
Signature · 1 line
Sakari Ailus
Hi Anil,
Quoted 11 lines · Anil Kumar Mamidala
Hi Sakari,
Can you please review the patches and provide your valuable feedback.
Please find the change list w.r.to v1 patch below.
1. Updated code with the review comments from you for patch v1.
- Add check for firmware size
- Remove hardcoding of MIPI lanes
- Usefwnode_graph_get_endpoint_by_id()API instead offwnode_graph_get_next_endpoint
2. Add streaming flag to avoid multiple times calling of stream on/off functionality if already in that state.
3. Addv4l2_ctrlsfor setting brightness, saturation, AE metering mode, contrast, gain ctrls.
The patches seem fine to me. I was waiting for Rob Herring's ack, but I see he's not cc'd nor is the devicetree list. Could you resend the set, with both cc'd?
Thanks.
Signature · 3 lines
Kind regards, Sakari Ailus