[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170125100732.GD1754@localhost.localdomain>
Date: Wed, 25 Jan 2017 10:07:32 +0000
From: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To: Chanwoo Choi <cw00.choi@...sung.com>
CC: <myungjoo.ham@...sung.com>, <linux-kernel@...r.kernel.org>,
<patches@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH v2] extcon: arizona: Wait for any running HPDETs to
complete on jack removal
On Wed, Jan 25, 2017 at 06:48:06PM +0900, Chanwoo Choi wrote:
> Hi,
>
> I modified some minor issue and added my comment on below.
> After modified them by myself, Applied it.
>
> On 2017년 01월 25일 18:34, Charles Keepax wrote:
> > As the HPDET can't be aborted mid way through we should not allow any new
> > insertion to be processed until the previous HPDET has finished. It is very
> > unlikely but with low enough debounce settings you could start a new HPDET
> > before the old one has completed, which results in an erroneous reading.
> >
> > Signed-off-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
> > ---
> > +#define ARIZONA_HPDET_WAIT_COUNT 15
> > +#define ARIZONA_HPDET_WAIT_DELAY_MS 20
>
> Move these definitions on the top.
>
You can make this change if it is your preference, but generally
I feel this makes the code less clear. Previously you could
look at this bit of the code locally and clearly see what was
happening now the reader will need to spin all the way up to the
top of the file probably twice.
> > +
> > +static int arizona_hpdet_wait(struct arizona_extcon_info *info)
> > +{
> > + struct arizona *arizona = info->arizona;
> > + unsigned int val;
> > + int i, ret;
> > +
> > + for (i = 0; i < ARIZONA_HPDET_WAIT_COUNT; i++) {
> > + ret = regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_2,
> > + &val);
>
> Remove the space indentation. I prefer to use only tab indentation.
>
Again I don't mind, but my understanding was this was the
preferred style in the kernel and checkpatch --strict will warn
if you remove the spaces. It does also match the style of the
rest of the file itself.
Thanks,
Charles
Powered by blists - more mailing lists