All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] platform: arm64: Huawei Matebook E Go embedded controller
@ 2025-01-13 17:49 Pengyu Luo
  2025-01-13 17:50 ` [PATCH v3 2/6] platform: arm64: add Huawei Matebook E Go EC driver Pengyu Luo
  2025-01-13 17:51 ` [PATCH v3 3/6] usb: typec: ucsi: Add a macro definition for UCSI v1.0 Pengyu Luo
  0 siblings, 2 replies; 20+ messages in thread
From: Pengyu Luo @ 2025-01-13 17:49 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Sebastian Reichel, Heikki Krogerus,
	Greg Kroah-Hartman, Jean Delvare, Guenter Roeck
  Cc: devicetree, linux-kernel, linux-arm-msm, platform-driver-x86,
	linux-pm, linux-usb, linux-hwmon, Pengyu Luo

This adds binding, drivers and the DT support for the Huawei Matebook E Go
(sc8280xp-based) Embedded Controller which is also found in Huawei Matebook
E Go LTE (sc8180x-based), but I don't have the sc8180x one to perform tests,
so this series enable support for sc8280xp variant only, this series provides
the following features:

- battery and charger information report
- charging thresholds control
- FN lock (An alternative method)
- LID switch detection
- Temperature sensors
- USB Type-C altmode
- USB Type-C PD(high power)

Thanks to the work of Bjorn and Dmitry([1]), the work of Nikita([2]), writing a
EC driver won't be suffering. This work refers a lot to their work, also, many
other works. I mentioned them in the source file.

Depends: https://lore.kernel.org/linux-arm-msm/20241220160530.444864-1-mitltlatltl@gmail.com

[1] https://lore.kernel.org/all/20240614-yoga-ec-driver-v7-0-9f0b9b40ae76@linaro.org/
[2] https://lore.kernel.org/all/20240315-aspire1-ec-v5-0-f93381deff39@trvn.ru/

base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc

Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
Changes in v3:
- Link to v2: https://lore.kernel.org/linux-arm-msm/20250105174159.227831-1-mitltlatltl@gmail.com

dt-binding:
- drop generic compatibles. (Krzysztof)
- remove '+' to use literal block style. (Krzysztof)

ec:
- take struct gaokun_ucsi_reg as parameter (Heikki)
- add almost all kernel doc comments (Krzysztof, Heikki)

ucsi:
- drop unnecessary ucsi quirks (Dmitry)
- add UCSI v1.0 to ucsi.h (Heikki)
- use gaokun_ucsi_read_cci() to read cci directly (Heikki)
- drop unnecessary gaokun_ucsi_get_port_num (Heikki)
- rename member port_num => num_ports (Heikki)
- fix completion, forgot to signal threads in previous version

dt:
- fix indentation (Konrad)
- add a link between role switch and connector

Changes in v2:
- Link to v1: https://lore.kernel.org/linux-arm-msm/20241227171353.404432-1-mitltlatltl@gmail.com

global:
- drop qcom's products(i.e. sc8180x, sx8280xp) everywhere, use 'product'-based instead(Krzysztof, Bryan)
- drop Cc Nikita Travkin, we had discussed the device in PM.
- add myself to MAINTAINERS

dt-binding:
- fix building (Rob Herring (Arm))
- remove unnecessary code (Krzysztof)
- add bugzilla documentation, insights of gaokun(see [1] or patch[1/5]) (Krzysztof, Aiqun(Maria))
- explain the difference between PMIC GLink and gaokun EC (Aiqun(Maria))

ec:
- use Linux style comments (Krzysztof)
- add a comment for mutex lock (Krzysztof)
- add more kerneldoc for exported functions (Krzysztof)
- eliminate unnecessary conditions (Bryan)
- add a macro for check thresholds (Bryan)
- improve English (Bryan)
- use existing sysfs interface(hwmon, psy) whenever possible (Krzysztof)
- use __le16 and related endianess conversion function for temp data (Ilpo)
- drop alias for packet headers (Ilpo)
- avoid hardcoding i2c msgs size (Aiqun(Maria))
- add a comment for the sleep in critial region (Bryan, Aiqun(Maria))
- use macro to construct packet (Bryan, Aiqun(Maria))

wmi:
- dropped

