Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1603491
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 11/15] i2c: core: Allow getting ACPI info by index |
| Date | 2017-03-17 18:40 +0100 |
| Message-ID | <tm415-1ya-37@gated-at.bofh.it> (permalink) |
| References | <tlWPT-4pa-5@gated-at.bofh.it> <tlWPU-4pa-33@gated-at.bofh.it> |
| Organization | Intel Finland Oy |
On Fri, 2017-03-17 at 10: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.
>
+Cc: Jarkko (our main I2C guy)
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> 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..32b58fb 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;
> };
> @@ -123,6 +125,9 @@ static int i2c_acpi_fill_info(struct acpi_resource
> *ares, void *data)
> struct acpi_resource_i2c_serialbus *sb;
> acpi_status status;
>
> + if (lookup->index != -1 && lookup->n++ != lookup->index)
> + return 1;
> +
> if (info->addr || ares->type !=
> ACPI_RESOURCE_TYPE_SERIAL_BUS)
> return 1;
>
> @@ -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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/15] Add Intel Cherry Trail Whiskey Cove PMIC support Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
[PATCH 02/15] ACPI / PMIC: Add opregion driver for Intel CHT Whiskey Cove PMIC Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
[PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 19:00 +0100
Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-22 18:10 +0100
Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:10 +0100
[PATCH 13/15] i2c: core: Allow drivers to specify index for irq to get from of / ACPI Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 13/15] i2c: core: Allow drivers to specify index for irq to get from of / ACPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:50 +0100
Re: [PATCH 13/15] i2c: core: Allow drivers to specify index for irq to get from of / ACPI kbuild test robot <lkp@intel.com> - 2017-03-20 10:40 +0100
[PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:20 +0100
Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Lee Jones <lee.jones@linaro.org> - 2017-03-20 11:50 +0100
Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-20 14:00 +0100
[PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS controller driver Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS controller driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 19:30 +0100
Re: [PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS controller driver Hans de Goede <hdegoede@redhat.com> - 2017-03-23 15:00 +0100
[PATCH 11/15] i2c: core: Allow getting ACPI info by index Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 11/15] i2c: core: Allow getting ACPI info by index Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:40 +0100
[PATCH 10/15] power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:40 +0100
Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost Hans de Goede <hdegoede@redhat.com> - 2017-03-20 23:40 +0100
Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:00 +0100
[PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper function Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
Re: [PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper function Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:50 +0100
Re: [PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper function Hans de Goede <hdegoede@redhat.com> - 2017-03-22 17:00 +0100
[PATCH 04/15] power: supply: bq24190_charger: Add no_register_reset pdata flag Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
Re: [PATCH 04/15] power: supply: bq24190_charger: Add no_register_reset pdata flag Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:30 +0100
[PATCH 07/15] power: supply: bq24190_charger: Add support for bq24192[i] Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
[PATCH 05/15] power: supply: bq24190_charger: Limit charging voltage to 4.3V Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
[PATCH 09/15] power: supply: bq24190_charger: Add voltage_max_design prop to battery Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
Re: [PATCH 09/15] power: supply: bq24190_charger: Add voltage_max_design prop to battery Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:20 +0100
[PATCH 06/15] power: supply: bq24190_charger: Use i2c-core irq-mapping code Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
Re: [PATCH 06/15] power: supply: bq24190_charger: Use i2c-core irq-mapping code Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:30 +0100
Re: [PATCH 06/15] power: supply: bq24190_charger: Use i2c-core irq-mapping code Sebastian Reichel <sre@kernel.org> - 2017-03-20 05:50 +0100
[PATCH 08/15] power: supply: bq24190_charger: Add support for external fuel gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
csiph-web