Skip to content

Commit 79703e0

Browse files
committed
Merge tag 'tag-chrome-platform-for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
Pull chrome platform updates from Benson Leung: "CrOS EC: - Refactoring of some of cros_ec's headers: include/linux/mfd/cros_ec.h now removed, new cros_ec.h added to drivers/platform/chrome which contains shared operations of cros_ec transport drivers. - Response tracing in cros_ec_proto Wilco EC: - Fix unregistration order. - Fix keyboard backlight probing on systems without keyboard backlight - Minor cleanup (newlines in printks, COMPILE_TEST) Misc: - chromeos_laptop converted to use i2c_new_scanned_device instead of i2c_new_probed_device" * tag 'tag-chrome-platform-for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec: Match implementation with headers platform/chrome: cros_ec: Drop unaligned.h include platform/chrome: wilco_ec: Allow wilco to be compiled in COMPILE_TEST platform/chrome: wilco_ec: Add newlines to printks platform/chrome: wilco_ec: Fix unregistration order cros_ec: treewide: Remove 'include/linux/mfd/cros_ec.h' platform/chrome: cros_ec_ishtp: Make init_lock static platform/chrome: chromeos_laptop: Convert to i2c_new_scanned_device platform/chrome: cros_ec_lpc: Use platform_get_irq_optional() for optional IRQs platform/chrome: cros_ec_proto: Add response tracing platform/chrome: cros_ec_trace: Match trace commands with EC commands
2 parents eadc4e4 + 034dbec commit 79703e0

34 files changed

Lines changed: 190 additions & 97 deletions

‎drivers/iio/accel/cros_ec_accel_legacy.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <linux/iio/trigger_consumer.h>
1919
#include <linux/iio/triggered_buffer.h>
2020
#include <linux/kernel.h>
21-
#include <linux/mfd/cros_ec.h>
2221
#include <linux/module.h>
2322
#include <linux/slab.h>
2423
#include <linux/platform_data/cros_ec_commands.h>

‎drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/iio/trigger_consumer.h>
1717
#include <linux/iio/triggered_buffer.h>
1818
#include <linux/kernel.h>
19-
#include <linux/mfd/cros_ec.h>
2019
#include <linux/module.h>
2120
#include <linux/platform_data/cros_ec_commands.h>
2221
#include <linux/platform_data/cros_ec_proto.h>

‎drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <linux/iio/kfifo_buf.h>
1414
#include <linux/iio/trigger_consumer.h>
1515
#include <linux/kernel.h>
16-
#include <linux/mfd/cros_ec.h>
1716
#include <linux/module.h>
1817
#include <linux/slab.h>
1918
#include <linux/platform_data/cros_ec_commands.h>

‎drivers/iio/light/cros_ec_light_prox.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/iio/triggered_buffer.h>
1515
#include <linux/iio/trigger_consumer.h>
1616
#include <linux/kernel.h>
17-
#include <linux/mfd/cros_ec.h>
1817
#include <linux/module.h>
1918
#include <linux/platform_data/cros_ec_commands.h>
2019
#include <linux/platform_data/cros_ec_proto.h>

‎drivers/iio/pressure/cros_ec_baro.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/iio/triggered_buffer.h>
1515
#include <linux/iio/trigger_consumer.h>
1616
#include <linux/kernel.h>
17-
#include <linux/mfd/cros_ec.h>
1817
#include <linux/module.h>
1918
#include <linux/slab.h>
2019
#include <linux/platform_data/cros_ec_commands.h>

‎drivers/media/platform/cros-ec-cec/cros-ec-cec.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/cec.h>
1515
#include <linux/slab.h>
1616
#include <linux/interrupt.h>
17-
#include <linux/mfd/cros_ec.h>
1817
#include <linux/platform_data/cros_ec_commands.h>
1918
#include <linux/platform_data/cros_ec_proto.h>
2019
#include <media/cec.h>

‎drivers/mfd/cros_ec_dev.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include <linux/kconfig.h>
99
#include <linux/mfd/core.h>
10-
#include <linux/mfd/cros_ec.h>
1110
#include <linux/module.h>
1211
#include <linux/mod_devicetable.h>
1312
#include <linux/of_platform.h>

‎drivers/platform/chrome/chromeos_laptop.c‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct acpi_peripheral {
6363
struct chromeos_laptop {
6464
/*
6565
* Note that we can't mark this pointer as const because
66-
* i2c_new_probed_device() changes passed in I2C board info, so.
66+
* i2c_new_scanned_device() changes passed in I2C board info, so.
6767
*/
6868
struct i2c_peripheral *i2c_peripherals;
6969
unsigned int num_i2c_peripherals;
@@ -87,8 +87,8 @@ chromes_laptop_instantiate_i2c_device(struct i2c_adapter *adapter,
8787
* address we scan secondary addresses. In any case the client
8888
* structure gets assigned primary address.
8989
*/
90-
client = i2c_new_probed_device(adapter, info, addr_list, NULL);
91-
if (!client && alt_addr) {
90+
client = i2c_new_scanned_device(adapter, info, addr_list, NULL);
91+
if (IS_ERR(client) && alt_addr) {
9292
struct i2c_board_info dummy_info = {
9393
I2C_BOARD_INFO("dummy", info->addr),
9494
};
@@ -97,22 +97,24 @@ chromes_laptop_instantiate_i2c_device(struct i2c_adapter *adapter,
9797
};
9898
struct i2c_client *dummy;
9999

100-
dummy = i2c_new_probed_device(adapter, &dummy_info,
101-
alt_addr_list, NULL);
102-
if (dummy) {
100+
dummy = i2c_new_scanned_device(adapter, &dummy_info,
101+
alt_addr_list, NULL);
102+
if (!IS_ERR(dummy)) {
103103
pr_debug("%d-%02x is probed at %02x\n",
104104
adapter->nr, info->addr, dummy->addr);
105105
i2c_unregister_device(dummy);
106106
client = i2c_new_device(adapter, info);
107107
}
108108
}
109109

110-
if (!client)
110+
if (IS_ERR(client)) {
111+
client = NULL;
111112
pr_debug("failed to register device %d-%02x\n",
112113
adapter->nr, info->addr);
113-
else
114+
} else {
114115
pr_debug("added i2c device %d-%02x\n",
115116
adapter->nr, info->addr);
117+
}
116118

117119
return client;
118120
}

‎drivers/platform/chrome/cros_ec.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <linux/platform_data/cros_ec_commands.h>
1717
#include <linux/platform_data/cros_ec_proto.h>
1818
#include <linux/suspend.h>
19-
#include <asm/unaligned.h>
19+
20+
#include "cros_ec.h"
2021

2122
#define CROS_EC_DEV_EC_INDEX 0
2223
#define CROS_EC_DEV_PD_INDEX 1

‎drivers/platform/chrome/cros_ec.h‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* ChromeOS Embedded Controller core interface.
4+
*
5+
* Copyright (C) 2020 Google LLC
6+
*/
7+
8+
#ifndef __CROS_EC_H
9+
#define __CROS_EC_H
10+
11+
int cros_ec_register(struct cros_ec_device *ec_dev);
12+
int cros_ec_unregister(struct cros_ec_device *ec_dev);
13+
14+
int cros_ec_suspend(struct cros_ec_device *ec_dev);
15+
int cros_ec_resume(struct cros_ec_device *ec_dev);
16+
17+
bool cros_ec_handle_event(struct cros_ec_device *ec_dev);
18+
19+
#endif /* __CROS_EC_H */

0 commit comments

Comments
 (0)