From patchwork Sat May 6 15:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 679695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CB30C7EE2C for ; Sat, 6 May 2023 15:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbjEFPzM (ORCPT ); Sat, 6 May 2023 11:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233051AbjEFPzI (ORCPT ); Sat, 6 May 2023 11:55:08 -0400 Received: from sonic308-18.consmr.mail.ir2.yahoo.com (sonic308-18.consmr.mail.ir2.yahoo.com [77.238.178.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27FA914923 for ; Sat, 6 May 2023 08:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1683388504; bh=y7nBXmAWn5fuyd+W51PTlojU0wcY54lQ2u9CMVZDNDM=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=FSXHaszpe8+R06HwaygqEkYEfX7+Iq7O7n6qn401LgxnRVwHb1+xIfLh5qEYPDOU500F9JeVBHsN2dO5/QmPM9U60HdeVN/FsCZ1yMmrVSXrxuDkPHQs94sS1FXZHur9YokW1kBz7lgeyoOC79KnhRvi51qhpSheIbfmx3EiPYKAynpgp96N6n5rPkc0zZgI9JtY5hKAljWu5uYhIJ7NLKyFPqzm3Ko8rRQTaeHGcn9/XrJwWWpHp3fSIBfmYISA2Zpbm5d56OZWF0bzle3pm5OaxtG9QVxrGY8DVqy/qum6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ih9IV3i7LI5Uak2AcRoGEhuRy4ntgdRwBjRav6vqysjXnK3vDOcTKMTlqd7_gRo_7 tamHsAMmDpZ7Hsy7Ld27_jPRoEkLvcUrziyEcBCka3UK2uUzDM9oeBa_3oIzW2L4ri9NXjfKTTp. nmbhDOIbReSpf6j.PU4E4NrLON3XuBX_Iboq71YKtScB0r.stZzPGZYwEDZlWWWluWwk._8Eg5wh orEomx.njNsnD1vbmFpU12OBXhhCAhnRAZoMJNYN_XGhe1kT1S7.Pkcs6x6FOkBsK5Xu71V6bQOF KkWVc56Eh6tCxZCj170PHjdti7UIXOphyThNPFQmZXZ5Cn3w9lEsSGPYroOmMo4kAgFmeHNZTo.Q x5nMr1HSf_YyfZ4DXIwmnx..H7pfhXjIAKzL3HGfhS_9DQUbjVl9fOD1Jky_pDD7LmGWLzFKd7sW vnW0v6J_mjmsW9mCYIFVln0pwxzg7PdnLdDeizoszuZ5KFHxHHYHi865ioPLdsmUUhe_PyKmAtFQ 8NCpXKYY9kDm6HksCxptNhVzqzpyr_qoLTAouze2J0QbFdUXfQr2LZxrCe8.tl_UdUJDa8ajJNbi ahfH99WszOWSv6vi16WOqsemdGqK29roRUiiM8aRtG5JDb80fKU8eR4ld07GKSr.0OyXRXzcPj7f .Uhtv8_vTpyB1.RahxG568uLrxC5mgbs_s97oTobksRulGJ74i6VrubWUc2rqPkDTzBYzfMA9z5M CvXjRbVpVbuzZMrXa0WE- X-Sonic-MF: X-Sonic-ID: 9852f431-f38e-4c96-bd14-9c7684c2562e Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Sat, 6 May 2023 15:55:04 +0000 Received: by hermes--production-ir2-74cd8fc864-s5qrx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2f796affa0781b2e3002453351a4dea5; Sat, 06 May 2023 15:54:59 +0000 (UTC) From: Jakob Hauser To: Sebastian Reichel , Lee Jones , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Beomho Seo , Chanwoo Choi , Stephan Gerhold , Raymond Hackley , Pavel Machek , Axel Lin , ChiYuan Huang , Linus Walleij , Henrik Grimler , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v4 0/8] Add RT5033 charger device driver Date: Sat, 6 May 2023 17:54:27 +0200 Message-Id: <20230506155435.3005-1-jahau@rocketmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 References: <20230506155435.3005-1-jahau.ref@rocketmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patchset adds the charger driver "rt5033-charger". It is part of the multifunction device rt5033. The patchset is based on an older version by Beomho Seo of March 2015. For more information on the history and setup of the patchset see the cover sheet of version v1, there is a link further down below the changelog. Changes in v4: - Rebased to next-20230505 - Patch 6: Towards the end of the patch, where getting the extcon device, the procedure was changed to first get the connector node and than go one level up to get the extcon. - Patch 8: For rt5033-charger changed the "extcon" phandle into a "connector" phandle. Updated the connector property description (in charger) and examples (charger and mfd) accordingly. v1: https://lore.kernel.org/linux-pm/cover.1677620677.git.jahau@rocketmail.com/T/#t v2: https://lore.kernel.org/linux-pm/cover.1681646904.git.jahau@rocketmail.com/T/#t v3: https://lore.kernel.org/linux-pm/cover.1682636929.git.jahau@rocketmail.com/T/#t The result of the patchset v4 can be seen at: https://github.com/Jakko3/linux/blob/rt5033-charger_v4/drivers/power/supply/rt5033_charger.c Jakob Hauser (7): mfd: rt5033: Fix chip revision readout mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver power: supply: rt5033_charger: Add RT5033 charger device driver power: supply: rt5033_charger: Add cable detection and USB OTG supply power: supply: rt5033_battery: Adopt status property from charger dt-bindings: Add rt5033 mfd, regulator and charger Stephan Gerhold (1): mfd: rt5033: Drop rt5033-battery sub-device .../bindings/mfd/richtek,rt5033.yaml | 113 +++ .../power/supply/richtek,rt5033-charger.yaml | 64 ++ drivers/mfd/rt5033.c | 8 +- drivers/power/supply/Kconfig | 8 + drivers/power/supply/Makefile | 1 + drivers/power/supply/rt5033_battery.c | 24 + drivers/power/supply/rt5033_charger.c | 728 ++++++++++++++++++ include/linux/mfd/rt5033-private.h | 64 +- include/linux/mfd/rt5033.h | 10 +- 9 files changed, 993 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml create mode 100644 drivers/power/supply/rt5033_charger.c