Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2323806lqb; Mon, 27 May 2024 16:16:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXihAwwH8nJvarH2iG1g930/5iGhcnIdnqsiRWTkKftOM8gLvTwY+iNFyqAT7v5K4YIP8O1Tr24dwSsLY+KB4KGGf1Dnv9OA2qSwCm0JA== X-Google-Smtp-Source: AGHT+IE3gEDVb+vqCFiazgn3O6eNnGGQi5EHIVxjm5mKqP9bXS1O5lzMvMmwDxorbyY6A/vpsF1x X-Received: by 2002:a05:6000:4028:b0:357:9017:48a2 with SMTP id ffacd0b85a97d-357901748f2mr7040742f8f.26.1716851778361; Mon, 27 May 2024 16:16:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716851778; cv=pass; d=google.com; s=arc-20160816; b=YT5x3Wlb/i2Hg0/Mk1KiYwgZpnDsbcOaIYh+eSJme+Cpx+ycjSOVxJVxB05mEIlGxx cxL+fZU/xxU/HtTIm1hvURYCS2/0zxoR2QifDBociuqLZuZZ2tmsppMuOKBJFs/nJQRL 9ClyEsE20HLXJna03WTgE8B+ehOzhyPaeGX/cRCBeuJ4eO1gczggPRzSg6KtlGQOFUFJ AO5xTnA+lzfWGJjBFrqik/SWDvsyIWU9J3CHO29AiGxiNnhTg04AzDdr9bw0Il1IGZxS C/JSQUk5DIHGg8vbYi2ntNV4d/d+k60gZ4G9HdxXyckez2UM+SN7vnA/8atLDil9OH5K 6eIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iKTdzlNEkZJDeB62d/owKD2BDh8/+OHG29/inxAJauQ=; fh=KHzjRc7VEO0VSb9QH67dt0a/GHokUecvzgkVdf+JM2o=; b=F6FeDwOGzpCa+ZeHID0PvnI/XLsC+VWSyUHsGlikxZIXB5jMhXKL4yYn+/vxq6XgbZ M6/pJDfks+9qeffHDLNYDdQ0cB4VXhNZ/lfQhQDWcLaAk789FxOIPuWPeu4lZHX9vJ0e jF9docLLXGKwfp7/S5v4I2RR1U6wr2wWChtpk/A59MFGZb+OnTjZkXWZyIziRy08NyXJ QUZ/tsrAgWKsGQp1EgEioHIx+GBGDcnW06hPCudE2zn3UYkeFgvuDrCrTZ18xNu3wRkX 5Pn3A6bWJkUWEHTSEK5faUyjpn6rRYw9Iu2fgrNs98EDDafk89Xq88Pozg4Mg7np3uVR Dd+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mXxfFzZw; 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-191507-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191507-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-a626cc641e9si427414766b.569.2024.05.27.16.16.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191507-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=mXxfFzZw; 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-191507-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191507-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 1CC2B1F21E18 for ; Mon, 27 May 2024 23:16:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AC2F167DAF; Mon, 27 May 2024 23:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mXxfFzZw" Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 2F27C33C8 for ; Mon, 27 May 2024 23:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716851764; cv=none; b=u27MGhGyAhHKOzSPELPrrWunb3oP48VPlt+FRsonGBCaluMOc62aus9KHgxJ44y8r5JvEf+YRNxQtqWN9+44GkIEOKmMfCxBnUGfDGKDZ1vPyDToIY4lVFwcM4lKuhhHlmIsoQxsKvHnVsFE0zZbiuFBIcimk6DUiUu08SqkJdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716851764; c=relaxed/simple; bh=mybrqCieBXpDyCN3cGK2kFHGCjeNghf5MU60VbNyxDE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bhypABiDxANCwXLoDR+M5aFk/dQT27Ns4ynJe7e+iIoORf128nfspPozqW4V3Gf0Uag1v+lQR6Fd5uVlAUoZFPrBNS4ZOyl/tLd37zHjop1PUNQzo/v+gfh7Iq9HHXZzjZYhNCHRcz83p11dD5qPLT6jNdgCRaQIKeLZ2zQFWm4= 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=mXxfFzZw; arc=none smtp.client-ip=209.85.208.170 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-f170.google.com with SMTP id 38308e7fff4ca-2e6f51f9de4so2470031fa.3 for ; Mon, 27 May 2024 16:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716851761; x=1717456561; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iKTdzlNEkZJDeB62d/owKD2BDh8/+OHG29/inxAJauQ=; b=mXxfFzZwi8EWpPU01Y4tCV3+FjiQ6G5NaNqRvBfsWppolxdw799XQaaFBqDnKbgnZm /ViCIghYeECnNTYHo6ymRuxDJ5QAr2QWNiJkHhIzyIUgxBTUFoIYxp/w9p30cB6/xeCa b8FoS7OLtDz/hmmofag83inAQQQa/c+UN6JOAATjJ/bTsS+buUK5Pq22SAvrQ1dHv/yP qvCskzPz2QZo/hOqLrL7qB5EuupW4UesEFGCt1zoseD7N7C5iTapGqKh1jh62sL6hXZu cHb7we9qTkjwOHuy9ZIogfYyXwPvsmmHdyiARwC+herRJICF58J5M3S2b3JdRcirLy28 p2RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716851761; x=1717456561; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iKTdzlNEkZJDeB62d/owKD2BDh8/+OHG29/inxAJauQ=; b=OZBMaoZqzHV2Fx/XXoyPoeNzbpfIH+2CH3aSvvOvHdPZnRNcM549qMjVxbzA1UpfpN /y2jQHDylzl4Td1+oNh0cc1HIQnuPrcSAbK2iqkCh5SNrPFQ+atuoRGyM4JnbnFFWpDN LDgDsDfCuRlYM8UGpmc3Yk3JFvN2Zk0dc7gM5cxyAoqxeQaCsstnkmSK5ysDwqiNfA6Z TMPd1WDF2gh7vkIKzuPzPZy/x2r4HDjLrwTZJ8HKK+jmLkrhNjwnXoSmjEMcFs38tX6w y0oZIjXv6T2YfndhFmIDJsSLpvoayYKofGzEwOATotS6bMlqpupfIF2kJsDqlyHCvmGh kw5Q== X-Forwarded-Encrypted: i=1; AJvYcCVh0WEiXKfYcxkcCc02nvxm2eEGqZiFnw4amVrzDGCAv9dLQHk3rI0RiT1e+c/EhP00qRtvq0NY34Q5Qpsx63spazYVcOTPZlP9W9Lk X-Gm-Message-State: AOJu0YzVbiF3lunzm2SuRt12sIDKF3+PkrzyoD22Z1kGw+1Ow4HMwBX1 58itIi83ddiA780o5Po7nLlzHxsm5l0ryhCdC6Y/EnKPFaYwMgY7ILXWDADIaWk= X-Received: by 2002:a05:651c:504:b0:2de:8697:e08b with SMTP id 38308e7fff4ca-2e95b0c1620mr106716491fa.26.1716851761425; Mon, 27 May 2024 16:16:01 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e9866d87c5sm956961fa.95.2024.05.27.16.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:16:00 -0700 (PDT) Date: Tue, 28 May 2024 02:15:59 +0300 From: Dmitry Baryshkov To: Oliver Neukum Cc: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Hans de Goede , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Bryan O'Donoghue , Heikki Krogerus , Greg Kroah-Hartman , Konrad Dybcio , 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 Subject: Re: [PATCH v3 4/6] power: supply: lenovo_yoga_c630_battery: add Lenovo C630 driver Message-ID: References: <20240527-yoga-ec-driver-v3-0-327a9851dad5@linaro.org> <20240527-yoga-ec-driver-v3-4-327a9851dad5@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=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 27, 2024 at 02:26:36PM +0200, Oliver Neukum wrote: > On 27.05.24 12:03, Dmitry Baryshkov wrote: > > Hi, > > > +struct yoga_c630_psy { > > + struct yoga_c630_ec *ec; > > + struct device *dev; > > + struct device_node *of_node; > > + struct notifier_block nb; > > + struct mutex lock; > > + > > + struct power_supply *adp_psy; > > + struct power_supply *bat_psy; > > + > > + unsigned long last_status_update; > > + > > + bool adapter_online; > > + > > + bool unit_mA; > > + > > + unsigned int scale; > > why do you store unit_mA and scale? This looks redundant and like a source > of confusion to me. Here we just followed the AML code in ACPI tables. The unit_mA is a returned from the_BIX method, the 'scale' is used internally in the DSDT. If you think that it's better, I can change all '* scale * 1000' to 'if unit_mA then foo = bar * 10000 else foo = bar * 1000'. -- With best wishes Dmitry