Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp747478ybk; Wed, 13 May 2020 12:00:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZxSsT9wX1kFO8vMVI+DvhebmlyNO0EhcRoSab1IiVHJxmrhsGgD6+WXuO7pT/v82mmv5n X-Received: by 2002:a05:6402:286:: with SMTP id l6mr988565edv.253.1589396435196; Wed, 13 May 2020 12:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589396435; cv=none; d=google.com; s=arc-20160816; b=PsEBqYV2kfIcEXG0oTd9lfhHd6HYHNPyMiu6VmEamc0jVvNr04uVo1lJtBxcONgpJV 3jy/m0ds2JQ2EG7Ry1DR0fJECBsTQLZRU6yJjsihJYND2jIEYe4fqXsZd062KyIjzRZx U5Be/60QD0SJs2ouqQ/CheIkvDt2min1DysuPu3+2PKYEWMOTOiAV6fpVBBb2HDpPmXh TLaw+1hnek8Q6H7c1zeHN0FJW61VqKMN5pP/2mQlAceUf7jQ0JO1Qz8lD0VaOIG8EbNM wtderDZPpxjloIWTf7Qpmy+sxr4yyqNtmquBn4nuTRSkI5IQeQP2ohmp7hokwtdDExGO 3Xqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Hfo1euNFKv9WMPPpvFaH1YTVCxRc3lIi6aKYCqJM3us=; b=WZ5XHx7hckFGCfpoaxFtZZIZ9buQf4KQc7SKeU67EJPBN2JOAH7qeCalAqjfToyTIa VRhF79CzMj53MO4BpqmY+vXUOyorznrqHjVj7Kg9J4iLD1BstEPrLDYh6FqKqGF3fEKW tn702+wUt0hvQD8Josqakr/1ulWLezIQ2UoHFftDTtEy3vbMGKK660yaMJC43U7mWABy 2z9TxtP1wWBUaV04dNzyVYA918LH/7xftAGAB2Zpgs7Dv1sBR0FbhAjZI/d+SgFLgri3 itVrl6qQ8xup41ksTIpWGITMQxzc5zYij3efS16P78gAKp3lS7POJU5TORfhCDaMKBA3 kwrw== ARC-Authentication-Results: i=1; mx.google.com; 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch20si377970ejb.31.2020.05.13.12.00.11; Wed, 13 May 2020 12:00:35 -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; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390384AbgEMS4f (ORCPT + 99 others); Wed, 13 May 2020 14:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2390362AbgEMS4d (ORCPT ); Wed, 13 May 2020 14:56:33 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62B77C061A0E; Wed, 13 May 2020 11:56:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id DAE132A2521 Received: by jupiter.universe (Postfix, from userid 1000) id 63EF24800F8; Wed, 13 May 2020 20:56:29 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Rob Herring , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv1 00/19] Improve SBS battery support Date: Wed, 13 May 2020 20:55:56 +0200 Message-Id: <20200513185615.508236-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset improves support for SBS compliant batteries. Due to the changes, the battery now exposes 32 power supply properties and (un)plugging it generates a backtrace containing the following message without the first patch in this series: --------------------------- WARNING: CPU: 0 PID: 20 at lib/kobject_uevent.c:659 add_uevent_var+0xd4/0x104 add_uevent_var: too many keys --------------------------- For references this is what an SBS battery status looks like after the patch series has been applied: cat /sys/class/power_supply/sbs-0-000b/uevent POWER_SUPPLY_NAME=sbs-0-000b POWER_SUPPLY_TYPE=Battery POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_CAPACITY_LEVEL=Normal POWER_SUPPLY_HEALTH=Good POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_CYCLE_COUNT=12 POWER_SUPPLY_VOLTAGE_NOW=11441000 POWER_SUPPLY_CURRENT_NOW=-26000 POWER_SUPPLY_CURRENT_AVG=-24000 POWER_SUPPLY_CAPACITY=76 POWER_SUPPLY_CAPACITY_ERROR_MARGIN=1 POWER_SUPPLY_TEMP=198 POWER_SUPPLY_TIME_TO_EMPTY_AVG=438600 POWER_SUPPLY_TIME_TO_FULL_AVG=3932100 POWER_SUPPLY_SERIAL_NUMBER=0000 POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_MAX_DESIGN=10800000 POWER_SUPPLY_ENERGY_NOW=31090000 POWER_SUPPLY_ENERGY_FULL=42450000 POWER_SUPPLY_ENERGY_FULL_DESIGN=41040000 POWER_SUPPLY_CHARGE_NOW=2924000 POWER_SUPPLY_CHARGE_FULL=3898000 POWER_SUPPLY_CHARGE_FULL_DESIGN=3800000 POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=3000000 POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE_MAX=12300000 POWER_SUPPLY_MANUFACTURE_YEAR=2017 POWER_SUPPLY_MANUFACTURE_MONTH=7 POWER_SUPPLY_MANUFACTURE_DAY=3 POWER_SUPPLY_MANUFACTURER=UR18650A POWER_SUPPLY_MODEL_NAME=GEHC -- Sebastian Jean-Francois Dagenais (1): power: supply: sbs-battery: add ability to disable charger broadcasts Sebastian Reichel (18): kobject: increase allowed number of uevent variables power: supply: core: add capacity error margin property power: supply: core: add manufacture date properties power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED power: supply: sbs-battery: Add TI BQ20Z65 support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support power: supply: sbs-battery: simplify read_read_string_data power: supply: sbs-battery: add PEC support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support power: supply: sbs-battery: add MANUFACTURE_DATE support power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support power: supply: sbs-battery: fix idle battery status power: supply: sbs-battery: switch from of_property_* to device_property_* power: supply: sbs-battery: switch to i2c's probe_new power: supply: sbs-battery: constify power-supply property array dt-bindings: power: sbs-battery: Convert to yaml Documentation/ABI/testing/sysfs-class-power | 45 ++- .../power/supply/sbs,sbs-battery.yaml | 83 +++++ .../bindings/power/supply/sbs_sbs-battery.txt | 27 -- drivers/power/supply/power_supply_sysfs.c | 5 + drivers/power/supply/sbs-battery.c | 348 +++++++++++++----- include/linux/kobject.h | 2 +- include/linux/power_supply.h | 5 + 7 files changed, 404 insertions(+), 111 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/sbs,sbs-battery.yaml delete mode 100644 Documentation/devicetree/bindings/power/supply/sbs_sbs-battery.txt -- 2.26.2