Subject: [PATCH] [acpi ec] Add necessary EC defines and fields to header - Add EC device command defines - Add waitqueue and expect fields (for events) to struct acpi_ec Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/ec/driver.c | 3 +++ drivers/acpi/drivers/ec/ec.h | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) applies-to: b2c3bdf973508839e91dd2f14b37b70af40f9ce1 c5fa902d3f78ab18d50d9dde089eba3cd20b8ed8 diff --git a/drivers/acpi/drivers/ec/driver.c b/drivers/acpi/drivers/ec/driver.c index 7559ea7..d723916 100644 --- a/drivers/acpi/drivers/ec/driver.c +++ b/drivers/acpi/drivers/ec/driver.c @@ -43,6 +43,9 @@ static int ec_add(struct acpi_dev * ad) dev_set_drvdata(&ad->dev, ae); + ae->e_expect = 0; + init_waitqueue_head(&ae->e_waitq); + if (ec_poll_mode == EC_MODE_INTR) ec_intr_init(ae); else diff --git a/drivers/acpi/drivers/ec/ec.h b/drivers/acpi/drivers/ec/ec.h index 0834f50..aed63df 100644 --- a/drivers/acpi/drivers/ec/ec.h +++ b/drivers/acpi/drivers/ec/ec.h @@ -19,6 +19,22 @@ enum { EC_MODE_INTR = 0, }; +#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ +#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ +#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */ +#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ +#define ACPI_EC_EVENT_OBF 0x01 /* Output buffer full */ +#define ACPI_EC_EVENT_IBE 0x02 /* Input buffer empty */ +#define ACPI_EC_DELAY 50 /* Wait 50ms max. during EC ops */ +#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ +#define ACPI_EC_UDELAY 100 /* Poll @ 100us increments */ +#define ACPI_EC_UDELAY_COUNT 1000 /* Wait 10ms max. during EC ops */ +#define ACPI_EC_COMMAND_READ 0x80 +#define ACPI_EC_COMMAND_WRITE 0x81 +#define ACPI_EC_BURST_ENABLE 0x82 +#define ACPI_EC_BURST_DISABLE 0x83 +#define ACPI_EC_COMMAND_QUERY 0x84 + struct acpi_ec { struct acpi_dev * e_ad; @@ -29,6 +45,9 @@ struct acpi_ec { struct acpi_generic_address e_status; struct acpi_generic_address e_command; struct acpi_generic_address e_data; + + unsigned int e_expect; + wait_queue_head_t e_waitq; }; --- 0.99.9.GIT