From patchwork Sat Sep 7 11:07:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 826529 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 444B41494A5; Sat, 7 Sep 2024 11:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725707270; cv=none; b=c+VgL92jqNoMt1RrnXDStXArsz4l5JZcfTqGwmLByxnRcflRwEdUUFcWRuLQAC7x5ZFZ9wxMEbm2EL+RjgGeT8CRMc8Zp/2EQ+iskcZCM59RIUI0oR6Kr6Qe+H7QkdPWVsVqIUfcpfomfXcEy6v7RGeFBbbNl68o2FTJmjjHXUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725707270; c=relaxed/simple; bh=R6qJtdYpTEwJLIYy53ByPsU+RFK5XSWQ0eOuYm1IJlo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p8dsf/oKUuVBkGaQz+kF0bOqrEJVAIw8VxFtsArJsde6qrze/8fdnLLWTK7f2/SrPy0pM3cJR8E+sDHENyk3g8ObZYuTmJOrLMI2IwUCH0/7XjrEarTk4M4FL9L/CUK9syE9bzYMuf2FG+7ximsQVS3bBnwj1vTP8JmettgctTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q5IOV2FB; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q5IOV2FB" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42ba9b47f4eso15781595e9.1; Sat, 07 Sep 2024 04:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725707268; x=1726312068; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xZqH8/VSdIZjoarJlumv8oYCXdCtI6nJjgyT6bq+i0k=; b=Q5IOV2FBsxt2kZkuoQaNtsDnfGB69FEIevysSXCiBaN5ygNrBifDRVZv/+EmJr33U8 eZKrIdUMlAefKIUzOmsPwcV00657m0o05OZrXV70n80yyf6s1cg4kt1ou1kc1YSxZZI/ DHt4i6Mjhvvcr7Ecz/Ea3nozQp/M0eFpAQ1zIX/Y9uw7Ly8KI9fWWRVf5h6lvVoAGy/H wdKlokDDxtxk3uB5cRWQT8TPBW41rRDcU0SQd3c8K39VTXgAgcN8VUjqO9e10HI2k33p ZBucjO1VqRdjdWJCXo7NyLrKMTzjyxORpjo+OIRzgEJo9gguVG748Cs1IIGP3R8JTLNi O0hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725707268; x=1726312068; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xZqH8/VSdIZjoarJlumv8oYCXdCtI6nJjgyT6bq+i0k=; b=ZYq2OCYuiMXjvNoZE8XcRPHFz2hhhwvv+cqo5FOzUZh11A61aQ1d1JLB6X584pDI/d /TzMuqmFx04lRpjTTIpfNizoDQwvgzDCY+ufvJhvpDMktBvH4l4s8M8+joqR7ry9W022 4ugkvSX49qMvs0TnS70go5O410ov6wM53nrvtQHu19hPNSpjRMqhNce2YxjrdA2YU+rh 5G/KdXAwre75Va66/CKE60+4ewyBl719cOORu01B6HKJgKGASdVOkLbYc28XGiqsi7jZ YN2wyc76gwoea+D18JV2CgNdFsm90fxIM8dSI23wq9u/aALGhMTkStqp1w/2vU6pFxv6 mQiw== X-Forwarded-Encrypted: i=1; AJvYcCVzEdkc8eMwtnnNFMnVnZIwYTr4nSHQ0ve46hhH36L8AJVDx8XSuFQgk8TtcWNSih3indTqUYEwZrFk@vger.kernel.org, AJvYcCWKkiAON6LHXec8Tp30DD01QFeJ3zU/Yc/6sWSBahgj2Oj69IjWka7RBuhOo2PtK21BLQxcv49x/Y1JzvyP@vger.kernel.org X-Gm-Message-State: AOJu0Yw8+cJHYVYbXzFxTOIGwDAq/f74+e9s635e1IyuTfLwrjo1QvKL 7y0khS4h/glF8tMO28e8dbhrTIU7R8KcfDPJeYwxNY7PSLuMpof+Mv7NCxa5 X-Google-Smtp-Source: AGHT+IHuXcy2qenL5ZGasWsC/+uDIaV/+cayUg7F6FLgmV9JQIWh9OQtQc1T+VKLS6mAdKi9YtOIlg== X-Received: by 2002:a05:600c:444f:b0:424:8dbe:817d with SMTP id 5b1f17b1804b1-42c95b39e54mr75203285e9.10.1725707267652; Sat, 07 Sep 2024 04:07:47 -0700 (PDT) Received: from [192.168.1.130] (51B6DC2A.dsl.pool.telekom.hu. [81.182.220.42]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb444b0sm13719415e9.21.2024.09.07.04.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 04:07:47 -0700 (PDT) From: " =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= " X-Google-Original-From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Sat, 07 Sep 2024 13:07:45 +0200 Subject: [PATCH 1/2] dt-bindings: power: supply: bq256xx: Add omit-battery-class property Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240907-bq256xx-omit-battery-class-v1-1-45f6d8dbd1e5@mainlining.org> References: <20240907-bq256xx-omit-battery-class-v1-0-45f6d8dbd1e5@mainlining.org> In-Reply-To: <20240907-bq256xx-omit-battery-class-v1-0-45f6d8dbd1e5@mainlining.org> To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725707265; l=962; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=R6qJtdYpTEwJLIYy53ByPsU+RFK5XSWQ0eOuYm1IJlo=; b=h8L5jgwZf+2kJRUPrq6ZE8XiRCmXquDCr2MBTQqrfJvK3qjJ35eDpWj/jX3Op3tYUwlbliq/r mAUnKo+FwvpD/2+K9JdRTvlEqeUscQN5oT29UPce7jZtzCZ2wvOYfva X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= Add omit-battery-class property for avoid system create a battery device. Signed-off-by: Barnabás Czémán --- Documentation/devicetree/bindings/power/supply/bq256xx.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml index a76afe3ca299..744f5782e8e7 100644 --- a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml +++ b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml @@ -62,6 +62,12 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle description: phandle to the battery node being monitored + omit-battery-class: + type: boolean + description: | + If this property is set, the operating system does not try to create a + battery device. + interrupts: maxItems: 1 description: | From patchwork Sat Sep 7 11:07:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 826391 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 52946158556; Sat, 7 Sep 2024 11:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725707271; cv=none; b=ZFT1H7EZDlvUgyCC2jpn42EZlHH0RVfYIRGrMKOedEFI3CD88PDJOPnq0Gign/28RMQTgByY5Vt77cvilsDGRJzWfJFrnifEoTRLJZlKGYKznmcxjAk9rZbyWOZNgrhlSaYPkhgIqaYT1TtdpDaGiVqRT4d8ldRlvw473ZIpw0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725707271; c=relaxed/simple; bh=udRTh01PFdNwrz5h6uyHU1yEO3a3lSXrCIR5rWz7vCo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EQyVF7y7xG/JW5s3aTtNC0AjyVgTZr+eOblenAZ2ZlPUfcyma+r1TpE3VIc3Q6qVUHhn+0VmnYkQNX9zPDoBcD97kCgOck6AblbJAkYeCb7QywV4DUTohJYxYyauVGFhvDN1xeO7HKoIFbEHuQF7usDsGYpZ3xq12Pa+A31qDXI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y0BmB88D; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y0BmB88D" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-428e0d184b4so21931895e9.2; Sat, 07 Sep 2024 04:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725707269; x=1726312069; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Nn3W1kMigTVE8blchx+fEv/bpRlWtEY28Jz/T9i8iA4=; b=Y0BmB88D9089fael/icln5NNlttYC8zBgNoezWyLZAO6wMMvaZwBYvAOutc17Lt9/X gGKc51x0eBAHXokexw7poTbBhSidklpbaNNXGufU3fL8Y5c/EyLvoY11t8eJ2LfMojiD S7yKZT2kzweKoB1Cjwj3iO1b+8BH8MhuaCv4EwNXf82lab6AK7yrgmlmGD7P7o7GlWcP YQ1tuWV/U8J63G6TkUB9wRQThlFLgivpOAL7spk9fpKwn5Q99UNeBJ/qO/gaYkFGewnu hu7atLyQ6N2qx/qYRLyUV0lho3GX/nWECNV9oXxcfT+O2CZzfubJ1nbYRhwqXdcPIT1q 6g4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725707269; x=1726312069; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nn3W1kMigTVE8blchx+fEv/bpRlWtEY28Jz/T9i8iA4=; b=eQvrr8BYf/E6M3rNGaAcS02QojhwoUdPAKp5wfUKufuNKPmn2vyTgdbBR415tMtusn hjIQSDKJjTNcwiT11KT/5Jz8utcXhnniG7YAw5gVja6fVGIEywCrkEzuAV93cs79Fjtm BP2Wp2KtE303Dg58f/IRU8itCQVpZlAXE1qvU2J2HpgcxrnviEjyC39tx4JSfVb/oEgo 4F2/M/LxF+/u4kywsK73eJFAvrsTWeDPOUu1ToShY42HTe1N3a0l/tUHznQZdhxAuGha kF7Uu/hngjedqHC6J9aXocPhRRFn6WICEoh2zPaUP8eKAvnH4nunY562HvExUVW0OV9/ +v+A== X-Forwarded-Encrypted: i=1; AJvYcCUQKG5mFnuv45z7YzDW9IG40EX6x2InwGKVjbuj5IOmfhWYak8A7gqqBlH0ryDt60zOP6fQw6DwOCE6eP3D@vger.kernel.org, AJvYcCWpjVR/yx3kZFTJRAHP68AQAC9E84hKIxM4pEdyvIaUmYHHLjxfY2laJbFMI7oC43NWMddx3fT2DQZf@vger.kernel.org X-Gm-Message-State: AOJu0YyLbU5Eaef5dxvZSeycM3wRL2bTQVnef5nysHcvd7E/GRqxus/F V2enZ3e/4LYxfTd6PVJOvHBTGfhy8gjaxOmp+bKJL4yKaDas++HW3lCLKc7N X-Google-Smtp-Source: AGHT+IHSy+MLOjb96dv5ua1bHQAoaTx9nS32PPhKOkrFsquf1+TmcibLteRqakdjbU+c4tDt8zltaw== X-Received: by 2002:a05:600c:4713:b0:426:689b:65b7 with SMTP id 5b1f17b1804b1-42c9f9d359dmr41212935e9.25.1725707268603; Sat, 07 Sep 2024 04:07:48 -0700 (PDT) Received: from [192.168.1.130] (51B6DC2A.dsl.pool.telekom.hu. [81.182.220.42]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb444b0sm13719415e9.21.2024.09.07.04.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 04:07:48 -0700 (PDT) From: " =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= " X-Google-Original-From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Sat, 07 Sep 2024 13:07:46 +0200 Subject: [PATCH 2/2] power: supply: bq256xx: Add ability to omit battery class Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240907-bq256xx-omit-battery-class-v1-2-45f6d8dbd1e5@mainlining.org> References: <20240907-bq256xx-omit-battery-class-v1-0-45f6d8dbd1e5@mainlining.org> In-Reply-To: <20240907-bq256xx-omit-battery-class-v1-0-45f6d8dbd1e5@mainlining.org> To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725707265; l=1218; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=udRTh01PFdNwrz5h6uyHU1yEO3a3lSXrCIR5rWz7vCo=; b=pBEi+vQWV1Tf+hFCfwy10ZgliSgqQx629lgUiySLwHV5X2JAURNICMyNzYM8EhcSLD3ytbXN1 ttQNSUOD81SBWegIe7kmTGomM5mJopKkmAU6g7iZ4/+HTY/Yo+Hgvdo X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= Add omit-battery-class property to avoid make a battery device for charger when fg makes one. Signed-off-by: Barnabás Czémán --- drivers/power/supply/bq256xx_charger.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c index 5514d1896bb8..62721d564b39 100644 --- a/drivers/power/supply/bq256xx_charger.c +++ b/drivers/power/supply/bq256xx_charger.c @@ -1547,12 +1547,14 @@ static int bq256xx_power_supply_init(struct bq256xx_device *bq, return PTR_ERR(bq->charger); } - bq->battery = devm_power_supply_register(bq->dev, - &bq256xx_battery_desc, - psy_cfg); - if (IS_ERR(bq->battery)) { - dev_err(dev, "power supply register battery failed\n"); - return PTR_ERR(bq->battery); + if (!device_property_read_bool(dev, "omit-battery-class")) { + bq->battery = devm_power_supply_register(bq->dev, + &bq256xx_battery_desc, + psy_cfg); + if (IS_ERR(bq->battery)) { + dev_err(dev, "power supply register battery failed\n"); + return PTR_ERR(bq->battery); + } } return 0; }