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>,
	Wolfram Sang <wsa@the-dreams.de>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: linux-acpi@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 1/4] i2c: core: Allow getting ACPI info by index
Date: Sun, 26 Mar 2017 15:16:29 +0300	[thread overview]
Message-ID: <1490530589.21738.32.camel@linux.intel.com> (raw)
In-Reply-To: <20170325135550.22509-2-hdegoede@redhat.com>

On Sat, 2017-03-25 at 14:55 +0100, Hans de Goede wrote:
> Modify struct i2c_acpi_lookup and i2c_acpi_fill_info() to allow
> using them to get the info from a certain index in the ACPI-resource
> list rather then taking the first I2cSerialBus resource.
> 

Fine by me, though same question / note as per patch 3.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -No changes
> Changes in v2:
> -Increment number of found i2c busses for lookup-by-index after
> checking
>  the acpi-resource is an i2c bus rather then before
> ---
>  drivers/i2c/i2c-core.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index d2402bb..f7faa99 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -112,6 +112,8 @@ struct i2c_acpi_lookup {
>  	acpi_handle adapter_handle;
>  	acpi_handle device_handle;
>  	acpi_handle search_handle;
> +	int n;
> +	int index;
>  	u32 speed;
>  	u32 min_speed;
>  };
> @@ -130,6 +132,9 @@ static int i2c_acpi_fill_info(struct acpi_resource
> *ares, void *data)
>  	if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C)
>  		return 1;
>  
> +	if (lookup->index != -1 && lookup->n++ != lookup->index)
> +		return 1;
> +
>  	status = acpi_get_handle(lookup->device_handle,
>  				 sb->resource_source.string_ptr,
>  				 &lookup->adapter_handle);
> @@ -182,6 +187,7 @@ static int i2c_acpi_get_info(struct acpi_device
> *adev,
>  
>  	memset(&lookup, 0, sizeof(lookup));
>  	lookup.info = info;
> +	lookup.index = -1;
>  
>  	ret = i2c_acpi_do_lookup(adev, &lookup);
>  	if (ret)
> @@ -328,6 +334,7 @@ u32 i2c_acpi_find_bus_speed(struct device *dev)
>  	lookup.search_handle = ACPI_HANDLE(dev);
>  	lookup.min_speed = UINT_MAX;
>  	lookup.info = &dummy;
> +	lookup.index = -1;
>  
>  	status = acpi_walk_namespace(ACPI_TYPE_DEVICE,
> ACPI_ROOT_OBJECT,
>  				     I2C_ACPI_MAX_SCAN_DEPTH,

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

  reply	other threads:[~2017-03-26 12:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-25 13:55 [PATCH v3 0/4]: i2c-core improvements for complex ACPI-devices + cht-wc-fuel-gauge driver Hans de Goede
2017-03-25 13:55 ` [PATCH v3 1/4] i2c: core: Allow getting ACPI info by index Hans de Goede
2017-03-26 12:16   ` Andy Shevchenko [this message]
2017-03-25 13:55 ` [PATCH v3 2/4] i2c: core: Add new i2c_acpi_new_device helper function Hans de Goede
2017-03-25 13:55 ` [PATCH v3 3/4] i2c: core: Allow drivers to specify index for irq to get from of / ACPI Hans de Goede
2017-03-26 12:15   ` Andy Shevchenko
2017-03-26 15:07     ` Hans de Goede
2017-03-30 17:39     ` Hans de Goede
2017-03-30 20:39       ` Wolfram Sang
2017-03-31 10:03         ` Hans de Goede
2017-03-31 16:23           ` Wolfram Sang
2017-03-31 18:22             ` Hans de Goede
2017-03-31 19:54               ` Wolfram Sang
2017-03-31 20:13                 ` Andy Shevchenko
2017-03-31 20:59                 ` Hans de Goede
2017-03-31 21:19                   ` Wolfram Sang
2017-04-01 16:33               ` Dmitry Torokhov
2017-04-02 12:17                 ` Hans de Goede
2017-04-03 18:29                   ` Dmitry Torokhov
2017-03-25 13:55 ` [PATCH v3 4/4] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Hans de Goede
2017-03-25 18:42   ` Sebastian Reichel
2017-03-26  8:56     ` Hans de Goede

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=1490530589.21738.32.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=sre@kernel.org \
    --cc=tiwai@suse.de \
    --cc=wsa@the-dreams.de \
    /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.