Skip to content

Commit 0ec5a38

Browse files
committed
Merge tag 'tag-chrome-platform-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
Pull chrome platform updates from Tzung-Bi Shih: "New drivers - Driver for ChromeOS human presence sensor Cleanups: - Add missing property in dt-binding example. - Update the availability of properties in dt-binding. - Separate dt-binding for ChromeOS fingerprint sensor. Improvements: - Set PROBE_PREFER_ASYNCHRONOUS for some drivers for shortening boot time. Fixes: - Fix an use-after-free in cros_ec_typec. And minor fixes and cleanups" * tag 'tag-chrome-platform-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_typec: zero out stale pointers platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init() platform/chrome: cros_ec: Convert to i2c's .probe_new() platform/chrome: cros_ec_lpc: Force synchronous probe platform/chrome: cros_ec_spi: Set PROBE_PREFER_ASYNCHRONOUS platform/chrome: cros_ec_lightbar: Set PROBE_PREFER_ASYNCHRONOUS platform/chrome: cros_ec_debugfs: Set PROBE_PREFER_ASYNCHRONOUS platform/chrome: cros_ec_lpc: Mark PROBE_PREFER_ASYNCHRONOUS platform/chrome: cros_ec_lpc: Move mec_init to device probe platform/chrome: Use kstrtobool() instead of strtobool() platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() dt-bindings: cros-ec: Add ChromeOS fingerprint binding dt-bindings: cros-ec: Reorganize and enforce property availability platform/chrome: cros_hps_i2c: make remove callback return void platform/chrome: add a driver for HPS
2 parents 7a76117 + 9a8aadc commit 0ec5a38

22 files changed

