Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp815037ybg; Tue, 9 Jun 2020 13:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9AA5an+SF0wc6nVLAyWbPl3NK0+85J9F6T7DVPeQ3Jopd9UrACkshqmETeJBBVMGzIoam X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr27543277edy.277.1591735071941; Tue, 09 Jun 2020 13:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591735071; cv=none; d=google.com; s=arc-20160816; b=nJn4ORyuF5f1T5Xv1ROv6aCZ1bmxXERbP+gFI5vtTaX/wG6JYNzTmWPYWHZ/PmqIqo Z2Ky40WbPuTyTxlT2ElVg+bJjcWAeajgpBoMh0NxxP5DZKaAIunWyL34joptQgc+DjKr UItGeNXLCQpsNliGRWA8GGejq5DvVFtPcks5mIKiRJWIsdXdzCzLv/xUeRMY1s6zdzIU h55B5HXg0bO9iKBDQ/k/HjzcZxIF4n2+kkLYcJAkV6LDUIchrxuEsWP+lmce50FqICsC t72P1pI5K9LOsTZvRu51GFip1IuABmwutTZlG+uvM0HQ0Y0sZNHR4l5XUJrFeAZ5O/Lu i3Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=AREZFen+390F/g/lLqSOI2E3OTadaJweieFHsKjOGEo=; b=mKDNe2XW97jNs1geJ2h70UwesmoXa598w8hTcIMqM2rmNpt/yM/Z+OrXyZ8p/wFZ4J KfZwBLw4k0p6/mycH3MtYZglVwKHQeRLQBvFWkHWu49NxhBTLvQAOkTxZWSzc2Q/hcmk /vjGM3ya93gJgweYbqpkyKkewZPLIGIuVfNNQ5L5cL8sx5J/1zfNhu9WykLEA/7+0QrT gfx/SFNGgmA7+y91fXysXFH2GEDfGQLZSBfs2tjyQH8EQctxetmvj2ePaA7OzSaT1/lY mME2ClXDO8tNIMQtb6beaxKQYy2+xGxc8+pBJddzO4hdJi1RXpay/F2VJ1i6JuehGaRW Vumw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chromium.org header.s=google header.b=mCASZcRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si11455402ejm.613.2020.06.09.13.37.29; Tue, 09 Jun 2020 13:37:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@chromium.org header.s=google header.b=mCASZcRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731007AbgFITWo (ORCPT + 99 others); Tue, 9 Jun 2020 15:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgFITWn (ORCPT ); Tue, 9 Jun 2020 15:22:43 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8681DC03E97C for ; Tue, 9 Jun 2020 12:22:43 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d8so5241226plo.12 for ; Tue, 09 Jun 2020 12:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AREZFen+390F/g/lLqSOI2E3OTadaJweieFHsKjOGEo=; b=mCASZcRtsW2E9COdZCGGeuE6fxEOLG8kDxoXySFgqYfZkelvoZBw41VZgZ7yG7T2UY 3NumPgt5kZ5QkhfHFo9v9bI06oehP5L1msin12ey1vmNVyZbK5eAv0BaRAsETVGqaKP4 04KW+40DI4sYL6yy17H4KQCE7TtXDHFiyQIT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AREZFen+390F/g/lLqSOI2E3OTadaJweieFHsKjOGEo=; b=nm2d/JCvSsN0n/m1dU59HdylkOPFQ9rOFf7rSVtGmUHPTeeq+LVggA41vA7/BNSSfV WfnIUWyF/zRzTHMYpHtxteRD4VwqLMlJaM9sMp1CpKgBDFEnAWXwRf1KKkl0rfz1rVhX rtacxAAkQt8m/nSX+WTc2qvHs20CT0mktQ8N4KRjC/uxvZr5fEofsh2laQtVDZtJYGTp /4k/2ae1J9CQBe2crYQgetSWtNNJB3z1EhGwgmLzdIl5SAoQxPzBh6VoEthPAbvp16D9 6iMjXFfdjjTkhC2Nka61N1TsKwuaNE9CGP6j0USl9TFX2be0nFXDBqTwCpvNPiwnnNSZ ktDQ== X-Gm-Message-State: AOAM532wP+nJff9GK4m3zIL8XWrmV0ivt/OjLBKZ/Zf2tCFF9ZcrjP25 wBwBZjJpK50nPZPtP2trptFCDg== X-Received: by 2002:a17:902:bc86:: with SMTP id bb6mr4501337plb.243.1591730562043; Tue, 09 Jun 2020 12:22:42 -0700 (PDT) Received: from twawrzynczak.bld.corp.google.com ([161.97.245.194]) by smtp.gmail.com with ESMTPSA id p12sm10883174pfq.69.2020.06.09.12.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 12:22:41 -0700 (PDT) From: Tim Wawrzynczak Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Tim Wawrzynczak Subject: [PATCH 1/2] power: supply: Add new power supply prop for date of manufacture Date: Tue, 9 Jun 2020 13:22:36 -0600 Message-Id: <20200609192237.32571-1-twawrzynczak@chromium.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Smart Battery Specification v1.1 defines Manufacture Date as one of its availabe registers. This patch adds this as a property so that power_supply drivers can support the property and report it in syfs. Signed-off-by: Tim Wawrzynczak Change-Id: I90bf8c67b0cd531f2155404424a98302a1c931d6 --- drivers/power/supply/power_supply_sysfs.c | 3 ++- include/linux/power_supply.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index f37ad4eae60b9..ac6d9992a8675 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -171,7 +171,7 @@ static ssize_t power_supply_show_property(struct device *dev, ret = sprintf(buf, "%s\n", power_supply_scope_text[value.intval]); break; - case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_SERIAL_NUMBER: + case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_MANUFACTURE_DATE: ret = sprintf(buf, "%s\n", value.strval); break; default: @@ -310,6 +310,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(model_name), POWER_SUPPLY_ATTR(manufacturer), POWER_SUPPLY_ATTR(serial_number), + POWER_SUPPLY_ATTR(manufacture_date), }; static struct attribute * diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 28413f737e7d0..67839bb0a46b6 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -162,6 +162,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_SERIAL_NUMBER, + POWER_SUPPLY_PROP_MANUFACTURE_DATE, }; enum power_supply_type { -- 2.26.2