[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <542023C8.8080802@metafoo.de>
Date: Mon, 22 Sep 2014 15:27:36 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>
CC: wsa@...-dreams.de, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, mark.rutland@....com,
srinivas.pandruvada@...ux.intel.com
Subject: Re: [PATCH] i2c: Add generic support passing secondary devices addresses
On 09/22/2014 12:45 PM, Mika Westerberg wrote:
> On Fri, Sep 05, 2014 at 04:02:19PM +0200, Jean-Michel Hautbois wrote:
>> Some I2C devices have multiple addresses assigned, for example each address
>> corresponding to a different internal register map page of the device.
>> So far drivers which need support for this have handled this with a driver
>> specific and non-generic implementation, e.g. passing the additional address
>> via platform data.
>>
>> This patch provides a new helper function called i2c_new_secondary_device()
>> which is intended to provide a generic way to get the secondary address
>> as well as instantiate a struct i2c_client for the secondary address.
>>
>> The function expects a pointer to the primary i2c_client, a name
>> for the secondary address and an optional default address. The name is used
>> as a handle to specify which secondary address to get.
>>
>> The default address is used as a fallback in case no secondary address
>> was explicitly specified. In case no secondary address and no default
>> address were specified the function returns NULL.
>>
>> For now the function only supports look-up of the secondary address
>> from devicetree, but it can be extended in the future
>> to for example support board files and/or ACPI.
>>
>> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>
>
> Sorry, just noticed this one.
>
> Srinivas (CC'd) and I did similar patch series here:
>
> http://patchwork.ozlabs.org/patch/338342/
>
> We should probably collaborate on this one to get both DT and ACPI
> supported.
Yes. The idea was to keep the interface of the API generic so it can be used
by ACPI or other device topology description mechanisms as well.
But it looks as if the ACPI case is a bit more complex and we may need a
revision of the API. How for example in the ACPI case do you know which
address is which, when different parts of a chip are addressed using
different addresses?
- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists