linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev
@ 2015-05-20  8:39 Javier Martinez Canillas
  2015-05-20  8:39 ` [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; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-05-20  8:39 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel,
	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. The first two patches were posted
as a part of the "mfd: cros_ec: Add multi EC and proto v3 support" [0]
series but I split it since there isn't really a dependency and you can
pick these through your chrome-platform tree.

The last patch was posted a week ago [1] but I'm resending here to make
it easier for you to pick all the pending patches.

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/9/73
[1]: https://lkml.org/lkml/2015/5/13/1023


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

* [PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result
  2015-05-20  8:39 [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
@ 2015-05-20  8:39 ` Javier Martinez Canillas
  2015-05-20  8:39 ` [PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-05-20  8:39 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel,
	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


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

* [PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
  2015-05-20  8:39 [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  2015-05-20  8:39 ` [PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
@ 2015-05-20  8:39 ` Javier Martinez Canillas
  2015-05-20  8:39 ` [PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
  2015-05-28  9:10 ` [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  3 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-05-20  8:39 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel,
	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


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

* [PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table
  2015-05-20  8:39 [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  2015-05-20  8:39 ` [PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
  2015-05-20  8:39 ` [PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
@ 2015-05-20  8:39 ` Javier Martinez Canillas
  2015-05-28  9:10 ` [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
  3 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-05-20  8:39 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel,
	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


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

* Re: [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev
  2015-05-20  8:39 [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
                   ` (2 preceding siblings ...)
  2015-05-20  8:39 ` [PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
@ 2015-05-28  9:10 ` Javier Martinez Canillas
  2015-06-16  6:47   ` Javier Martinez Canillas
  3 siblings, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-05-28  9:10 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel

Hello Olof,

On 05/20/2015 10:39 AM, Javier Martinez Canillas wrote:
>
> 
> This series contain a fix and a cleanup for the cros_ec_lpc driver and
> a small fix for cros_ec_dev driver. The first two patches were posted
> as a part of the "mfd: cros_ec: Add multi EC and proto v3 support" [0]
> series but I split it since there isn't really a dependency and you can
> pick these through your chrome-platform tree.
> 
> The last patch was posted a week ago [1] but I'm resending here to make
> it easier for you to pick all the pending patches.
> 
> 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/9/73
> [1]: https://lkml.org/lkml/2015/5/13/1023
> 

Any comments about this series?

Best regards,
Javier

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

* Re: [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev
  2015-05-28  9:10 ` [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
@ 2015-06-16  6:47   ` Javier Martinez Canillas
  0 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-06-16  6:47 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Doug Anderson, Gwendal Grignou, Lee Jones, linux-kernel

On 05/28/2015 11:10 AM, Javier Martinez Canillas wrote:
> Hello Olof,
> 
> On 05/20/2015 10:39 AM, Javier Martinez Canillas wrote:
>>
>> 
>> This series contain a fix and a cleanup for the cros_ec_lpc driver and
>> a small fix for cros_ec_dev driver. The first two patches were posted
>> as a part of the "mfd: cros_ec: Add multi EC and proto v3 support" [0]
>> series but I split it since there isn't really a dependency and you can
>> pick these through your chrome-platform tree.
>> 
>> The last patch was posted a week ago [1] but I'm resending here to make
>> it easier for you to pick all the pending patches.
>> 
>> 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/9/73
>> [1]: https://lkml.org/lkml/2015/5/13/1023
>> 
> 
> Any comments about this series?
> 

Gentle ping.

Best regards,
Javier


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

end of thread, other threads:[~2015-06-16  6:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  8:39 [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
2015-05-20  8:39 ` [PATCH 1/3] platform/chrome: cros_ec_lpc - Use existing function to check EC result Javier Martinez Canillas
2015-05-20  8:39 ` [PATCH 2/3] platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 Javier Martinez Canillas
2015-05-20  8:39 ` [PATCH 3/3] platform/chrome: cros_ec_dev - Add a platform device ID table Javier Martinez Canillas
2015-05-28  9:10 ` [PATCH 0/3] platform/chrome: Changes for cros_ec_lpc and cros_ec_dev Javier Martinez Canillas
2015-06-16  6:47   ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).