Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3333942imu; Sun, 9 Dec 2018 23:46:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4m+x6kmLqasgobSilJU0qtRAq4e2+hx8saHgD6vReEsB3q3EflLVVouWomJcSBtoa8L5P X-Received: by 2002:a63:5518:: with SMTP id j24mr9852940pgb.208.1544427994411; Sun, 09 Dec 2018 23:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544427994; cv=none; d=google.com; s=arc-20160816; b=xf9Iih8G3cL8bxtfm8WkECLXIcfBfjTajTqNRVSqetP4l3PKGXuRMLtGdZT1nHuYfr ldTZ7Ok8xSG8dgi/+MTqMq3cdF1kx7eRto+6UF1ZnGkYO3Wj3lEZC8iPVM8Jp5zycnaq M2tiu8R2BpN0rVmaHzVM4S7qAB2Nhtc4Qjal/WfqoKKebXlrTc4mN/Ek7ZKKxpJr9XvI whuCYy5aUO9U+8qW8K/TXDxRWlNuXgy3UJWFGVCpWjeNuwuZ1yPpZTDzYAT1bQI2u0tP +LqpbLklnGhhDdqMDfwe4+2zhDiNJS7K7Z7IEHm9cLWRedBY2wQVj/lUrvv5p3vtR3QV HiCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Rr2ogrUmrDJhfJ/4FUx/noKAJVPw14z/gyQu7sQdipk=; b=O5ay3p/2M4dqdVi9ExnKcHd97hfFCgrzspD3eNgZ5VH8ZpLVDtPa5i4uFiAEq8KYy9 sonwlS9DzwN6vZ4zVTQbZ8iCKsYzwA5ebER27WzCAT5XLSNFhmiGjiwL1soDCaqSpAaF 6Ay6rT+kxlBu9AgoEOa1Gr6Jz+2S6g7ZQo0tSnzFm2Tzowt+sDpErNE9PFFO2exdMmrC Bs7OBtMUrHJPQhJ/mHCxMthumrrMWhgWSWHrCltniVAkeCvHORxYPmip8cIB/VKauJa7 AD01YQ3pmdKh1ob4tlC6H3Djmu+7JnUNTzEB/zUyw6n3fLpnH6+T6DeS0sj5TOVKroVF Yt6A== ARC-Authentication-Results: i=1; mx.google.com; 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 m75si8923412pga.432.2018.12.09.23.46.19; Sun, 09 Dec 2018 23:46:34 -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; 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 S1726242AbeLJHm6 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 10 Dec 2018 02:42:58 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:25843 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbeLJHm6 (ORCPT ); Mon, 10 Dec 2018 02:42:58 -0500 X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBp5hRw/qOxWRk4dCyh+3cT6eo6dYPn7/hui19zvYhTXI9T/Rws9qN1" X-RZG-CLASS-ID: mo00 Received: from [IPv6:2001:16b8:264d:f100:746c:60ac:be83:9114] by smtp.strato.de (RZmta 44.6 AUTH) with ESMTPSA id k03348uBA7gkv4O (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 10 Dec 2018 08:42:46 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Letux-kernel] [PATCH v2 4/5] gnss: sirf: add a separate supply for a lna From: "H. Nikolaus Schaller" In-Reply-To: <20181209195150.5192-5-andreas@kemnade.info> Date: Mon, 10 Dec 2018 08:42:48 +0100 Cc: Johan Hovold , Rob Herring , Mark Rutland , devicetree , LKML , Discussions about the Letux Kernel Content-Transfer-Encoding: 8BIT Message-Id: <918A20A2-30F4-45C8-9883-038DE57716C3@goldelico.com> References: <20181209195150.5192-1-andreas@kemnade.info> <20181209195150.5192-5-andreas@kemnade.info> To: Andreas Kemnade X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Am 09.12.2018 um 20:51 schrieb Andreas Kemnade : > > Devices might have a separate lna between antenna output of the gps some nitpicking: the LNA (low noise amplifier) is between the antenna and the GPS receiver. Therefore: s/between antenna output of the gps/between antenna input of the gps/ Otherwise fine! BR and thanks, Nikolaus > chip and the antenna which might have a separate supply. > > Signed-off-by: Andreas Kemnade > --- > Changes in v2: > - handle lna also if there is no on-off gpio > - rebase on changed 2/5 > > drivers/gnss/sirf.c | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --git a/drivers/gnss/sirf.c b/drivers/gnss/sirf.c > index c64369494afb..d339e8ef2508 100644 > --- a/drivers/gnss/sirf.c > +++ b/drivers/gnss/sirf.c > @@ -36,6 +36,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; > @@ -282,21 +283,32 @@ static int sirf_set_active(struct sirf_data *data, bool active) > static int sirf_runtime_suspend(struct device *dev) > { > struct sirf_data *data = dev_get_drvdata(dev); > + int ret = 0; > > if (!data->on_off) > - return regulator_disable(data->vcc); > + ret = regulator_disable(data->vcc); > + else > + ret = sirf_set_active(data, false); > > - return sirf_set_active(data, false); > + if (ret) > + return ret; > + > + return regulator_disable(data->lna); > } > > static int sirf_runtime_resume(struct device *dev) > { > struct sirf_data *data = dev_get_drvdata(dev); > + int ret; > + > + ret = regulator_enable(data->lna); > + if (ret) > + return ret; > > if (!data->on_off) > return regulator_enable(data->vcc); > - > - return sirf_set_active(data, true); > + else > + return sirf_set_active(data, true); > } > > static int __maybe_unused sirf_suspend(struct device *dev) > @@ -384,6 +396,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 > > _______________________________________________ > http://projects.goldelico.com/p/gta04-kernel/ > Letux-kernel mailing list > Letux-kernel@openphoenux.org > http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel