[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 18/41] arm: Introduce a generic way to use a device from acpi
- To: Parth Dixit <parth.dixit@xxxxxxxxxx>, Julien Grall <julien.grall@xxxxxxxxxx>
- From: Julien Grall <julien.grall@xxxxxxxxxx>
- Date: Sun, 24 May 2015 08:40:17 +0100
- Cc: keir@xxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>, andrew.cooper3@xxxxxxxxxx, tim@xxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Christoffer Dall <christoffer.dall@xxxxxxxxxx>
- Delivery-date: Sun, 24 May 2015 07:40:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
Hi Parth,
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.
If you prefix the DT callback by dt_ (or smth else), there would be
confusion and a smaller code.
Anyway, I will let Ian and Stefano gives their opinion on it.
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|