All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Lukasz Majewski <lukma@denx.de>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH 2/2] input: touchscreen mc13xxx: Add mc34708 support
Date: Wed, 11 Apr 2018 09:01:01 -0700	[thread overview]
Message-ID: <4690e30b3c4b97847123295f1994c6eafe4e0cbb.camel@perches.com> (raw)
In-Reply-To: <20180411141340.30939-2-lukma@denx.de>

On Wed, 2018-04-11 at 16:13 +0200, Lukasz Majewski wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
> 
> The mc34708 has a different bit to enable pen detection. This
> adds the driver data and devtype necessary to probe the device
> and to distinguish between the mc13783 and the mc34708.

style trivia:

> diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
[]
> @@ -96,6 +135,10 @@ static void mc13783_ts_report_sample(struct mc13783_ts_priv *priv)
>  
>  	cr0 = (cr0 + cr1) / 2;
>  
> +	if (priv->drvdata->type == MC13XXX_TYPE_MC34708)
> +		if (cr0 > 4080)
> +			cr0 = 0;

For easy of reading, this multiple if block should either
use braces around the first if like:

	if (foo) {
		if (bar)
			single_statement;
	}

or be written

	if (foo && bar)
		single_statement;

I generally prefer the latter style.

  reply	other threads:[~2018-04-11 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 14:13 [PATCH 1/2] input: touchscreen mc13xxx: Make platform data optional Lukasz Majewski
2018-04-11 14:13 ` [PATCH 2/2] input: touchscreen mc13xxx: Add mc34708 support Lukasz Majewski
2018-04-11 16:01   ` Joe Perches [this message]
2018-04-12 14:45     ` Lukasz Majewski
2018-04-13 22:27   ` Dmitry Torokhov

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=4690e30b3c4b97847123295f1994c6eafe4e0cbb.camel@perches.com \
    --to=joe@perches.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukma@denx.de \
    --cc=s.hauer@pengutronix.de \
    /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.