All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qianhui Xu" <xiaqinghuan@mail.ustc.edu.cn>, linux-input@vger.kernel.org
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	dmitry.torokhov@gmail.com
Subject: Re: [PATCH 4/5] Input: aw86927 - handle the AW8693X play and boost register layout
Date: Tue, 27 Oct 2026 13:37:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-186657@kernel.org> (raw)
In-Reply-To: <20261027132929.242158-5-xiaqinghuan@mail.ustc.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Input: aw86927 - 1-bit AW86938_PLAYCFG1_BST_MODE_MASK in aw86927_play_mode()
--

commit c20411cd705818dd58facc17d48437366131a42a
Author: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>

Input: aw86927 - handle the AW8693X play and boost register layout

This commit updates the aw86927 driver to handle the play, boost, VBAT,
and two-step stop register layout differences on AW86937 and AW86938
devices.

> diff --git a/drivers/input/misc/aw86927.c b/drivers/input/misc/aw86927.c
> index 42eb531c7e3b3..e8fd880ac1ded 100644
> --- a/drivers/input/misc/aw86927.c
> +++ b/drivers/input/misc/aw86927.c

[ ... ]

> @@ -291,9 +299,14 @@ static int aw86927_play_mode(struct aw86927_data *haptics, u8 play_mode)
>  
>  		err = regmap_update_bits(haptics->regmap,
>  					 AW86927_PLAYCFG1_REG,
> -					 AW86927_PLAYCFG1_BST_MODE_MASK,
> +					 haptics->model == AW86927 ?
> +					 AW86927_PLAYCFG1_BST_MODE_MASK :
> +					 AW86938_PLAYCFG1_BST_MODE_MASK,
> +					 haptics->model == AW86927 ?
>  					 FIELD_PREP(AW86927_PLAYCFG1_BST_MODE_MASK,
> -						    AW86927_PLAYCFG1_BST_MODE_BYPASS));
> +						    AW86927_PLAYCFG1_BST_MODE_BYPASS) :
> +					 FIELD_PREP(AW86938_PLAYCFG1_BST_MODE_MASK,
> +						    AW86938_PLAYCFG1_BST_MODE_BYPASS));
>  		if (err)
>  			return err;

[Severity: Medium]
The commit description notes that on AW86937 and AW86938 "the boost mode in
PLAYCFG1 is a two-bit field at bit 5 instead of bit 7", but
AW86938_PLAYCFG1_BST_MODE_MASK in drivers/input/misc/aw86927.c is defined as
a 1-bit mask:

#define AW86938_PLAYCFG1_REG			0x06
#define AW86938_PLAYCFG1_BST_MODE_MASK		GENMASK(5, 5)
#define AW86938_PLAYCFG1_BST_MODE_BYPASS	0
#define AW86938_PLAYCFG1_BST_VOUT_VREFSET_MASK	GENMASK(4, 0)

When aw86927_play_sine() -> aw86927_play_mode(haptics, AW86927_RAM_MODE) runs
on AW86937 or AW86938, regmap_update_bits() only updates bit 5 of
AW86927_PLAYCFG1_REG and leaves bit 6 untouched.

Should AW86938_PLAYCFG1_BST_MODE_MASK be defined as GENMASK(6, 5) so both
bits of the boost mode field are masked when configuring bypass mode?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027132929.242158-1-xiaqinghuan@mail.ustc.edu.cn?part=4

  reply	other threads:[~2026-10-27 13:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 13:29 [PATCH 0/5] Input: aw86927 - add AW86937 support and fix the AW8693X layout Qianhui Xu
2026-10-27 13:29 ` [PATCH 1/5] Input: aw86927 - fix the 7 V boost reference for AW86938 Qianhui Xu
2026-10-27 13:29 ` [PATCH 2/5] dt-bindings: input: awinic,aw86927: document the AW86937 variant Qianhui Xu
2026-10-27 18:06   ` Krzysztof Kozlowski
2026-10-27 13:29 ` [PATCH 3/5] Input: aw86927 - add support for Awinic AW86937 Qianhui Xu
2026-10-27 13:29 ` [PATCH 4/5] Input: aw86927 - handle the AW8693X play and boost register layout Qianhui Xu
2026-10-27 13:37   ` sashiko-bot [this message]
2026-10-27 13:29 ` [PATCH 5/5] Input: aw86927 - stop playback over suspend and on shutdown Qianhui Xu
2026-10-27 13:55   ` sashiko-bot

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=sashiko-outbox-186657@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiaqinghuan@mail.ustc.edu.cn \
    /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.