From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 18/41] arm: Introduce a generic way to use a device from acpi Date: Mon, 25 May 2015 12:00:45 +0200 Message-ID: <5562F2CD.4080702@citrix.com> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> <1431893048-5214-19-git-send-email-parth.dixit@linaro.org> <555DBF5E.8050303@citrix.com> <55618061.7080506@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Parth Dixit , Julien Grall Cc: keir@xen.org, Ian Campbell , andrew.cooper3@citrix.com, tim@xen.org, xen-devel , Stefano Stabellini , Jan Beulich , Christoffer Dall List-Id: xen-devel@lists.xenproject.org Hi Parth, On 25/05/2015 07:58, Parth Dixit wrote: > On 24 May 2015 at 13:10, Julien Grall wrote: >> On 24/05/2015 08:06, Parth Dixit wrote: >>> >>> > +struct acpi_device_desc { >>> > + /* Device name */ >>> > + const char *name; >>> > + /* Device class */ >>> > + enum device_class class; >>> > + /* type of device supported by the driver */ >>> > + const int class_type; >>> > + /* Device initialization */ >>> > + int (*init)(const void *data); >>> > +}; >>> >>> Given that the number of device will be minimal in Xen, I would prefer >>> to merge this structure into device_desc by adding the ACPI fields. >>> >>> It would avoid to duplicate everything for only 2 fields changes. >>> >>> From the drivers point of view it would look like >>> >>> DEVICE_START(....) >>> .dt_init = ... >>> #ifdef CONFIG_ACPI >>> .acpi_init = ... >>> #endif >>> DEVICE_END >>> >>> Or something like >>> >>> DEVICE_START(...) >>> DT_INIT(...) >>> ACPI_INIT(...) >>> DEVICE_END >>> >>> And ACPI_INIT will be a no-op when CONFIG_ACPI is not enabled. >>> >>> I think we agreed not to use common structure as it had some dt specific >>> entries and there was scope of confusion. >> >> >> I don't remember a such agreement. So far, only compatible and init are DT >> specific. The rest (most of the fields) are device agnostic. > Adding attachment of the previous discussion Thanks. Please a give link to the conversation (such as a mail archive) rather than an attachment. I had to look on the archive to find the context of this conversation... Also, that something useful to add in the notes of the patch (after ---). Regards, -- Julien Grall