Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1055520pxa; Wed, 12 Aug 2020 22:12:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIGfoWzGOg8TPIyXeIBvtHGH2ONzmZ9UYmY1Krfq1PjtytPPiY0z6NtYOWsLCjEQiRCShj X-Received: by 2002:aa7:da48:: with SMTP id w8mr3002364eds.329.1597295525171; Wed, 12 Aug 2020 22:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597295525; cv=none; d=google.com; s=arc-20160816; b=fK/6dhg/GzqGV6UMI87HInd784ksCoO1Flv9MDpNZxR3x2zgmDFrQdIw+bxhwOzhGe 0+aNGSEAGfuj/n/Jr0hoNiVZXBXf/g/ULPgra51dKGRFBsJZQLf06m09LkRzecR43jhE DSO63EWTW50zWV6IpPiiuj6+DCo7yzkQ4AIwCPgUbFLmLMouJd7pc84Ud+XFBqYiM1Ni bUry+U1RI9u2iebB7NEg+p3T0uCij2NzpChFGdyYl+V1N7M7jbUAvfMiQxJegrUTwHnO w2lf9YSrfUQC5cVNv0qMjCZGbLDywd+KSYrDiXvyzNZGhlHqVJNGOXDxk9NYej7l6IHG vE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xPZ6SG/zYPhOh4F1hrC3AfjzUbgPD+IZVvEp6h306j8=; b=G4Ib+1EPRco/NBcew6/c8owOgnVGymd+fEfcyc46Gqlh35SekrvWjYLhADfucyoP/w 6dVBToOH3pFswpquUdjBNO0bA8gmryz9WUOC36ywkqL0LP+yVlwsfn0VLyNf+Gu2STd7 CO1dp9rpfhjZKV0bNxtkhTvaNBdO3nQEWPDDbmCOeLuSlc5NNpukrHeojiY7FJ9INSbV z93mKLAAdavkm75rwrk0CIxAexoepXUtOHMZVOA9lvIZThxyyyBpQrpGshvc6FWgXtWg LTZMZ+uYW9Fk+tlbmXr/bik4N99syqnvDkNwUJNP1oF0wgBVQBkuEMt99NcPf8hD+zUj 18NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="fEl/Jq/I"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e27si2518074eje.173.2020.08.12.22.11.42; Wed, 12 Aug 2020 22:12:05 -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=@chromium.org header.s=google header.b="fEl/Jq/I"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbgHMFLA (ORCPT + 99 others); Thu, 13 Aug 2020 01:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbgHMFLA (ORCPT ); Thu, 13 Aug 2020 01:11:00 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B3A5C061757 for ; Wed, 12 Aug 2020 22:11:00 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id i92so3778554pje.0 for ; Wed, 12 Aug 2020 22:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xPZ6SG/zYPhOh4F1hrC3AfjzUbgPD+IZVvEp6h306j8=; b=fEl/Jq/IgbTmIkW1eFw7j5PmpSOA8UBiPp5t3w904WZTHkDJEq/ZZ70kMgDTGl8a0r SwlJ3GCcXfKEBKDCanVitTiE3DrwVmGy6PQpol/PJAUKrkGRDX6+8JyqzOZmQJJwH9gG YCcys+vF7D+sRiPBBbE619Go7a0cY/tLQYkf8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xPZ6SG/zYPhOh4F1hrC3AfjzUbgPD+IZVvEp6h306j8=; b=AB5bBEVmp9tGuLTwCEXInI6BQ7ukACq6ZwKVbrD5onoLwcSt7Nw5QQE9f+J7LXo0T4 KZfDtbjs4H4om/TEB5SY0KZuPIcZx557gzhLtGkE2jgygT8RlqFqEtULSapJ8IzAzPSM JvIjjHvO84cRNPmQe4hxko0NSiOvSvhLJf3vE3C5ZKftV246OafxWYF9fh8BYr7dUK2J UIoCuDC/iFkYyAEfO6c4Ad3/tc1YOLOu/ncminT+bEWpfplYt7jx/60ClfEtplXUkYF7 2oqDQpnNJZ5x6y7UzmuFgnxTRxW+/HU2G0p7DErP+r7g6gRmfzQp+Jq5fwU7Ith4LisT YM4A== X-Gm-Message-State: AOAM5310cWz8C7zjj4fKpxDz91XrgUIUGhzx3e7fPWwHfBMOVSJnXBbF Cwj4gsNIHwniGQMvkL363ME1DA== X-Received: by 2002:a17:902:b193:: with SMTP id s19mr2445834plr.72.1597295459232; Wed, 12 Aug 2020 22:10:59 -0700 (PDT) Received: from ikjn-p920.tpe.corp.google.com ([2401:fa00:1:10:f693:9fff:fef4:a8fc]) by smtp.gmail.com with ESMTPSA id fh14sm3720153pjb.38.2020.08.12.22.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 22:10:58 -0700 (PDT) From: Ikjoon Jang To: Sebastian Reichel , linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, drinkcat@chromium.org, Ikjoon Jang Subject: [PATCH v3 0/2] power: supply: sbs-battery: fix presence check Date: Thu, 13 Aug 2020 13:10:06 +0800 Message-Id: <20200813051008.3461515-1-ikjn@chromium.org> X-Mailer: git-send-email 2.28.0.236.gb10cc79966-goog In-Reply-To: <0200811065307.2094930-1-ikjn@chromium.org> References: <0200811065307.2094930-1-ikjn@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When gpio detection is not supplied, presence state transitions depend on every smbus transfer result from get_property(). This patch tries to check battery presence again with well supported command before state transition. Changes: v3: check return value of get_presence_and_health() v2: combine get_presence_and_health functions to reuse Ikjoon Jang (2): power: supply: sbs-battery: combine get_presence_and_health power: supply: sbs-battery: don't assume i2c errors as battery disconnect drivers/power/supply/sbs-battery.c | 98 ++++++++++++++++-------------- 1 file changed, 53 insertions(+), 45 deletions(-) -- 2.28.0.236.gb10cc79966-goog