Message ID | 20240614-yoga-ec-driver-v7-0-9f0b9b40ae76@linaro.org |
---|---|
Headers | show |
Series | power: supply: Lenovo Yoga C630 EC | expand |
On Fri, 14 Jun 2024, Dmitry Baryshkov wrote: > This adds binding, driver and the DT support for the Lenovo Yoga C630 > Embedded Controller, to provide battery information. > > Support for this EC was implemented by Bjorn, who later could not work > on this driver. I've picked this patchset up and updated it following > the pending review comments. > > DisplayPort support is still not a part of this patchset. It uses EC > messages to provide AltMode information rather than implementing > corresponding UCSI commands. However to have a cleaner uAPI story, the > AltMode should be handled via the same Type-C port. > > Merge strategy: the driver bits depend on the platform/arm64 patch, > which adds interface for the subdrivers. I'd either ask to get that > patch merged to the immutable branch, which then can be picked up by > power/supply and USB trees or, to make life simpler, ack merging all > driver bits e.g. through USB subsystem (I'm biased here since I plan to > send more cleanups for the UCSI subsystem, which would otherwise result > in cross-subsystem conflicts). In preparation for making an IB, I took patch 1-2 into platform-drivers-x86-lenovo-c630 branch. I'll tag it once LKP has built tested the branch.
On Fri, 14 Jun 2024, Dmitry Baryshkov wrote: > On the Lenovo Yoga C630 WOS laptop the EC provides access to the adapter > and battery status. Add the driver to read power supply status on the > laptop. > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > --- > drivers/power/supply/Kconfig | 9 + > drivers/power/supply/Makefile | 1 + > drivers/power/supply/lenovo_yoga_c630_battery.c | 500 ++++++++++++++++++++++++ > 3 files changed, 510 insertions(+) > > diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig > index 3e31375491d5..55ab8e90747d 100644 > --- a/drivers/power/supply/Kconfig > +++ b/drivers/power/supply/Kconfig > @@ -167,6 +167,15 @@ config BATTERY_LEGO_EV3 > help > Say Y here to enable support for the LEGO MINDSTORMS EV3 battery. > > +config BATTERY_LENOVO_YOGA_C630 > + tristate "Lenovo Yoga C630 battery" > + depends on OF && EC_LENOVO_YOGA_C630 > + help > + This driver enables battery support on the Lenovo Yoga C630 laptop. > + > + To compile the driver as a module, choose M here: the module will be > + called lenovo_yoga_c630_battery. > + > config BATTERY_PMU > tristate "Apple PMU battery" > depends on PPC32 && ADB_PMU > diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile > index 58b567278034..8ebbdcf92dac 100644 > --- a/drivers/power/supply/Makefile > +++ b/drivers/power/supply/Makefile > @@ -32,6 +32,7 @@ obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o > obj-$(CONFIG_BATTERY_GAUGE_LTC2941) += ltc2941-battery-gauge.o > obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o > obj-$(CONFIG_BATTERY_LEGO_EV3) += lego_ev3_battery.o > +obj-$(CONFIG_BATTERY_LENOVO_YOGA_C630) += lenovo_yoga_c630_battery.o > obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o > obj-$(CONFIG_BATTERY_QCOM_BATTMGR) += qcom_battmgr.o > obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o > diff --git a/drivers/power/supply/lenovo_yoga_c630_battery.c b/drivers/power/supply/lenovo_yoga_c630_battery.c > new file mode 100644 > index 000000000000..0209cdb5546f > --- /dev/null > +++ b/drivers/power/supply/lenovo_yoga_c630_battery.c > @@ -0,0 +1,500 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2022-2024, Linaro Ltd > + * Authors: > + * Bjorn Andersson > + * Dmitry Baryshkov > + */ > +#include <linux/auxiliary_bus.h> > +#include <linux/bits.h> Add #include <linux/cleanup.h> for guard(). (I added it into patch 2/6 myself so you don't need to respin that patch just because of it). Once you've addressed the include and the note from Sebastian about Kconfig dependencies, please add: Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
On Fri, 14 Jun 2024, Dmitry Baryshkov wrote: > The Lenovo Yoga C630 WOS laptop provides implements UCSI interface in > the onboard EC. Add glue driver to interface the platform's UCSI > implementation. > > Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
On Fri, 14 Jun 2024 02:43:37 +0300, Dmitry Baryshkov wrote: > This adds binding, driver and the DT support for the Lenovo Yoga C630 > Embedded Controller, to provide battery information. > > Support for this EC was implemented by Bjorn, who later could not work > on this driver. I've picked this patchset up and updated it following > the pending review comments. > > [...] Applied, thanks! [5/6] arm64: dts: qcom: sdm845: describe connections of USB/DP port commit: 1ef3a30f4dc953a8da7aa68ee4658dc7c3710aac [6/6] arm64: dts: qcom: c630: Add Embedded Controller node commit: 060a1ebd91c1f1bdce8433d559f214204b835add Best regards,