Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp616040pxb; Tue, 1 Feb 2022 07:04:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtHWCbP6vFezc7LpFzXB7EFUf0CZ35V5RFBsQy8f6uDB+oszlzhRc96ntXUiPJtZx7lNpx X-Received: by 2002:a17:906:b116:: with SMTP id u22mr21523206ejy.427.1643727887350; Tue, 01 Feb 2022 07:04:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643727887; cv=none; d=google.com; s=arc-20160816; b=FOAdy/4poEiVY6mEsrlDN5Y0pWQqlRJcYZg4vpUd/myKeunps2tmB3AtZflv1IBAry E09PvRSLoPwbP1vDnmpbTTGv9h1WK8BorJP/pwi0X4V7mLOlamW+rUiSEPoySa9XYGd3 QgfX7LSNK86uDBetIVqwP7BT/ZIfJ8f4xkz2tmvT9uTElAbZLfRve6CYl+tFgWeIK1XD 23H/Yz9s/QcR34OCRaa41AEYjBfSKNTTgc9Kc5/wLqMjo1UCW2NimtGAiplM1hf49qrV op3NksR3EVQnUzZI0qb+zaixoyiO7ErY9q6EtDmleYsGvpymDuwPsParW+GW0ucKzWVN aE7w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ra3kQHTCwzQUyLE3rcy1WJPB0zxIUMMyGd0X+9XuSqE=; b=RRaJsS60iu/EnkKwjD1zhmtH+85kqA8TDN/XiFrCKMLpym8RAuB02KoLBF8TkaY+u6 IdeGclAeVSNJIYJGANZrYPFNWZlYkaaCBCCdtKEuJhZswmjwX6hsuJDi2NvVlvUTD1JN ypAtxCoa31l1GQ7stAk2twGwVFKw254u9BirvVvHXY/lFyebRw/vKwwWCWvMT0fmgYY1 3MfVBZBn/s7qTBIAaq5rmu2206WFZUmm8extQHS9iQ8plzWmhpd4jMCQHj09MBC/GllU biIveCBCsYM6WABxury5k+tCymVcBu2Doqs4cWik0SQTLFOTBy3iaY9eEQ08YEz2/dGW jUDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hKqG7MHf; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ht10si4019275ejc.820.2022.02.01.07.04.19; Tue, 01 Feb 2022 07:04:47 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=hKqG7MHf; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347508AbiA3UrF (ORCPT + 99 others); Sun, 30 Jan 2022 15:47:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45472 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356234AbiA3UrB (ORCPT ); Sun, 30 Jan 2022 15:47:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643575621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ra3kQHTCwzQUyLE3rcy1WJPB0zxIUMMyGd0X+9XuSqE=; b=hKqG7MHfz369RkClyWTGvZTb1ywEdy73PJ5T7WL89hNv8xtkm+sJ2DRLCcYYsTTCDpDP4/ KnrhA581PqJD37UC/iHWZ9ezA+UPQQl8thNpx40iCZO01n1JZUbyKiiRZNPMr/oXNIqMGn kXfLfza99MjEPjF5BfhnCV8Zrue2p4U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-9KpcgcOoOMy7z6cEgDaPGA-1; Sun, 30 Jan 2022 15:46:57 -0500 X-MC-Unique: 9KpcgcOoOMy7z6cEgDaPGA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F0B21006AA3; Sun, 30 Jan 2022 20:46:55 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73B9F61093; Sun, 30 Jan 2022 20:46:49 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko , Wolfram Sang , Lee Jones , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel Cc: Hans de Goede , Len Brown , linux-acpi@vger.kernel.org, Yauhen Kharuzhy , Tsuchiya Yuto , Fabio Aiuto , platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v4 07/20] power: supply: bq25890: Enable charging on boards where we skip reset Date: Sun, 30 Jan 2022 21:45:44 +0100 Message-Id: <20220130204557.15662-8-hdegoede@redhat.com> In-Reply-To: <20220130204557.15662-1-hdegoede@redhat.com> References: <20220130204557.15662-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On boards where the "linux,skip-reset" boolean property is set we don't reset the charger; and on some boards where the fw takes care of initalizition F_CHG_CFG is set to 0 before handing control over to the OS. Explicitly set F_CHG_CFG to 1 on boards where we don't reset the charger, so that charging is always enabled on these boards, like it is always enabled on boards where we do reset the charger. Signed-off-by: Hans de Goede --- drivers/power/supply/bq25890_charger.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index f758e28046e5..d185299db9c3 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -747,6 +747,17 @@ static int bq25890_hw_init(struct bq25890_device *bq) dev_dbg(bq->dev, "Reset failed %d\n", ret); return ret; } + } else { + /* + * Ensure charging is enabled, on some boards where the fw + * takes care of initalizition F_CHG_CFG is set to 0 before + * handing control over to the OS. + */ + ret = bq25890_field_write(bq, F_CHG_CFG, 1); + if (ret < 0) { + dev_dbg(bq->dev, "Enabling charging failed %d\n", ret); + return ret; + } } /* disable watchdog */ -- 2.33.1