All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Mehdi Djait <mehdi.djait@bootlin.com>
Cc: mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl,
	laurent.pinchart@ideasonboard.com,
	krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org,
	conor+dt@kernel.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com,
	maxime.chevallier@bootlin.com
Subject: Re: [PATCH v9 3/3] media: i2c: Introduce a driver for the Techwell TW9900 decoder
Date: Wed, 29 Nov 2023 16:02:08 +0100	[thread overview]
Message-ID: <ZWdScBVicBfjPuVA@aptenodytes> (raw)
In-Reply-To: <dc65a89e7803782a75bf663158e031356ef7cb1a.1700235276.git.mehdi.djait@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 3563 bytes --]

Hi Mehdi,

On Fri 17 Nov 23, 16:42, Mehdi Djait wrote:
> The Techwell video decoder supports PAL, NTSC standards and
> has a parallel BT.656 output interface.
> 
> This commit adds support for this device, with basic support
> for NTSC and PAL, along with brightness and contrast controls.
> 
> The TW9900 is capable of automatic standard detection. This
> driver is implemented with support for PAL and NTSC
> autodetection.

Very nice work on this iteration, I am quite happy with it!

There is just one cosmetic comment below. With that fixed, you can add my:
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> Signed-off-by: Mehdi Djait <mehdi.djait@bootlin.com>
> ---
>  MAINTAINERS                |   6 +
>  drivers/media/i2c/Kconfig  |  15 +
>  drivers/media/i2c/Makefile |   1 +
>  drivers/media/i2c/tw9900.c | 777 +++++++++++++++++++++++++++++++++++++
>  4 files changed, 799 insertions(+)
>  create mode 100644 drivers/media/i2c/tw9900.c

[...]

> diff --git a/drivers/media/i2c/tw9900.c b/drivers/media/i2c/tw9900.c
> new file mode 100644
> index 000000000000..895ca459087b
> --- /dev/null
> +++ b/drivers/media/i2c/tw9900.c
> @@ -0,0 +1,777 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for the Techwell TW9900 multi-standard video decoder.
> + *
> + * Copyright (C) 2018 Fuzhou Rockchip Electronics Co., Ltd.
> + * Copyright (C) 2020 Maxime Chevallier <maxime.chevallier@bootlin.com>
> + * Copyright (C) 2023 Mehdi Djait <mehdi.djait@bootlin.com>
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/i2c.h>
> +#include <linux/module.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/regulator/consumer.h>
> +#include <media/media-entity.h>
> +#include <media/v4l2-async.h>
> +#include <media/v4l2-ctrls.h>
> +#include <media/v4l2-event.h>
> +#include <media/v4l2-subdev.h>
> +
> +#define TW9900_REG_CHIP_ID			0x00
> +#define TW9900_REG_CHIP_STATUS			0x01
> +#define TW9900_REG_CHIP_STATUS_VDLOSS		BIT(7)
> +#define TW9900_REG_CHIP_STATUS_HLOCK		BIT(6)
> +#define TW9900_REG_OUT_FMT_CTL			0x03
> +#define TW9900_REG_OUT_FMT_CTL_STANDBY		0xA7
> +#define TW9900_REG_OUT_FMT_CTL_STREAMING	0xA0
> +#define TW9900_REG_CKHY_HSDLY			0x04
> +#define TW9900_REG_OUT_CTRL_I			0x05
> +#define TW9900_REG_ANALOG_CTL			0x06
> +#define TW9900_REG_CROP_HI			0x07
> +#define TW9900_REG_VDELAY_LO			0x08
> +#define TW9900_REG_VACTIVE_LO			0x09
> +#define TW9900_REG_HACTIVE_LO			0x0B
> +#define TW9900_REG_CNTRL1			0x0C
> +#define TW9900_REG_BRIGHT_CTL			0x10
> +#define TW9900_REG_CONTRAST_CTL			0x11
> +#define TW9900_REG_VBI_CNTL			0x19
> +#define TW9900_REG_ANAL_CTL_II			0x1A
> +#define TW9900_REG_OUT_CTRL_II			0x1B
> +#define TW9900_REG_STD				0x1C
> +#define TW9900_REG_STD_AUTO_PROGRESS		BIT(7)
> +#define TW9900_STDNOW_MASK			GENMASK(6, 4)
> +#define TW9900_REG_STDR				0x1D
> +#define TW9900_REG_MISSCNT			0x26
> +#define TW9900_REG_MISC_CTL_II			0x2F
> +#define TW9900_REG_VVBI				0x55

Please reintroduce the newline here...

> +#define TW9900_CHIP_ID				0x00
> +#define TW9900_STD_NTSC_M			0
> +#define TW9900_STD_PAL_BDGHI			1
> +#define TW9900_STD_AUTO				7

... and here to separate between register definitions and more general values.

> +#define TW9900_VIDEO_POLL_TRIES			20

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2023-11-29 15:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 15:42 [PATCH v9 0/3] media: i2c: Introduce driver for the TW9900 video decoder Mehdi Djait
2023-11-17 15:42 ` [PATCH v9 1/3] dt-bindings: vendor-prefixes: Add techwell vendor prefix Mehdi Djait
2023-11-17 15:42 ` [PATCH v9 2/3] media: dt-bindings: media: i2c: Add bindings for TW9900 Mehdi Djait
2023-11-29 14:50   ` Paul Kocialkowski
2023-11-17 15:42 ` [PATCH v9 3/3] media: i2c: Introduce a driver for the Techwell TW9900 decoder Mehdi Djait
2023-11-22 10:43   ` Dan Carpenter
2023-11-29 15:02   ` Paul Kocialkowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-22  4:04 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWdScBVicBfjPuVA@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.