linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Richardson <jonathar@broadcom.com>
To: Joe Perches <joe@perches.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Ray Jui <rjui@broadcom.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver
Date: Fri, 19 Dec 2014 11:51:33 -0800	[thread overview]
Message-ID: <549481C5.7050802@broadcom.com> (raw)
In-Reply-To: <1418868881.28384.8.camel@perches.com>

Thanks Joe. I'll send out a new patch set with your suggestions/fixes
shortly.

On 14-12-17 06:14 PM, Joe Perches wrote:
> On Wed, 2014-12-17 at 17:59 -0800, Jonathan Richardson wrote:
>> Add initial version of the Broadcom touchscreen driver.
> 
> trivia:
> 
>> diff --git a/drivers/input/touchscreen/bcm_iproc_tsc.c b/drivers/input/touchscreen/bcm_iproc_tsc.c
> 
>> +/* Bit values for REGCTL2 */
>> +#define TS_CONTROLLER_EN_BIT    (1 << 16)
>> +#define TS_CONTROLLER_AVGDATA_SHIFT 8
>> +#define TS_CONTROLLER_AVGDATA_MASK (0x7 << TS_CONTROLLER_AVGDATA_SHIFT)
>> +#define TS_CONTROLLER_PWR_LDO   (1<<5)
>> +#define TS_CONTROLLER_PWR_ADC   (1<<4)
>> +#define TS_CONTROLLER_PWR_BGP   (1<<3)
>> +#define TS_CONTROLLER_PWR_TS    (1<<2)
>> +#define TS_WIRE_MODE_BIT        (1<<1)
> 
> Be nicer to use the same spacing around <<
> or maybe use the BIT macro.
> 
> []
> 
>> +static int get_tsc_config(struct device_node *np, struct iproc_ts_priv *priv)
>> +{
>> +	int ret;
>> +	u32 val;
>> +	struct device *dev = &priv->pdev->dev;
>> +
>> +	priv->cfg_params = default_config;
>> +
>> +	ret = of_property_read_u32(np, "scanning_period", &val);
>> +	if (ret >= 0) {
>> +		if ((1 <= val) && (val <= 256))
>> +			priv->cfg_params.scanning_period = val;
>> +		else {
>> +			dev_err(dev, "scanning_period must be [1-256]");
>> +			return -EINVAL;
>> +		}
> 
> ret is never used so I'd probably remove it
> from all these blocks.
> 
> It's probably be nicer to invert the logic ald
> remove the else.
> 
> There's a missing terminating newline too.
> 
> Something like:
> 
> 	if (of_property_read_u32(np, "scanning_period", &val) >= 0) {
> 		if (val < 1 || val > 256) {
> 			dev_err(dev, "scanning_period must be [1-256]\n");
> 			return -EINVAL;
> 		}
> 		priv->cfg_params.scanning_period = val;
> 	}
> 
> etc...
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2014-12-19 19:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Jonathan Richardson <jonathar@broadcom.com>
2014-12-18  1:59 ` [PATCH 0/2] Add support for Broadcom iProc touchscreen Jonathan Richardson
     [not found]   ` <1418867992-3550-1-git-send-email-jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2014-12-18  1:59     ` [PATCH 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver Jonathan Richardson
2014-12-18  2:14       ` Joe Perches
2014-12-19 19:51         ` Jonathan Richardson [this message]
2014-12-19 19:56           ` Dmitry Torokhov
2014-12-18  1:59   ` [PATCH 2/2] Input: touchscreen-iproc: add device tree bindings Jonathan Richardson
2014-12-19 22:17 ` [PATCH v2 0/2] Add support for Broadcom iProc touchscreen Jonathan Richardson
2014-12-19 22:17   ` [PATCH v2 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver Jonathan Richardson
2015-01-15  1:02     ` Dmitry Torokhov
2015-01-15  5:44       ` Scott Branden
2015-01-15  6:07         ` Dmitry Torokhov
2015-01-15 19:51           ` Jonathan Richardson
2015-02-11 18:45             ` Jonathan Richardson
     [not found]               ` <54DBA34E.8090400-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-02-24 23:18                 ` Dmitry Torokhov
2015-02-27  1:02                   ` Jonathan Richardson
     [not found]     ` <1419027470-7969-2-git-send-email-jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2014-12-19 22:26       ` Joe Perches
2014-12-19 23:03         ` Jonathan Richardson
2015-01-01  0:55           ` Jonathan Richardson
2015-01-15  1:08           ` Florian Fainelli
2015-01-15 19:19             ` Jonathan Richardson
2015-02-24 23:29       ` Dmitry Torokhov
2015-03-02 19:13         ` Jonathan Richardson
2014-12-19 22:17   ` [PATCH v2 2/2] Input: touchscreen-iproc: add device tree bindings Jonathan Richardson
2015-03-11  1:17 ` [PATCH v3 0/2] Add support for Broadcom iProc touchscreen Jonathan Richardson
     [not found]   ` <1426036669-21659-1-git-send-email-jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-11  1:17     ` [PATCH v3 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver Jonathan Richardson
2015-03-11  9:46       ` Paul Bolle
2015-03-11 17:05         ` Jonathan Richardson
2015-03-11  1:17   ` [PATCH v3 2/2] Input: touchscreen-iproc: add device tree bindings Jonathan Richardson
     [not found] ` <Jonathan Richardson <jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-12 17:45   ` [PATCH v4 0/2] Add support for Broadcom iProc touchscreen Jonathan Richardson
2015-03-12 17:45     ` [PATCH v4 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver Jonathan Richardson
2015-03-12 17:59       ` Joe Perches
     [not found]         ` <1426183169.2742.10.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2015-03-12 22:44           ` Jonathan Richardson
2015-03-12 17:45     ` [PATCH v4 2/2] Input: touchscreen-iproc: add device tree bindings Jonathan Richardson

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=549481C5.7050802@broadcom.com \
    --to=jonathar@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).