All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev
@ 2015-06-22  6:27 Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-06-22  6:27 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, linux-kernel, Gwendal Grignou, Javier Martinez Canillas

Hello Olof,

This series contain a fix and a cleanup for the cros_ec_lpc driver and
a small fix for cros_ec_dev driver. Is a resend of a patch-set posted
posted more than one month ago [0] but most patches were already posted
as a part of a different series [1] that was split out so have been in
the list for months.

Can you please review them? The patches are really trivial.

Javier Martinez Canillas (3):
  platform/chrome: cros_ec_lpc - Use existing function to check EC
    result
  platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
  platform/chrome: cros_ec_dev - Add a platform device ID table

 drivers/platform/chrome/cros_ec_dev.c |  6 ++++++
 drivers/platform/chrome/cros_ec_lpc.c | 21 +++++++++------------
 2 files changed, 15 insertions(+), 12 deletions(-)

Best regards,
Javier

[0]: https://lkml.org/lkml/2015/5/20/184
[1]: https://lkml.org/lkml/2015/5/9/73

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* [RESEND PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result
  2015-06-22  6:27 [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
@ 2015-06-22  6:27 ` Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-06-22  6:27 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, linux-kernel, Gwendal Grignou, Javier Martinez Canillas

Commit 6db07b633658 ("mfd: cros_ec: Check result code from EC messages")
added a common cros_ec_check_result() function that can be used to check
the ec_msg->result for errors and warns about them.

Use the existing function instead of duplicating same check in the driver.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
---
 drivers/platform/chrome/cros_ec_lpc.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 8f9ac4d7bbd0..4fc4d6dfe67e 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -95,19 +95,9 @@ static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec,
 
 	/* Check result */
 	msg->result = inb(EC_LPC_ADDR_HOST_DATA);
-
-	switch (msg->result) {
-	case EC_RES_SUCCESS:
-		break;
-	case EC_RES_IN_PROGRESS:
-		ret = -EAGAIN;
-		dev_dbg(ec->dev, "command 0x%02x in progress\n",
-			msg->command);
+	ret = cros_ec_check_result(ec, msg);
+	if (ret)
 		goto done;
-	default:
-		dev_dbg(ec->dev, "command 0x%02x returned %d\n",
-			msg->command, msg->result);
-	}
 
 	/* Read back args */
 	args.flags = inb(EC_LPC_ADDR_HOST_ARGS);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* [RESEND PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
  2015-06-22  6:27 [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
@ 2015-06-22  6:27 ` Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
  2015-08-21 17:05 ` [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Olof Johansson
  3 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-06-22  6:27 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, linux-kernel, Gwendal Grignou, Javier Martinez Canillas

Since the verion of ACPI in Google BIOS does not enumerate the devices
in the LPC bus, the cros_ec_lpc driver resorts to DMI data to check if
a system is supported by the driver and autoload if built as a module.

Add information about the Google Pixel 2 to the DMI device table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 drivers/platform/chrome/cros_ec_lpc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 4fc4d6dfe67e..b4ca75b12b70 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -247,6 +247,13 @@ static struct dmi_system_id cros_ec_lpc_dmi_table[] __initdata = {
 		},
 	},
 	{
+		/* x86-samus, the Chromebook Pixel 2. */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Samus"),
+		},
+	},
+	{
 		/* x86-peppy, the Acer C720 Chromebook. */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* [RESEND PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table
  2015-06-22  6:27 [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
  2015-06-22  6:27 ` [RESEND PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
@ 2015-06-22  6:27 ` Javier Martinez Canillas
  2015-08-21 17:05 ` [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Olof Johansson
  3 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2015-06-22  6:27 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, linux-kernel, Gwendal Grignou, Javier Martinez Canillas

If the cros_ec_dev driver is built as a module, modalias information is
not filled so the module is not autoloaded. Add a platform device table
and use the MODULE_DEVICE_TABLE() macro to export that information in
the module so user-space can match the modalias uevent and autoload it.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 drivers/platform/chrome/cros_ec_dev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index 6090d0b2826f..4232c8136939 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -216,6 +216,12 @@ static int ec_device_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct platform_device_id cros_ec_id[] = {
+	{ "cros-ec-ctl", 0 },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_id);
+
 static struct platform_driver cros_ec_dev_driver = {
 	.driver = {
 		.name = "cros-ec-ctl",
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev
  2015-06-22  6:27 [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
                   ` (2 preceding siblings ...)
  2015-06-22  6:27 ` [RESEND PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
@ 2015-08-21 17:05 ` Olof Johansson
  3 siblings, 0 replies; 5+ messages in thread
From: Olof Johansson @ 2015-08-21 17:05 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: Doug Anderson, linux-kernel, Gwendal Grignou

On Mon, Jun 22, 2015 at 08:27:17AM +0200, Javier Martinez Canillas wrote:
> Hello Olof,
> 
> This series contain a fix and a cleanup for the cros_ec_lpc driver and
> a small fix for cros_ec_dev driver. Is a resend of a patch-set posted
> posted more than one month ago [0] but most patches were already posted
> as a part of a different series [1] that was split out so have been in
> the list for months.
> 
> Can you please review them? The patches are really trivial.

Apologies for the delay. Applied now.


-Olof


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

end of thread, other threads:[~2015-08-21 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22  6:27 [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
2015-06-22  6:27 ` [RESEND PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
2015-06-22  6:27 ` [RESEND PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
2015-06-22  6:27 ` [RESEND PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
2015-08-21 17:05 ` [RESEND PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Olof Johansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.