Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp229420lqb; Tue, 28 May 2024 13:54:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsPpXnW0ax3pi74YNnpRI7fwyz+ENV373QwfxUID572d8AiBnDq6GNLbCpKg4brReQYj/XIjiMGa27azd8X9J47cWMFE9mktNOir9sjQ== X-Google-Smtp-Source: AGHT+IFFaL+qExAd9R1ocRigDpUaJ1eW8F9/RpddS0Oj6EUNSi59p7JK5QydTQ/bcv4dFHP3fjzA X-Received: by 2002:a17:907:1303:b0:a59:cdc9:6fd9 with SMTP id a640c23a62f3a-a62641deb6cmr746332566b.21.1716929683204; Tue, 28 May 2024 13:54:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716929683; cv=pass; d=google.com; s=arc-20160816; b=fiGAE/9TOxvk5ro1Xw/W0nySVHFo48WOn7sqhqHWj6xNCm+x14OnD3u8d9syqm9wLM DxBBTwgMRQB66D9z1XNRCd6nco2Wfd4YMbYPHQJZIPnuDgqXJt+YJripTqXbkgDtNcu1 kZ1d0knZ0sOfppQpjBJ+FEFyjt4FQ7sCVrKywTUeK04ftHG/FZhnkfJQ9n4sVNQZ5L1n lZj1a3r8jWsFhKxoKMuqC0h81TV65JRKITNDda1qPMoX1Q+nZhFFMDwhpuX8NBZZZHCN tWJueCR4X8hjnfdOQxP2pKhDFRnk6ogcGtAIYIyycn5ZPIOEJH19OU4v9Sul/9XTgA7P SwLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=KzZhxdvPLE6mLIqgxvohaJdPdDCKtRQaOpGQeC6Iw60=; fh=u9XX6r8Bx7s2zEKRNGJHWFOJ+WjurFGPsm0dI+OKf8w=; b=KoBhFaHcg73L0r9e+lRd+LlO+T21Wzmz2N2MNXwfZVjcOFCGWCU3qNwzHyk5Sj++s9 e1yS7jeAjf00TD+L5TEHZheJNJhvHj+4OxGF1qfc5YqnfWUEEzFpdFShJEKcR3V9pvjh AZX+QsCHeDLlX8pAijuRPGMzkH2VXP63M7tkgdXorP1TkeSQ0Z/0LXXAJx4A6iqgmnxA 3asPA2OA/KS4jAdi1xzHCIo500tjtmI9CWlb1ih2ETROVqyBfe/LNTMwQhmuaKXt/GGe fIww3YUuC0UJVG/F/m1vtInodWT8sGrVGMek/NuObbktvXEzP/FhYqAFDmD5uUfbYcz+ o3vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gEUEogse; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-193060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6341fb4e73si116366366b.478.2024.05.28.13.54.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 13:54:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gEUEogse; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-193060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 21A471F2B300 for ; Tue, 28 May 2024 20:47:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7850B17BB1B; Tue, 28 May 2024 20:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gEUEogse" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E89217967E for ; Tue, 28 May 2024 20:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716929098; cv=none; b=Cv/wJYQNi2I3D+BxcxicxCLAp0Zl0G+KCWSac+T3dlPlQXWZy2OeROI11su7QYUtjBWi2LFycjXuoVluqwYuNYZPOjc93ySLIZMTZGAHCJct+29eo/H8JaISuQRZOuk5MpbrhHD1P7zT1bLmEY+0/TKIbG+Q1nmO9FUfSyHPX2c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716929098; c=relaxed/simple; bh=Ort2/caZVUYwVthaQyqzi46Ex/gklHG9yBV76k5aP2E=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=eyMl2u5qYVsKpDPM0oZ14k6Msr8sM1siWL8XuPMNTWKSGKvSIuLbuwo9BcZKlyKLOJtF1wDbRDC7R7tDG+7RcmogVjSdz7mFd1yYpvBu/mnamB5chsKwDuMYCV0NHsEkvtO6GofVP0RpE4WKOyhCcY7cSoOb82zo9gU4CdK/GZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gEUEogse; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2e95a7545bdso14089071fa.2 for ; Tue, 28 May 2024 13:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716929094; x=1717533894; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=KzZhxdvPLE6mLIqgxvohaJdPdDCKtRQaOpGQeC6Iw60=; b=gEUEogse2a6pvTcim852+up1CtuqHIkXK+kjmSoP6JVYMjb5mkSqGJa/xzJ0JzeKbv toDO6kOxMj6BEfIlyK0tsC7o/KSdmdS6bpj0XPs3lJygFVXR50CUa57WsSVp5Yq8/O9D 268VGqiZQFWvhSdf9Km5gVaIInu3KjDn/K54eIsARffpVzU+ngIPYUMiLEQ/r6y3gaIp 88JNhNEI11UX9RWjwepKEFOR/4Jl2QwoZmoHcnVqLng2iE1Wu5p5Zr807MbQUoivPZfE Q09vtSTDuehhGoAE6B99XfM95TuR/kdkNEhWniDaxn/F6I62d+vs/y5BSfpe4DARM6QH 4Yhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716929094; x=1717533894; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KzZhxdvPLE6mLIqgxvohaJdPdDCKtRQaOpGQeC6Iw60=; b=KdN8F+bfzdkJUlvFUb42S2kDiBWZ81KGTroXqQcw3CD6mFqdQCALlBbPZaXREcEF9U bXHZfrWLJ3tq5jPnBDVGaUEfF8PdQ1jycvIPpnQHp9DzbjDO59+M51CPyGuo7jdU66pb L7RhMSTRV7Y9OhRJM/MtOZW6bZZGCfeANLfv4A7vzCWqlogMDV9Fsl2cp795Yz0gk4DV SGqoGHAeqNOzfIi7cO1No8PRoDBm0FaOSclAXrDqxjFDDoUoQgZLJYGKPh8C3g8Q89dQ MN7vroF/dy78s9jM8ppgDMQCTW7HBK0vffO3lmdPnjoMP0Fpq4+9Fl+hdspUrQsp2LSl Xr3w== X-Forwarded-Encrypted: i=1; AJvYcCWr7v+q1+QRdD2heGpeiAm10Fez/e5LwYi3WRpl352SuyNoJuXs1h3T193C4iOJ0SYKpPwzLqc4eEeKYfnr65qkCddGNX9flOPX1Vjs X-Gm-Message-State: AOJu0Yy/jw9E8VDsduRt3x3v4nC2ymS2Z6XZGl/xcIPQ9gzUsg4shthS 0gSKmh9lf1RLwSqnQ8OqjamyHQuH0bqdDh6Ka2gkHXWH0KqOe5ZMFM3bb0qZASc= X-Received: by 2002:a2e:8ec4:0:b0:2e9:87f7:caa with SMTP id 38308e7fff4ca-2e987f70d11mr17203611fa.41.1716929094332; Tue, 28 May 2024 13:44:54 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e95bdcd21esm22759431fa.100.2024.05.28.13.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 13:44:53 -0700 (PDT) From: Dmitry Baryshkov Subject: [PATCH v4 0/6] power: supply: Lenovo Yoga C630 EC Date: Tue, 28 May 2024 23:44:45 +0300 Message-Id: <20240528-yoga-ec-driver-v4-0-4fa8dfaae7b6@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAD1CVmYC/3XOyw6CMBCF4VchXTuktJSLK9/DsKh0gIlKzZQ0E sK7CyQmblz+i/PlLCIgEwZxThbBGCmQH7fIT4loBzv2COS2FkqqXBpVwux7C9iCY4rIUBadKzv jnMVKbKMXY0fvA7w2W3fsnzANjPbLaKmkyYyqZJ0qpXWuC8jAPWniOb1ZnsNw9/HyoNGyTz33O ztQmDzPx82od/zvo6hBglalrSuTOevML9Ws6/oBlMuyoPQAAAA= To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Bryan O'Donoghue , Heikki Krogerus , Greg Kroah-Hartman , Konrad Dybcio Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin , Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3634; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Ort2/caZVUYwVthaQyqzi46Ex/gklHG9yBV76k5aP2E=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ1qYk8uBHNmJot+3S8w8Pfc2n7pSvLJijOn0Z+/a3Vxbe 69z/cnsZDRmYWDkYpAVU2TxKWiZGrMpOezDjqn1MINYmUCmMHBxCsBELC04GFbmyeZrfXbg8/rH 4Vxkarnt2L6GufafdX93WG6XWvVnloLaVpETV9gk7Xxi3cL1L5ncueqV3rgpZsX3C3qBMt6/Y++ 8P3b3/LPiJpW6EA373ZwvlKvntzT6Pwp8ePTsF8eZ28U4Qu8wFGkKpu2RbBUSXr7tzZbdghZ7c1 oL39z8x+Os9lDm05XeNO3Uo9rpC+ZtZmQI+99WL8Rx93nvAY6JnWwL5tV8Om8Uc47znv9Zg7pZ3 jW9P+/VGFf4VzddY+wKenWPz3SB0bVZWXKt56LO/64rTM+1fNOrwf0oK5rX7FDhVtXzu6fO3brj tbH02ceHuiQDj+p+aNDZdsDnpLyQ75KtTuUZSg1MvZM6AA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A 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). --- Changes in v4: - Moved bindings to platform/ to follow example of other Acer Aspire1 EC (Nikita Travkin) - Fixed dt validation for EC interrupt pin (Rob Herring) - Dropped separate 'scale' property (Oliver Neukum) - Link to v3: https://lore.kernel.org/r/20240527-yoga-ec-driver-v3-0-327a9851dad5@linaro.org Changes in v3: - Split the driver into core and power supply drivers, - Added UCSI driver part, handling USB connections, - Fixed Bjorn's address in DT bindings (Brian Masney) - Changed power-role for both ports to be "dual" per UCSI - Link to v2: https://lore.kernel.org/linux-arm-msm/20230205152809.2233436-1-dmitry.baryshkov@linaro.org/ Changes in v2: - Dropped DP support for now, as the bindings are in process of being discussed separately, - Merged dt patch into the same patchseries, - Removed the fixed serial number battery property, - Fixed indentation of dt bindings example, - Added property: reg and unevaluatedProperties to the connector bindings. - Link to v1: https://lore.kernel.org/linux-arm-msm/20220810035424.2796777-1-bjorn.andersson@linaro.org/ --- Bjorn Andersson (2): dt-bindings: platform: Add Lenovo Yoga C630 EC arm64: dts: qcom: c630: Add Embedded Controller node Dmitry Baryshkov (4): platform: arm64: add Lenovo Yoga C630 WOS EC driver usb: typec: ucsi: add Lenovo Yoga C630 glue driver power: supply: lenovo_yoga_c630_battery: add Lenovo C630 driver arm64: dts: qcom: sdm845: describe connections of USB/DP port .../bindings/platform/lenovo,yoga-c630-ec.yaml | 83 ++++ arch/arm64/boot/dts/qcom/sdm845.dtsi | 53 ++- .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 75 ++++ drivers/platform/arm64/Kconfig | 14 + drivers/platform/arm64/Makefile | 1 + drivers/platform/arm64/lenovo-yoga-c630.c | 279 ++++++++++++ drivers/power/supply/Kconfig | 9 + drivers/power/supply/Makefile | 1 + drivers/power/supply/lenovo_yoga_c630_battery.c | 479 +++++++++++++++++++++ drivers/usb/typec/ucsi/Kconfig | 9 + drivers/usb/typec/ucsi/Makefile | 1 + drivers/usb/typec/ucsi/ucsi_yoga_c630.c | 189 ++++++++ include/linux/platform_data/lenovo-yoga-c630.h | 42 ++ 13 files changed, 1234 insertions(+), 1 deletion(-) --- base-commit: 6dc544b66971c7f9909ff038b62149105272d26a change-id: 20240527-yoga-ec-driver-76fd7f5ddae8 Best regards, -- Dmitry Baryshkov