Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9581253imu; Wed, 5 Dec 2018 07:08:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/U56wgn2vaQN+uBgll0vvWek3jiEWq8WY5vf8X+263rLElmh7VZRTbkbTga5TtHfq+9BgXz X-Received: by 2002:a63:8ac4:: with SMTP id y187mr20941562pgd.446.1544022484179; Wed, 05 Dec 2018 07:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022484; cv=none; d=google.com; s=arc-20160816; b=XHAkOxwScqQG4xRgJZSNTiidStKXDpAeQYFKphnJ4d1iCj93OPa+l1ZYUw5uKLNFWF I5YRuFlrvqf23ZWO3H51ryQfv3Mvcs9qNNn8MbXKC1EJEJFs8OrhFqfqRHVaYHXbjumO oVdZ04Eq4SSXL5hq6Rnc8+fKivOeno3UiAhUi4IfeM76HubPb5Yj+QajJMBbMM8DFFFq h7gKyGMViQQQcuqnL443z7ypz2Yr6DAyMg3VDx4n6QiYORlMnUv7V8NaI5yD0z6L8Iq4 WucP8dfoWI79My1j+tOOvHpmlaeWC+evIpYaJQQEUEi3aCWyBf6sUwIXo7PiDT12wedZ WadQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=z+43scOvjQymplkXmGk9hI1a477LYVA40yOkLt1y+Rk=; b=ppG2XdEaz2WnGsR5GsrM3L4u6gsiIECA1T92+04GoXl4+6Qc/EOWiUmg92SkOv8HVh QvAUMtWu6GUzp/q366JSLI60ax5mrmvGyIv+DTbeIhBuL937/slBOWzlBg99FXvi4ft9 g2sP5l1znx9CmtClayrm8msKAwRuZEKBfpTsDJmDraIwRQAP6XIJMbH6RcwNVTshZaNV Y1slSj6oZ9tIMPLIwMZEngfoE+yCMIZSvbsMBIYcXt60kEAzpy15IfkYYjLFCGNkzxQr MKaXTjmHEYMdnNn4pss9jI9pIruEj3T+JtqWkqUPNNNyFI0vKN1tPtgAxgrS8bLZDSVF FXAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LRiwA93z; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j28si18153335pgm.160.2018.12.05.07.07.48; Wed, 05 Dec 2018 07:08:04 -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=@gmail.com header.s=20161025 header.b=LRiwA93z; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727871AbeLEPGZ (ORCPT + 99 others); Wed, 5 Dec 2018 10:06:25 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38687 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727142AbeLEPGZ (ORCPT ); Wed, 5 Dec 2018 10:06:25 -0500 Received: by mail-lj1-f196.google.com with SMTP id c19-v6so18648567lja.5; Wed, 05 Dec 2018 07:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z+43scOvjQymplkXmGk9hI1a477LYVA40yOkLt1y+Rk=; b=LRiwA93zV8yiahlchOQfAh1z8Tj99kSZo6OYPqiY51WhFAZaCQOAqH0ngp5uCoro1v eBPHxWJrsUqF6AoFb62qlKpJcwfDTqaHQDgUU5/EgJMUTc5E8bovG2raJy8Vg81ok9jQ 8C0cEVKt1rmEvJ+TWiZMVbvR+CUDJeLK0+uboLdLh83lkVVgoYNRxn8vbtBlPATkXFWs XjGWngrHHYGVL5IcC/xCDw9rmWWONyXvKlRokBgYRJlUBEcLMzVu6jH7LQ7r0sGiYi8l hNa9mAvFN1SC9HIvwatkEKa/Q1V3xBzzleZLpL4afvW8SFECqHvGmMuUQDB9rdaNAIhH 3ebw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=z+43scOvjQymplkXmGk9hI1a477LYVA40yOkLt1y+Rk=; b=EvbShNS88w174lXaKU6cFftls7wn5fbqrcgitI7peWGw2l2jGKCffUWYexyhMqskDo c8fcb0oz+63/vo/2mRUGKIFucxeqmX5l1sHkDNOO4aspGpdDFfzMz+vIxDp0gfzwtjIK OGr9Ljy55jdVGCEG6gaeRPeg77d6oNTSYbVNpncXa0EXZMTfZ+sXyU7qzOlMEEiGBw5u tKfcJUIW0XZvELZRJT8HQNYwYFMzEiGWdJGvnqNnx7aWTI+6Rm8JhmWlMSp2T6roB7vQ ETjGDzSTFZpW4/0y4CpmcxLV6vcX+UQQFZBs9FKUiv+tbMkZBenZ8s2D0SU+anHb+FtG vQMw== X-Gm-Message-State: AA+aEWZ4k9plTxVo48ttq4nzqVISaxwyn3bA/TxC2BX9WGAvp1K3HdBy sQtWnYrlr8NazbPj58vfZXkUw/O0 X-Received: by 2002:a2e:4503:: with SMTP id s3-v6mr16175313lja.44.1544022383046; Wed, 05 Dec 2018 07:06:23 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id m77sm3666440lfg.3.2018.12.05.07.06.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 07:06:22 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gUYkq-00041d-Uz; Wed, 05 Dec 2018 16:06:25 +0100 Date: Wed, 5 Dec 2018 16:06:24 +0100 From: Johan Hovold To: Andreas Kemnade Cc: 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 Subject: Re: [PATCH RFC 4/5] gnss: sirf: add a separate supply for a lna Message-ID: <20181205150624.GH15689@localhost> References: <20181118215801.12280-1-andreas@kemnade.info> <20181118215801.12280-5-andreas@kemnade.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181118215801.12280-5-andreas@kemnade.info> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 18, 2018 at 10:58:00PM +0100, Andreas Kemnade wrote: > 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); I don't think you want to disable it until the device has entered hibernate mode. > 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; This one needs to be managed as vcc in the case where we have no onoff-signal connected, right? Similar for suspend of course. > + > ret = sirf_set_active(data, true); > > if (!ret) > return 0; > > +err_disable_vcc: > if (!data->on_off) > regulator_disable(data->vcc); > + Superfluous newline. > err_close_serdev: > serdev_device_close(data->serdev); > return ret; Johan