mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bod@kernel.org
To: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"André Apitzsch" <git@apitzsch.eu>,
	"Luca Weiss" <luca.weiss@fairphone.com>,
	"Daniel Scally" <dan.scally@ideasonboard.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 2/3] media: i2c: dw9719: Update DW9800K driver
Date: Tue, 13 Oct 2026 00:26:27 +0100	[thread overview]
Message-ID: <179184758746.1635143.1022569720918218811.b4-reply@b4> (raw)
In-Reply-To: <20260914-b4-dw9800k_cleanup-v2-2-6553273aaa33@fairphone.com>

On 2026-09-14 12:25 +0200, Griffin Kroah-Hartman wrote:
> The previous DW9800K driver code was created without access to a
> datasheet for the part, now that we have one we can clean up some
> misunderstandings and add some features for further expandability.
> 
> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>

1. Be more explicit about which misunderstandings and features you mean.
2. Generally speaking for each thing you might write in the commit log
   a) Misunderstanding X
   b) Thing fixed y

   I'd recommend making those standalone patches.
3. Since you appear to be describing Fixes: here you should
   c) Have a Fixes: tag
   d) Cc: stable@vger.kernel.org

>  drivers/media/i2c/dw9719.c | 71 ++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 62 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c
> index 3b7ba88fd67c044ef9005a0aac6a5d26ab939a90..982be59b9ee17a12e8c25ab790ccb8351454c91c 100644
> --- a/drivers/media/i2c/dw9719.c
> +++ b/drivers/media/i2c/dw9719.c
> @@ -68,9 +68,18 @@
>  #define DW9761_VCM_PRELOAD		CCI_REG8(8)
>  #define DW9761_DEFAULT_VCM_PRELOAD	0x73
>  
> -#define DW9800K_DEFAULT_SAC		1
> +#define DW9800K_ID			0xEB
> +#define DW9800K_DEFAULT_SAC		3
>  #define DW9800K_MODE_SAC_SHIFT		6
> -#define DW9800K_DEFAULT_VCM_FREQ		0x10
> +
> +#define DW9800K_RESONANCE		CCI_REG8(7)
> +
> +#define DW9800K_DEFAULT_DIV		0x01
> +#define DW9800K_DIV_SHIFT		6
> +#define DW9800K_DIV_LOW_SHIFT		2
> +
> +#define DW9800K_DEFAULT_SACT		0x20
> +
>  
>  #define to_dw9719_device(x) container_of(x, struct dw9719_device, sd)
>  
> @@ -90,6 +99,8 @@ struct dw9719_device {
>  	u32 mode_low_bits;
>  	u32 sac_mode;
>  	u32 vcm_freq;
> +	u32 div;
> +	u32 sac_time;
>  
>  	struct dw9719_v4l2_ctrls {
>  		struct v4l2_ctrl_handler handler;
> @@ -140,10 +151,6 @@ static int dw9719_power_up(struct dw9719_device *dw9719, bool detect)
>  			dw9719->sac_mode = DW9718S_DEFAULT_SAC;
>  			dw9719->vcm_freq = DW9718S_DEFAULT_VCM_FREQ;
>  			goto props;
> -		case DW9800K:
> -			dw9719->sac_mode = DW9800K_DEFAULT_SAC;
> -			dw9719->vcm_freq = DW9800K_DEFAULT_VCM_FREQ;
> -			goto props;

As an example this change should be argued on its merits - you need to lead
your reviewers to water and then see how they'd like to drink.

>  		default:
>  			break;
>  		}
> @@ -165,6 +172,12 @@ static int dw9719_power_up(struct dw9719_device *dw9719, bool detect)
>  			dw9719->sac_mode = DW9761_DEFAULT_SAC;
>  			dw9719->vcm_freq = DW9761_DEFAULT_VCM_FREQ;
>  			break;
> +		case DW9800K_ID:
> +			dw9719->sac_mode = DW9800K_DEFAULT_SAC;
> +			dw9719->vcm_freq = DW9719_DEFAULT_VCM_FREQ;
> +			dw9719->div = DW9800K_DEFAULT_DIV;
> +			dw9719->sac_time = DW9800K_DEFAULT_SACT;
> +			break;
>  		default:
>  			dev_err(dw9719->dev,
>  				"Error unknown device id 0x%02llx\n", val);
> @@ -185,14 +198,54 @@ static int dw9719_power_up(struct dw9719_device *dw9719, bool detect)
>  		/* Optional indication of VCM prescale */
>  		device_property_read_u32(dw9719->dev, "dongwoon,vcm-prescale",
>  					 &dw9719->vcm_freq);
> +
> +		/* Optional indication of clock pre-scale select */
> +		device_property_read_u32(dw9719->dev, "dongwoon,clock-presc",
> +					 &dw9719->div);
> +
> +		/* Optional indication of SAC timing */
> +		device_property_read_u32(dw9719->dev, "dongwoon,timing-control",
> +					 &dw9719->sac_time);
>  	}
>  
>  	switch (dw9719->model) {
>  	case DW9800K:
> -		cci_write(dw9719->regmap, DW9719_CONTROL, DW9719_ENABLE_RINGING, &ret);
> +		int ring, sac;
> +
> +		/*
> +		 * Enable ringing for SAC3-SAC5
> +		 *
> +		 * sac_mode	reg	Mode
> +		 * ===========================
> +		 *	0	0X	Direct
> +		 *	1	1X	LSC
> +		 *	2	00	SAC2
> +		 *	3	01	SAC3
> +		 *	4	10	SAC4
> +		 *	5	11	SAC5
> +		 */
> +		switch (dw9719->sac_mode) {
> +		case 0:
> +			ring = 0;
> +			sac = 0;
> +			break;
> +		case 1:
> +			ring = 0;
> +			sac = 2;
> +			break;
> +		default:
> +			ring = DW9719_ENABLE_RINGING;
> +			sac = dw9719->sac_mode - 2;
> +			break;
> +		}

For example what is ringing - a patch should cover "enable ringing it does
thing X" and then the code should be a straight-forward reading of thing X,
matching the commit log.
---
bod


  reply	other threads:[~2026-10-12 23:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 10:25 [PATCH v2 0/3] Dongwoon DW9800K update patchset Griffin Kroah-Hartman
2026-09-14 10:25 ` [PATCH v2 1/3] dt-bindings: media: i2c: dw9800: Redocument DW9800K Griffin Kroah-Hartman
2026-09-16  9:06   ` Krzysztof Kozlowski
2026-10-01 13:17     ` Griffin Kroah-Hartman
2026-10-02  9:08       ` Krzysztof Kozlowski
2026-09-14 10:25 ` [PATCH v2 2/3] media: i2c: dw9719: Update DW9800K driver Griffin Kroah-Hartman
2026-10-12 23:26   ` bod [this message]
2026-09-14 10:25 ` [PATCH v2 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Fix DW9800K support Griffin Kroah-Hartman

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=179184758746.1635143.1022569720918218811.b4-reply@b4 \
    --to=bod@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=dan.scally@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=git@apitzsch.eu \
    --cc=griffin.kroah@fairphone.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®