ucsi:
- reorder headers (Bryan)
- a comment for the orientation map macro (Bryan)
- make mux mode map more explicit(minus six is very clear now) (Bryan, Dmitry)
- handle port update exceptions return (Bryan)
- a comment for the UCSI quirks (Dmitry)
- use the inline hint for the short register function (Dmitry)
- use the API with delay to handle register instead of a direct sleep (Bryan)
- handle unfinished initialization early

psy:
- add charging related sysfs to here (Krzysztof, Dmitry)
- document ABI for power_supply sysfs (Krzysztof)
- drop charging threshold, use smart charging instead

dts:
- correct indentation, properties' order. (Konrad)

Pengyu Luo (6):
  dt-bindings: platform: Add Huawei Matebook E Go EC
  platform: arm64: add Huawei Matebook E Go EC driver
  usb: typec: ucsi: Add a macro definition for UCSI v1.0
  usb: typec: ucsi: add Huawei Matebook E Go ucsi driver
  power: supply: add Huawei Matebook E Go psy driver
  arm64: dts: qcom: gaokun3: Add Embedded Controller node

 .../ABI/testing/sysfs-class-power-gaokun      |  47 +
 .../bindings/platform/huawei,gaokun-ec.yaml   | 124 +++
 MAINTAINERS                                   |   9 +
 .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 163 ++++
 drivers/platform/arm64/Kconfig                |  21 +
 drivers/platform/arm64/Makefile               |   1 +
 drivers/platform/arm64/huawei-gaokun-ec.c     | 841 ++++++++++++++++++
 drivers/power/supply/Kconfig                  |  10 +
 drivers/power/supply/Makefile                 |   1 +
 drivers/power/supply/huawei-gaokun-battery.c  | 548 ++++++++++++
 drivers/usb/typec/ucsi/Kconfig                |  11 +
 drivers/usb/typec/ucsi/Makefile               |   1 +
 drivers/usb/typec/ucsi/ucsi.h                 |   1 +
 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c   | 524 +++++++++++
 .../linux/platform_data/huawei-gaokun-ec.h    |  80 ++
 15 files changed, 2382 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-power-gaokun
 create mode 100644 Documentation/devicetree/bindings/platform/huawei,gaokun-ec.yaml
 create mode 100644 drivers/platform/arm64/huawei-gaokun-ec.c
 create mode 100644 drivers/power/supply/huawei-gaokun-battery.c
 create mode 100644 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
 create mode 100644 include/linux/platform_data/huawei-gaokun-ec.h

-- 
2.47.1


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

end of thread, other threads:[~2025-02-22 11:29 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 17:49 [PATCH v3 0/6] platform: arm64: Huawei Matebook E Go embedded controller Pengyu Luo
2025-01-13 17:50 ` [PATCH v3 2/6] platform: arm64: add Huawei Matebook E Go EC driver Pengyu Luo
2025-01-13 18:34   ` Guenter Roeck
2025-01-13 18:56   ` Ilpo Järvinen
2025-01-14  8:31     ` Pengyu Luo
2025-01-14 15:40       ` Ilpo Järvinen
2025-01-16 12:02   ` Heikki Krogerus
2025-01-13 17:51 ` [PATCH v3 3/6] usb: typec: ucsi: Add a macro definition for UCSI v1.0 Pengyu Luo
2025-01-13 17:51   ` [PATCH v3 4/6] usb: typec: ucsi: add Huawei Matebook E Go ucsi driver Pengyu Luo
2025-01-16 11:55     ` Heikki Krogerus
2025-01-16 18:26       ` Pengyu Luo
2025-01-13 17:51   ` [PATCH v3 5/6] power: supply: add Huawei Matebook E Go psy driver Pengyu Luo
2025-02-20  0:24     ` Sebastian Reichel
2025-02-20  6:43       ` Pengyu Luo
2025-02-21  1:33         ` Sebastian Reichel
2025-02-21  6:01           ` Pengyu Luo
2025-02-21 22:22             ` Sebastian Reichel
2025-02-22 11:27               ` Pengyu Luo
2025-01-13 17:51   ` [PATCH v3 6/6] arm64: dts: qcom: gaokun3: Add Embedded Controller node Pengyu Luo
2025-01-16 11:26   ` [PATCH v3 3/6] usb: typec: ucsi: Add a macro definition for UCSI v1.0 Heikki Krogerus

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.