From: Tony Lindgren <tony@atomide.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
devicetree@vger.kernel.org, Marcel Partap <mpartap@gmx.net>,
Mark Rutland <mark.rutland@arm.com>,
Michael Scott <michael.scott@linaro.org>,
Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH] mfd: cpcap: Add minimal support
Date: Thu, 24 Nov 2016 06:43:13 -0800 [thread overview]
Message-ID: <20161124144313.GN4082@atomide.com> (raw)
In-Reply-To: <20161124085926.GV10134@dell.home>
* Lee Jones <lee.jones@linaro.org> [161124 00:56]:
> On Wed, 23 Nov 2016, Tony Lindgren wrote:
>
> > * Lee Jones <lee.jones@linaro.org> [161121 03:43]:
> > > On Fri, 18 Nov 2016, Tony Lindgren wrote:
> > > > --- a/drivers/mfd/Makefile
> > > > +++ b/drivers/mfd/Makefile
> > > > @@ -97,6 +97,7 @@ obj-$(CONFIG_MFD_MC13XXX_I2C) += mc13xxx-i2c.o
> > > > obj-$(CONFIG_MFD_CORE) += mfd-core.o
> > > >
> > > > obj-$(CONFIG_EZX_PCAP) += ezx-pcap.o
> > > > +obj-$(CONFIG_MFD_CPCAP) += cpcap.o
> > >
> > > Who is the manufacturer?
> >
> > Hmm that I don't know. There seems to be both ST and TI versions
> > of this chip manufactured for Motorola. So my guess is that it
> > should be Motorola unless there's some similar catalog part
> > available from ST used by others. If anybody has more info
> > on this please let me know :)
>
> If this IP is shared amongst vendors, it usually means it was designed
> by someone else? Synopsis perhaps?
After searching around, many specs say "ST Ericsson CPCAP". So let's
assume the manufacturer should be ste.
> > > > + cpcap->vendor = (val >> 6) & 0x0007;
> > > > + cpcap->revision = ((val >> 3) & 0x0007) | ((val << 3) & 0x0038);
> > >
> > > Lots of magic numbers here. I suggest you define them.
> >
> > I'll check if some earlier code has these defined. Otherwise I'll
> > just add a comment on the lack of available documentation.
>
> *sad face*
>
> Does that mean you don't even know what they're for?
Luckily the Motorola driver folks documented all the registers.
Unfortunately the register bits just have names. I need to
check if we have names for these bits.
> > > > + error = cpcap_init_irq_bank(cpcap, 0, 0, 16);
> > >
> > > 'ret' is more traditional.
> >
> > FYI error seems to be preferred over ret as it's meaning is
> > clear, git grep "error =" drivers/input for example.
> > I can of course change it if you prefer ret over error.
>
> I'd prefer to stick to the conventions of *this* subsystem.
>
> ... and the most common convention used kernel wide:
>
> $ git grep "ret =" | wc -l
> 117976
> $ git grep "err =" | wc -l
> 56708
> $ git grep "error =" | wc -l
> 14427
OK sure will rename.
> > > > +#define CPCAP_REG_LDEB 0x1270 /* LMR Debounce Settings */
> > > > +#define CPCAP_REG_LGDET 0x1274 /* LMR GCAI Detach Detect */
> > > > +#define CPCAP_REG_LMISC 0x1278 /* LMR Misc Bits */
> > > > +#define CPCAP_REG_LMACE 0x127c /* LMR Mace IC Support */
> > > > +
> > > > +#define CPCAP_REG_TEST 0x7c00 /* Test */
> > > > +
> > > > +#define CPCAP_REG_ST_TEST1 0x7d08 /* ST Test1 */
> > > > +
> > > > +#define CPCAP_REG_ST_TEST2 0x7d18 /* ST Test2 */
> > >
> > > It would be nice to line up the entire file. #OCD
> >
> > Hmm care to clarify what you mean here? I think it's lined up with
>
> I'm missing context now you've <snip>ed.
>
> These look straight, however is the whole file lined up (as much as
> *practically* possible)?
Yeah it should be, I'll check.
> > tabs to line up. I left empty lines where the registers are not
> > contiguous. What does #OCD mean, Obsessive Compulsive Disorder over
> > header files maybe? :)
>
> Yes, that's what it means.
>
> /me likes straight lines. :)
Sure nothing wrong with that ;)
Regards,
Tony
next prev parent reply other threads:[~2016-11-24 14:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 1:27 [PATCH] mfd: cpcap: Add minimal support Tony Lindgren
2016-11-21 11:45 ` Lee Jones
2016-11-21 16:34 ` Rob Herring
2016-11-23 15:03 ` Tony Lindgren
2016-11-23 15:26 ` Tony Lindgren
2016-11-24 8:59 ` Lee Jones
2016-11-24 14:43 ` Tony Lindgren [this message]
[not found] ` <20161124085926.GV10134-Re9dqnLqz4GzQB+pC5nmwQ@public.gmane.org>
2016-11-29 15:20 ` Rob Herring
2016-11-29 15:48 ` Tony Lindgren
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=20161124144313.GN4082@atomide.com \
--to=tony@atomide.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michael.scott@linaro.org \
--cc=mpartap@gmx.net \
--cc=robh+dt@kernel.org \
--cc=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).