linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH] ACPI / PMIC: xpower: Do pinswitch magic when reading GPADC
Date: Sun, 9 Jul 2017 20:16:11 +0200	[thread overview]
Message-ID: <fc38898b-c612-876e-6a75-b84bc8dc9123@redhat.com> (raw)
In-Reply-To: <1499522283.22624.309.camel@linux.intel.com>

Hi,

On 08-07-17 15:58, Andy Shevchenko wrote:
> On Sat, 2017-07-08 at 15:40 +0200, Hans de Goede wrote:
>> Testing has shown that the TS-pin's bias-current needs to be disabled
>> when reading the GPIO0 pin in GPADC mode.
>>
>> It seems that there is only 1 bias current source and to be able to
>> use it
>> for the GPIO0 pin in GPADC mode it must be temporarily turned off for
>> the
>> TS pin, but the datasheet does not mention this.
>>
>> This commit adds the necessary writes to turn the TS pin BIAS current
>> off before and back on after reading the GPADC. This fixes the GPADC
>> always returning a reading of 0.
>>
>>
> 
>> +	/* After switching to the GPADC pin give things some time to
>> settle */
>> +	usleep_range(6000, 10000);
> 
> msleep(6); ?

That will make checkpatch unhappy and may sleep for as long as 20ms, also see:
Documentation/timers/timers-howto.txt which advices against using msleep for
short sleeps.

Regards,

Hans


  reply	other threads:[~2017-07-09 18:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08 13:40 [PATCH] ACPI / PMIC: xpower: Do pinswitch magic when reading GPADC Hans de Goede
2017-07-08 13:58 ` Andy Shevchenko
2017-07-09 18:16   ` Hans de Goede [this message]
2017-07-21 21:12   ` Rafael J. Wysocki
2017-07-23 12:28     ` Andy Shevchenko
2017-07-26 18:45       ` Rafael J. Wysocki

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=fc38898b-c612-876e-6a75-b84bc8dc9123@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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).