Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2021807imu; Sun, 18 Nov 2018 14:00:06 -0800 (PST) X-Google-Smtp-Source: AJdET5caT8Bee6nvDWV8O91haRqHLKJ6FE0DiB5UVzVsE6TgQ7QSOIaGHkvxJOM90nHnQF16vrHH X-Received: by 2002:a62:c28e:: with SMTP id w14mr13747808pfk.115.1542578406701; Sun, 18 Nov 2018 14:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542578406; cv=none; d=google.com; s=arc-20160816; b=AVmg+eWi8amdZs3GwqKEPNNhzNiuxUsexvl49OJnI2ekBN8ql/q8FhdIgKJndoh/1w w5X4Bo73MBulBS4sn/dxeG3WsQfYR6NPimPbLJQ+KQq9lmW1k4WchVMo7+Q07qEMtCV/ Gju6Z4quZk5nQZUnVjJdGyhbZhByzd/lqBrptSqHb6Qptu7CjakqH2cv2ffOChsSETfR twNvGOoIDVHcNnbiFPKLpCUdL4lMC9qRoQeOCJuI/FQm3akMytMzGrMCyYgzY0AVG7c1 Fdxdy6iRTTkfcCGtd29tiTRf/wt7VDgGpq37kPfGT4RUIFf8zdPjio+F+NIt6Hg/PzS5 04sQ== 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=t3B3l8VIggkSXnv4U/Fsu0ElHYuyPPhuVFrf9TC8Xho=; b=WDB5XzeV2Gh271ZPr58bIfoB5TydT6pCB7TbL1PfThPIwisqp22ynhC7c++DwLyp2H 73smr17hgaS1uPgS9f4Ad53Pw9L8KSyExZOr2sik17x8bZ9u2XeiuA6pWA9KsudlfNUL ZjT/1mQxjRI1U1MMMfh/54a6oOfB64x3D7tj4ql8K61xC9qjOJMldgJlAfL2GuznjAZC 6fml/PdywFxMzM769TvZndGCOtaBqB6rxeF7cfURwbqtwq9ZThBgPO9R0VsBthIqOKww PGNosciQpvw3xB+YcQVmyKx3yp84/8RCY/UBIsR+LwJerQBjHbjpvlJ/rXuqWC0T5itH TBhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=aUWb2But; 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 c138-v6si33714329pfc.6.2018.11.18.13.59.52; Sun, 18 Nov 2018 14:00:06 -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=aUWb2But; 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 S1728102AbeKSITz (ORCPT + 99 others); Mon, 19 Nov 2018 03:19:55 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:52548 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbeKSITx (ORCPT ); Mon, 19 Nov 2018 03:19:53 -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=t3B3l8VIggkSXnv4U/Fsu0ElHYuyPPhuVFrf9TC8Xho=; b=aUWb2ButCiCWDixki6+47FSV5 mDrSLn8PYoyBfKkmkUsrh+ZeeHooPJyyom+x8bqzZMzrF1dDWkN89U3uRDHV2d+abxMVx0hkUOL9p qcMN8wEiG2Ho8H/HNDsQ84fV+omrwWVtQDG1n79Im7Y452gZqXZ9+PO/KMmraEIvLy1zM=; Received: from p200300ccfbe8ca001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:fbe8:ca00:1a3d:a2ff:febf:d33a] helo=aktux) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gOV59-00078V-D8; Sun, 18 Nov 2018 22:58:19 +0100 Received: from andi by aktux with local (Exim 4.89) (envelope-from ) id 1gOV59-0003DH-41; Sun, 18 Nov 2018 22:58:19 +0100 From: Andreas Kemnade To: johan@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Discussions about the Letux Kernel Cc: Andreas Kemnade Subject: [PATCH RFC 4/5] gnss: sirf: add a separate supply for a lna Date: Sun, 18 Nov 2018 22:58:00 +0100 Message-Id: <20181118215801.12280-5-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181118215801.12280-1-andreas@kemnade.info> References: <20181118215801.12280-1-andreas@kemnade.info> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Devices might have a separate lna between antenna output of the gps chip and the antenna which might have a separate supply Signed-off-by: Andreas Kemnade --- drivers/gnss/sirf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gnss/sirf.c b/drivers/gnss/sirf.c index 6a0e5c0a2d62..f7573ca2dacd 100644 --- a/drivers/gnss/sirf.c +++ b/drivers/gnss/sirf.c @@ -30,6 +30,7 @@ struct sirf_data { struct serdev_device *serdev; speed_t speed; struct regulator *vcc; + struct regulator *lna; struct gpio_desc *on_off; struct gpio_desc *wakeup; int irq; @@ -217,6 +218,7 @@ static int sirf_runtime_suspend(struct device *dev) if (!data->on_off) return regulator_disable(data->vcc); + regulator_disable(data->lna); ret = sirf_set_active(data, false); if (ret) @@ -245,13 +247,20 @@ static int sirf_runtime_resume(struct device *dev) if (ret) goto err_close_serdev; } + + ret = regulator_enable(data->lna); + if (ret) + goto err_disable_vcc; + ret = sirf_set_active(data, true); if (!ret) return 0; +err_disable_vcc: if (!data->on_off) regulator_disable(data->vcc); + err_close_serdev: serdev_device_close(data->serdev); return ret; @@ -340,6 +349,12 @@ static int sirf_probe(struct serdev_device *serdev) goto err_put_device; } + data->lna = devm_regulator_get(dev, "lna"); + if (IS_ERR(data->lna)) { + ret = PTR_ERR(data->lna); + goto err_put_device; + } + data->on_off = devm_gpiod_get_optional(dev, "sirf,onoff", GPIOD_OUT_LOW); if (IS_ERR(data->on_off)) -- 2.11.0