Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1578817imu; Wed, 16 Jan 2019 23:14:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN6N7yobM0YNXpS+sKRecos7Pq7L6PvQYG/dCngsDSjKSy5uznaTJhvZIjiBnAnqYLrd7N1/ X-Received: by 2002:a62:868b:: with SMTP id x133mr14490406pfd.252.1547709278271; Wed, 16 Jan 2019 23:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547709278; cv=none; d=google.com; s=arc-20160816; b=RjBPfQ7GFyVSXcmMmAR8a85pejvzAaCN+FtP8tyID04gPUAyV5CQsg2bA87NgTC3pu PRnFMway2cgYy7v7xONlAcLwdpVWIReljgTjA+nawDurZrqa3lOIopqV9kb/VMwDmUNU mUh0btpLpfmhzmQjwQ2WXYrqgh/JV6cGD9TYWNNo80xe0MMLXqQNv2OcS1HOVMD+hfgQ HzV9pVWGGbGnlUwWVUyQbIcOhk4CJdUImB/m8PbPYm/TMq+H77/w7n1f/lA7Xkl6H5Co mWKi+F2jsuUpdfxwsDsugMkoUXHA1FPKQuGVAxrhUPIXxHHqVSO8AX6MLCHGy7Vxd4pJ q3+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ODKVwioI1OjspNMWnexaPX78Xq+7wuCKuu9zTO60uOQ=; b=iUY6q5xRZb5a99syOpx7D6gCGzbKkyRD3UJKl/spLyXwHBcPb7AvIAhiv0zCrOsxTX /v+x/IJRsAAnbF7BTNNIPWkdG5jcc1OfqgkOs0fQD2eMuUk8hJzs2GsW9uwZnctA5Fj1 PQooC1xlqwhzaVAF0kI6+tCQMvkIr7v4gmN9bqdTagU7muVunEzuXxBmXP/l3Yxe0Apj wpfYT6W4JwmgWrjk7BzioxbteWDeRA6ch7DYK2BiouQz6gNeCoYaBej9Pe5oixWs8toz +rf5qeXWGk4AnYsdLmRt5z92k8rA7WhoVk/pRFqmCQ3HkhP4ahjPkHymy+TGEw4+8ELR QJeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b="ME/UHrqd"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m35si763212pgb.246.2019.01.16.23.14.22; Wed, 16 Jan 2019 23:14:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b="ME/UHrqd"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728933AbfAPVSx (ORCPT + 99 others); Wed, 16 Jan 2019 16:18:53 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:55534 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbfAPVSu (ORCPT ); Wed, 16 Jan 2019 16:18:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ODKVwioI1OjspNMWnexaPX78Xq+7wuCKuu9zTO60uOQ=; b=ME/UHrqdvocww4Khy6voq0QkD FX1KKZ5BRucne9Ex9+xBBD3J2rdAt3W7JxzC3ASQtbasBCFcycajQifzGatvyOa1oOs2XRlSjp2+D vAA/SIh5XR4RrVae0EdZJjfDEdAnqy4UFA717ErwaJikDV3nNMWSYlUZqn5epykUYBY4g=; Received: from p200300ccfbcc8e007ee9d3fffe1fa246.dip0.t-ipconnect.de ([2003:cc:fbcc:8e00:7ee9:d3ff:fe1f:a246] helo=eeepc) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gjsaD-0006Il-Ce; Wed, 16 Jan 2019 22:18:45 +0100 Received: from andi by eeepc with local (Exim 4.89) (envelope-from ) id 1gjsaB-0001f7-UR; Wed, 16 Jan 2019 22:18:44 +0100 From: Andreas Kemnade To: letux-kernel@openphoenux.org, johan@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Kemnade Subject: [PATCH v3 2/6] gnss: sirf: set power state initially off Date: Wed, 16 Jan 2019 22:18:08 +0100 Message-Id: <20190116211812.6337-3-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190116211812.6337-1-andreas@kemnade.info> References: <20190116211812.6337-1-andreas@kemnade.info> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the GTA04 mobile phone, it was observed that the gps was powered on sometimes intially. Generally a reboot without powering the device off (direct reset of the processor, reboot from a system where gps power toggle was done in userspace) or glitches on the gpio pin during power on could cause this problem. This has the drawback that probing takes some seconds on systems without wakeup signal. On systems with wakeup signal this penalty is much lower. But if the chip is initially on and that is not fixed, the suspend current will be multiple times higher, so this sacrifice should be justified Signed-off-by: Andreas Kemnade --- - was part of 2/5 in v2 drivers/gnss/sirf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gnss/sirf.c b/drivers/gnss/sirf.c index b21e14351b82..c7706b91f6f0 100644 --- a/drivers/gnss/sirf.c +++ b/drivers/gnss/sirf.c @@ -367,6 +367,13 @@ static int sirf_probe(struct serdev_device *serdev) if (IS_ENABLED(CONFIG_PM)) { pm_runtime_set_suspended(dev); /* clear runtime_error flag */ pm_runtime_enable(dev); + /* + * Device might be enabled at boot, so ensure it is off. + * This was observed in practice on GTA04. + */ + ret = sirf_set_active(data, false); + if (ret < 0) + goto err_disable_rpm; } else { ret = sirf_runtime_resume(dev); if (ret < 0) -- 2.11.0