From patchwork Fri Jan 13 06:17:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 3960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp122800wrt; Thu, 12 Jan 2023 23:00:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3nvZ3xBGPf3tJKsBAfGuUTzIaoqRiQQmQt2eYKKQTU/jDoGmyt99Grx5Ayv3s1kgiaWeu X-Received: by 2002:a17:907:874c:b0:7fc:4242:f9ec with SMTP id qo12-20020a170907874c00b007fc4242f9ecmr67745109ejc.43.1673593227316; Thu, 12 Jan 2023 23:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673593227; cv=none; d=google.com; s=arc-20160816; b=o8XPXz1FVlME0dLl9cRdifoJBCKaIm7/BFn3QE6xt5u/aI9vu9up+4fpOr8Mf+scs4 hq5BUzth7nnuLpyZ3BxI3RXCpdOMdalG/AcOBws/aEmJ1J5c2lnvMmqWQtb8i5yOcraG ClMoe/B8f/e0yWTnEB+NoQ82GFMClrH1V7uWRFPXrKtm0V0ebS6LF1Z6aYjkbab7SRSe oBK9pSNJ7bvP01icZrptjGTArbFpxwLZ3UscQh6gLjiU8TGim4u/dKhOfIBl1V1HXR6p XQu6E04hhzoi6HCiKrFoO5fQ/xSE8DoBv9HF8OVQJOMPyIAg7dKWMtAeysXfxwRZ+xXu 7URw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=X6fGy4hcZaM4AVZur13EPDN9Tq5BheZdR247i/8BoLA=; b=G0GHEbXiE36oaHMZYNhdkAxi08ickY5JAX0WzioSb9ZvGawW3JJCZCxK1kehOeTSWC 1cHlbCBol4ZmV8fDw6jUbJQ1Fbyzzb9tNVuoK3clV1NgXLgMI7t5jKxyddS3zL++UX01 i/uxE57Mp0S3AY5vjV6AqnYv2kIpP13gSvsmVFO+4l/Nq4HzKNfUaV6Tx/SIYf18FETf O5ew1Yg/MTyyBuA6ET8C945ABVE1J6nxo2PrYEnQoYYlvq20IOvNCn44vOCMq0ye6Unz 65tfG9JAbzzUOE0mw4PHrstJQe4hSM5yTSvx2VPOh2Il/sMfde/PGMB++Wqnnp0X8Smh W+qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a056402280500b0046b2d74c08csi26044676ede.38.2023.01.12.23.00.03; Thu, 12 Jan 2023 23:00:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240922AbjAMG7Q (ORCPT + 99 others); Fri, 13 Jan 2023 01:59:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240795AbjAMG5E (ORCPT ); Fri, 13 Jan 2023 01:57:04 -0500 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F27C81C2E; Thu, 12 Jan 2023 22:42:28 -0800 (PST) X-MailGates: (compute_score:DELIVER,40,3) Received: from 192.168.8.21 by mg.richtek.com with MailGates ESMTP Server V3.0(2729:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:23:39 +0800 (CST) X-MailGates: (compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTP Server V5.0(16494:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:17:47 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Fri, 13 Jan 2023 14:17:47 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.20 via Frontend Transport; Fri, 13 Jan 2023 14:17:47 +0800 From: To: , , CC: , , , , , Subject: [PATCH RESEND v8 0/3] Add Richtek RT9471 3A battery charger support Date: Fri, 13 Jan 2023 14:17:43 +0800 Message-ID: <1673590666-24618-1-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754889692059215191?= X-GMAIL-MSGID: =?utf-8?q?1754889692059215191?= From: ChiYuan Huang This patch set is to add Richtek RT9471 charger support. The RT9471/D is a highly-integrated 3A switch mode battery charge management and system power path management device for single cell Li-Ion and Li-polymer battery. The low impedance power path optimizes switch-mode operation efficiency, reduces battery charging time and extends battery life during discharging phase. Since v8: - revert v7 for adding irq wakeup capable, i2c core already did it. Since v7: - Add irq wakeup capable. - Add missing header 'module.h' for MODULE_DEVICE_TABLE. Since v6: - Use 'ATTRIBUTE_GROUPS' macro to simplify the attribute coding. - Explain more details for sysoff_enable attribute. Since v5: - Remove one line wrapper. - Merge header content into source file, remove header file. - Remove 'charge_term_enable' sysfs entry and merge it into 'charge_term_current' property control. - Change MODULE_LICENSE from 'GPL v2' to 'GPL'. Following by the below discussion https://lore.kernel.org/all/YxAVAt2eWB3NFlrk@google.com/ - Recover all the change in sysfs-class-power. - New a sysfs-class-power-rt9471 file. - Remove 'charge_term_enable' sysfs entry, directly integrate it in 'charge_term_current' power supply property control. Since v4: - Remove the line for the owner field in driver. - Add the documentation for sysfs entries. Since v3: - Move unevaluatedProperties line after $ref for binding patch. - Add Reviewed-by tag for binding patch. Since v2: - Remove the properties for interrupt controller things in the binding documentation. - Fix dtc error for typo, it's 'regulator-name', not 'regulator-compatible'. - Add regulator min/max microamp to allow otg vbus current adjustable in example. - Specify the active-level for charge-enable-gpios in binding example. - Fix checkpatch error about 'foo * bar' to 'foo *bar' in psy_device_to_chip function. - Specify the member name directly for the use of linear range. ChiYuan Huang (3): dt-bindings: power: supply: Add Richtek RT9471 battery charger power: supply: rt9471: Add Richtek RT9471 charger driver Documentation: power: rt9471: Document exported sysfs entries Documentation/ABI/testing/sysfs-class-power-rt9471 | 32 + .../bindings/power/supply/richtek,rt9471.yaml | 73 ++ drivers/power/supply/Kconfig | 16 + drivers/power/supply/Makefile | 1 + drivers/power/supply/rt9471.c | 931 +++++++++++++++++++++ 5 files changed, 1053 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9471 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml create mode 100644 drivers/power/supply/rt9471.c