From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CBDAC433DF for ; Mon, 15 Jun 2020 17:58:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6CC54206F1 for ; Mon, 15 Jun 2020 17:58:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KFQuTv1Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CC54206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pmroVFK1NcIG/gsk7J4ptB7IYwdEA+5In0g/aHo7Kp0=; b=KFQuTv1QwZCY+O j6gbPU8fKxk/GI0yFdAJtpvrpnS3eyiBLkgPkpcLVz4mbprcPx0q2yEnfA16Mk/N2LtGRAQfIeXyO gDdYKWuKtGHkJfKRZevf8Nx3ZS7fCr2e7HR58bniand5kLvSdGmshZvUU9yNVJbKPwIzv+g7HrqAX NCrMQV3gCSNd70e1S82qfPgqHsstdsW7gE5/SmUEOiPDps5JFSrA0R3EhwIvonYkPk005m510w20g bDSqdha1M0T34BlPZSrsnqmTo5B4TDgJpwbD7jJMuhpDWxndz+J8hL+hJqa7LnktG8TO+DiuhSXS9 zzJwkSYySVUhk410T+PQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jktNi-0000aM-Nr; Mon, 15 Jun 2020 17:58:50 +0000 Received: from mail-io1-f65.google.com ([209.85.166.65]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jktNg-0000Zh-0n for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 17:58:49 +0000 Received: by mail-io1-f65.google.com with SMTP id u13so1288697iol.10 for ; Mon, 15 Jun 2020 10:58:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/74HbfroHB61O/mrzbKJJjBB8AZlHWxP2oBPibXkxY8=; b=UD4vttqTPBbxmQ2Aul+edi2fVy+RJSpWfky0X2R+eIs5ZbHyOwQ5t0yj8pYjrOUARd w2biGD54/ctLxVXHoPJkkwqlXS5JGoHI/1v8rAnf0ykofZkOPSsbHOgG9OlpRzClZv0Q OVPWpzKuh/IqIRoLvn76Jh5iI6oVuke/7/h+hu/XHavOO3DWgpzB7U1bk/gVQcJ8ZFyJ XMPrGJ1bdGh283mQnnLFz55ybqoCaLi6Ev07ozS8gpSjcVdHIF9vcx0fFHhaRhaX6ea+ ornL743p5HqoqFBJrH+8B9BmBfI44egKpoJIx9361COJW0bgUJLbUcm5Gr/DRXZnp9jM yOPg== X-Gm-Message-State: AOAM533XVBmPZ/En68lfNhcFoGbXUr8kWiqN9kh0CqHShXf/QbiJ9ypz OhQZ9VN/4e8bN1BK5BJ6JA== X-Google-Smtp-Source: ABdhPJzHHZp4+2D2CPnREtsOrP4HU0FKnjC7ZBKz9hcq/Ll5x38zJ+ihu5f8fyhIDgmwsspw8rJWgw== X-Received: by 2002:a6b:91d4:: with SMTP id t203mr28373543iod.149.1592243927188; Mon, 15 Jun 2020 10:58:47 -0700 (PDT) Received: from xps15 ([64.188.179.251]) by smtp.gmail.com with ESMTPSA id p9sm8303940ile.87.2020.06.15.10.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 10:58:46 -0700 (PDT) Received: (nullmailer pid 2044691 invoked by uid 1000); Mon, 15 Jun 2020 17:58:44 -0000 Date: Mon, 15 Jun 2020 11:58:44 -0600 From: Rob Herring To: Sebastian Reichel Subject: Re: [PATCHv2 3/6] power: supply: gpio-charger: add charge-current-limit feature Message-ID: <20200615175844.GA2032047@bogus> References: <20200605224403.181015-1-sebastian.reichel@collabora.com> <20200605224403.181015-4-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200605224403.181015-4-sebastian.reichel@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_105848_055680_9DF2E82F X-CRM114-Status: GOOD ( 16.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Sebastian Reichel , Haojian Zhuang , Russell King , linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Robert Jarzmik , Daniel Mack , Emil Velikov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jun 06, 2020 at 12:44:00AM +0200, Sebastian Reichel wrote: > Add new charge-current-limit feature to gpio-charger. > > Signed-off-by: Sebastian Reichel > --- > .../bindings/power/supply/gpio-charger.yaml | 31 ++++ > drivers/power/supply/gpio-charger.c | 140 ++++++++++++++++++ > 2 files changed, 171 insertions(+) > > diff --git a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml > index 30eabbb14ef3..e11cfdc68a51 100644 > --- a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml > +++ b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml > @@ -39,6 +39,25 @@ properties: > maxItems: 1 > description: GPIO indicating the charging status > > + charge-current-limit-gpios: > + minItems: 1 > + maxItems: 32 > + description: GPIOs used for current limiting > + > + charge-current-limit-mapping: > + description: List of touples with current in uA and a GPIO bitmap (in s/touples/tuples/ > + this order). The touples must be provided in descending order of the and here. > + current limit. > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > + items: > + items: > + - description: > + Current limit in uA > + - description: > + Encoded GPIO setting. Bit 0 represents last GPIO from the > + charge-current-limit-gpios property. Bit 1 second to last > + GPIO and so on. Seems a bit odd that bit N doesn't represent index N of the gpios. > + > required: > - compatible > > @@ -47,6 +66,12 @@ anyOf: > - gpios > - required: > - charge-status-gpios > + - required: > + - charge-current-limit-gpios > + > +dependencies: > + charge-current-limit-gpios: [ charge-current-limit-mapping ] > + charge-current-limit-mapping: [ charge-current-limit-gpios ] > > additionalProperties: false > > @@ -60,4 +85,10 @@ examples: > > gpios = <&gpd 28 GPIO_ACTIVE_LOW>; > charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>; > + > + charge-current-limit-gpios = <&gpioA 11 GPIO_ACTIVE_HIGH>, > + <&gpioA 12 GPIO_ACTIVE_HIGH>; > + charge-current-limit-mapping = <2500000 0x00>, // 2.5 A => both GPIOs low > + <700000 0x01>, // 700 mA => GPIO A.12 high > + <0 0x02>; // 0 mA => GPIO A.11 high > }; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel