Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp759246ybt; Wed, 1 Jul 2020 09:18:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza09MzWu4kyhRtsHE7RxxoNpTBlMrEqWbQLK4JbaPOr/n/BZONFuclDfBmhlsAZIquWjDq X-Received: by 2002:a17:906:3042:: with SMTP id d2mr22804036ejd.420.1593620320206; Wed, 01 Jul 2020 09:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593620320; cv=none; d=google.com; s=arc-20160816; b=0HQijCec0dBdK/KZCRiI19G6Be46RJCyoFR3v7kUhlTOdBfpvh/PkqfdZ+UDlmIt8v MXMPkKERpLjgvG19bVmKfQpLqneRI8Adv0xnKhS9vjP12Ni9FGIfy41ZNWnImmbzW3ma UdiQXU+5lS8LzLUmbxq2Cw+XgiRWXnn5rJevdcK/Xkx6xdh5l7p5htr8Ek0hp7TzFc1f 41OoaMNeu53sE1z4xLiy9fIoWOnXzbYaNcDCKhC/4I5df7hbDTTZ9cRc17feZi+eHIpH qW8Ebw6vppc9UOW5s3IFPK1MYBmo4mv60DmBB4/fpT/PPKHovOBw6OVASgQzXRyHVqe6 Vq2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9WPoC+4MyW3qnNiiwhqShaYgpjRjv0p2SDcxuyf5YO8=; b=DYLrimnWQM6lAyBQ2YVrQtTP6P87QdYOGlGwYUcF0AdufRRgylWmyxmxG6RL3cw0bl vDKvqTajWSfWTVWQwGq4h6ceSInDjpZcxU1Vz+/9CLebKx9J0WPBRIFtUJ9e3NjfESST nBlSZPXMz4WkkYkwBI9RmjwXVV34qUEKVZTrLNDsRzpZCucaURmnAHKND6Umh+feIcOr wFk+dcoYnxBAJnG+TGvzmIidc8reJQzN4+ckPShFmYgMdc8a9+YLoAiWhNptGXGwxuhW TaJJDJ2pi6F/lKn/vpOeM5I2IExJlDed1/0IAZ03iWNqfQ3UlA8P5ahYned5USmBM92h wwFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ko726iab; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si4056998ejo.267.2020.07.01.09.18.17; Wed, 01 Jul 2020 09:18:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ko726iab; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732329AbgGAQRQ (ORCPT + 99 others); Wed, 1 Jul 2020 12:17:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:45126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbgGAQRQ (ORCPT ); Wed, 1 Jul 2020 12:17:16 -0400 Received: from earth.universe (dyndsl-091-096-062-146.ewe-ip-backbone.de [91.96.62.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CF4E20760; Wed, 1 Jul 2020 16:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593620235; bh=5yCWPuDKKPBG+3wyVyrG68dBy5zQQVEAkJjSRZMx/r0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ko726iabypBH1VsVQwgsmGJP1Ucbw89m/xZTCOmYVcvQwMKF/tREOKGpu/6j0wiVb eUx7KeszqMCWFz0w2EowceW+z9AMfFGjj+gGenLgPgNawDtrrKODlI5xt+tMJh3Hpn VcHRO03+RxqZzomhATa9Rux5VMBXFAhIAoQ80q4o= Received: by earth.universe (Postfix, from userid 1000) id A99323C08CE; Wed, 1 Jul 2020 18:17:13 +0200 (CEST) Date: Wed, 1 Jul 2020 18:17:13 +0200 From: Sebastian Reichel To: Ricardo Rivera-Matos Cc: pali@kernel.org, robh@kernel.org, afd@ti.com, dmurphy@ti.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sspatil@android.com Subject: Re: [EXTERNAL] Re: [PATCH v14 4/4] power: supply: bq25150 introduce the bq25150 Message-ID: <20200701161713.f67htedosevy4oyp@earth.universe> References: <20200630215426.26450-1-r-rivera-matos@ti.com> <20200630215426.26450-5-r-rivera-matos@ti.com> <20200630233341.d5ztfv5rcbhjxi4r@earth.universe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 30, 2020 at 11:17:30PM -0500, Ricardo Rivera-Matos wrote: > [...] > > > +static int bq2515x_battery_set_property(struct power_supply *psy, > > > + enum power_supply_property prop, > > > + const union power_supply_propval *val) > > > +{ > > > + struct bq2515x_device *bq2515x = power_supply_get_drvdata(psy); > > > + int ret; > > > + > > > + switch (prop) { > > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: > > > + ret = bq2515x_set_batt_reg(bq2515x, val->intval); > > > + break; > > > + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: > > > + ret = bq2515x_set_const_charge_current(bq2515x, val->intval); > > > + break; > > > + case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: > > > + ret = bq2515x_set_precharge_current(bq2515x, val->intval); > > > + break; > > > + default: > > > + return -EINVAL; > > > + } > > > + > > > + return ret; > > > +} > > Expose those through the charger device. The battery device > > can expose maximum data (e.g. POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX), > > but should not control the charging itself. > ACK. Just to confirm this would eliminate the need for the > bq2515x_battery_set_property altogether as these three properties should be > set in the charger device. There will only be a bq2515x_battery_get_property > to report the CONSTANT_CHARGE_VOLTAGE_MAX and CONSTANT_CHARGE_CURRENT_MAX > values captured from the devicetree. Right. -- Sebastian