mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: Marge Yang <marge.yang@tw.synaptics.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, david.chiu@tw.synaptics.com,
	derek.cheng@tw.synaptics.com, sam.tsai@synaptics.com,
	vincent.huang@tw.synaptics.com
Subject: Re: [PATCH V2] Input: synaptics-rmi4- Add a new feature for Forepad.
Date: Tue, 13 Jun 2023 22:48:55 +0200	[thread overview]
Message-ID: <20230613204855.bm4wxneamkd76heq@intel.intel> (raw)
In-Reply-To: <20230612022607.315149-1-marge.yang@tw.synaptics.com>

Hi Marge,

[...]

> +static irqreturn_t rmi_f21_attention(int irq, void *ctx)
> +{
> +	struct rmi_function *fn = ctx;
> +	struct f21_data *f21 = dev_get_drvdata(&fn->dev);
> +	int error;
> +
> +	error = rmi_read_block(fn->rmi_dev,
> +				fn->fd.data_base_addr+RMI_F21_FORCE_CLICK_OFFSET,
> +				f21->data_regs, 1);
> +	if (error) {
> +		dev_err(&fn->dev,
> +			"%s: Failed to read f21 data registers: %d\n",
> +			__func__, error);
> +		return IRQ_RETVAL(error);
> +	}
> +
> +	if (!!(f21->data_regs[0] & RMI_f21_FORCE_CLICK))

no need for double negation here.

Andi

> +		input_report_key(f21->input, f21->key_code, true);
> +	else
> +		input_report_key(f21->input, f21->key_code, false);
> +	return IRQ_HANDLED;
> +}

  reply	other threads:[~2023-06-13 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  2:26 Marge Yang
2023-06-13 20:48 ` Andi Shyti [this message]
2023-07-03  2:49   ` Marge Yang

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=20230613204855.bm4wxneamkd76heq@intel.intel \
    --to=andi.shyti@kernel.org \
    --cc=david.chiu@tw.synaptics.com \
    --cc=derek.cheng@tw.synaptics.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marge.yang@tw.synaptics.com \
    --cc=sam.tsai@synaptics.com \
    --cc=vincent.huang@tw.synaptics.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®