Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4617453pxj; Wed, 12 May 2021 09:20:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzChnDxg+PNSdvyk4TnnGD4jes5dA+Tk0X2ITiB9QEvgquzaA4h1VBihbubAlr1NELLZWUL X-Received: by 2002:a17:906:fcdc:: with SMTP id qx28mr6780646ejb.375.1620836400463; Wed, 12 May 2021 09:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836400; cv=none; d=google.com; s=arc-20160816; b=f0pmKQwovblwDcieBRWZ2rAZRdMtl0GqdJix/OhuEuCVDx1BWeZxYcs9jROc9Kr84E B7a5nRNQKWIlYMwSX3//NNQgnirkIAr4ZAql8/SLxaXwZLy5sQf+SI3N0OSfUwMz+GYw cw/rcIy2PKoBw3oj/7Z091HWjXBSHhFlLjTyXT62oeMNQUXazflhkp0KuI9OUPR+oIZY GzXjApatJ53YUQIsLxsKKXGn3m0o8JpkS66uAVj370g75PFA4dSFwtPu+Ncy/S7wF0I0 pn+rWZcZk9GLqmS9Xm3bpGZgrKT/TLCYcVr6Qupzge2b+VRO4hx2ZdUkYQtThapGH4ZK cGAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B+gcLJoJlegdut757+4uN5leLQncAbUjYEKK1ca/gtI=; b=KieW1NzpOcjefLpy+kcjWGre7Mh4C+U9uP/EXOiFR5Y01Qj4nNBRprtOfvPoyMPvBZ 408/UpDlFf1aI3Ky0HZkWhyIF9P2QJufyPi9NI19UHgwF9WAlaynYUz8NSjjBlbIEXMg fjU/Sem5kXnXhTLnpnHz6x0Cdgz5DAqewTGDCo/VfBOtMTsfktpGUZIsKCACPka++yi4 n2lindAFHdIfscVfxFqWxtPANPVlfyWcIGKMr4Dd17k/aCsTfkVLDGNpNf7zCcWPzXhW 6yfCTbOe2r1Hy5WCdTQWje+aPrxMmxhEZhjIi/KfmZELrSmhaMulISkSbzEobK1xMvVj IoZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BfdoiS7O; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq6si348462ejb.103.2021.05.12.09.19.35; Wed, 12 May 2021 09:20:00 -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=@linuxfoundation.org header.s=korg header.b=BfdoiS7O; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237924AbhELQOv (ORCPT + 99 others); Wed, 12 May 2021 12:14:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233308AbhELP3K (ORCPT ); Wed, 12 May 2021 11:29:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC19461438; Wed, 12 May 2021 15:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832513; bh=g+Ve+Jsgli8CEVaZcP9VDknhoulY1TncyOd7deDURT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BfdoiS7OhZxpjgsXsUuwyEVRRlCj1aHiYB2Vl5+nhYgx58DYPU04+VwBBS3pFCRyr j5kP03JVB99UbsGPVxHrBPWUCVmG58NL2ubgcqQFqaBBfLG1+o9ArZn8qpSIafT0be qd3Z4CFD7a7xNNHni3EJquZ90FIfngkX9+ChXD+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ricardo Rivera-Matos , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.10 311/530] power: supply: bq25980: Move props from battery node Date: Wed, 12 May 2021 16:47:01 +0200 Message-Id: <20210512144830.021910569@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ricardo Rivera-Matos [ Upstream commit 04722cec1436c732d39153ce6ae2ebf71ac3ade7 ] Currently POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT and POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE are exposed on the battery node and this is incorrect. This patch exposes both of them on the charger node rather than the battery node. Fixes: 5069185fc18e ("power: supply: bq25980: Add support for the BQ259xx family") Signed-off-by: Ricardo Rivera-Matos Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/bq25980_charger.c | 40 ++++++++------------------ 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/drivers/power/supply/bq25980_charger.c b/drivers/power/supply/bq25980_charger.c index c936f311eb4f..b94ecf814e43 100644 --- a/drivers/power/supply/bq25980_charger.c +++ b/drivers/power/supply/bq25980_charger.c @@ -606,33 +606,6 @@ static int bq25980_get_state(struct bq25980_device *bq, return 0; } -static int bq25980_set_battery_property(struct power_supply *psy, - enum power_supply_property psp, - const union power_supply_propval *val) -{ - struct bq25980_device *bq = power_supply_get_drvdata(psy); - int ret = 0; - - switch (psp) { - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: - ret = bq25980_set_const_charge_curr(bq, val->intval); - if (ret) - return ret; - break; - - case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: - ret = bq25980_set_const_charge_volt(bq, val->intval); - if (ret) - return ret; - break; - - default: - return -EINVAL; - } - - return ret; -} - static int bq25980_get_battery_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) @@ -701,6 +674,18 @@ static int bq25980_set_charger_property(struct power_supply *psy, return ret; break; + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: + ret = bq25980_set_const_charge_curr(bq, val->intval); + if (ret) + return ret; + break; + + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: + ret = bq25980_set_const_charge_volt(bq, val->intval); + if (ret) + return ret; + break; + default: return -EINVAL; } @@ -922,7 +907,6 @@ static struct power_supply_desc bq25980_battery_desc = { .name = "bq25980-battery", .type = POWER_SUPPLY_TYPE_BATTERY, .get_property = bq25980_get_battery_property, - .set_property = bq25980_set_battery_property, .properties = bq25980_battery_props, .num_properties = ARRAY_SIZE(bq25980_battery_props), .property_is_writeable = bq25980_property_is_writeable, -- 2.30.2