public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI: EC: Use default setup handler
@ 2008-03-24 20:22 Alexey Starikovskiy
  2008-03-24 20:22 ` [PATCH 2/2] Don't delete boot ec Alexey Starikovskiy
  2008-03-25  0:52 ` [PATCH 1/2] ACPI: EC: Use default setup handler Len Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Starikovskiy @ 2008-03-24 20:22 UTC (permalink / raw)
  To: LenBrown; +Cc: Linux-acpi

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---

 drivers/acpi/ec.c |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index f0e8216..167af37 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -533,20 +533,6 @@ static void do_ec_poll(struct work_struct *work)
    -------------------------------------------------------------------------- */
 
 static acpi_status
-acpi_ec_space_setup(acpi_handle region_handle,
-		    u32 function, void *handler_context, void **return_context)
-{
-	/*
-	 * The EC object is in the handler context and is needed
-	 * when calling the acpi_ec_space_handler.
-	 */
-	*return_context = (function != ACPI_REGION_DEACTIVATE) ?
-	    handler_context : NULL;
-
-	return AE_OK;
-}
-
-static acpi_status
 acpi_ec_space_handler(u32 function, acpi_physical_address address,
 		      u32 bits, acpi_integer *value,
 		      void *handler_context, void *region_context)
@@ -858,7 +844,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
 	status = acpi_install_address_space_handler(ec->handle,
 						    ACPI_ADR_SPACE_EC,
 						    &acpi_ec_space_handler,
-						    &acpi_ec_space_setup, ec);
+						    NULL, ec);
 	if (ACPI_FAILURE(status)) {
 		acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
 		return -ENODEV;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Don't delete boot ec
  2008-03-24 20:22 [PATCH 1/2] ACPI: EC: Use default setup handler Alexey Starikovskiy
@ 2008-03-24 20:22 ` Alexey Starikovskiy
  2008-03-25  0:52 ` [PATCH 1/2] ACPI: EC: Use default setup handler Len Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Starikovskiy @ 2008-03-24 20:22 UTC (permalink / raw)
  To: LenBrown; +Cc: Linux-acpi

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---

 drivers/acpi/ec.c |   43 +++++++++++++++++++------------------------
 1 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 167af37..3d93621 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -708,9 +708,6 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
 	status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
 	if (ACPI_FAILURE(status))
 		return status;
-	/* Find and register all query methods */
-	acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
-			    acpi_ec_register_query_methods, ec, NULL);
 	/* Use the global lock for all EC transactions? */
 	acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
 	ec->handle = handle;
@@ -745,31 +742,28 @@ static int acpi_ec_add(struct acpi_device *device)
 	strcpy(acpi_device_class(device), ACPI_EC_CLASS);
 
 	/* Check for boot EC */
-	if (boot_ec) {
-		if (boot_ec->handle == device->handle) {
-			/* Pre-loaded EC from DSDT, just move pointer */
-			ec = boot_ec;
-			boot_ec = NULL;
-			goto end;
-		} else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
-			/* ECDT-based EC, time to shut it down */
-			ec_remove_handlers(boot_ec);
-			kfree(boot_ec);
-			first_ec = boot_ec = NULL;
+	if (boot_ec &&
+	    (boot_ec->handle == device->handle ||
+	     boot_ec->handle == ACPI_ROOT_OBJECT)) {
+		ec = boot_ec;
+		boot_ec = NULL;
+	} else {
+		ec = make_acpi_ec();
+		if (!ec)
+			return -ENOMEM;
+		if (ec_parse_device(device->handle, 0, ec, NULL) !=
+		    AE_CTRL_TERMINATE) {
+			kfree(ec);
+			return -EINVAL;
 		}
 	}
 
-	ec = make_acpi_ec();
-	if (!ec)
-		return -ENOMEM;
-
-	if (ec_parse_device(device->handle, 0, ec, NULL) !=
-	    AE_CTRL_TERMINATE) {
-		kfree(ec);
-		return -EINVAL;
-	}
 	ec->handle = device->handle;
-      end:
+
+	/* Find and register all query methods */
+	acpi_walk_namespace(ACPI_TYPE_METHOD, ec->handle, 1,
+			    acpi_ec_register_query_methods, ec, NULL);
+
 	if (!first_ec)
 		first_ec = ec;
 	acpi_driver_data(device) = ec;
@@ -924,6 +918,7 @@ int __init acpi_ec_ecdt_probe(void)
 		boot_ec->data_addr = ecdt_ptr->data.address;
 		boot_ec->gpe = ecdt_ptr->gpe;
 		boot_ec->handle = ACPI_ROOT_OBJECT;
+		acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
 	} else {
 		/* This workaround is needed only on some broken machines,
 		 * which require early EC, but fail to provide ECDT */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ACPI: EC: Use default setup handler
  2008-03-24 20:22 [PATCH 1/2] ACPI: EC: Use default setup handler Alexey Starikovskiy
  2008-03-24 20:22 ` [PATCH 2/2] Don't delete boot ec Alexey Starikovskiy
@ 2008-03-25  0:52 ` Len Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Len Brown @ 2008-03-25  0:52 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Linux-acpi

1-2 addded to acpi-test

thanks,
-Len

On Monday 24 March 2008, Alexey Starikovskiy wrote:
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> ---
> 
>  drivers/acpi/ec.c |   16 +---------------
>  1 files changed, 1 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index f0e8216..167af37 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -533,20 +533,6 @@ static void do_ec_poll(struct work_struct *work)
>     -------------------------------------------------------------------------- */
>  
>  static acpi_status
> -acpi_ec_space_setup(acpi_handle region_handle,
> -		    u32 function, void *handler_context, void **return_context)
> -{
> -	/*
> -	 * The EC object is in the handler context and is needed
> -	 * when calling the acpi_ec_space_handler.
> -	 */
> -	*return_context = (function != ACPI_REGION_DEACTIVATE) ?
> -	    handler_context : NULL;
> -
> -	return AE_OK;
> -}
> -
> -static acpi_status
>  acpi_ec_space_handler(u32 function, acpi_physical_address address,
>  		      u32 bits, acpi_integer *value,
>  		      void *handler_context, void *region_context)
> @@ -858,7 +844,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
>  	status = acpi_install_address_space_handler(ec->handle,
>  						    ACPI_ADR_SPACE_EC,
>  						    &acpi_ec_space_handler,
> -						    &acpi_ec_space_setup, ec);
> +						    NULL, ec);
>  	if (ACPI_FAILURE(status)) {
>  		acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
>  		return -ENODEV;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-25  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-24 20:22 [PATCH 1/2] ACPI: EC: Use default setup handler Alexey Starikovskiy
2008-03-24 20:22 ` [PATCH 2/2] Don't delete boot ec Alexey Starikovskiy
2008-03-25  0:52 ` [PATCH 1/2] ACPI: EC: Use default setup handler Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox