Skip to content

Commit

Permalink
power: supply: Add Lenovo Yoga C630 EC driver
Browse files Browse the repository at this point in the history
The Qualcomm Snapdragon-based Lenovo Yoga C630 has some sort of EC
providing AC-adapter and battery status, as well as USB Type-C altmode
notifications for Displayport operation.

The Yoga C630 ships with Windows, where these operations primarily are
implemented in ACPI, but due to various issues with the hardware
representation therein it's not possible to run Linux on this
information. As such this is a best-effort re-implementation of these
operations, based on the register map expressed in ACPI and a fair
amount of trial and error.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
andersson authored and 0x011011110 committed Sep 24, 2022
1 parent 0e1c775 commit a9f55bd
Show file tree
Hide file tree
Showing 3 changed files with 558 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/power/supply/Kconfig
Expand Up @@ -905,4 +905,15 @@ config BATTERY_UG3105
device is off or suspended, the functionality of this driver is
limited to reporting capacity only.

config LENOVO_YOGA_C630_EC
tristate "Lenovo Yoga C630 EC battery driver"
depends on DRM
depends on I2C
help
Driver for the Embedded Controller in the Qualcomm Snapdragon-based
Lenovo Yoga C630, which provides battery information and USB Type-C
altmode notifications.

Say M or Y here to include this support.

endif # POWER_SUPPLY
1 change: 1 addition & 0 deletions drivers/power/supply/Makefile
Expand Up @@ -109,3 +109,4 @@ obj-$(CONFIG_BATTERY_ACER_A500) += acer_a500_battery.o
obj-$(CONFIG_BATTERY_SURFACE) += surface_battery.o
obj-$(CONFIG_CHARGER_SURFACE) += surface_charger.o
obj-$(CONFIG_BATTERY_UG3105) += ug3105_battery.o
obj-$(CONFIG_LENOVO_YOGA_C630_EC) += yoga-c630-ec.o

0 comments on commit a9f55bd

Please sign in to comment.