Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753695AbdFVTjU (ORCPT ); Thu, 22 Jun 2017 15:39:20 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35168 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbdFVTjT (ORCPT ); Thu, 22 Jun 2017 15:39:19 -0400 Date: Thu, 22 Jun 2017 12:39:13 -0700 From: Benson Leung To: Enric Balletbo i Serra Cc: olof@lixom.net, bleung@chromium.org, linux-kernel@vger.kernel.org, lee.jones@linaro.org, Gwendal Grignou , Thierry Escande Subject: Re: [PATCH RESEND 07/13] platform/chrome: cros_ec_lpc: Add support for GOOG004 ACPI device Message-ID: <20170622193913.GB85041@decatoncale.mtv.corp.google.com> References: <20170516161319.13257-1-enric.balletbo@collabora.com> <20170516161319.13257-8-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DKU6Jbt7q3WqK7+M" Content-Disposition: inline In-Reply-To: <20170516161319.13257-8-enric.balletbo@collabora.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4634 Lines: 152 --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Enric and Thierry, On Tue, May 16, 2017 at 06:13:13PM +0200, Enric Balletbo i Serra wrote: > From: Gwendal Grignou >=20 > This patch removes platform_device_register() call and adds an ACPI > device id structure. The driver is now automatically probed for devices > with a GOOG0004 ACPI entry. >=20 > Signed-off-by: Gwendal Grignou > Signed-off-by: Thierry Escande Signed-off-by: Benson Leung Applied to what will become the immutable branch. > --- > drivers/platform/chrome/Kconfig | 2 +- > drivers/platform/chrome/cros_ec_lpc.c | 23 +++++++++-------------- > 2 files changed, 10 insertions(+), 15 deletions(-) >=20 > diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kc= onfig > index 6d80fb5..0ad6e29 100644 > --- a/drivers/platform/chrome/Kconfig > +++ b/drivers/platform/chrome/Kconfig > @@ -49,7 +49,7 @@ config CROS_EC_CHARDEV > =20 > config CROS_EC_LPC > tristate "ChromeOS Embedded Controller (LPC)" > - depends on MFD_CROS_EC && (X86 || COMPILE_TEST) > + depends on MFD_CROS_EC && ACPI && (X86 || COMPILE_TEST) > help > If you say Y here, you get support for talking to the ChromeOS= EC > over an LPC bus. This uses a simple byte-level protocol with a > diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chr= ome/cros_ec_lpc.c > index bc2dc62..90703521 100644 > --- a/drivers/platform/chrome/cros_ec_lpc.c > +++ b/drivers/platform/chrome/cros_ec_lpc.c > @@ -21,6 +21,7 @@ > * expensive. > */ > =20 > +#include > #include > #include > #include > @@ -32,6 +33,7 @@ > #include > =20 > #define DRV_NAME "cros_ec_lpcs" > +#define ACPI_DRV_NAME "GOOG0004" > =20 > static int ec_response_timed_out(void) > { > @@ -288,6 +290,12 @@ static int cros_ec_lpc_remove(struct platform_device= *pdev) > return 0; > } > =20 > +static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] =3D { > + { ACPI_DRV_NAME, 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, cros_ec_lpc_acpi_device_ids); > + > static struct dmi_system_id cros_ec_lpc_dmi_table[] __initdata =3D { > { > /* > @@ -328,15 +336,12 @@ MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table); > static struct platform_driver cros_ec_lpc_driver =3D { > .driver =3D { > .name =3D DRV_NAME, > + .acpi_match_table =3D cros_ec_lpc_acpi_device_ids, > }, > .probe =3D cros_ec_lpc_probe, > .remove =3D cros_ec_lpc_remove, > }; > =20 > -static struct platform_device cros_ec_lpc_device =3D { > - .name =3D DRV_NAME > -}; > - > static int __init cros_ec_lpc_init(void) > { > int ret; > @@ -356,21 +361,11 @@ static int __init cros_ec_lpc_init(void) > return ret; > } > =20 > - /* Register the device, and it'll get hooked up automatically */ > - ret =3D platform_device_register(&cros_ec_lpc_device); > - if (ret) { > - pr_err(DRV_NAME ": can't register device: %d\n", ret); > - platform_driver_unregister(&cros_ec_lpc_driver); > - cros_ec_lpc_reg_destroy(); > - return ret; > - } > - > return 0; > } > =20 > static void __exit cros_ec_lpc_exit(void) > { > - platform_device_unregister(&cros_ec_lpc_device); > platform_driver_unregister(&cros_ec_lpc_driver); > cros_ec_lpc_reg_destroy(); > } > --=20 > 2.9.3 >=20 --=20 Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. bleung@google.com Chromium OS Project bleung@chromium.org --DKU6Jbt7q3WqK7+M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJZTBzhAAoJEB8J9XsKL+ZYTswP/17TbB41cf7H+mw016bSaLLq sfG44ACJNXIB8N6On/J8YtQaVX14VmODe5NJ2FFzi3JtrA43MWaD/CdEmcW3QIdb mMCi4GoPs9MzLEb9XZ33dcAjn02wr45GTBdsEjKNPnfhiDdLaRGdvXm/rQvdvevb Pi3xoioe8q/7VCXjdxtCNQQXjrLv/aIkzU8rLZ5N9bUUPiu2ioScyRV/+8ggdl/5 SD0/xHfov0Q2GgCkgU5baRsXrGdPfkZ2RAdJN+J7ecZycp4Z4lDx2ERxRAjUEzX1 /wgjdN+NEngi4pufubUe7rEwoYsg5nzbxXNc7licx3ucBu5IiVWC+0YelkPO/O2u iTtUt+/F7ctRShrZ0SH2UIaThYD+6+crCQt2bXGDzwO0R3E8ijteo6DwU1RlhHL5 KXy6zH0kUjkz/Ck7NGUVefMzGVOWKq+hWW3RMTl9M0p/Er3GYIJsrJvcxLFsOBdl BCiaEQ2lJaMrXTqiGvnFY8xRzo6BLao17gBZRVh4O8LydclqTa43/aQIwecNr4e4 fHkE1mGjhlTw1Baut0/k7pw39dIrGNTa6hgADv0ms5fsZqrEmbnbm2yLks18a1Ei vt7ZCD6Tul0LN4I2+aMUmRnfduFMlE1zaaPHizFXSZINkccOx4iPeF7a1jd+AvMH oSwMDaRztcFlW+hvTC0E =X+D/ -----END PGP SIGNATURE----- --DKU6Jbt7q3WqK7+M--