mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Luca Weiss <luca.weiss@fairphone.com>
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH RESEND v3 2/3] Input: aw86927 - add driver for Awinic AW86927
Date: Thu, 25 Sep 2025 14:15:42 +0200	[thread overview]
Message-ID: <81822df8-1978-4f22-93e7-87b79e1fc9f3@oss.qualcomm.com> (raw)
In-Reply-To: <20250925-aw86927-v3-2-1fc6265b42de@fairphone.com>

On 9/25/25 12:07 PM, Griffin Kroah-Hartman wrote:
> Add support for the I2C-connected Awinic AW86927 LRA haptic driver.
> 
> This driver includes a hardcoded sine waveform to be uploaded to the
> AW86927's SRAM for haptic playback.
> This driver does not currently support all the capabilities of the
> AW86927, such as F0 calibration, RTP mode, and CONT mode.
> 
> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
> ---

I'll give you a couple of cosmetic comments, feel free to ignore

uint8_t is abbreviated as u8 in the kernel

[...]

> +#define AW86927_PLAYCFG1_BST_MODE_MASK		GENMASK(7, 7)

GENMASK(n, n) is BIT(n)

[...]

> +static int aw86927_wait_enter_standby(struct aw86927_data *haptics)
> +{
> +	unsigned int reg_val;
> +	int err;

"ret" is more common (for "return value")

[...]

> +	switch (play_mode) {
> +	case AW86927_STANDBY_MODE:
> +		/* Briefly toggle standby, then toggle back to standby off */
> +		err = regmap_update_bits(haptics->regmap,
> +				AW86927_SYSCTRL3_REG,
> +				AW86927_SYSCTRL3_STANDBY_MASK,
> +				FIELD_PREP(AW86927_SYSCTRL3_STANDBY_MASK,
> +					   AW86927_SYSCTRL3_STANDBY_ON));

this is regmap_set_bits(regmap, register, field), you can consider
dropping the _MASK suffix too

> +		if (err)
> +			return err;
> +
> +		err = regmap_update_bits(haptics->regmap,
> +				AW86927_SYSCTRL3_REG,
> +				AW86927_SYSCTRL3_STANDBY_MASK,
> +				FIELD_PREP(AW86927_SYSCTRL3_STANDBY_MASK,
> +					   AW86927_SYSCTRL3_STANDBY_OFF));

regmap_clear_bits()

(also regmap_assign_bits() which is a conditional version of the two
is a nice piece of syntax sugar)

Konrad

  reply	other threads:[~2025-09-25 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 10:07 [PATCH RESEND v3 0/3] Add support for Awinic AW86927 haptic driver Griffin Kroah-Hartman
2025-09-25 10:07 ` [PATCH RESEND v3 1/3] dt-bindings: input: Add Awinic AW86927 Griffin Kroah-Hartman
2025-09-28  5:01   ` Dmitry Torokhov
2025-09-25 10:07 ` [PATCH RESEND v3 2/3] Input: aw86927 - add driver for " Griffin Kroah-Hartman
2025-09-25 12:15   ` Konrad Dybcio [this message]
2025-09-28  4:10     ` Dmitry Torokhov
2025-09-28  5:03   ` Dmitry Torokhov
2025-09-25 10:07 ` [PATCH RESEND v3 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Add vibrator support Griffin Kroah-Hartman
2025-10-27 22:36   ` (subset) " Bjorn Andersson
2025-10-27 22:36 ` [PATCH RESEND v3 0/3] Add support for Awinic AW86927 haptic driver Bjorn Andersson

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=81822df8-1978-4f22-93e7-87b79e1fc9f3@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=griffin.kroah@fairphone.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=robh@kernel.org \
    /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®