All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] ACPI / PMIC: xpower: Add support for the GPI1 regulator to the OpRegion handler
Date: Fri, 21 Apr 2017 12:30:46 +0300	[thread overview]
Message-ID: <1492767046.24567.113.camel@linux.intel.com> (raw)
In-Reply-To: <20170421073433.10897-2-hdegoede@redhat.com>

On Fri, 2017-04-21 at 09:34 +0200, Hans de Goede wrote:
> Some Bay Trail devices use a GPI1 regulator field (address 0x4c) in
> their 0x8d power OpRegion, add support for this.
> 
> This fixes AE_BAD_PARAMETER errors getting thrown on these devices and
> fixes these errors causing these devices to not suspend.

>  	int data;
>  
> +	/* GPIO1 LDO regulator needs special handling */
> +	if (reg == 0x92) {
> +		if (on)
> +			data = 0x03;
> +		else
> +			data = 0x04;
> +
> +		return regmap_update_bits(regmap, reg, 0x07, data);
> +	}

I would go with

if (reg == 0x92)
 return regmap_update_bits(regmap, reg, 0x07, on ? 0x03 : 0x04);

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2017-04-21  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21  7:34 [PATCH 1/2] ACPI / PMIC: xpower: Fix power_table addresses Hans de Goede
2017-04-21  7:34 ` [PATCH 2/2] ACPI / PMIC: xpower: Add support for the GPI1 regulator to the OpRegion handler Hans de Goede
2017-04-21  9:30   ` Andy Shevchenko [this message]
2017-04-21  9:32 ` [PATCH 1/2] ACPI / PMIC: xpower: Fix power_table addresses Andy Shevchenko

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=1492767046.24567.113.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.