Message ID | 20240819164619.556309-1-macroalpha82@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5F3FC52D6F for <linux-arm-kernel@archiver.kernel.org>; Mon, 19 Aug 2024 16:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/e5lsHcVaB+uAytpXe/h2T5BUGUbMv4au3JS+eKlceA=; b=nLcy7VgrGXxyD0x7EzIiCuiDmq SgHbCD7ZflktEC+g61CNrl9p6YftnWB2i5ivjmhHvLE/sGIaZFl6d19/69KEqGMF2d8HJtO+kfWiV eFaGUPugUVH2gIDUAGNN2qcoqD+8zmz+HLjHjJnWHByAkdegZlyCAnxbqSVc2F/bnK6eDiv1WZLuO xZ6oCH3rPIkMULtkQyCzVTq2B4tVqT7zSeTBPhvQ0b3KlQ+ANAMU3jI8x/Im5TT988hm96aM3lk/d RkQK/uQT+pW536v8Cle4EwFunEl2NereOPzSXZGlrNyGEYCaWgMt78R9tI13xf+WUW23JGAWwWmCJ 9WED+5/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5ZX-00000002EvN-1HEX; Mon, 19 Aug 2024 16:49:35 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5Yi-00000002Edy-0vl8 for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 16:48:45 +0000 Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-70943713472so1994108a34.2 for <linux-arm-kernel@lists.infradead.org>; Mon, 19 Aug 2024 09:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724086122; x=1724690922; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/e5lsHcVaB+uAytpXe/h2T5BUGUbMv4au3JS+eKlceA=; b=d60e+vPE6ZTIKzhU91smjPJ6p9OWsM4PT9ScfzWaby1TU7vtsqcqZ/jJXTZJDZCiBh ta7bo/Xj1trFtLg0B+q5qCLJ05fi3i+Xxrax8N6jgjYs8Lcadse1tCZnvwOf05eZCnmx jm5qYLaCqAT2mN0A/+YscipMVf/08mkC0PO/moDbpn7P3NWfDNSzSStMVMgPTlkJrASM TSspwgYQDgWQCig39lI2YrxR8d3umaRW/NFUOmGa/w3GDMNXzi7u9LxFtVZ9VQNAJTEk mT+iF39aoetft8sg7vjD5eYB2Rjd/OZ2mvYhIH65aqPIBN+3/paFTMLS50ENPMCj7590 CE/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724086122; x=1724690922; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/e5lsHcVaB+uAytpXe/h2T5BUGUbMv4au3JS+eKlceA=; b=OY6U+YwLH+WLS4sWD/myTSBvES3gIBR89y3kcRPsa8Qpd+cwfE3XS+XUpqgS/epe5t N8IUs8N/9/PiwqV0Fyvp+lostglB2AVFcKoc94z2MarQXd+j4ontZaMYjlZlc27qVU1p XhTEfNunq10sGVC8a8uV+XK+mHqyDxXPhvVNSd2fAE/glWMsyYcZUrO5y7PWIhklaEB+ Ycn2Vtfvn+8w2/U8/lVWiGx0XUu+nahVjgRF5KW5aYFp6zknyZhBcQH+yrsP52jFNcC6 c2PNXDnukjVSaz4YPN5S8VZbZaPuVagilaxRlPwfAY4OzS43EWU+uw2bT6UMO+tYFSBm Tz7g== X-Forwarded-Encrypted: i=1; AJvYcCUhgLzrwJOFpfr6QVUf0q0pwWJYvoj2dmoW3GJJDEZWK+4BcoJcmol+kMPG8k9H6hjkSGpPaH2JGvC9C6iF0DrXMfZP5eDdyX1WH1hOz9QDtOZb4u8= X-Gm-Message-State: AOJu0YwW73RvJUEl8Mv0Oywci0BK71E+4iK51c8P5qT2WZQkb7ulfcaU rj/0hDC/5rheJzd1fFU07S1JK/LYL2WZivBOPsaRIqTOry9buolTHGyo9A== X-Google-Smtp-Source: AGHT+IHUayXAxzAfw8JT4WbVwDnTS2IAPvqLrAz9kWPM8obo31aP1Msh/iEPvQgqi656nkRvCtLl4g== X-Received: by 2002:a05:6830:6602:b0:708:d84d:f62a with SMTP id 46e09a7af769-70cac89c004mr15724939a34.22.1724086122192; Mon, 19 Aug 2024 09:48:42 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70ca649c61csm2332428a34.26.2024.08.19.09.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 09:48:42 -0700 (PDT) From: Chris Morgan <macroalpha82@gmail.com> To: linux-sunxi@lists.linux.dev Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, quentin.schulz@free-electrons.com, mripard@kernel.org, tgamblin@baylibre.com, aidanmacdonald.0x0@gmail.com, u.kleine-koenig@pengutronix.de, lee@kernel.org, samuel@sholland.org, jernej.skrabec@gmail.com, sre@kernel.org, wens@csie.org, conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, lars@metafoo.de, jic23@kernel.org, jonathan.cameron@huawei.com, Chris Morgan <macromorgan@hotmail.com> Subject: [PATCH V3 00/15] Add Battery and USB Supply for AXP717 Date: Mon, 19 Aug 2024 11:46:04 -0500 Message-Id: <20240819164619.556309-1-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_094844_286408_90252EB3 X-CRM114-Status: GOOD ( 15.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Add Battery and USB Supply for AXP717
|
expand
|
From: Chris Morgan <macromorgan@hotmail.com> Add support for monitoring the USB charger and battery charger on the AXP717 PMIC. This required some driver refactoring of the axp20x USB and battery charger as the AXP717 is somewhat different but can still benefit from some common elements. Note that as of now the charging current now value may be incorrect as the scale and offsets were not documented in the datasheet. I suspect the scale is 1 and the offset is somewhere around 450mA though. Changes from V2: - Added constraints for input-current-limit-microamp constraints for x-powers,axp20x-usb-power-supply.yaml. - Used FIELD_GET() and removed unnecessary -EINVAL per comments from Jonathan Cameron. Changes from V1: - Refactored against mainline to remove BOOST pre-requisite. - Corrected commit subjects for DT bindings. - Split refactoring and AXP717 support into different patches. - Added IRQ for VBUS over voltage. There appears to be a bug with the VBUS fault IRQ because it is assigned IRQ num 0. - Corrected battery driver to report POWER_SUPPLY_PROP_VOLTAGE_MIN and POWER_SUPPLY_PROP_VOLTAGE_MAX instead of *_DESIGN. Chris Morgan (15): iio: adc: axp20x_adc: Add adc_en1 and adc_en1 to axp_data power: supply: axp20x_battery: Remove design from min and max voltage power: supply: axp20x_battery: Make iio and battery config per device power: supply: axp20x_usb_power: Make VBUS and IIO config per device dt-bindings: power: supply: axp20x: Add input-current-limit-microamp power: supply: axp20x_usb_power: add input-current-limit-microamp dt-bindings: power: supply: axp20x-battery: Add monitored-battery dt-bindings: iio: adc: Add AXP717 compatible dt-bindings: power: supply: axp20x: Add AXP717 compatible dt-bindings: power: supply: axp20x: Add AXP717 compatible mfd: axp20x: Add ADC, BAT, and USB cells for AXP717 iio: adc: axp20x_adc: add support for AXP717 ADC power: supply: axp20x_usb_power: Add support for AXP717 power: supply: axp20x_battery: add support for AXP717 arm64: dts: allwinner: h700: Add charger for Anbernic RG35XX .../bindings/iio/adc/x-powers,axp209-adc.yaml | 12 + .../x-powers,axp20x-battery-power-supply.yaml | 7 + .../x-powers,axp20x-usb-power-supply.yaml | 70 ++- .../sun50i-h700-anbernic-rg35xx-2024.dts | 21 + drivers/iio/adc/axp20x_adc.c | 182 +++++- drivers/mfd/axp20x.c | 25 +- drivers/power/supply/axp20x_battery.c | 590 ++++++++++++++++-- drivers/power/supply/axp20x_usb_power.c | 353 ++++++++++- include/linux/mfd/axp20x.h | 27 + 9 files changed, 1186 insertions(+), 101 deletions(-)