From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: myungjoo.ham@samsung.com, patches@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] extcon: arizona: Update manual headphone detection calculation
Date: Fri, 30 May 2014 10:42:43 +0100 [thread overview]
Message-ID: <20140530094243.GB11951@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5387DE87.5090009@samsung.com>
On Fri, May 30, 2014 at 10:27:35AM +0900, Chanwoo Choi wrote:
> Hi Charles,
>
> On 05/30/2014 12:27 AM, Charles Keepax wrote:
> > The higher levels of impedance have a higher minimum value than the
> > first level. As the same value was used for all levels, higher impedances
> > were reported with a very low level of accuracy. This patch applies the
> > approriate lower threshold for each level.
> >
> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> > ---
> > drivers/extcon/extcon-arizona.c | 13 ++++++++-----
> > 1 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> > index f2c36b1..c1c8647 100644
> > --- a/drivers/extcon/extcon-arizona.c
> > +++ b/drivers/extcon/extcon-arizona.c
> > @@ -329,12 +329,13 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
> > }
> >
> > static struct {
> > + unsigned int threshold;
> > unsigned int factor_a;
> > unsigned int factor_b;
> > } arizona_hpdet_b_ranges[] = {
> > - { 5528, 362464 },
> > - { 11084, 6186851 },
> > - { 11065, 65460395 },
> > + { 100, 5528, 362464 },
> > + { 169, 11084, 6186851 },
> > + { 169, 11065, 65460395 },
>
> If you possible, I want to know the 'unit' of the variable(factor_a, factor_b).
I am not sure there are really especially sensible units to give.
>
> > };
> >
> > static struct {
> > @@ -391,7 +392,8 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
> > >> ARIZONA_HP_IMPEDANCE_RANGE_SHIFT;
> >
> > if (range < ARRAY_SIZE(arizona_hpdet_b_ranges) - 1 &&
> > - (val < 100 || val >= 0x3fb)) {
> > + (val < arizona_hpdet_b_ranges[range].threshold ||
> > + val >= 0x3fb)) {
>
> I don't understand the meaning of 0x3fb hex value.
> I prefer to define constant variable for readability.
Thats fine I can add a define as part of this patch.
Thanks,
Charles
next prev parent reply other threads:[~2014-05-30 9:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 15:27 [PATCH 1/4] extcon: arizona: Remove duplicate set of input parent device Charles Keepax
2014-05-29 15:27 ` [PATCH 2/4] extcon: arizona: Use extcon cable API Charles Keepax
2014-05-30 1:25 ` Chanwoo Choi
2014-05-29 15:27 ` [PATCH 3/4] extcon: arizona: Update manual headphone detection calculation Charles Keepax
2014-05-30 1:27 ` Chanwoo Choi
2014-05-30 9:42 ` Charles Keepax [this message]
2014-05-29 15:27 ` [PATCH 4/4] extcon: arizona: Correct typo to disable regulation for button detection Charles Keepax
2014-05-30 1:31 ` Chanwoo Choi
2014-05-30 1:18 ` [PATCH 1/4] extcon: arizona: Remove duplicate set of input parent device Chanwoo Choi
2014-05-30 1:25 ` Chanwoo Choi
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=20140530094243.GB11951@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.wolfsonmicro.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