Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1734391ybi; Sun, 16 Jun 2019 11:59:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJKcdxKQzoQ+AoOyk5zO427qJo8Hsh7mu8j9KIZ6Jo49n5LSznNE6slbD/1vRSKuTmGRyV X-Received: by 2002:a17:902:b609:: with SMTP id b9mr25181985pls.8.1560711546282; Sun, 16 Jun 2019 11:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560711546; cv=none; d=google.com; s=arc-20160816; b=UtNT+piBx0LteHZ/vhNTIuMzLJBLKcXQE0e/YRNfzx3OFicKkGjP/kQxmReTCIA/Cv 0+YbU3PVLlpLgjniqX43pOxgJMo3tvQMfMFJD2M/5NVi9Fpc7RxKZdYNyY3EvEYyHyrt GqDm/vfVvbpdQvO0BkEaIi17M1iZmuFiaN6/IFhPLDSpUrQgJ2VNrLkRCsjM5mJ9tIrm XG4ZA9/wsV0+L9sxdW4OAkcrDE806PLS2UWCoJK5e1PS5WmRBq5EWxxgxsI5LrXCU4v0 00gIX3cPXILXrwVPo/VFt4CJUObGPPFO2qzOSQp3Jc/u0oPcf9UzgD3L/V/vek9HydfX K30A== 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=nByq7PxBYO/HndonaLBb5oHmEIAYGRGMS68VxuzBGRk=; b=hy+p89/KIjq0vh0xzR38gy3qxw3lAvv0ppZ9L4Tld4KjD/6BIumV9xtzdNb1xJH0F3 DYj1D8Nu2prnd+GKAeVXJ5jpqT2FsuJxM3VHDE4YmycNZOo1y5C0cRGsaSUWAIgTyK+P Urs6vHvxCrNPdT83K9TeRFvDdGKHFkPegjAIVXrfZPORu6GvSPvhg16HXP4/UGGPD3SZ oH89/MZOKLKu3WDfYtFw6QVyA0I6Nh6JgS4mNt46d1/g/JHm2WPIG1uDn6t9DF9EXcrh 28YEoN27FymtQ2k9p/x3Y8515oGy+mYAADLJWFXyaqD7XLodReT44LCNahmSI9RbkEIg qJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=giYKqR3u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si8008490pjn.9.2019.06.16.11.58.40; Sun, 16 Jun 2019 11:59:06 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=giYKqR3u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727361AbfFPSzv (ORCPT + 99 others); Sun, 16 Jun 2019 14:55:51 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34687 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbfFPSzv (ORCPT ); Sun, 16 Jun 2019 14:55:51 -0400 Received: by mail-pl1-f194.google.com with SMTP id i2so3154897plt.1 for ; Sun, 16 Jun 2019 11:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nByq7PxBYO/HndonaLBb5oHmEIAYGRGMS68VxuzBGRk=; b=giYKqR3uuQzsw5eaDqiRp2acTNqFnPZNGfkvdyqIK6e9DdG1wdGpT2902CyfnnL0+V gQV/aJZxaJ766T6k8+tdS9q6HW3KDh1ON4bIkNDME3gU/wcQzaLxtbC5DMFeOI1oZA7/ Vi0T1Efpctouh5bCEQWcjjTvLDLMvGyKAezVaGE0pIjmDJJSB0vQjP13WPB3uxVAWzXH grHH4ruo8iX4GTXQYV3nWBhGHy6qSq59TnG7lWUepXuSUDu3hKnm1vR0eqdKeHDvECRh Fqgyr2FnnzfW15sdK1rzgQS07lJkkV4w1FTg2PGUDgsQC3e1j+2LJ8eKpFLS9INoLzW+ 0c5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nByq7PxBYO/HndonaLBb5oHmEIAYGRGMS68VxuzBGRk=; b=iWbSpdWLWB/qfcnp8WLBBQkkaVWtBS3P62nAu3pkZBIKFxpMb7c03tzvgeS60lT0+p UXQJQVQN3vcZNjQGyN9zlj7SpzE5OEZRgXFOy8m4xGdhnEBNCqDsOuLZEFlbVZG0JwO4 L09PXenOu1B2RpYh3MZ6/u/LhkvnecQhsT+92AFSxb+5/hOLj+P7QbHGUi0WXqZn4FuB zjWHuiSPnrACxkSQiUc5WyXKrXjcW4SgTMRrslmEyh/i2Mqq/wNtv3J1HX63eIH7wJNC LDat8lAUZ2Tagf511Hh4ORsaY5wAhiEGatDEQi0Lk8ZXIM1Bh30BSZcoAnXq3EEBYhJK DeqA== X-Gm-Message-State: APjAAAVql2RS0UZKQzC+wVNvKKEwmf+MQUJBJQd51hvgbkHqIkaYPFZq Rax3jAQacePrO+aXQGxBeDBLOw== X-Received: by 2002:a17:902:24c:: with SMTP id 70mr103472422plc.2.1560711350661; Sun, 16 Jun 2019 11:55:50 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id m41sm12325765pje.18.2019.06.16.11.55.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 16 Jun 2019 11:55:49 -0700 (PDT) Date: Sun, 16 Jun 2019 11:56:37 -0700 From: Bjorn Andersson To: Sebastian Reichel , John Stultz Cc: lkml , Andy Gross , David Brown , Amit Pundir , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 2/3] reset: qcom-pon: Add support for gen2 pon Message-ID: <20190616185637.GE31088@tuxbook-pro> References: <20190614231451.45998-1-john.stultz@linaro.org> <20190614231451.45998-2-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190614231451.45998-2-john.stultz@linaro.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 14 Jun 16:14 PDT 2019, John Stultz wrote: > Add support for gen2 pon register so "reboot bootloader" can > work on pixel3 and db845. > > Cc: Andy Gross > Cc: David Brown > Cc: Bjorn Andersson > Cc: Amit Pundir > Cc: Rob Herring > Cc: Mark Rutland > Cc: Sebastian Reichel > Cc: linux-arm-msm@vger.kernel.org > Cc: devicetree@vger.kernel.org > Reviewed-by: Bjorn Andersson > Signed-off-by: John Stultz > Sebastian, please take the first two patches through your tree and we'll pick the dts patch through arm-soc. Regards, Bjorn > v2: > * Split out dts changes into separate path > * Minor cleanups and remove unused variables > --- > drivers/power/reset/qcom-pon.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c > index 3fa1642d4c543..22a743a0bf28c 100644 > --- a/drivers/power/reset/qcom-pon.c > +++ b/drivers/power/reset/qcom-pon.c > @@ -14,11 +14,15 @@ > > #define PON_SOFT_RB_SPARE 0x8f > > +#define GEN1_REASON_SHIFT 2 > +#define GEN2_REASON_SHIFT 1 > + > struct pm8916_pon { > struct device *dev; > struct regmap *regmap; > u32 baseaddr; > struct reboot_mode_driver reboot_mode; > + long reason_shift; > }; > > static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot, > @@ -30,7 +34,7 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot, > > ret = regmap_update_bits(pon->regmap, > pon->baseaddr + PON_SOFT_RB_SPARE, > - 0xfc, magic << 2); > + 0xfc, magic << pon->reason_shift); > if (ret < 0) > dev_err(pon->dev, "update reboot mode bits failed\n"); > > @@ -60,6 +64,7 @@ static int pm8916_pon_probe(struct platform_device *pdev) > return error; > > pon->reboot_mode.dev = &pdev->dev; > + pon->reason_shift = (long)of_device_get_match_data(&pdev->dev); > pon->reboot_mode.write = pm8916_reboot_mode_write; > error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode); > if (error) { > @@ -73,8 +78,9 @@ static int pm8916_pon_probe(struct platform_device *pdev) > } > > static const struct of_device_id pm8916_pon_id_table[] = { > - { .compatible = "qcom,pm8916-pon" }, > - { .compatible = "qcom,pms405-pon" }, > + { .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT }, > + { .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT }, > + { .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT }, > { } > }; > MODULE_DEVICE_TABLE(of, pm8916_pon_id_table); > -- > 2.17.1 >