Re: [PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-03-07 Thread Lee Jones
On Thu, 22 Feb 2018, Wenkai Du wrote:

> This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.
> 
> It is no longer needed to install Chrome EC GPE handler to have
> GPE enabled in suspend to idle path. It is found that with this
> handler installed, EC wake up doesn't work because default EC
> event handler that can wake up system is not getting called.
> 
> Signed-off-by: Wenkai Du 
> ---
>  drivers/mfd/Makefile   |   1 -
>  drivers/mfd/cros_ec.c  |  15 ++
>  drivers/mfd/cros_ec_acpi_gpe.c | 103 
> -
>  include/linux/mfd/cros_ec.h|  18 ---
>  4 files changed, 3 insertions(+), 134 deletions(-)
>  delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c

Applied, thanks.

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-03-07 Thread Lee Jones
On Thu, 22 Feb 2018, Wenkai Du wrote:

> This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.
> 
> It is no longer needed to install Chrome EC GPE handler to have
> GPE enabled in suspend to idle path. It is found that with this
> handler installed, EC wake up doesn't work because default EC
> event handler that can wake up system is not getting called.
> 
> Signed-off-by: Wenkai Du 
> ---
>  drivers/mfd/Makefile   |   1 -
>  drivers/mfd/cros_ec.c  |  15 ++
>  drivers/mfd/cros_ec_acpi_gpe.c | 103 
> -
>  include/linux/mfd/cros_ec.h|  18 ---
>  4 files changed, 3 insertions(+), 134 deletions(-)
>  delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c

Applied, thanks.

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-02-26 Thread Benson Leung
On Thu, Feb 22, 2018 at 01:30:52PM -0800, Wenkai Du wrote:
> This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.
> 
> It is no longer needed to install Chrome EC GPE handler to have
> GPE enabled in suspend to idle path. It is found that with this
> handler installed, EC wake up doesn't work because default EC
> event handler that can wake up system is not getting called.
> 
> Signed-off-by: Wenkai Du 

Acked-by: Benson Leung 

> ---
>  drivers/mfd/Makefile   |   1 -
>  drivers/mfd/cros_ec.c  |  15 ++
>  drivers/mfd/cros_ec_acpi_gpe.c | 103 
> -
>  include/linux/mfd/cros_ec.h|  18 ---
>  4 files changed, 3 insertions(+), 134 deletions(-)
>  delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c
> 
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index d9d2cf0d32ef..e9fd20dba18d 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -13,7 +13,6 @@ obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
>  obj-$(CONFIG_MFD_BCM590XX)   += bcm590xx.o
>  obj-$(CONFIG_MFD_BD9571MWV)  += bd9571mwv.o
>  cros_ec_core-objs:= cros_ec.o
> -cros_ec_core-$(CONFIG_ACPI)  += cros_ec_acpi_gpe.o
>  obj-$(CONFIG_MFD_CROS_EC)+= cros_ec_core.o
>  obj-$(CONFIG_MFD_CROS_EC_I2C)+= cros_ec_i2c.o
>  obj-$(CONFIG_MFD_CROS_EC_SPI)+= cros_ec_spi.o
> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
> index d61024141e2b..c221163d5b9e 100644
> --- a/drivers/mfd/cros_ec.c
> +++ b/drivers/mfd/cros_ec.c
> @@ -173,8 +173,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
>  
>   dev_info(dev, "Chrome EC device registered\n");
>  
> - cros_ec_acpi_install_gpe_handler(dev);
> -
>   return 0;
>  
>  fail_mfd:
> @@ -188,8 +186,6 @@ int cros_ec_remove(struct cros_ec_device *ec_dev)
>  {
>   mfd_remove_devices(ec_dev->dev);
>  
> - cros_ec_acpi_remove_gpe_handler();
> -
>   if (ec_dev->irq)
>   free_irq(ec_dev->irq, ec_dev);
>  
> @@ -204,14 +200,9 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
>   int ret;
>   u8 sleep_event;
>  
> - if (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) {
> - sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND;
> - } else {
> - sleep_event = HOST_SLEEP_EVENT_S0IX_SUSPEND;
> -
> - /* Clearing the GPE status for any pending event */
> - cros_ec_acpi_clear_gpe();
> - }
> + sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ?
> +   HOST_SLEEP_EVENT_S3_SUSPEND :
> +   HOST_SLEEP_EVENT_S0IX_SUSPEND;
>  
>   ret = cros_ec_sleep_event(ec_dev, sleep_event);
>   if (ret < 0)
> diff --git a/drivers/mfd/cros_ec_acpi_gpe.c b/drivers/mfd/cros_ec_acpi_gpe.c
> deleted file mode 100644
> index 56d305dab2d4..
> --- a/drivers/mfd/cros_ec_acpi_gpe.c
> +++ /dev/null
> @@ -1,103 +0,0 @@
> -/*
> - * ChromeOS EC multi-function device
> - *
> - * Copyright (C) 2017 Google, Inc
> - *
> - * This software is licensed under the terms of the GNU General Public
> - * License version 2, as published by the Free Software Foundation, and
> - * may be copied, distributed, and modified under those terms.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * The ChromeOS EC multi function device is used to mux all the requests
> - * to the EC device for its multiple features: keyboard controller,
> - * battery charging and regulator control, firmware update.
> - */
> -#include 
> -
> -#define ACPI_LID_DEVICE  "LID0"
> -
> -static int ec_wake_gpe = -EINVAL;
> -
> -/*
> - * This handler indicates to ACPI core that this GPE should stay enabled for
> - * lid to work in suspend to idle path.
> - */
> -static u32 cros_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
> -void *data)
> -{
> - return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
> -}
> -
> -/*
> - * Get ACPI GPE for LID0 device.
> - */
> -static int cros_ec_get_ec_wake_gpe(struct device *dev)
> -{
> - struct acpi_device *cros_acpi_dev;
> - struct acpi_device *adev;
> - acpi_handle handle;
> - acpi_status status;
> - int ret;
> -
> - cros_acpi_dev = ACPI_COMPANION(dev);
> -
> - if (!cros_acpi_dev || !cros_acpi_dev->parent ||
> -!cros_acpi_dev->parent->handle)
> - return -EINVAL;
> -
> - status = acpi_get_handle(cros_acpi_dev->parent->handle, ACPI_LID_DEVICE,
> -  );
> - if (ACPI_FAILURE(status))
> - return -EINVAL;
> -
> - ret = acpi_bus_get_device(handle, );
> - if (ret)
> - return ret;
> -
> - return adev->wakeup.gpe_number;
> -}
> -
> -int 

Re: [PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-02-26 Thread Benson Leung
On Thu, Feb 22, 2018 at 01:30:52PM -0800, Wenkai Du wrote:
> This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.
> 
> It is no longer needed to install Chrome EC GPE handler to have
> GPE enabled in suspend to idle path. It is found that with this
> handler installed, EC wake up doesn't work because default EC
> event handler that can wake up system is not getting called.
> 
> Signed-off-by: Wenkai Du 

Acked-by: Benson Leung 

> ---
>  drivers/mfd/Makefile   |   1 -
>  drivers/mfd/cros_ec.c  |  15 ++
>  drivers/mfd/cros_ec_acpi_gpe.c | 103 
> -
>  include/linux/mfd/cros_ec.h|  18 ---
>  4 files changed, 3 insertions(+), 134 deletions(-)
>  delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c
> 
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index d9d2cf0d32ef..e9fd20dba18d 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -13,7 +13,6 @@ obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
>  obj-$(CONFIG_MFD_BCM590XX)   += bcm590xx.o
>  obj-$(CONFIG_MFD_BD9571MWV)  += bd9571mwv.o
>  cros_ec_core-objs:= cros_ec.o
> -cros_ec_core-$(CONFIG_ACPI)  += cros_ec_acpi_gpe.o
>  obj-$(CONFIG_MFD_CROS_EC)+= cros_ec_core.o
>  obj-$(CONFIG_MFD_CROS_EC_I2C)+= cros_ec_i2c.o
>  obj-$(CONFIG_MFD_CROS_EC_SPI)+= cros_ec_spi.o
> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
> index d61024141e2b..c221163d5b9e 100644
> --- a/drivers/mfd/cros_ec.c
> +++ b/drivers/mfd/cros_ec.c
> @@ -173,8 +173,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
>  
>   dev_info(dev, "Chrome EC device registered\n");
>  
> - cros_ec_acpi_install_gpe_handler(dev);
> -
>   return 0;
>  
>  fail_mfd:
> @@ -188,8 +186,6 @@ int cros_ec_remove(struct cros_ec_device *ec_dev)
>  {
>   mfd_remove_devices(ec_dev->dev);
>  
> - cros_ec_acpi_remove_gpe_handler();
> -
>   if (ec_dev->irq)
>   free_irq(ec_dev->irq, ec_dev);
>  
> @@ -204,14 +200,9 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
>   int ret;
>   u8 sleep_event;
>  
> - if (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) {
> - sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND;
> - } else {
> - sleep_event = HOST_SLEEP_EVENT_S0IX_SUSPEND;
> -
> - /* Clearing the GPE status for any pending event */
> - cros_ec_acpi_clear_gpe();
> - }
> + sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ?
> +   HOST_SLEEP_EVENT_S3_SUSPEND :
> +   HOST_SLEEP_EVENT_S0IX_SUSPEND;
>  
>   ret = cros_ec_sleep_event(ec_dev, sleep_event);
>   if (ret < 0)
> diff --git a/drivers/mfd/cros_ec_acpi_gpe.c b/drivers/mfd/cros_ec_acpi_gpe.c
> deleted file mode 100644
> index 56d305dab2d4..
> --- a/drivers/mfd/cros_ec_acpi_gpe.c
> +++ /dev/null
> @@ -1,103 +0,0 @@
> -/*
> - * ChromeOS EC multi-function device
> - *
> - * Copyright (C) 2017 Google, Inc
> - *
> - * This software is licensed under the terms of the GNU General Public
> - * License version 2, as published by the Free Software Foundation, and
> - * may be copied, distributed, and modified under those terms.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * The ChromeOS EC multi function device is used to mux all the requests
> - * to the EC device for its multiple features: keyboard controller,
> - * battery charging and regulator control, firmware update.
> - */
> -#include 
> -
> -#define ACPI_LID_DEVICE  "LID0"
> -
> -static int ec_wake_gpe = -EINVAL;
> -
> -/*
> - * This handler indicates to ACPI core that this GPE should stay enabled for
> - * lid to work in suspend to idle path.
> - */
> -static u32 cros_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
> -void *data)
> -{
> - return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
> -}
> -
> -/*
> - * Get ACPI GPE for LID0 device.
> - */
> -static int cros_ec_get_ec_wake_gpe(struct device *dev)
> -{
> - struct acpi_device *cros_acpi_dev;
> - struct acpi_device *adev;
> - acpi_handle handle;
> - acpi_status status;
> - int ret;
> -
> - cros_acpi_dev = ACPI_COMPANION(dev);
> -
> - if (!cros_acpi_dev || !cros_acpi_dev->parent ||
> -!cros_acpi_dev->parent->handle)
> - return -EINVAL;
> -
> - status = acpi_get_handle(cros_acpi_dev->parent->handle, ACPI_LID_DEVICE,
> -  );
> - if (ACPI_FAILURE(status))
> - return -EINVAL;
> -
> - ret = acpi_bus_get_device(handle, );
> - if (ret)
> - return ret;
> -
> - return adev->wakeup.gpe_number;
> -}
> -
> -int cros_ec_acpi_install_gpe_handler(struct device 

[PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-02-22 Thread Wenkai Du
This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.

It is no longer needed to install Chrome EC GPE handler to have
GPE enabled in suspend to idle path. It is found that with this
handler installed, EC wake up doesn't work because default EC
event handler that can wake up system is not getting called.

Signed-off-by: Wenkai Du 
---
 drivers/mfd/Makefile   |   1 -
 drivers/mfd/cros_ec.c  |  15 ++
 drivers/mfd/cros_ec_acpi_gpe.c | 103 -
 include/linux/mfd/cros_ec.h|  18 ---
 4 files changed, 3 insertions(+), 134 deletions(-)
 delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c

diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index d9d2cf0d32ef..e9fd20dba18d 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_MFD_ASIC3)   += asic3.o tmio_core.o
 obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
 obj-$(CONFIG_MFD_BD9571MWV)+= bd9571mwv.o
 cros_ec_core-objs  := cros_ec.o
-cros_ec_core-$(CONFIG_ACPI)+= cros_ec_acpi_gpe.o
 obj-$(CONFIG_MFD_CROS_EC)  += cros_ec_core.o
 obj-$(CONFIG_MFD_CROS_EC_I2C)  += cros_ec_i2c.o
 obj-$(CONFIG_MFD_CROS_EC_SPI)  += cros_ec_spi.o
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index d61024141e2b..c221163d5b9e 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -173,8 +173,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
 
dev_info(dev, "Chrome EC device registered\n");
 
-   cros_ec_acpi_install_gpe_handler(dev);
-
return 0;
 
 fail_mfd:
@@ -188,8 +186,6 @@ int cros_ec_remove(struct cros_ec_device *ec_dev)
 {
mfd_remove_devices(ec_dev->dev);
 
-   cros_ec_acpi_remove_gpe_handler();
-
if (ec_dev->irq)
free_irq(ec_dev->irq, ec_dev);
 
@@ -204,14 +200,9 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
int ret;
u8 sleep_event;
 
-   if (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) {
-   sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND;
-   } else {
-   sleep_event = HOST_SLEEP_EVENT_S0IX_SUSPEND;
-
-   /* Clearing the GPE status for any pending event */
-   cros_ec_acpi_clear_gpe();
-   }
+   sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ?
+ HOST_SLEEP_EVENT_S3_SUSPEND :
+ HOST_SLEEP_EVENT_S0IX_SUSPEND;
 
ret = cros_ec_sleep_event(ec_dev, sleep_event);
if (ret < 0)
diff --git a/drivers/mfd/cros_ec_acpi_gpe.c b/drivers/mfd/cros_ec_acpi_gpe.c
deleted file mode 100644
index 56d305dab2d4..
--- a/drivers/mfd/cros_ec_acpi_gpe.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * ChromeOS EC multi-function device
- *
- * Copyright (C) 2017 Google, Inc
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * The ChromeOS EC multi function device is used to mux all the requests
- * to the EC device for its multiple features: keyboard controller,
- * battery charging and regulator control, firmware update.
- */
-#include 
-
-#define ACPI_LID_DEVICE  "LID0"
-
-static int ec_wake_gpe = -EINVAL;
-
-/*
- * This handler indicates to ACPI core that this GPE should stay enabled for
- * lid to work in suspend to idle path.
- */
-static u32 cros_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
-  void *data)
-{
-   return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
-}
-
-/*
- * Get ACPI GPE for LID0 device.
- */
-static int cros_ec_get_ec_wake_gpe(struct device *dev)
-{
-   struct acpi_device *cros_acpi_dev;
-   struct acpi_device *adev;
-   acpi_handle handle;
-   acpi_status status;
-   int ret;
-
-   cros_acpi_dev = ACPI_COMPANION(dev);
-
-   if (!cros_acpi_dev || !cros_acpi_dev->parent ||
-  !cros_acpi_dev->parent->handle)
-   return -EINVAL;
-
-   status = acpi_get_handle(cros_acpi_dev->parent->handle, ACPI_LID_DEVICE,
-);
-   if (ACPI_FAILURE(status))
-   return -EINVAL;
-
-   ret = acpi_bus_get_device(handle, );
-   if (ret)
-   return ret;
-
-   return adev->wakeup.gpe_number;
-}
-
-int cros_ec_acpi_install_gpe_handler(struct device *dev)
-{
-   acpi_status status;
-
-   ec_wake_gpe = cros_ec_get_ec_wake_gpe(dev);
-
-   if (ec_wake_gpe < 0)
-   return ec_wake_gpe;
-
-   status = acpi_install_gpe_handler(NULL, ec_wake_gpe,
- 

[PATCH] Revert "mfd: cros_ec: Add ACPI GPE handler for LID0 devices"

2018-02-22 Thread Wenkai Du
This reverts commit e04653a9dcf4d98defe2149c885382e5cc72082f.

It is no longer needed to install Chrome EC GPE handler to have
GPE enabled in suspend to idle path. It is found that with this
handler installed, EC wake up doesn't work because default EC
event handler that can wake up system is not getting called.

Signed-off-by: Wenkai Du 
---
 drivers/mfd/Makefile   |   1 -
 drivers/mfd/cros_ec.c  |  15 ++
 drivers/mfd/cros_ec_acpi_gpe.c | 103 -
 include/linux/mfd/cros_ec.h|  18 ---
 4 files changed, 3 insertions(+), 134 deletions(-)
 delete mode 100644 drivers/mfd/cros_ec_acpi_gpe.c

diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index d9d2cf0d32ef..e9fd20dba18d 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_MFD_ASIC3)   += asic3.o tmio_core.o
 obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
 obj-$(CONFIG_MFD_BD9571MWV)+= bd9571mwv.o
 cros_ec_core-objs  := cros_ec.o
-cros_ec_core-$(CONFIG_ACPI)+= cros_ec_acpi_gpe.o
 obj-$(CONFIG_MFD_CROS_EC)  += cros_ec_core.o
 obj-$(CONFIG_MFD_CROS_EC_I2C)  += cros_ec_i2c.o
 obj-$(CONFIG_MFD_CROS_EC_SPI)  += cros_ec_spi.o
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index d61024141e2b..c221163d5b9e 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -173,8 +173,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
 
dev_info(dev, "Chrome EC device registered\n");
 
-   cros_ec_acpi_install_gpe_handler(dev);
-
return 0;
 
 fail_mfd:
@@ -188,8 +186,6 @@ int cros_ec_remove(struct cros_ec_device *ec_dev)
 {
mfd_remove_devices(ec_dev->dev);
 
-   cros_ec_acpi_remove_gpe_handler();
-
if (ec_dev->irq)
free_irq(ec_dev->irq, ec_dev);
 
@@ -204,14 +200,9 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
int ret;
u8 sleep_event;
 
-   if (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) {
-   sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND;
-   } else {
-   sleep_event = HOST_SLEEP_EVENT_S0IX_SUSPEND;
-
-   /* Clearing the GPE status for any pending event */
-   cros_ec_acpi_clear_gpe();
-   }
+   sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ?
+ HOST_SLEEP_EVENT_S3_SUSPEND :
+ HOST_SLEEP_EVENT_S0IX_SUSPEND;
 
ret = cros_ec_sleep_event(ec_dev, sleep_event);
if (ret < 0)
diff --git a/drivers/mfd/cros_ec_acpi_gpe.c b/drivers/mfd/cros_ec_acpi_gpe.c
deleted file mode 100644
index 56d305dab2d4..
--- a/drivers/mfd/cros_ec_acpi_gpe.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * ChromeOS EC multi-function device
- *
- * Copyright (C) 2017 Google, Inc
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * The ChromeOS EC multi function device is used to mux all the requests
- * to the EC device for its multiple features: keyboard controller,
- * battery charging and regulator control, firmware update.
- */
-#include 
-
-#define ACPI_LID_DEVICE  "LID0"
-
-static int ec_wake_gpe = -EINVAL;
-
-/*
- * This handler indicates to ACPI core that this GPE should stay enabled for
- * lid to work in suspend to idle path.
- */
-static u32 cros_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
-  void *data)
-{
-   return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
-}
-
-/*
- * Get ACPI GPE for LID0 device.
- */
-static int cros_ec_get_ec_wake_gpe(struct device *dev)
-{
-   struct acpi_device *cros_acpi_dev;
-   struct acpi_device *adev;
-   acpi_handle handle;
-   acpi_status status;
-   int ret;
-
-   cros_acpi_dev = ACPI_COMPANION(dev);
-
-   if (!cros_acpi_dev || !cros_acpi_dev->parent ||
-  !cros_acpi_dev->parent->handle)
-   return -EINVAL;
-
-   status = acpi_get_handle(cros_acpi_dev->parent->handle, ACPI_LID_DEVICE,
-);
-   if (ACPI_FAILURE(status))
-   return -EINVAL;
-
-   ret = acpi_bus_get_device(handle, );
-   if (ret)
-   return ret;
-
-   return adev->wakeup.gpe_number;
-}
-
-int cros_ec_acpi_install_gpe_handler(struct device *dev)
-{
-   acpi_status status;
-
-   ec_wake_gpe = cros_ec_get_ec_wake_gpe(dev);
-
-   if (ec_wake_gpe < 0)
-   return ec_wake_gpe;
-
-   status = acpi_install_gpe_handler(NULL, ec_wake_gpe,
- ACPI_GPE_EDGE_TRIGGERED,