From: Jonathan Richardson <jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: Dmitry Torokhov <dtor-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Anatol Pomazau <anatol-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Scott Branden <sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
bcm-kernel-feedback-list
<bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Subject: Re: [PATCH v4 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver
Date: Thu, 12 Mar 2015 15:44:19 -0700 [thread overview]
Message-ID: <550216C3.8090807@broadcom.com> (raw)
In-Reply-To: <1426183169.2742.10.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
On 15-03-12 10:59 AM, Joe Perches wrote:
> On Thu, 2015-03-12 at 10:45 -0700, Jonathan Richardson wrote:
>> Add initial version of the Broadcom touchscreen driver.
>
> style trivia:
> (any of which could be fixed/improved/ignored later)
>
>> diff --git a/drivers/input/touchscreen/bcm_iproc_tsc.c b/drivers/input/touchscreen/bcm_iproc_tsc.c
> []
>> +static void ts_reg_dump(struct iproc_ts_priv *priv)
>> +{
>> + struct device *dev = &priv->pdev->dev;
>> +
>> + dev_dbg(dev, "regCtl1 = 0x%08x\n",
>> + readl(priv->regs + REGCTL1));
>
> The output case here generally isn't very important so
> sometimes it's better to use a macro like:
>
> #define dbg_reg(dev, priv, reg) \
> dev_dbg(dev, "%20s= 0x%08x\n", #reg, readl((priv)->regs + reg))
>
>> + dev_dbg(dev, "regCtl2 = 0x%08x\n",
>> + readl(priv->regs + REGCTL2));
>
> so these become
> dbg_reg(dev, priv, INTERRUPT_THRES);
> dbg_reg(dev, priv, INTERRUPT_MASK);
>
> etc...
>
> This style can reduce typo and copy/paste defects.
>
>> + dev_dbg(dev, "interrupt_Thres = 0x%08x\n",
>> + readl(priv->regs + INTERRUPT_THRES));
>> + dev_dbg(dev, "interrupt_Mask = 0x%08x\n",
>> + readl(priv->regs + INTERRUPT_MASK));
>> + dev_dbg(dev, "interrupt_Status = 0x%08x\n",
>> + readl(priv->regs + INTERRUPT_STATUS));
>> + dev_dbg(dev, "controller_Status = 0x%08x\n",
>> + readl(priv->regs + CONTROLLER_STATUS));
>> + dev_dbg(dev, "FIFO_Data = 0x%08x\n",
>> + readl(priv->regs + FIFO_DATA));
>> + dev_dbg(dev, "analog_Control = 0x%08x\n",
>> + readl(priv->regs + ANALOG_CONTROL));
>> + dev_dbg(dev, "aux_Data = 0x%08x\n",
>> + readl(priv->regs + AUX_DATA));
>> + dev_dbg(dev, "debounce_Cntr_Stat = 0x%08x\n",
>> + readl(priv->regs + DEBOUNCE_CNTR_STAT));
>> + dev_dbg(dev, "scan_Cntr_Stat = 0x%08x\n",
>> + readl(priv->regs + SCAN_CNTR_STAT));
>> + dev_dbg(dev, "rem_Cntr_Stat = 0x%08x\n",
>> + readl(priv->regs + REM_CNTR_STAT));
>> + dev_dbg(dev, "settling_Timer_Stat = 0x%08x\n",
>> + readl(priv->regs + SETTLING_TIMER_STAT));
>> + dev_dbg(dev, "spare_Reg = 0x%08x\n",
>> + readl(priv->regs + SPARE_REG));
>> + dev_dbg(dev, "soft_Bypass_Control = 0x%08x\n",
>> + readl(priv->regs + SOFT_BYPASS_CONTROL));
>> + dev_dbg(dev, "soft_Bypass_Data = 0x%08x\n",
>> + readl(priv->regs + SOFT_BYPASS_DATA));
>> +}
>
> []
>
>> +static int get_tsc_config(struct device_node *np, struct iproc_ts_priv *priv)
>> +{
>> + u32 val;
> []
>> + if (of_property_read_u32(np, "debounce_timeout", &val) >= 0) {
>> + if (val < 0 || val > 255) {
>
> testing u32 < 0 isn't necessary.
>
> Maybe it'd be better to emit the out of range value too
>
>> + dev_err(dev, "debounce_timeout must be [0-255]\n");
>
> dev_err(dev, "debounce_timeout (%u) must be [0-255]\n", val);
>
>
Thanks. I'll make the suggested changes and send out a new patch.
Jon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-12 22:44 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
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 [this message]
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=550216C3.8090807@broadcom.com \
--to=jonathar-dy08kvg/lbpwk0htik3j/w@public.gmane.org \
--cc=anatol-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dtor-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.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).