Lines changed: 298 additions & 42 deletions

Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ examples:
4848
cros_ec: ec@0 {
4949
compatible = "google,cros-ec-spi";
5050
reg = <0>;
51+
interrupts = <35 0>;
5152
5253
typec {
5354
compatible = "google,cros-ec-typec";

Documentation/devicetree/bindings/chrome/google,cros-kbd-led-backlight.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ examples:
2727
cros_ec: ec@0 {
2828
compatible = "google,cros-ec-spi";
2929
reg = <0>;
30+
interrupts = <15 0>;
3031
3132
kbd-led-backlight {
3233
compatible = "google,cros-kbd-led-backlight";

Documentation/devicetree/bindings/extcon/extcon-usbc-cros-ec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ examples:
4040
cros-ec@0 {
4141
compatible = "google,cros-ec-spi";
4242
reg = <0>;
43+
interrupts = <44 0>;
4344
4445
usbc_extcon0: extcon0 {
4546
compatible = "google,extcon-usbc-cros-ec";

Documentation/devicetree/bindings/i2c/google,cros-ec-i2c-tunnel.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ examples:
4747
compatible = "google,cros-ec-spi";
4848
reg = <0>;
4949
spi-max-frequency = <5000000>;
50+
interrupts = <99 0>;
5051
5152
i2c-tunnel {
5253
compatible = "google,cros-ec-i2c-tunnel";

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@ properties:
2020
compatible:
2121
oneOf:
2222
- description:
23-
For implementations of the EC is connected through I2C.
23+
For implementations of the EC connected through I2C.
2424
const: google,cros-ec-i2c
2525
- description:
26-
For implementations of the EC is connected through SPI.
26+
For implementations of the EC connected through SPI.
2727
const: google,cros-ec-spi
2828
- description:
29-
For implementations of the EC is connected through RPMSG.
29+
For implementations of the FPMCU connected through SPI.
30+
items:
31+
- const: google,cros-ec-fp
32+
- const: google,cros-ec-spi
33+
- description:
34+
For implementations of the EC connected through RPMSG.
3035
const: google,cros-ec-rpmsg
3136

32-
controller-data:
33-
description:
34-
SPI controller data, see bindings/spi/samsung,spi-peripheral-props.yaml
35-
type: object
37+
controller-data: true
3638

3739
google,cros-ec-spi-pre-delay:
3840
description:
@@ -62,15 +64,23 @@ properties:
6264
the SCP.
6365
$ref: "/schemas/types.yaml#/definitions/string"
6466

65-
spi-max-frequency:
66-
description: Maximum SPI frequency of the device in Hz.
67+
spi-max-frequency: true
6768

6869
reg:
6970
maxItems: 1
7071

7172
interrupts:
7273
maxItems: 1
7374

75+
reset-gpios:
76+
maxItems: 1
77+
78+
boot0-gpios:
79+
maxItems: 1
80+
description: Assert for bootloader mode.
81+
82+
vdd-supply: true
83+
7484
wakeup-source:
7585
description: Button can wake-up the system.
7686

@@ -155,18 +165,67 @@ allOf:
155165
- if:
156166
properties:
157167
compatible:
158-
contains:
159-
enum:
160-
- google,cros-ec-i2c
161-
- google,cros-ec-rpmsg
168+
not:
169+
contains:
170+
const: google,cros-ec-spi
162171
then:
163172
properties:
173+
controller-data: false
164174
google,cros-ec-spi-pre-delay: false
165175
google,cros-ec-spi-msg-delay: false
166176
spi-max-frequency: false
167177
else:
168178
$ref: /schemas/spi/spi-peripheral-props.yaml
169179

180+
- if:
181+
properties:
182+
compatible:
183+
not:
184+
contains:
185+
const: google,cros-ec-rpmsg
186+
then:
187+
properties:
188+
mediatek,rpmsg-name: false
189+
190+
required:
191+
- reg
192+
- interrupts
193+
194+
- if:
195+
properties:
196+
compatible:
197+
contains:
198+
const: google,cros-ec-fp
199+
then:
200+
properties:
201+
'#address-cells': false
202+
'#size-cells': false
203+
typec: false
204+
ec-pwm: false
205+
kbd-led-backlight: false
206+
keyboard-controller: false
207+
proximity: false
208+
codecs: false
209+
cbas: false
210+
211+
patternProperties:
212+
"^i2c-tunnel[0-9]*$": false
213+
"^regulator@[0-9]+$": false
214+
"^extcon[0-9]*$": false
215+
216+
# Using additionalProperties: false here and
217+
# listing true properties doesn't work
218+
219+
required:
220+
- reset-gpios
221+
- boot0-gpios
222+
- vdd-supply
223+
else:
224+
properties:
225+
reset-gpios: false
226+
boot0-gpios: false
227+
vdd-supply: false
228+
170229
additionalProperties: false
171230

172231
examples:
@@ -222,4 +281,22 @@ examples:
222281
compatible = "google,cros-ec-rpmsg";
223282
};
224283
};
284+
285+
# Example for FPMCU
286+
- |
287+
spi0 {
288+
#address-cells = <0x1>;
289+
#size-cells = <0x0>;
290+
291+
ec@0 {
292+
compatible = "google,cros-ec-fp", "google,cros-ec-spi";
293+
reg = <0x0>;
294+
interrupt-parent = <&gpio_controller>;
295+
interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
296+
spi-max-frequency = <3000000>;
297+
reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
298+
boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
299+
vdd-supply = <&pp3300_fp_mcu>;
300+
};
301+
};
225302
...

Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ examples:
4848
cros-ec@0 {
4949
compatible = "google,cros-ec-spi";
5050
reg = <0>;
51+
interrupts = <101 0>;
5152
5253
cros_ec_pwm: pwm {
5354
compatible = "google,cros-ec-pwm";

Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ examples:
4141
reg = <0>;
4242
#address-cells = <1>;
4343
#size-cells = <0>;
44+
interrupts = <99 0>;
4445
4546
regulator@0 {
4647
compatible = "google,cros-ec-regulator";

Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ examples:
5757
cros-ec@0 {
5858
compatible = "google,cros-ec-spi";
5959
reg = <0>;
60+
interrupts = <93 0>;
6061
6162
codecs {
6263
#address-cells = <2>;

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4954,6 +4954,12 @@ S: Maintained
49544954
F: drivers/platform/chrome/cros_usbpd_notify.c
49554955
F: include/linux/platform_data/cros_usbpd_notify.h
49564956

4957+
CHROMEOS HPS DRIVER
4958+
M: Dan Callaghan <dcallagh@chromium.org>
4959+
R: Sami Kyöstilä <skyostil@chromium.org>
4960+
S: Maintained
4961+
F: drivers/platform/chrome/cros_hps_i2c.c
4962+
49574963
CHRONTEL CH7322 CEC DRIVER
49584964
M: Joe Tessler <jrt@google.com>
49594965
L: linux-media@vger.kernel.org

drivers/platform/chrome/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ config CROS_EC_TYPEC
228228
To compile this driver as a module, choose M here: the module will be
229229
called cros_ec_typec.
230230

231+
config CROS_HPS_I2C
232+
tristate "ChromeOS HPS device"
233+
depends on HID && I2C && PM
234+
help
235+
Say Y here if you want to enable support for the ChromeOS
236+
human presence sensor (HPS), attached via I2C. The driver supports a
237+
sensor connected to the I2C bus and exposes it as a character device.
238+
To save power, the sensor is automatically powered down when no
239+
clients are accessing it.
240+
231241
config CROS_USBPD_LOGGER
232242
tristate "Logging driver for USB PD charger"
233243
depends on CHARGER_CROS_USBPD

0 commit comments

Comments
 (0)