mbox series

[v2,0/5] Add support for DCMIPP camera interface of STMicroelectronics STM32 SoC series

Message ID 20230829132357.192535-1-alain.volmat@foss.st.com
Headers show
Series Add support for DCMIPP camera interface of STMicroelectronics STM32 SoC series | expand

Message

Alain Volmat Aug. 29, 2023, 1:23 p.m. UTC
This patchset introduces support for Digital Camera Memory Interface
Pixel Processor (DCMIPP) of STMicroelectronics STM32 SoC series.

This initial support implements a single capture pipe
allowing RGB565, YUV, Y, RAW8 and JPEG capture with
frame skipping, prescaling and cropping.

DCMIPP is exposed through 3 subdevices:
- dcmipp_dump_parallel: parallel interface handling
- dcmipp_dump_postproc: frame skipping, prescaling and cropping control
- dcmipp_dump_capture: video device capture node

v2:
  - removal of pclk-max-frequency from yaml example dts
  - codying-style fixes
  - correction in enum functions (format, mbus, frame_size ...) handling
  - drop of v4l2_pipeline_pm_ calls, and specific open/close handler of
    vdev
  - video dev s_stream handling updated to call s_stream of remote subdev
    instead of loop until sensor subdev
  - code update following media_pipeline & v4l2_async_ api changes since v1
  - removal of IP reset call upon error
  - removal of link_validate handlers
  - addition of V4L2_CAP_IO_MC device_caps
  - removal of the frame skip control for the time being, will be added
    back in another commit once control method will be agreed
  - change byteproc entity type to MEDIA_ENT_F_PROC_VIDEO_SCALER
  - various fixes from Dan & Sakari remarks

Alain Volmat (2):
  dt-bindings: media: add bindings for dcmipp driver
  media: MAINTAINERS: add entry for STM32 DCMIPP driver

Hugues Fruchet (3):
  media: stm32-dcmipp: STM32 DCMIPP camera interface driver
  ARM: dts: stm32: add dcmipp support to stm32mp135
  ARM: multi_v7_defconfig: enable STM32 DCMIPP media support

 .../bindings/media/st,stm32-dcmipp.yaml       |   95 ++
 MAINTAINERS                                   |    9 +
 arch/arm/boot/dts/st/stm32mp135.dtsi          |    9 +
 arch/arm/configs/multi_v7_defconfig           |    1 +
 drivers/media/platform/st/stm32/Kconfig       |   15 +
 drivers/media/platform/st/stm32/Makefile      |    1 +
 .../platform/st/stm32/stm32-dcmipp/Makefile   |    5 +
 .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c    | 1040 +++++++++++++++++
 .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c   |  692 +++++++++++
 .../st/stm32/stm32-dcmipp/dcmipp-common.c     |  105 ++
 .../st/stm32/stm32-dcmipp/dcmipp-common.h     |  227 ++++
 .../st/stm32/stm32-dcmipp/dcmipp-core.c       |  673 +++++++++++
 .../st/stm32/stm32-dcmipp/dcmipp-parallel.c   |  523 +++++++++
 13 files changed, 3395 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/Makefile
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.h
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
 create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-parallel.c

Comments

Alain Volmat Sept. 1, 2023, 2:43 p.m. UTC | #1
Hi Conor,

thanks for the review.  I've taken into account your comment and
will push this into the v3.


On Tue, Aug 29, 2023 at 04:00:06PM +0100, Conor Dooley wrote:
> Hey,
> 
> On Tue, Aug 29, 2023 at 03:23:45PM +0200, Alain Volmat wrote:
> > Add the yaml binding for the DCMIPP driver.
> 
> Please drop all mentions of drivers, bindings are for hardware.

Ok

> 
> > 
> > Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
> > ---
> >  .../bindings/media/st,stm32-dcmipp.yaml       | 95 +++++++++++++++++++
> >  1 file changed, 95 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
> > new file mode 100644
> > index 000000000000..63f03a1c42b6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
> > @@ -0,0 +1,95 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/st,stm32-dcmipp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: STMicroelectronics STM32 DCMIPP Digital Camera Memory Interface Pixel Processor binding
> 
> s/binding// to appease the bot.

Ok

> 
> > +
> > +maintainers:
> > +  - Hugues Fruchet <hugues.fruchet@foss.st.com>
> > +  - Alain Volmat <alain.volmat@foss.st.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: st,stm32mp13-dcmipp
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    items:
> > +      - const: kclk
> 
> Can drop the items: here since you only have one. The name is also
> pretty pointless when you only have one...

Ok, I removed clock-names (from required as well).
> 
> > +
> > +  resets:
> > +    maxItems: 1
> > +
> > +  port:
> > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > +    unevaluatedProperties: false
> > +    description:
> > +      DCMIPP supports a single port node with parallel bus.
> > +
> > +    properties:
> > +      endpoint:
> > +        $ref: video-interfaces.yaml#
> > +        unevaluatedProperties: false
> > +
> > +        properties:
> > +          bus-type:
> > +            enum: [5, 6]
> > +            default: 5
> > +
> > +          bus-width:
> > +            enum: [8, 10, 12, 14]
> > +            default: 8
> > +
> > +          pclk-sample: true
> > +          hsync-active: true
> > +          vsync-active: true
> > +
> > +        required:
> > +          - pclk-sample
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +  - resets
> > +  - port
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +    #include <dt-bindings/clock/stm32mp13-clks.h>
> > +    #include <dt-bindings/reset/stm32mp13-resets.h>
> > +    dcmipp: dcmipp@5a000000 {
> 
> Neither of the labels here are used AFAICT, please remove them.

Done

Regards,
Alain